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

Re: Mapping RDFa to microdata+json

From: Ivan Herman <ivan@w3.org>
Date: Fri, 25 Nov 2011 09:11:06 +0100
Cc: Jeni Tennison <jeni@jenitennison.com>, HTML Data Task Force WG <public-html-data-tf@w3.org>
Message-Id: <BD312DAD-5532-4EEA-9084-250D7F549866@w3.org>
To: Gregg Kellogg <gregg@kellogg-assoc.com>

On Nov 24, 2011, at 21:03 , Gregg Kellogg wrote:

> 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.

Well... I do use the triple on vocabulary usage, but that is part of the RDFa spec and I also use information that the generic RDF environment, in this case RDFLib, stores in the graph: indeed, my distiller stores the namespace declarations of the original RDFa source as Namespace objects in the RDFLib graph. For the rest, I try to analyze the graph itself.

> 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.

I would not be in favour of a direct mapping definition of RDFa to JSON-LD: it might push implementers in a corner, not being able to use the RDF library they are used to. A set of generic (though fairly obvious) guidelines may be in order.

What remains is the question on how JSON-LD could/should be mapped on the microdata-JSON. However, wouldn't that be a lossy mapping? Wouldn't we hit the issue of multiple typing, datatypes, etc, again?


> 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

Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf
Received on Friday, 25 November 2011 08:08:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:08:25 UTC