Re: @structure

On 12/05/2011 12:17 AM, Markus Lanthaler wrote:
>
> Hmmm.. let me try. Assume you have a context vcard.jsonld which defines
> (among others):
>
>    { "telephone": { "@iri": "xxx", "datatype": "xsd:string", "@container":
> "@set" } }
>
> and another one like employee.jsonld
>
>    { "telephone": { "@iri": "xxx", "datatype": "xsd:string" }
>
>
> If I now use those two in a JSON-LD document
>
>    {
>      "@context": [ "vcard.jsonld", "employee.jsonld" ],
>      "name": "Markus Lanthaler",
>      "country": "Italy",
>      "telephone": "123-456790",
>      "project": "JSON-LD"
>    }
>
> Telephone would always be an array even though I might only wanna have a
> single value for every employee. So I would need something like
> "@container": "@none" to override the container in employee.jsonld
>
> That's what I meant. I hope it's cleare now.

Yes, that's clearer. We could define the @context merge rules (in fact, 
I was thinking that they would already work this way) to replace the 
entire context entry for a term when you merge contexts. I think that 
would better model expected behavior anyway. So in your example above, 
"employee.jsonld" would overwrite the definition for "telephone" 
entirely, resulting in no @set being used, without any need for 
"@container": "@none".

-- 
Dave Longley
CTO
Digital Bazaar, Inc.

Received on Monday, 5 December 2011 18:09:33 UTC