Re: Type coercion to decimals?

good morning;

> On 2019-01-12, at 21:19:46, Gregg Kellogg <gregg@greggkellogg.net> wrote:
> 
>> On Jan 11, 2019, at 3:41 AM, Dave Reynolds <dave.e.reynolds@gmail.com> wrote:
>> 
>> Hi,
>> 
>> I have json data with floating point numbers which I'm trying to interpret as jsonld where the jsonld context calls for the relevant properties to be interpreted as xsd:decimal.
>> ...
>> 
>> Using the json-ld playground, and using Jena (which in turn depends on jsonld-java), this generates the purported n-quads:
>> 
>> <http://example.com/resource/1> <http://www.w3.org/2003/01/geo/wgs84_pos#lat> "5.1449604E1"^^<http://www.w3.org/2001/XMLSchema#decimal> <http://example.com/graph/1> .
>> 
>> <http://example.com/resource/1> <http://www.w3.org/2003/01/geo/wgs84_pos#long> "-2.601738E0"^^<http://www.w3.org/2001/XMLSchema#decimal> <http://example.com/graph/1> .
>> ...
> 
> The issue stems from the JSON data model which has a single numeric type. The JSON-LD spec provides for native numbers to either be interpreted as integer or double, but not decimal, as you see. ...


how does this restriction explain why it is not a bug for a processor to accept a lexical form, transform it gratuitously into one which does not correspond to the type and then emit a term with invalid syntax.

best regards, from berlin,

Received on Monday, 14 January 2019 15:28:20 UTC