Confused Development

I develop software and I often get confused in the process. I usually find the answers after a while, but a month later I can't remember them. So from now on, I will write them down here.

Friday, November 10, 2006

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 id or the about attribute of an XML element. xml:base is respected.
  • The PREDICATE is referenced using the property attribute of an XML element.
  • The OBJECT is referenced using either the content attribute or the actual content. The content attribute takes precedence.
  • Objects can be typed as a specific datataype using the type attribute.
Example:
<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 id or the about attribute of an XML element. xml:base is respected.
  • The PREDICATE is referenced using the rel attribute of an XML element. Using rev instead of rel inverts 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 href attribute.

All this is explained in much more detail in the

(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!)

Tuesday, November 07, 2006

Enabling RDF Upload on WordPress 2.0

Just as a reminder to self: to enable the old Uploads Options panel in WordPress2.0+, I need to install the Filosofo Old-Style Upload plugin. I need this to allow semiBlog to upload RDF annotations to the blogging server.