RESTful output from AADL catalog

After a somewhat restful day… (groan)

In an effort to make the AADL catalog a little more accessible to developers, I’ve written a little bit of middleware that generates REST output from the catalog. Yes, we currently have RSS feeds directly from the catalog, but they are not suited for true development. REST output will allow developers to freely access both hitlist data and bibliographical data without having to do any funky scraping, parsing, or wand-waving.

Please take a look, hack away, try to break it, whatever. Beta testers are always welcome!

Here are the details:

If you were to do a keyword search for “Harry Potter” on our catalog, you would see the URI looking like this:

http://www.aadl.org/cat/seek/search/X?Harry%20Potter&searchscope=26&m=&SORT=D

That, of course, is the hitlist. You want RESTful output. So change the URI to:

http://www.aadl.org/cat/rest/search/X?Harry%20Potter&searchscope=26&m=&SORT=D

Basically, you are just changing “seek” to “rest”. The base URI for the REST interface is http://www.aadl.org/cat/rest/ but going there without a query won’t get you much. Anyway, the output from the preceding looks like:

<?xml version="1.0"?>
<p:Records xmlns:p="http://www.aadl.org"
           xmlns:xlink="http://www.w3.org/1999/xlink">
	<Record id = "1249810" xlink:href="http://www.aadl.org/cat/rest/record/1249810"/>
	<Record id = "1251743" xlink:href="http://www.aadl.org/cat/rest/record/1251743"/>
	<Record id = "1239167" xlink:href="http://www.aadl.org/cat/rest/record/1239167"/>
	<Record id = "1260602" xlink:href="http://www.aadl.org/cat/rest/record/1260602"/>
	<Record id = "1249532" xlink:href="http://www.aadl.org/cat/rest/record/1249532"/>
	<Record id = "1249531" xlink:href="http://www.aadl.org/cat/rest/record/1249531"/>
	<Record id = "1230466" xlink:href="http://www.aadl.org/cat/rest/record/1230466"/>
	<Record id = "1258774" xlink:href="http://www.aadl.org/cat/rest/record/1258774"/>
	<Record id = "1237981" xlink:href="http://www.aadl.org/cat/rest/record/1237981"/>
	<Record id = "1224899" xlink:href="http://www.aadl.org/cat/rest/record/1224899"/>
	<Record id = "1236034" xlink:href="http://www.aadl.org/cat/rest/record/1236034"/>
	<Record id = "1228878" xlink:href="http://www.aadl.org/cat/rest/record/1228878"/>
</p:Records>

That’s useful to get the hitlist of records for that search. Obviously, those URI’s above denote the corresponding records in REST format. The first one (http://www.aadl.org/cat/rest/record/1249810) looks like:

<?xml version="1.0"?>
<p:Record xmlns:p="http://www.aadl.org"
          xmlns:xlink="http://www.w3.org/1999/xlink">
	<callnum>823 Bu</callnum>
	<author>Burkart, Gina, 1971-</author>
	<fulltitle>A parent's guide to Harry Potter / Gina Burkart</fulltitle>
	<title>A parent's guide to Harry Potter </title>
	<pubinfo>Downers Grove, Ill. : InterVarsity Press, c2005</pubinfo>
	<desc>112 p</desc>
	<bibliography>Includes bibliographical references</bibliography>
	<contents>The Harry hype -- More than a story -- The modern fairy tale -- Discussing fantasy with children -- Morals, not magic -- The real issues in Harry Potter -- Dealing with traumatic experiences -- Facing fears -- Battling bullies -- Delving into diversity -- Hiding hurts -- Letting go of anger -- Getting help -- Choosing good over evil -- The power of love -- Facing spiritual battles</contents>
	<isbn>0830832882</isbn>
	<price>$11.00</price>
	<lang>eng</lang>
	<copies>0</copies>
	<catdate>08-16-2005</catdate>
	<mattype>a</mattype>
	<avail>No copies available</avail>
	<recordlink xlink:href="http://www.aadl.org/cat/seek/record=1249810"/>
</p:Record>

This data would be very easily accessible using something like PHP’s simpleXML. I think one of my next little side projects will be to write a class that accesses this and make it available for download here. Enjoy!

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • blogmarks
  • co.mments
  • del.icio.us
  • De.lirio.us
  • digg
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • scuttle
  • Shadows
  • Simpy
  • TailRank
  • YahooMyWeb

8 Comments so far
Leave a comment

Nice, John - that looks clean enough to start building more services from without going through a lot of screen-scraping grief.

I’ll see if I can’t get a little bit of python code to make use of this interface too.

Did you look at opensearch at all?

Some of us are developing a spec that’s similar in intent called unAPI. Would be interested in any feedback if you thought it worthwhile. -dc

Ed S., Yes, I’ve looked at it. It would be very cool to somehow adopt that standard, but due to some very real limitations with the access we have to our ILS, I don’t see that happening in a meaningful way. Opensearch would either require a robust implementation from the our vendor (III) or they need to provide the tools that would allow me to do it myself.

DC: From what I’ve read about unAPI, it’s a microformat standard, correct? (I may be way off base) I’m very interested in pursuing catalog microformats, especially if there is a standard already, which it looks like you’re working on. I’ll find you.
:)

John, here’s a page with some more citation formats, if you’re looking for points of comparison:

http://www.microformats.org/wiki/cite-formats

the SimpleDC output is real output from a search of the U of Michigan catalog.

This is really cool, thanks!

[…] Inspiried by John Blyberg's middleware which provides REST output from the Ann Arbor catalogue, I've put together something similar for ours: http://webcat.hud.ac.uk/rest/info.html […]

OK, after a bit more work I managed to transform this output into something that adheres to the COINS standard for bibliography references. It’s not perfect (it just works on books) but a few people on #code4lib found that it validates.

More details soon, I’ll write it up on http://www.superpatron.com .



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

(required)

(required)