- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Sat, 1 Jun 2013 12:55:29 +0200
- To: "'Linked JSON'" <public-linked-json@w3.org>
- Cc: "'W3C RDF WG'" <public-rdf-wg@w3.org>
On Saturday, June 01, 2013 5:28 AM, Gregg Kellogg wrote: > >> I think this needs more discussion. I would be a -1 on anything that > >> yields a non-round-tripable RDF/JSON-LD/RDF conversion. > > > > We have that already, useNativeTypes = false > > If that were the default, then I'd probably be okay with it, but the > default is true, which leads to data loss. Then the simplest thing to do is probably to set it to false. In that case however we should add some mechanism that allows to convert expanded value objects to be converted to native types. Compaction would be the best place to do so IMO. That being said, I still believe a data publisher is capable of deciding whether such a data loss is acceptable or not and set the flag accordingly when converting RDF to JSON-LD. > > Could you please describe how you would see this work. E.g., how > > would the > > following JSON-LD snippets be expanded/compacted/converted to RDF: > > > > "prop1": { "@value": 5 } > > Given that it's starting as a native value, it could either be > interpreted as "5"^^xsd:integer or "5.0E0"^^xsd:double. We currently > say the former, but I could see always transforming native JSON numbers > to xsd:double. Thanks Gregg. What I was looking for however was something looking more like a test case. Something like useNativeTypes = true, expressed as (1) in the following statement "prop1" --expand(1)--> { "@value": 5 } --compact(1)--> "{ "@value": 5 } and if useNativeTypes = false, expressed as (0) in the following statement "prop1" --expand(0)--> { "@value": "5" } --compact(0)--> "{ "@value": "5" } because I'm not sure I completely understood your proposal in all its details. So here are the JSON-LD snippets to be expanded/compacted/converted to RDF again: "prop1": { "@value": 5 } "prop2": { "@value": 5, "@type": "xsd:double" } "prop3": { "@value": "5.0", "@type": "xsd:double" } "prop4": { "@value": "5.0E0", "@type": "xsd:double" } "prop5": { "@value": "99999...1000s.of.9s", "@type": "xsd:integer" } and how the corresponding RDF literals would be transformed to JSON-LD: <> <prop3> "5"^^"xsd:double" . <> <prop3> "5.0"^^"xsd:double" . <> <prop4> "5.0E0"^^"xsd:double" . <> <prop5> "99999...1000s.of.9s"^^"xsd:integer" . Thanks, Markus -- Markus Lanthaler @markuslanthaler
Received on Saturday, 1 June 2013 10:56:00 UTC