Joining the semantic web party
So, I’ve finally got round to joining the machine readable party that is the semantic web. I used RDFa (RDF in attributes) to add semantic data inline. With RDFa, you don’t need to write a separate document (e.g. an RDF/XML document), you just add a few attributes into your existing XHTML, and RDFa compliant consumers should be able handle it.
There are a number of good introductions to RDFa around. I’d recommend the W3C RDFa Primer and Mark Birbeck’s Getting started with RDFa: Creating a basic FOAF profile.
Once you’ve got the basics sorted, it’s just a matter of learning the predicates provided by the vocabularies you’re using. As a start, I’d recommend checking out the Dublin Core Vocabulary, and the FOAF vocabulary.
There are a couple of tools that I found useful for checking that what I was doing was correct. The RDFa Distiller should be the first port of call, extracting RDFa from a site and outputting it in RDF/XML, N-triples or Turtle format. To visualise your data, use the W3C RDF Validator, which produces some really useful RDF graphs.
I found myself often using these two sequentially, i.e. get my RDF/XML from the distiller, then run it through the Validator to visualise it. To make this process a little easier, I added a link at the bottom of my blog, which runs the URL of the results of the distiller of the current page through the validator. Hey presto! One click metadata visualisation.
If you want to use this yourself, I made it into a bookmarklet. Just drag the following link into your address bar — RDF Graph. Then, any time you’re on a page which uses RDFa, click the bookmark to show you the RDF graph.

Comments
Subscribe Make comment