RDFa
As reported over on semiBlog, I spent this week at ISWC2006 in Athens, GA and presented my blogging tool there during the poster session. I got to present it to a lot of people, among them Dean Allemang of TopQuadrant. He seemed to like it, but immediately gave me a lecture on how I should link the blog posts to the RDF metadata - use RDFa, use RDFa, use RDFa! In fact, he insisted that my life would turn into paradise straight away if I would start using RDFa in semiBlog, and that I would go to hell otherwise. That convinced me! :-)
Anyway, having the metadata embedded in the actual HTML code instead of linking to some file (as I do at the moment) would relieve me of some annoying problems I have with uploading rdf/xml file.
So, here are a few quick notes on how RDFa works. Generally speaking, RDFa encodes RDF triples as attributes to arbitrary XML elements (and is thus strictly speaking a method of embedding RDF in XHTML, not just any HTML).
Encoding Triples with Literal Objects:- The SUBJECT is referenced either by the
idor theaboutattribute of an XML element.xml:baseis respected. - The PREDICATE is referenced using the
propertyattribute of an XML element. - The OBJECT is referenced using either the
contentattribute or the actual content. Thecontentattribute takes precedence. - Objects can be typed as a specific datataype using the
typeattribute.
<span about="http://semiblog.semanticweb.org/rdfaexamples/posterSession" role="cal:Vevent" xmlns:cal="http://www.w3.org/2002/12/cal/ical#"> <span property="cal:summary">Posters Reception</span> <span property="cal:dtstart" content="2006-11-08T00:00:00+0000" type="xsd:date"/> <span property="cal:dtend" content="2006-11-08T02:00:00+0000" type="xsd:date"/> </span>Encoding Triples with Resource Objects:
- The SUBJECT is referenced either by the
idor theaboutattribute of an XML element.xml:baseis respected. - The PREDICATE is referenced using the
relattribute of an XML element. Usingrevinstead ofrelinverts the relationship, and turns the subject into the object and vice versa (think of passivization in natural language). - The OBJECT is referenced using either the
hrefattribute.
All this is explained in much more detail in the
- RDFa Syntax Specification, and the
- RDFa Primer.
(A sidenote: One aspect that I don't like about the RDFa solution in comparison to linking from the HTML to a SPARQL query is this: when I embed the RDF, it remains static. When I link to a query, I always get the latest, most up-to-date result. However, that's not really an issue at the moment, since I don't actually link to a SPARQL endpoint!)


