W3C home > Mailing lists > Public > public-linked-json@w3.org > October 2011

Re: Distinguishing a context document from an instance document

From: Ivan Herman <ivan@w3.org>
Date: Mon, 3 Oct 2011 14:26:16 +0200
Cc: <public-linked-json@w3.org>
Message-Id: <91CCC39A-E894-405B-B21F-480DDBCEA343@w3.org>
To: Markus Lanthaler <markus.lanthaler@gmx.net>

On Oct 3, 2011, at 08:16 , Markus Lanthaler wrote:

>> Not at all, we still support external JSON-LD Context Documents. We
>> just
>> don't support external context documents inside of JSON-LD Context
>> Documents to prevent recursion issues.
> 
> Oh OK.. now I got it.
> 
> 
>> Just to clarify, this would be valid in a normal JSON-LD document, and
>> would load bar.jsonld as well as creating the "foo" term mapping, but
>> if the document were loaded because it was the target of a @context in
>> a JSON-LD document, the processing rules would indicate that bar.jsonld
>> not be loaded. In fact, this document should be considered to be
>> invalid.
> 
> Hmm... I don't think that's a good idea. At least not if we don't have
> different MIME types for contexts and instance documents. Since that depends
> on how you invoke the API I would move that decision to the API. So, e.g.,
> add a parameter like bool loadImportedContexts.
> 
> Do you really think we get into troubles if we load contexts inside
> contexts? Was this ever a problem in CSS for instance? Of course an API has
> to apply some reasonable limit but that's normal. We could also have a
> best-practice in the spec. But I wouldn't like the idea of documents that
> are valid JSON-LD documents, but invalid context documents if we don't
> differentiate them accordingly.
> 

This is a good point and I do not think the term 'invalid' is in order here. Those imported json ld documents are perfectly valid documents, but when looking at them for @context, some part of the document will be disregarded.

Isn't that already the case, b.t.w.? Forgetting the recursion danger issue for a moment, if I have document <a>

{
  "@context" : { "foo" : "http://a.b.c" },
  "someprop" {
     "@context" :
         { "foo" : "http://q.r.s" }
  },
  "bar" : "http://x.y.z"
}

and then, in <b>

{
  "@context" : <a>,
  "foo": "something"
  "bar": "something else"
}

I would expect to get

<> <http://a.b.c> "something"; <bar> "something else" .

ie, the nested @context and the property-value pair outside @context to be disregarded.

That being said, your reference to CSS is compelling, I am not sure what the experience is there.

Ivan



> 
> 
> --
> Markus Lanthaler
> @markuslanthaler
> 
> 
> 
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
PGP Key: http://www.ivan-herman.net/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf
Received on Monday, 3 October 2011 12:25:25 GMT

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