- From: Dave Longley <dlongley@digitalbazaar.com>
- Date: Mon, 03 Jun 2013 12:51:33 -0400
- To: public-linked-json@w3.org
On 06/03/2013 07:35 AM, Markus Lanthaler wrote: > On Monday, June 03, 2013 12:15 AM, Gregg Kellogg wrote: >> On Jun 2, 2013, at 1:46 PM, Markus Lanthaler wrote: >>> If a consumer really doesn't like the literal values, it can, e.g., >>> round-trip the data through the RDF conversion algorithms to convert >>> them to native types. Processors might also offer helper methods to >>> do this without having to go through RDF - I plan to add one to >>> mine. This also has the advantage that the user can select what to >>> transform (e.g., http://schema.org/Number). >> That's a pretty good idea, and I could support that. > Asking you and Sandro directly: Would it address your concerns if we would > change the default value of useNativeTypes to false and add a statement > saying that consumers can convert literals to native types by round-tripping > through RDF? > > Would you support changing the conversion to include all XSD numeric types > (not sure about xsd:decimal) if useNativeTypes = true. > > Would you support changing the conversion of JSON numbers to always produce > xsd:doubles? This question was for Gregg and Sandro, but I don't think that I would support *always* converting JSON numbers to xsd:doubles. I'd like this use case to be supported: Read some data from RDFa that has a datatype of xsd:integer. Convert the data to JSON-LD w/native number conversion on. Work with the data, possibly modifying the number. Convert the data to back to RDF (N-Quads) where the value (object) has an xsd:integer datatype and it looks like an integer (not a double). This use case is currently supported by the spec. > > We could also recommend (non-normatively) that JSON-LD processors implement > helper methods to do this without going through RDF, i.e., allowing it in a > manner which preserves the document's structure. > > > -- > Markus Lanthaler > @markuslanthaler > > -- Dave Longley CTO Digital Bazaar, Inc.
Received on Monday, 3 June 2013 16:52:00 UTC