Unfortunately, RDFa lobbyists on the HTML WG mailing list forced the spec out of HTML5 core for the time being. This manoeuver was understandable (a lot of energy went into RDFa, after all), but in my opinion very short-sighted. How many uphill battles did we have, trying to get RDF to the broader developer community? And how many were successful? Atom, microformats, OpenID, Portable Contacts, XRDS, Activity Streams (well, not really), these are examples where RDFers tried, but failed to promote some of their infrastructure into the respective solutions. Now: HTML5, where the initial RDF lobbying actually had an effect and lead to a native mechanism for RDF-in-HTML. Yes, native, not in some separate spec. This would have become part of every HTML5 book, any HTML developer on this planet would have learned about it. Finally a battle won. And what a great one. HTML.
But no, Microdata wasn't developed by an RDF group, so they voted it out again. Now, the really sad thing is, there could have been a solution that would have served everybody sufficiently well, both HTMLers and RDFers. The RDFa group recently realized that RDFa needs to be revised anyway, there is going to be an RDFa 1.1 which will require new parsers. If they'd swallowed their pride, they would most probably have been able to define RDFa 1.1 as a proper superset of Microdata.
Here is a short overview of RDF features supported by Microdata:
- Explicit resource containers, via @itemscope (in RDFa, the boundaries of a resource are often implicitly defined by @rel or @typeof)
- Subject declaration, via @itemid (RDFa uses @about)
- Main subject typing, via @itemtype (RDFa uses @typeof)
- Predicate declaration, via @itemprop (RDFa uses @property, @rel, and @rev)
- Literal objects, via node values (RDFa also allows hidden values via @content)
- Non-literal objects, via @href, @src, etc. (RDFa also allows hidden values via @resource)
- Object language, via @lang
- Blank nodes
- the possibility to preserve markup, but probably not necessarily as an explicit rdf:XMLLiteral
- datatypes for literal objects (I personally never used them in practice in the last 6 years that I've been developing RDF apps, but I can see some use cases)
I've been using Microdata in two of my recent RDF apps and the CMS module of (ahem, still not documented) Trice, and it's been a great experience. ARC is going to get a "microRDF" extractor that supports the RDF-in-Microdata markup below (Note: this output still requires a 2nd extraction process, as the current Microdata draft's RDF mechanism only produces intermediate RDF triples, which then still have to be post-processed. I hope my related suggestion will become official, but I seem to be the only pro-Microdata RDFer on the HTML list right now, so it may just stay as a convention):
Microdata:
<div itemscope itemtype="http://xmlns.com/foaf/0.1/Person"> <!-- plain props are mapped to the itemtype's context --> <img itemprop="img" src="mypic.jpg" alt="a pic of me" /> My name is <span itemprop="name"><span itemprop="nick">Alec</span> Tronnick</span> and I blog at <a itemprop="weblog" href="http://alec-tronni.ck/">alec-tronni.ck</a>. <!-- other RDF vocabs can be used via full itemprop URIs --> <span itemprop="http://purl.org/vocab/bio/0.1/olb"> I'm a crash test dummy for semantic HTML. </span> </div>Extracted RDF:
@base <http://host/path/> @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix bio: <http://purl.org/vocab/bio/0.1/> . _:bn1 a foaf:Person ; foaf:img <mypic.jpg> ; foaf:name "Alec Tronnick" ; foaf:nick "Alec" ; foaf:weblog <http://alec-tronni.ck/> ; bio:olb "I'm a crash test dummy for semantic HTML." .