More direct conversion from microdata to RDFa?

Converting microdata to RDFa could be made easier by bypassing the vocab
attribute. Microdata incorporates the concept of vocabulary in the data item
type via @itemtype. Coming from a microdata perspective, the concept of
vocabulary URI is an extra element (different from the item type) which
could be avoided by the following proposal. Since there is a mechanism being
designed to infer a vocabulary namespace from the microdata @itemtype, RDFa
could use a similar mechanism, and use the first token of @typeof to
construct the namespace that we currently put in @vocab.

Consider the following microdata snippet:

<div itemscope itemtype="http://schema.org/Person>
   My name is <span itemprop="name">John Doe</span>.
</div>

Currently to convert to RDFa, you need to split @itemtype into two
attributes: @vocab and @typeof. What I'm suggesting is a direct mapping from
@itemtype to @typeof without the need of @vocab, where @typeof would include
the full URI:

<div typeof="http://schema.org/Person>
   My name is <span property="name">John Doe</span>.
</div>

This would ease the RDFa to microdata and vice versa from a human
standpoint.

Note that I'm not suggesting to drop @vocab, but simply to make it optional,
which would make the common microdata snippets a no brainer to convert to
RDFa by a simple attributes string replace. In the processing model
sequence, step 3 would have to include an extra step for the case where
@vocab is missing, and use the same mechanism as Gregg is defining for
microdata to RDF conversion. Here is a suggestion:

[[[
3. Next the current element is examined for any change to the default
vocabulary via @vocab. If @vocab is present and contains a value, its value
updates the local default vocabulary. If the value is empty, then the local
default vocabulary must be reset to the Host Language defined default. If
@vocab is not present but the first token of @typeof is an absolute
URI, construct the local default vocabulary by removing everything following
the last SOLIDUS U+002F ("/") or NUMBER SIGN U+0023 ("#") in the first token
of @typeof.
]]]


Thoughts?

Steph.

Received on Wednesday, 12 October 2011 14:57:28 UTC