W3C home > Mailing lists > Public > public-rdf-wg@w3.org > July 2013

Re: Updated JSON-LD spec to more closely align w/ RDF data model

From: Peter F. Patel-Schneider <pfpschneider@gmail.com>
Date: Wed, 10 Jul 2013 07:18:24 -0700
Message-ID: <51DD6D30.8090808@gmail.com>
To: Markus Lanthaler <markus.lanthaler@gmx.net>
CC: 'RDF WG' <public-rdf-wg@w3.org>
In a certain strong sense I don't care about the actual solution, just that it 
somehow matches JSON (which appears to be rather difficult as no one seems to 
know just what JSON numbers mean, so I guess that this devolves to matching 
JSON implementations), that meets the "burst of laughter" test (which means 
that no one bursts out laughing when the solution is described to them), and 
that it covers all JSON numbers (up to a certain magnitude and/or precision, 
perhaps).

The first bit is why I was asking about implementations that support this 
particular way of interpreting JSON numbers.

peter



On 07/10/2013 06:49 AM, Markus Lanthaler wrote:
> On Wednesday, July 10, 2013 2:37 AM, Peter F. Patel-Schneider wrote:
>> I've been looking through the IETF JSON mailing list, and haven't been finding
>> anything about mixed JSON numbers (i.e., some JSON numbers are integers
>> and some are floats).
>>
>> I would appreciate pointers that support this interpretation of what
>> JSON numbers mean.
> This is one of the issues that consumed most time. We concluded that the vast majority of applications don't care about some minor issues when round-tripping data between JSON-LD and RDF. On the other hand, it significantly simplifies developer's lives if we map things like 1, 2, 3 to xsd:integers instead of converting them to xsd:doubles.
>
> It also aligns JSON-LD closer to Turtle, which does the same but doesn't suffer under the same problems as parsers are specifically built for this purpose whereas we built on top of existing JSON parsers. How concrete applications handle arbitrarily big integers in a Turtle document is also unspecified for that matter. Sure, you can always represent those things as strings but you can't do anything useful with it then. Consequently, some applications might reject too large integers. Same situation in JSON IMO.
>
> I think you would prefer to interpret all JSON numbers as xsd:doubles, is that correct? This was already proposed by Pierre-Antoine some time ago but didn't have enough support to result in a spec change. I could live with that but wouldn't be too happy about it because it would mean that a JSON-LD document like
>
>    {
>      "@id": "",
>      "ex:prop": 1
>    }
>
> wouldn't result in the following Turtle document
>
>    <> ex:prop 1
>
> but
>
>    <> ex:prop 1.0E0
>
> I think most people would agree that the mapping we currently have aligns better in that regard.
>
>
>
> --
> Markus Lanthaler
> @markuslanthaler
>
>
Received on Wednesday, 10 July 2013 14:19:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:30 UTC