« Library robots | Main | Tight code »

OpenURL 1.0

NisoI've spent some time this week looking at the OpenURL 1.0 spec, mainly because Jeff Young is using it in the WikiD (used to be called MetaWiki) processor.  It's a lot more concrete than what I heard Herbert Van de Sompel talk about a few years ago, but abstract enough to build a structured Wiki on top of it, which is probably abstract enough for most of us.

About the only way I can understand this sort of thing is to write some code that processes it.  It's easy to fool yourself that you understand something, but a lot harder to be fooled when your program fails because you really didn't.  Has anyone else ever been confused trying to keep track of the difference between the referent, referrer, referring-entity, requestor, and resolver?  Too many R's, but I'm clear on them now, at least for the day.

Somewhat in the spirit of our one and two page OAI-PMH harverster and repository, I've managed to cram an OpenURL resolver into around 200 lines of Python code that will at least handle the examples Jeff has up here.  It doesn't actually do anything other than parse the Context Object and echo it back in XSLT formatted XML.  I know there are some things missing, but I think the code could be extended.

Probably the most difficult part of getting this to work is coping with the two basic ways of encoding the new OpenURLs.  KEV is what you need to put a simple OpenURL into a URL, and XML for anything more complicated. 

In case you're interested in the code, here's a compressed tar file of the 200+ lines of code and the support files to exercise it.  No promises that it's abstract enough to build a Wiki on, but I did go to the trouble of adding the gratuitous white-space that Python programmers seem to expect to make it more readable.  There's a README.txt file in the openurl directory.  I'd be interested in hearing from anyone that tries it out.

--Th

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/331110/2866913

Listed below are links to weblogs that reference OpenURL 1.0:

Comments

Post a comment

Comments are moderated, and will not appear on this weblog until the author has approved them.

If you have a TypeKey or TypePad account, please Sign In

My Photo

July 2008

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31