March 29, 2004

Audioscrobbler

Audioscrobbler is another service that meets the criteria described in "Scattered Self.

I've just signed up, and already have an RSS 1.0 feed of my recent listening.

Very cool site.

Posted by ldodds at 02:36 PM | Feedback? | TrackBack

How to make RDF and JSP place nicely together?

Via Gavin (via the chumpologica): An application architecture that should yield superior productivity.

Interesting stuff. I've been pondering something similar myself, mainly because I have a slice of an application I'm working on that I want to replace with an RDF data model and storage. To achieve this successfully I need to make sure that the data nicely dovetails with the JSP 2.0/JSTL templating environment we've built on top. However I don't want to model everything as objects if I can help it, because by doing so I'm going to sacrifice some of the flexibility I gain from using RDF.

Ideally I want to gut the current Data Access Objects and replace them with node that navigates the underlying RDF graph, perhaps using an RDF query language, and then return a subset of that graph in a form that suitable for traversing with JSTL. There's not a great deal of business logic in that slice of the application so there's little else to change.

I had been wondering whether the technique used in RDF Twig could be generalized to creation of simple object hierarchies (Lists and Maps). Rx4RDF might be another useful place to mine for ideas.

Suggestions for other useful APIs to techniques to explore will be gratefully received.

btw, if you find that you start extending your object model to allow arbitrary property annotation, and some of those properties are actually pointers to other objects in your graph, then that's probably a sign that you may be better off using an RDF based model. And possibly Python too but I've not explored that angle yet.

Posted by ldodds at 01:48 PM | Feedback? | TrackBack

Get Your FOAF On: Events continued

Part of the continuing Get Your FOAF On series, this tutorial is a companion to the earlier installment on events, covering some specific types of event description.

While the RDF iCalender effort is certainly the most rigorous approach to describing events in RDF, this doesn't mean that it's the only way to do it and other vocabularies offer some alternatives for specific cases.

This tutorial will look at the Conference and Bio vocabularies that describe conference participation and births, deaths, and marriages.

The BIO vocabulary is an RDF schema created by Ian Davis that can be used to capture biographical details about people whether living or dead. It defines it's own notion of an Event, independent of that defined in RDF Calendar, and refining it into three types of significant event that can happen to someone: Birth, Death and Marriage. An event has a specific date-time at which it happened (bio:date), and a textual description of where it took place (bio:place).

Here's how one uses it:


<foaf:Person xmlns:bio="http://purl.org/vocab/bio/0.1/">
<foaf:name>Leigh Dodds</foaf:name>
<bio:event>
<bio:Birth>
<bio:date>1972-04-30</bio:date>
<bio:place>Teignmouth, Devon, United Kingdom</bio:place>
</bio:Birth>
</bio:event>
</foaf:Person>

Associating a person with a birth, death or marriage event is handled by the bio:event property the value of which is a particular kind of event: bio:Birth, bio:Death, or bio:Marriage. The above example describes my birthday (30th April 1972) and where it took place.

The description of the event's location is obviously fairly limited, a more detailed geographical description might have been more useful (we'll look at these in a later installment), however for the limited use case that the BIO vocabulary is aimed at it's probably enough.

So with Births, Deaths, and Marriages out of the way, what about conferences?

Jennifer Golbeck has written an OWL schema for capturing conference related metadata. The schema treats a conference, panels, presentations as events but unfortunately the schema is not yet tied into RDFiCal so the two aren't fully interoperable.

For an example of how to use this schema see this example from my conference metadata wiki which is an application exploring easy authoring of this kind of data.

Posted by ldodds at 01:16 PM | Feedback? | TrackBack

MusicBrainz RDF Schema

This has already circulated to a few folk, but I thought I'd share it with a wider audience.

Basically I've written up a first attempt at an RDF Schema for MusicBrainz. Here's the schema and here's the accompanying notes, including some comments on how SongBuddy exports its data as RDF and how this might be improved.

The goal here is to turn this into the official schema for MusicBrainz data (Robert Kaye seems keen to get a schema in place). So comments are very welcome.

Posted by ldodds at 01:05 PM | Feedback? | TrackBack

Scattered Self

Over the past few months I've begun scattering my online presence over a number of different services, taking advantage of their XML/RDF interfaces to re-integrate myself using my FOAF description.

Here are some notes on my experiences so far, and some suggestions for a couple of other services that I'd like to see built.

Currently I'm using AllConsuming for books, del.icio.us for bookmarks and Morten's FOAF hosting to grab my wishlist from Amazon.

Prompted by chumpage from Matt Biddulph I've also started looking at bloglines as an online RSS aggregator.

The main advantage I've found with this setup is the sheer portability. No more worrying about synchronizing bookmarks or aggregator configs between work and home. It's already Out There.

The other key advantage is that these services enrich the data I provide them with, augmenting it with additional metadata. E.g. via del.icio.us I can see comments from other users, or see items that have been similarly categorized. AllConsuming provides links to other reviews, blogs, etc. For little effort on my part, e.g. a bookmarklet click or a quick book title search, all this data becomes immediately available. That's a big return on a small investment of time and is the sort of benefit that will keep me using a service.

As these services allow me to take away my augmented data in an easily processable format (XML/RDF) it means that as a hacker I can do Cool Things. But, more importantly, as an end user I don't have to worry about the pointy brackets: I key in some data and as well as an enriching my online experience, it also gives me a URL, a RESTful access point to my data, at which I can point other services. This is the Unix pipe metaphor extended to the web: small specialized services that can be plumbed together to create interesting applications.

Imagine routing your blogroll to allconsuming so that it can provide you with a list of what your friends are reading. From there its a small leap to create a list of book recommendations that can in turn be fed into Amazon. Amazon might take this data, add it to your wishlist, and in turn provide you with additional recommendations. Your wishlist is available via your FOAF description so your favourite social networking site can provide your nearest and dearest with a list of things to buy you for your birthday, and so on.

This process doesn't have to be guided by hand either. As this data is linked from my FOAF description any service can grab all this data and use it as it sees fit (I do reserve the right to sign it for particular services however, to avoid abuse). The data is available my performing simple GET operations from the URLs in my FOAF. The resulting RDF data which uses standard vocabularies wherever possible, can be interpreted by the service. And it can do this without having to know anything about the service generating the data. Look ma, I just became a web service intermediary; no SOAP, UDDI, whatever required! Simple linking and standard vocabularies are all it takes.

Let's synthesise the above rambling into a series of recommendations for building user-centric services:


  • Don't try to do to much: do a few things and do them well

  • Make it easy to add data to the service. Bookmarklets, augmented with a small form, are the best way to handle this

  • Don't appropriate my data or restrict it's use: at the very least I should be able to get back what I put in. Ideally it should be augmented

  • Provide a REST style interface to export the data. This should use stable URIs (so I can rely on it) and it should not require manual intervention to export the data.

  • Facilities to protect the data export are welcome, but should not be required. Doing so makes it harder to share data

  • Use RDF for the data formats, it's designed for integrating disparate types of data; failing that use XML so I can easily transform it

At the moment some of the services I'm using fail to achieve these recommendations. For example Bloglines only allow me to manually export the data. The del.icio.us API, which is richer than the RSS feeds, is password protected making it hard to share the data. Share Your OPML doesn't allow me to reuse the data so that one falls at the first and most significant hurdle.

I'm sure there are other recommendations, but I think these make a useful start. Can you think of any others?

My quest for services isn't yet complete as I still need a place, similar to AllConsuming, through which I can manage my music collection. Something layered on top of MusicBrainz would be ideal. I also want somewhere to manage my event data, e.g. gig or conference attendance. I can easily mark this up using FOAF and iCal, but a service that aggregates and enriches that data would be interesting.

Posted by ldodds at 12:53 PM | Feedback? | TrackBack

March 09, 2004

SAXON

Via Cafe con Leche I notice that Saxon 7.9 has been released. The interesting thing is that Mike Kay has founded Saxonica Limited which will offer professional services and additional modules, including a schema-aware processor as a commercial offering.

I've used Saxon for a long time now. It's my XSLT processor of choice. I've never bothered with Xalan or other processors as Saxon has always Just Worked.

Like any good tool Saxon is adjustable enough to help you solve any particular problem. Just recently I've benefited from both the saxon:preview which helped me deal with a large transform and the very easy extension mechanism that allowed me to invoke some Java code during a transformation (generating a SHA1 sum for an email address).

I think it's good news that Mike is intending to continue offering the basic product for free and wish him well in the commerical venture.

Posted by ldodds at 11:15 AM | Feedback? | TrackBack

March 01, 2004

FOAF Blogrolls

I came across a posting from Matthew Haughey this morning which contained this comment:

I think developers forget that people won't or can't use any technology until it's got an easy-to-use interface. I know it's important at some level, but I couldn't care less about say, which RDF vocabulary FOAF will use, I only care how easy it will be to add FOAF stuff to my site (best is having something do it automatically

The posting was noting that blo.gs has just added XFN support.

So taking Matt's comments to heart I whipped up a simple interface that uses FOAF to generate a blogroll.

Basically I've just hacked up a JSP page that does the following:

  • Loads a FOAF document, specified using a foaf parameter in the query string, then
  • Finds all foaf:weblog properties in the resulting graph, and
  • Works out the name of the thing with the weblog (using, in order: foaf:name, foaf:nick, dc:title, "unknown", and
  • Generates a series of div elements each containing a link to that weblog using that name

I've added foaf:weblog properties to some of the people that I know so you can see the result. The URL is:

http://www.ldodds.com/micro-util/blogroll.jsp?foaf=http://www.ldodds.com/ldodds-knows.rdf

By default the JSP generates HTML, but if you add type=js to the querystring it generates Javascript instead. So you can include it in your blog either directly (with an include), or using a script tag.

Here's the same thing except as Javascript:

http://www.ldodds.com/micro-util/blogroll.jsp?foaf=http://www.ldodds.com/ldodds-knows.rdf&type=js

And here's how you'd incorporate it into your blog:

<script language="javascript" src="http://www.ldodds.com/micro-util/blogroll.jsp?foaf=http://www.ldodds.com/ldodds-knows.rdf&type=js"/>

The JSP page doesn't do some fairly obvious things like sorting based on names, using foaf:homepage if there's no weblog, or adding XFN attributes based on the type of relationship, but it's easy enough to add. This is just a quick lunch hour hack. Drop a comment to encourage me to extend it!

There are possibly better ways to model blogrolls in FOAF, I'm certainly not suggesting that this is the perfect solution. Hopefully though it goes some way to wards meeting Matt's criteria for easy integration and provide some simple returns on maintaining a FOAF description.

Posted by ldodds at 02:02 PM | Feedback? | TrackBack