Portrait of Edd Dumbill, taken by Giles Turnbull

Subscribe to updates

Feed icon Atom or RSS

or get email updates

What I make

a conference management web application

XTech Conference
a European web technology conference

Dashboard and FOAF, or, Joining the dots

This is a strange entry to write, I've been holding it back for several days now. It is intended to be about the latest work I've done with Dashboard and FOAF, but it's also pretty significant for FOAF in its own right. I'll cover the FOAF aspects first, then finish up with the pretty Dashboard screenshots.

An emerging problem with FOAF has been how to link from a web page to a FOAF file in such a way that says "I'm the author of this page and I'm described in this FOAF file."

It's not sufficient merely to link to a FOAF file with this tag:

 <link rel="meta" type="application/rdf+xml" title="FOAF"
       href="http://example.com/foaf.rdf" />

A FOAF file is arbitrary RDF. There is no way, and there will never be a way, of relying on the order of the elements in the file to tell you anything. For instance, the first description in my own file is actually about the file itself, rather than me. All of this means, that while the link tells a software agent that there's a related RDF file at a certain URL, it says no more.

Technorati use the untyped link in conjunction with data they hold in their own database to make the link. In your Technorati profile you can "claim" your blog: you essentially provide the "I made this!" information, which they put together with the FOAF link in order to connect you with your blog.

What is needed, however, is a way of doing this in a decentralized, webby, manner. So, I have proposed, and implemented, a solution for HTML pages. (There was broad consensus on this from the FOAF core developers.) In addition to the tag above, add another piece of metadata to your HTML's head section:

 <meta name="foaf:maker"
       content="foaf:mbox mailto:edd@usefulinc.com" />

This is shorthand for a bit of RDF that says the maker of this page has an mbox property of mailto:edd@usefulinc.com. Most people use the mbox_sha1sum property these days to obfuscate their email address. Such a usage would look like this:

 <meta name="foaf:maker":
   content="foaf:mbox_sha1sum '1ba3bffdd13a136d38b77542f2e26fd1dc0042f2'" />

The upshot of this is that a software agent can make the connection between you, as author, and your description in FOAF. So, use this in your web page and start joining up the dots between the HTML and FOAF web!

I've written this up fully in I Made This!, which also contains details of how to do similar neat tricks from your FOAF file, including linking to your RSS files. You should also read Dan Brickley's Pages about people article, which tackles similar topics.

And now, for a pretty picture.

Dashboard discovers web page FOAF links

I implemented code in Dashboard to sniff the two meta tags shown above. The link tag is used to generate an rdfurl clue, and the foaf:maker a foafid clue. The FOAF backend then downloads the RDF from the rdfurl, and displays personal data matched by the foafid clue. When I browse my web page, the result shown in Dashboard is quite pretty:

Edd Dumbill's FOAF information showing in a Dashboard panel

If you followed my earlier work with Dashboard and FOAFbot note that this is different: FOAFbot's not involved. It's Dashboard itself that's the consuming agent here. As I related previously I used the Drive C# RDF toolkit.

The Dashboard FOAF implementation also gives an interesting metric for how long it takes to implement a simple FOAF agent in a robust (read: no dodgy heuristics) manner. From having no code at all to the result you see in the screenshot took me less than seven hours.

blog comments powered by Disqus

You are reading the weblog of Edd Dumbill, writer, programmer, entrepreneur and free software advocate.
Copyright © 2000-2012 Edd Dumbill