W3C home > Mailing lists > Public > public-rdf-comments@w3.org > September 2012

Re: XSD datatypes in JSON-LD (was: Re: Use of XSD namespace in RDF recommendations)

From: Richard Cyganiak <richard@cyganiak.de>
Date: Wed, 5 Sep 2012 10:50:24 +0100
Cc: "'Gregg Kellogg'" <gregg@greggkellogg.net>, "'public-rdf-comments Comments'" <public-rdf-comments@w3.org>
Message-Id: <D1587E1A-F967-4EFB-90A5-9FB9430ABED8@cyganiak.de>
To: Markus Lanthaler <markus.lanthaler@gmx.net>

Thanks for the explanations. All sounds good to me except...

On 5 Sep 2012, at 10:38, Markus Lanthaler wrote:
>> Why would one want to set useNativeTypes to false?
> E.g. to not lose the information that 5 was intended to be a double when
> converting "5"^^xsd:double to JSON-LD. Otherwise "5" would be converted to a
> native JSON number and in the next toRDF() call it would become
> "5"^^xsd:integer as there's no fraction.

Why not convert "5"^^xsd:double to a JSON-native 5.0? This would allow round-tripping, and no useNativeTypes flag is necessary.

Received on Wednesday, 5 September 2012 09:51:03 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:54 UTC