W3C home > Mailing lists > Public > public-linked-json@w3.org > January 2012

Re: clarification/precision question on the JSON-LS syntax document

From: Ivan Herman <ivan@w3.org>
Date: Thu, 12 Jan 2012 13:40:28 +0100
Cc: "'Linked JSON'" <public-linked-json@w3.org>
Message-Id: <3D89B710-739C-479B-B9B9-31BF8AEDB628@w3.org>
To: "Markus Lanthaler" <markus.lanthaler@gmx.net>
Markus,

after we have established that is it correct... yes, it looks weird. And if it looks weird than it may be misleading, and may lead to author errors. If so, my instinctive reaction would be to disallow it. But, of course, this comes out of a necessity, namely that we have a graph and not a tree, ie, we need several roots. And the syntactic restrictions of JSON force us to do something. Ie, we have to have something.

I understand (and agree with) the requirement to reduce the number of keywords in JSON-LD. But maybe this is the case where it is worth making things explicit and not to try to conflate several different meanings into one keyword. What I would propose is to have a separate keyword, say, @root, that can be used to denote what we do here with @id. I would actually even introduce the extra restriction that this keyword can appear only at the top level of a JSON-LD file, although if we think of cut and paste from one JSON-LD file to the other, we may not want to have this. In parallel, I would disallow usage of @id in the examples below.

My 2 cents...

Ivan




On Jan 12, 2012, at 13:29 , Markus Lanthaler wrote:

> Hi Ivan,
> 
> Yes this is, at least as of the current spec, correct. But admittedly it
> looks weird. The first example is straightforward, the second one is a bit
> trickier. I interpret it as follows:
> 
> The first "@id" after "something" specifies that an IRI follows but instead
> of providing directly an array of IRIs an array of objects are provided.
> Since all of these objects specify the subject, JSON-LD automatically
> creates a link to those nodes, i.e., the IRI specified with "@id".
> 
> Thanks to your example I think I found a bug in the playground and a case
> which is not properly documented in the spec. I create a separate mail for
> that.
> 
> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 
> 
> 
>> -----Original Message-----
>> From: Ivan Herman [mailto:ivan@w3.org]
>> Sent: Tuesday, January 10, 2012 10:15 PM
>> To: Linked JSON
>> Subject: clarification/precision question on the JSON-LS syntax
>> document
>> 
>> Hi guys,
>> 
>> reading the Dec 27 version of the spec. My reading of it is that the
>> following two JSON-LD fragments are semantically identical (from where
>> I stand, for example, they would generate the same RDF triples):
>> 
>> {
>>   "something" : [
>>                    { "@id" : "http://www.ex1.org", "a" : "b" },
>>                    { "@id" : "http://www.ex2.org", "c" : "d" }
>>                 ],
>>    ...
>> }
>> 
>> and
>> 
>> {
>>   "something" : { @id :
>>                   [
>>                      { "@id" : "http://www.ex1.org", "a" : "b" },
>>                      { "@id" : "http://www.ex2.org", "c" : "d" }
>>                   ]
>>                 },
>>    ...
>> }
>> 
>> And the generated turtle in both cases is
>> 
>> [
>>   <uri-for-something> <http://www.ex1.org>, <http://www.ex2.org> ;
>>   ...
>> ]
>> 
>> <http://www.ex1.org> "uri-for-a" "b" .
>> <http://www.ex2.org> "uri-for-c" "d" .
>> 
>> First of all, is this correct? I deduce it from the fact that you use
>> the "@id" : [...] idiom in the document, in one of the examples, to
>> denote a number of top level, subjects.
>> 
>> However... how and where is that formally defined? Did I miss it, in
>> which case my apologies? Or if it is not there, shouldn't it?
>> 
>> Cheers
>> 
>> Ivan
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> ----
>> Ivan Herman, W3C Semantic Web Activity Lead
>> Home: http://www.w3.org/People/Ivan/
>> mobile: +31-641044153
>> FOAF: http://www.ivan-herman.net/foaf.rdf
>> 
>> 
>> 
>> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf







Received on Thursday, 12 January 2012 12:44:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:36 GMT