W3C home > Mailing lists > Public > public-linked-json@w3.org > November 2014

Re: Questions about value expansion

From: Sean Johnson <belucid@acm.org>
Date: Wed, 12 Nov 2014 18:51:32 -0500
To: public-linked-json@w3.org
Message-ID: <142178D5-2AEF-47AA-8011-E1EFB74DAEE6@acm.org>
> But -- I've got one quick response inline below:

>> Why does a native date, time and dateTime get expanded to include an 
>> @type, but a native integer does not? That seems inconsistent. And 
>> why does the @type get added in this case when the spec doesn't 
>> mention adding @type unless the active context includes a type 
>> mapping?
>>
>
> Since JSON-LD is a subset of JSON, the JSON-LD API spec only covers 
> native support for built-in JSON types. There is such a thing as a 
> JSON number and a JSON boolean -- so native conversion for integers, 
> doubles, and booleans are covered in the spec. However, JSON doesn't 
> natively support dates or times, so that's why @type must be present 
> there. It looks like the Ruby library has a proprietary feature to 
> auto-convert native Ruby dates/times to literals using an assumed 
> appropriate XSD @type.

Perfect! Just wanted some confirmation that what I was seeing there was 
a proprietary, above and beyond the call of duty, feature, and not a 
section of the spec I'd missed or misunderstood. So.. thanks for the 
reply Dave. It's helpful.

Cheers,
Sean
Received on Wednesday, 12 November 2014 23:52:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:42 UTC