W3C home > Mailing lists > Public > public-html-data-tf@w3.org > November 2011

Re: Mapping RDFa to microdata+json

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Thu, 24 Nov 2011 15:03:10 -0500
To: Jeni Tennison <jeni@jenitennison.com>
CC: HTML Data Task Force WG <public-html-data-tf@w3.org>
Message-ID: <02321BF5-9330-4CC0-A4A9-7C66512A827D@greggkellogg.net>
On Nov 24, 2011, at 11:39 AM, Jeni Tennison wrote:

> Hi,
> 
> The one piece of work that we have made absolutely no progress on is the mapping of RDFa to microdata+json [1].
> 
> I know that there are arguments against creating such a mapping at all, because it would be a lossy mapping and there is other work going on (JSON-LD [2]) that would provide a mapping to JSON which is both natural to use and doesn't lose information.
> 
> On the other hand, both microdata and microformats-2 can be used to create microdata+json and if there are tools for working with that format, and user familiarity with that format, it would seem sensible to be able to create it from RDFa as well. 
> 
> What do people here think? In our last few weeks, should we put some effort into defining a mapping from RDFa to microdata+json?

As JSON-LD is a pretty good match for RDFa, and there are at least two different implementations (my own and Ivan's new implementation), it would seem that some notes on generating JSON-LD from RDFa would be useful. From there, a JSON-LD to microdata+json mapping should be trivial.

For a generic RDFa to RDF to JSON-LD transformation, some information, such as prefix definitions, vocabulary use and element chaining, could be lost in such a transformation, but that may not be very important. Ivan's method uses information from the processor graph to re-construct much of this, but I think he may be using informational triples beyond the requirements of the spec. My own serialization makes a best effort using techniques similar to constructing a Turtle serialization, and can take advantage of prefixes encountered during parsing, or fallback on a set of "standard" prefix definitions.

Note that a generic RDFa to RDF transformation does not typically include the processor graph triples. We could specify a more direct transformation from RDFa to JSON-LD, but I'm not sure how many implementations we'd see, given that going through RDF is much more generic.

Gregg

> Jeni
> 
> [1] http://dev.w3.org/html5/md/Overview.html#application-microdata-json
> [2] http://json-ld.org/
> -- 
> Jeni Tennison
> http://www.jenitennison.com
> 
> 
Received on Thursday, 24 November 2011 20:04:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 24 November 2011 20:04:06 GMT