[whatwg] Annotating structured data that HTML has no semantics for

Philip Taylor excors+whatwg at gmail.com
Tue May 12 04:59:32 PDT 2009

On Tue, May 12, 2009 at 11:55 AM, Eduard Pascual <herenvardo at gmail.com> wrote:
> [...]
> (at least for now: many RDFa-aware agents vs. zero HTML5's
> microdata -aware agents)

HTML5 microdata parsers seem pretty trivial to write -
http://philip.html5.org/demos/microdata/demo.html is only about two
hundred lines to read all the data and to produce JSON and
N3-serialised RDF. It shouldn't take more than a few hours to produce
a similar library for other languages, including the time taken to
read the spec, so the implementation cost for generic parser libraries
doesn't seem like a significant problem.

The cost of integration with backend RDF-based systems seems more
significant - hopefully you could simply replace the frontend RDFa
parser with a microdata parser and generate the same RDF triples and
it would all work fine, but I don't know whether that's true in
practice (because maybe the microdata syntax is too restrictive to
represent the vocabularies people want to use, and so they'd have to
go to lots of extra effort to create a new vocabulary).

> [...] there are other cases where
> separate values might be needed: for example using a street address
> for the human-readable representation of a location and the exact
> geographic coordinates as the machine-readable (since not all
> micro-data parsers can rely on Google Maps's database to resolve
> street addresses, you know); or using a colored name (such as "lime
> green" displayed on lime green color) as the human-readable
> representation of a color, and the hexcode (like #00FF00) as the
> machine-readable representation.

You could replace
  <span itemprop="color">lime green</span>
  <span itemprop="location">1 High Street</span>
  <meta itemprop="color" content="#00FF00"><span>lime green</span>
  <meta itemprop="location.lat" content="56.78"><meta
itemprop="location.long" content="-12.34"><span>1 High Street</span>
to get the desired output. (Not particularly elegant syntax, though.)

Philip Taylor
excors at gmail.com

More information about the whatwg mailing list