Re: Mapping RDFa to microdata+json

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 UTC