After playing with del.icio.us and zool's RDF port of their API I wondered what other services I could link to from my FOAF.
Having spent a happy hour or so in Waterstones at the weekend purchasing some extra goodies to top up my already bulging bookshelves it dawned on me: AllConsuming.net has a REST interface so it should be a snap to create an RDF version of Erik's API using some XSLT.
Here's some notes on my first attempt at transforming the current reading list.
Here's the URL to fetch my current reading list from AllConsuming:
http://allconsuming.net/rest.cgi?action=GetCurrentlyReadingList&username=ldodds
You'll notice that it has a username parameter which is my AllConsuming username. Substitute your username in the URL to fetch your own list.
We can then take a stylesheet allconsuming2foaf.xsl and use the W3C XSLT service to apply it to my data.
The URL is pretty unfriendly, but you can use the form on the XSLT service page to plug in your URL and the URL of my stylesheet.
There are a couple of things worth noting in the output. Firstly I'm using the Wordnet namespace to indicate that each item is a Book. The Dublin Core title, and identifier elements are used to record the book title and ISBN. I wanted to use off-the-shelf vocabularies where possible.
Secondly, AllConsuming allows you to record some brief comments about a book. To capture that data I've used Danny's Review Vocabulary to indicate that a given book has a review, as well as indicating who the reviewer is. The generated RDF includes some details about me: my homepage as well as the fact that I have an OnlineAccount with AllConsuming.
To make the personal description slightly richer, I adapted the stylesheet to take two parameters: seeAlso which should be the URL of your FOAF description, and mbox_sha1sum which should be your encrypted email address. You can see these demonstrated in this version of my data.
Lastly the AllConsuming REST interface include the URLs of both the AllConsuming and Amazon pages for each book. To capture this data I used the foaf:page property to state "here's a page about this book". I scouted about for a couple of book price comparison sites that could be linked to via ISBN and added links to those pages also.
To link to this data from your FOAF description, simply add the following rdfs:seeAlso property:
<rdfs:seeAlso>
<foaf:Document rdf:about="...transformed data url...">
<dc:title>Current Reading List</dc:title>
</foaf:Document>
</rdfs:seeAlso>
Simply substitute the URL to your transformed AllConsuming data in the appropriate place. To save load on the XSLT service and AllConsuming you may just want to download the file and store it locally, updating it whenever you update your reading list.
Next steps are to tweak the stylesheet to cope with some of the other actions in the AllConsuming REST interface: there are some minor inconsistencies in the response formats which I'm not cleanly dealing with yet.
Posted by ldodds at February 24, 2004 09:39 AM | Feedback? | | TrackBackAah, now that's useful! I kept meaning to write that XSLT myself but never got around to it. Good stuff!
Posted by: Phil Wilson on February 24, 2004 01:21 PMGlad you liked it.
The ultimate plan is to set up some local cron jobs to grab data from various services and then build a local repository.
Posted by: Leigh Dodds on February 24, 2004 01:24 PMVery nice indeed, now all I need is an account on allconsuming...
BTW, the XPath for accountName should be "substring-after(header/@description, ' for ')" (it currently has .../@title).
Apart from the review "link" between between you and each of the books, shouldn't there be a "currentlyReading" property?
Oh, and re local cron jobs, I do that myself for my Amazon wishlist...
Thanks Morten, good catch on the accountName, haven't a clue why I didn't see that myself.
I think I'll whip up a simple vocab for reading lists, unless you know of one already. I could base it all on the AllConsuming categories, but these didn't quite gel with me: reading and re-reading for example. It's useful to have the extra granularity, but for a simple view of "what books is ldodds currently reading?" I need to combine these categories.
Posted by: Leigh Dodds on February 24, 2004 03:49 PMI've drafted a schema to properly associate people with their reading lists.
You can grab it from here, comments appreciated:
http://www.ldodds.com/schemas/book/index.rdf
Posted by: Leigh Dodds on February 24, 2004 09:00 PMVery nice work! :)
If there is one thing I'd like to see - its the author(s) of the book.
It is present in the info extracted from AllConsuming, but not in the RDF version.
Have you linked the reading list from your FOAF profile?
Maybe it is there but I don't see it.
Yes, the authors are there, but I wasn't sure how best to parse them: they're just a comma-separated list of names. I could just split on commas, but that gets tricky for names like "Joe Bloggs, Jr".
I'm intending to dig a bit more into how AllConsuming handles names of that forms.
And no, it's not linked from my FOAF yet because I wanted to fix up the bugs Morten reported. Later today...
Update:
I've written a simple schema for describing reading lists. This allows me to properly state: X is reading Y, X has read Y, etc. The transform now uses this schema. I've stated that the isbn property is Inverse-Functional. The ISBN documentation states that ISBNs shouldn't be re-used, so I believe this OK. So reading lists can now be smushed together.
The transform now correctly identifies which AllConsuming list you've requested and adds the appropriate properties. So you can now use the GetPurchasedBooksList, GetCompletedBooksList, GetFavouriteBooksList, and GetRereadingBooksList actions in the REST interface. The latter is interesting because I'm able to make two assertions: that you've read the book, and that you're currently reading it.
There were a couple of other bug fixes to the transform (corrected XPath as noted by Morten in comments above), removing trailing full-stop on account name.
Remaining work is to add author names to the books, but I'm wary about parsing this in XSLT because of likelihood of having commas in the authors name. Need to check how Amazon returns these.
If there's interest in transforming the other AllConsuming actions into RDF, then I could investigate this also.
Posted by: Leigh Dodds on February 26, 2004 01:08 PMLocal copies of my stuff:
They're now linked from my main FOAF description
These don't change that fast, so I've just written a shelf script to invoke curl to grab the data, then run Saxon over it to produce the various outputs.
Posted by: Leigh Dodds on February 26, 2004 02:20 PMExcuse the obscenity, but that's fucking great!
Posted by: Phil Wilson on February 27, 2004 03:35 PM mnosbercad.com Mercury Rev (this one is arguable either
http://university-gis.osbercad.com/university-gis.html university gis way). Sebadoh, first with Lou and Eric,
http://?-?.osbercad.com/?-?.html ? ? then with Lou and Jason. They Might Be
http://map-from.osbercad.com/map-from.html buy map from online Giants. Pixies, although they just broke
http://planning-gis.osbercad.com/planning-gis.html planning gis up before too much of it got to happen.
http://gis-net.osbercad.com/gis-net.html gis net Here's another bold statement: in my opinion,
http://g-i-s.osbercad.com/g-i-s.html g i s there are enough exceptions to this theory
http://tuscany.osbercad.com/tuscany.html tuscany online present in jazz, that as a music I will
http://gippsland.osbercad.com/gippsland.html gippsland exempt it from that entire clause. You
http://elevations.osbercad.com/elevations.html elevations can certainly find examples where a group
http://gis-certificate.osbercad.com/gis-certificate.html gis certificate split apart into factions or solo artists
http://mapobjects.osbercad.com/mapobjects.html mapobjects that weren't as interesting, but this is
http://postcodes.osbercad.com/postcodes.html postcodes more infrequent as less relevant. There.
http://svg-gis.osbercad.com/svg-gis.html svg gis Often when I'm walking around wearing my
http://england-map.osbercad.com/england-map.html england map headphones, I see other people also wearing
http://gis-t.osbercad.com/gis-t.html gis t headphones, and of course I wonder what
http://map-world.osbercad.com/map-world.html map world osbercad.comnm
Keep going, nice blog!
Posted by: oreck vacuums on July 25, 2005 07:31 AMKeep going!
Posted by: concert tickets on August 1, 2005 07:42 AM