Suggestion for Microdata to RDF conversion


I'm working on a Microdata parser as part of an RDF toolkit. One thing
I've implemented but that isn't directly stated in the draft is the
generation of property URIs in the context of the itemtype. The spec
mentions that plain properties are to be used "within the context of 
the types for which they are intended". And RDF vocabularies follow 
the {namespace}/{type|prop} or {namespace}#{type|prop} pattern. So,
I made my parser extract the following RDF triples:

  _:bnode a <> .
  _:bnode <> "Alec Tronnick" .
  _:bnode <> <mypic.jpg> .

from the Microdata snippet:

  <div itemscope="" itemtype="">
    My name is <span itemprop="name">Alec Tronnick</span>
    <img itemprop="img" src="mypic.jpg" alt="" />

as "name" and "img" are supposed to be applicable to the "Person"
type from the FOAF vocabulary. This sort of rule leads to very 
compact markup in most single-vocab use cases (even more compact
and readable than RDFa's CURIEs) and simple authoring.

A sophisticated parser *could* GET and check the RDF vocabulary 
for valid use of properties, but RDF does not have instance-level 
validation, so the transparent expansion of plain property names
does not conflict with the RDF spec(trum). An author can of 
course still use full URIs to mix in terms from other vocabs.


Benjamin Nowack

Received on Tuesday, 19 January 2010 17:17:53 UTC