Miskatonic University Press

My Hackfest report

02 October 2009 conferences code

This morning at Access during the Hackfest report I went on after Bess Sadler, who talked about the work she and Lisa Goddard did figuring out Ross Singer’s marc2rdf-modeler. Here’s what I said.

  • I listed the four things about Linked Data.
  • I said RDF is about subject-predicate-object relationships. “This conference hasName Access” and “This conference hasLocation Charlottetown.” Not scintillating conversation but a straightforward way of stating facts.
  • If you do all this then you end up being part of the big web of data illustrated on the Linked Data page. I need some data in that web for OpenFRBR, from Freebase, id.loc.gov, etc. How can I get to it with Ruby?
  • Let’s do an example. Take the LCSH authority record for Cider. I have the URI for that …
  • and I have the URI for broader term thanks to SKOS …
  • so how can I use Ruby to go from the URI for Cider to the URI for its broader term? I have the subject (Cider), the predicate (has broader term), and URIs for both. How do I get the URI for actual broader term? I can see with my eye it’s “Fruit wines” but I want to do it in Ruby.
  • I did it using Ruby bindings for Redland.

It took me all afternoon but eventually I figured this out:

$ irb
irb(main):001:0> require 'rdf/redland'
=> true

irb(main):002:0> cider_uri = Redland::Uri.new("http://id.loc.gov/authorities/sh85025940#concept")
=> #<Redland::Uri:0xb7c58854 @uri=#<SWIG::TYPE_p_librdf_uri_s:0xb7c5882c>>

irb(main):003:0> broader_uri = Redland::Uri.new("http://www.w3.org/2004/02/skos/core#broader")
=> #<Redland::Uri:0xb7c54074 @uri=#<SWIG::TYPE_p_librdf_uri_s:0xb7c5404c>>

irb(main):004:0> prefLabel_uri = Redland::Uri.new("http://www.w3.org/2004/02/skos/core#prefLabel")
=> #<Redland::Uri:0xb7c4f6f0 @uri=#<SWIG::TYPE_p_librdf_uri_s:0xb7c4f6c8>>

irb(main):005:0> storage=Redland::TripleStore.new("hashes",  "test", "new='yes',hash-type='memory',dir='.'")
=> #<Redland::TripleStore:0xb7c4a448 @store=#<SWIG::TYPE_p_librdf_storage_s:0xb7c4a3f8>,@store_type="hashes", @name="test">

irb(main):006:0> model=Redland::Model.new(storage)
=> #<Redland::Model:0xb7c47a68 @model=#<SWIG::TYPE_p_librdf_model_s:0xb7c47a18>, @store=#<Redland::TripleStore:0xb7c4a448 @store=#<SWIG::TYPE_p_librdf_storage_s:0xb7c4a3f8>, @store_type="hashes", @name="test">, @statements=[]>

irb(main):007:0> parser=Redland::Parser.new("raptor", "", nil)
=> #<Redland::Parser:0xb7c44200 @context=nil, @parser=#<SWIG::TYPE_p_librdf_parser_s:0xb7c441c4>, @idents=[]>

irb(main):008:0> model.size
=> 0

irb(main):009:0> parser.parse_into_model(model, cider_uri)
=> 0

irb(main):010:0> model.size
=> 14

irb(main):011:0> model.object(cider_uri, prefLabel_uri).to_s
=> "Cider@en"

irb(main):012:0> object_uri = model.object(cider_uri, broader_uri).uri
=> #<Redland::Uri:0xb7c399b8 @uri=#<SWIG::TYPE_p_librdf_uri_s:0xb7c39990>>

irb(main):013:0> object_uri.to_s
=> "http://id.loc.gov/authorities/sh85052187#concept"

irb(main):014:0> parser.parse_into_model(model, object_uri)
=> 0

irb(main):015:0> model.size
=> 27

irb(main):016:0> model.object(object_uri, prefLabel_uri).to_s
=> "Fruit wines@en"

With that, I move from piece of linked data to another, parse it, and pick out the piece of information I want. Now everything in the web of linked data is available to me.


DIG: Hackfest.

30 September 2009 conferences literature

I’m at Access 2009 in Charlottetown, Prince Edward Island, and today was the pre-conference Hackfest.

I brought three books with me to read:

Here’s my Hackfest report Ellroy-style.

Charlottetown, 9/30/09

I wake up. I’m tired. I was up late. I was working. I was doing e-mail. I was editing Ruby. I was watching a Railscast. I was reading.

I get ready. I get dressed. I go down to the restaurant. “Continental breakfast.” Read: cheap. Read: not very good. Read: bagels and muffins. Read: bad coffee.

I get food. I get bad coffee. I see people I know from other conference. I sit down. We talk. We eat. We leave. We meet Bess. We meet Gabriel. We meet Joy. We meet others. We get in cabs. We go to the university. We find the building.

Signs: “Hackfest.” We follow. People point. We get to the room. There are people there. They have laptops. They sit. They mill around. They stand. They talk. “Haven’t seen you since last year. How’ve you been?”

Vibe: GEEK.

Cory Doctorow giving a talk. No talks at Hackfest before. People uncertain. What’s going on? Cory sitting in chair. Cory working on laptop. Cory gets up. Paper with notes scribbled on it. He talks about copyright. He talks about freedom. He talks about how copyright law could affect US.

He vibes geek. He vibes cool.

DIG: Everyone infringes copyright. There is copyright-infringing content everywhere. YouTube. Usenet. BitTorrent. Blogs. Everwhere. But there is free content too. Mass shutdown of a site because there are copyrighted materials on it takes down all free stuff with it. You don’t care about copyright infringement because you don’t infringe? Because it’s greasy-haired teenagers swapping porn? Too bad, loser. Your site just disappeared because someone complained and your ISP shut you down without asking. BAAAAD.

DIG: All protocols can be used for piracy. HTTP. SMTP. NNTP. IRC. FTP. Companies say: build a pirate-proof protocol. Companies say: use that protocol. Cory says: That protocol will take away all privacy.

DIG: Real purpose of DRM is to keep people from putting their own code on a device. From using the device for their own purposes.

DIG: New copyright law in the works. ACTA. It says: copyright infringers go to jail. It sys: border guards can search your devices for copyright material.

DIG: “Librarians and archivists vastly underestimate the moral authority of librarians. You can’t say anything bad about them without looking like an asshole.” Cory says: Speak out. Use our image. Use our rep. Use our cred. Talk at work. Talk at government. Talk in public.

Cory stops. People clap. People interested. People inspired. People think: Stick it to them. People think: Hell yes. People think: Didn’t see it that way.

Cory sits. People ask questions. Cory answers. People talk. People discuss. OCLC. WorldCat. Metadata. Book covers. Databases. Fair use. Fair dealing. Canadian law. American law. EFF.

Ten o'clock. Time’s up. Cory pulls out laptop. He works. He types. He concentrates.

We talk about Hackfest ideas. We plan. We explain. We discuss. We vote. We split up into groups.

TABLE: Linked data.

TABLE: Optical character recognition correction done in browser in HTML editor.

TABLE: This.

TABLE: That.

TABLE: In other rooms.

I sit at linked data table. Declan sits. Bess sits. Lisa sits. Gabriel sits. Richard sits. Others sit. We introduce. I’m so-and-so. I work at this place. I’m interested in that.

Dan comes in. He vibes geek. He vibes cool. He sits down. He talks linked data. He talks Library of Congress.

Some people have things to work on. Some people don’t. Some people start to work. Some people leave.

We browse. We hack. We talk. We IRC. We tweet. We dent. We search. We edit. We download. We install. We reinstall. We talk to Ed in IRC. We talk to Ross in IRC. We ask for help. We offer help. We explain. We get confused. We hack.

Vibe: GEEK.

Vibe: LIBRARY.

I look at Ruby. I look at RDF. I find links. I read. I install Redland. I install Ruby bindings. I look at id.loc.gov. I look at subject authority records. I look at Cider. I download. I write. I hack.

Food comes. People say: Take a break. People say: Hey, it’s nice outside. People say: Big blue room.

Cory comes back. He talks with Bess. They talk book covers. They talk Open Library. They talk OCLC. They talk metadata. They talk copyright. Cory talks encrypted disks. Cory talks Ubuntu. Cory talks publishing process. He vibes helpful. He vibes open. He vibes interested. He vibes LIBRARY. He leaves. He has to write a column. He has to write a story.

Afternoon. Quieter. Fewer people. People have gone. People are splitsville. We work. We hack. We install. We talk.

I work on Ruby. I work on RDF. I work on my script. I read the docs. I look for examples. I get errors. I fix errors. I begin to figure something out. I remember seeing Ed do it. Ed did it in four lines. I have fifty lines. I don’t understand them all. I try this. I try that. I begin to figure it out.

I find an authority record. I load it in. I parse it. I have 14 statements. Fourteen triples. CRAZY. I want a broader term. I look for skos:broader. I find it. I know the predicate. I know the subject. I find the object. I find its URI. I load it. I load it as RDF. I parse it. I have 27 statements. Data links to data. Linked data. CRAZY.


How I put Ubuntu Netbook-Remix on my Eee

27 September 2009 unix uses.this

Screenshot of my Eee with Ubuntu Netbook-Remix on it

I have an Asus Eee 701. They keyboard’s too small but it’s a nice netbook and perfect for travelling. I had Ubuntu Eee (now Easy Peasy) on it, but a couple of days ago I brought it up to date with Ubuntu Netbook-Remix, with Ubuntu 9.04. Here’s what I did.

  • Downloaded Ubuntu Netbook-Remix, put it on a flash drive, and installed it. Dead easy.
  • Ran Update Manager to update everything.
  • Preferences: change to standard desktop.
  • Ran into a problem: The window manager stops working if you do what I did and then reboot. Why this hasn’t been fixed I don’t understand. I searched Google for ubuntu netbook-remix metacity and I found what I needed in the eighth result. The last comment in this bug report says to run gconftool-2 --set /desktop/gnome/session/required_components_list --type list --list-type=string ["windowmanager","panel"] and then reboot. I did so and it worked.
  • Copy .emacs* .bashrc .profile .lisp .ssh .themes into my home directory from a backup.
  • System | Preferences | Appearance: set to my Miskatonic theme, change background to solid colour SteelBlue4, turn off icons in menus, make toolbar button labels show text only.
  • Change Workplace Switcher so it has 3x2 windows named A-F.
  • System | Preferences | Keyboard Shortcuts so that Ctrl-arrow moves around workplaces instead of Ctrl-Alt-arrow.
  • Install: GNOME Do (set preferences so it runs automatically), Firefox 3.5, Emacs (snapshot version with GTK), auctex, git, ruby, rubygems, Thunderbird (with the Lightning and Google Provider extensions), and Apache for starters.
  • Change File Browser preferences to use list view by default.
  • Firefox extensions: Adblock Plus, Zotero 2, Customize Google, Session Manager, LibX for York University Libraries, CS Lite, Web Developer.
  • Wonder again what Firefox extension I need that will stop me from having to do this by hand every time I set up a new system.
  • Adjust placement of things in top menu bar.
  • Try to watch a Quicktime file and install codecs when prompted.
  • System | Preferences | Startup Applications: turn off things I don’t need.
  • Uninstall Evolution.
  • git pull various things.

I just noticed that the Eee has about 220 megs of swap space. It shouldn’t have any, because all that writing will speed up the flash drive wearing out and losing its memory. Hmm, maybe I’ll have to reinstall.


Kosavic, The York Digital Journals Project: Strategies for Institutional Open Journal Systems Implementations

19 September 2009 libraries york

My colleague Andrea Kosavic has a paper coming out in College & Research Libraries about York Digital Journals and a preprint is available: The York Digital Journals Project: Strategies for Institutional Open Journal Systems Implementations. If you’re interested in open access, Open Journal Systems, or successful advocacy, read it.


convmv solves rsync encoding problem

18 September 2009 unix

I was using rsync to copy files from a big external backup drive to an even bigger external backup drive I just got. (It’s a 500 gig Seagate FreeAgent Go, which requires only the USB connection for power.) I got a bunch of these errors:

rsync: recv_generator: failed to stat
"/path/Rough-Guide-to-Tango/15-N\#351stor-Marconi-Tr\#355o---Cuando-T\#372-No-Est\#341s.mp3":
Invalid or incomplete multibyte or wide character (84)

I installed convmv (“converts filenames from one encoding to another”), ran convmv -f latin1 -t utf-8 *, ran it again with --notest, and then rsync worked without any trouble. Nice!


Updated footnote list

14 September 2009 footnotes

Updated Fictional Footnotes with a couple of mentions of Paul Auster and one of René Daumal (A Night of Serious Drinking, a novel with an index), both sent in by readers of the page. The list slowly grows year by year.


My cracked Android

02 September 2009 android

Picture of my cracked HTC Magic smartphone

Last month I bought an HTC Magic smartphone with Rogers, a large Canadian telecommunications company, as my provider. I bought it because I wanted a smartphone, I didn’t want a Blackberry or an iPhone, and this runs Android, Google’s operating system for phones. I’d never had a mobile phone before but decided to get this so I could have Internet access everywhere I go, and also so I’d have a GPS dingus with me.

As you can see, I cracked the screen. I had it in a jacket pocket that ended up in the wrong place when I sat on a rock. Remarkably, the phone still works perfectly well, touch screen and all. The cracks are on the underside of the screen, and you can barely feel them on the top. I hope it’ll last a long time like this, because it would cost $600 to buy a new one.

Apps I use regularly: The Weather Channel, Useful Switchers, ConnectBot, My Tracks, Sky Map, No Signal Alert. And the built-in web browser, of course. Also I downloaded some Star Wars sounds and made them the ringtones for all the events.

Apps I downloaded but don’t use a lot but they look good: Better Terminal Emulator, Flashlight, Layar, Movies (from Flickster), Night Clock.

The battery performance seemed to improve after I completely drained it two or three times. I may have just been imagining that, and maybe it’s because I use the GPS dingus less than when I first bought the phone. I have to charge the phone every night but I don’t have any trouble getting through the day with regular usage. I keep a spare USB cable at work in case I need to, though.


Survival of the Fistest

30 July 2009 reviews

“Survival of the Fistest” is a review of Darwin’s Nightmare, by Mike Knowles (ECW, 2008). It appeared in Driven in October 2008. My thanks go to Gary Butler, the editor, for asking me to do it and then editing it.

Crime writer Mike Knowles is a real-life Hamilton, Ont. elementary school teacher, and from the looks of his dust-jacket photo, we’re guessing the students don’t give him any trouble. Or the Principal.

Darwin’s Nightmare, Knowles’s first novel, is a violent noir set in Steeltown. How violent? Wilson, the narrator, shoots a grandmother. (But she shot him first.) (But he was beating up her grandson.)

Thief-slash-killer Wilson is employed by the city’s top gangster for jobs he doesn’t want his own people to do. The book starts with our anti-hero robbing a courier of a bag at the Hamilton airport. The owners naturally come looking for it, the Russian mob gets involved, and soon enough Wilson finds himself caught up in a gang feud.

The basic plot is too simple to sustain a novel, so Knowles uses flashbacks to pad it out and develop Wilson’s character. There is an unnecessary chapter about a bartender who refuses to pay protection and goes on a murderous rampage, and while Hamilton is a great setting for a story like this, the city isn’t as real as John McFetridge’s Toronto in Dirty Sweet.

Darwin’s Nightmare is a fast, tough story nevertheless, filled with gun battles, smashed teeth, and gang warfare. A new if not yet wholly original voice in Canadian noir is welcome and this is a good first novel, particularly as a counterweight to the often flaccid mysteries this country produces. Crime fans will enjoy the book and should watch for his next offering; ECW has him scheduled for follow-up releases in fall 2009 and 2010.