RDF/XHTML

Steven Pemberton, CWI, Amsterdam and W3C
Chair, W3C HTML and Forms Working Groups

Mark Birbeck, xport.net

XHTML2

Generally useful markup, widely applicable, but not all things to all people

RDF

RDF community want RDF in XHTML

HTML Community want more semantics

HTML Community still have to buy in to RDF

HTML Community like to validate

RDF doesn't validate very easily

RDF/XHTML

RDF/XHTML is a new serialisation of RDF, designed to satisfy as many people as possible:

Triples rule!

Meshes better with traditional HTML approaches

Those who don't care can just ignore it

Leverage by gradual addition to existing markup

Sell it to HTML community by offering better search results

First attempt

Our first attempt was to use pure RDF attributes on XHTML elements

Almost worked, but not quite.

Then along came GRDDL: a standard method of extracting RDF from any markup

This meant that we could freely define our own markup to represent triples, and define the mapping with GRDDL

Examples

<meta name="dc.creator"
      content="Steven Pemberton"/>

now becomes:

<meta property="dc:creator">
    Steven Pemberton
</meta>

(use of @content still permitted, see later).

@name becomes @property because

  1. its datatype is different (it is now a Qname)
  2. it is the name used by RDF.

Link

<link rel="index" href="index.html"/>

now becomes

<link rel="index" resource="index.html"/>

@href becomes @resource because:

  1. it has different meaning to @href
  2. there are places where you can have both,
  3. it is the name used in RDF for the concept.

Do we need both rel and property?

There is a question whether @rel shouldn't be @property, since it is the same concept as with <meta>:

<link property="index" resource="index.html"/>

It could also be argued that @property refers to @content, and @rel refers to @resource. Are there use cases for using all of them at once on a single element in XHTML? For instance:

<meta property="dc:creator" rel="w3c:website"
      resource="http://www.cwi.nl/~steven/">
   Steven Pemberton
</meta>

Applying attributes

All meta/link attributes may be used on any element. They are:

@rel/@resource/@property: as above.

@content: if this is included, then it overrides the element content as metadata. For instance:

<span content="2004-04-04">yesterday</span>

Is @content a good name? It's the historical name in HTML. It's @value in RDF, but we already have an @value.

Datatype

@datatype: allows you to specify how to interpret the string. This means we don't have to introduce new semantic elements:

<span content="2004-04-04" datatype="xsd:date">
    yesterday
</span>

About

@about: A URI reference, the document/element that the metadata is about. If this is absent then the rules for deciding which element the metadata is about is as follows:

  1. If the element is a child of a <link>, then the metadata is about that.
  2. If the element is a child of an element with an @id, then the metadata is about that (this rule is still under discussion)
  3. Otherwise the metadata is about the document.

Conclusion

RDF/XHTML offers a low-hurdle approach to RDF for the HTML community.