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!


About this entry