Re: Distinguishing a context document from an instance document

On 10/01/2011 05:51 PM, Ivan Herman wrote:
> We should be careful of recursion issues, though. If context document
> may refer to other context documents, that can play some nasty
> tricks.
>
> We may declare that when a context document is imported, json-ld
> processors to do not follow further context imports, ie, it stops at
> one level.

Very good point, Ivan.

If we adopt the suggestion that a "JSON-LD Context Document" is just a 
regular JSON-LD document, we could prevent recursion issues by stating 
that any context that is not embedded in the "JSON-LD Context Document" 
file MUST NOT be processed. So, for example, processing this "JSON-LD 
Context Document":

{
    "@context":
    {
       "foo": "http://example.com/foo#"
    }
}

... would load "foo" into the set of known prefixes. However, processing 
this "JSON-LD Context Document":

{
    "@context":
    [
       "http://example.com/bar.jsonld",
       {"foo": "http://example.com/foo#"}
    }
}

.. would load "foo" into the set of known prefixes, but would not load 
http://example.com/bar.jsonld.

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
Founder/CEO - Digital Bazaar, Inc.
blog: Standardizing Payment Links - Why Online Tipping has Failed
http://manu.sporny.org/2011/payment-links/

Received on Sunday, 2 October 2011 20:59:32 UTC