- From: David I. Lehn <dil@lehn.org>
- Date: Thu, 11 Jun 2015 10:35:06 -0400
- To: David Janes <davidjanes@davidjanes.com>
- Cc: Linked JSON <public-linked-json@w3.org>
On Wed, Jun 10, 2015 at 3:13 PM, David Janes <davidjanes@davidjanes.com> wrote: > Bonus curiosity! In my model if I don't have the "@id": "...." I get an > error that terms in @context must define an @id. Cool. > > But why does schema.org's @context not get this error message?? All their > terms look like > > "artMedium": { "@type": "@id" }, > It's because they define the @vocab in their context doc: "@vocab": "http://schema.org/", When the terms don't define an @id and are not CURIEs or URLs it will fall back to expanding them with that @vocab. You could do the same in your context to simplify your rules but it can lead to confusion about what the active vocab is. The last one defined will win. Lots of examples that use schema.org context likely assume that the active vocab is for schema.org. So things like {"@type":"Person"} will work. But if you have multiple contexts and the last one sets a different vocab then those examples would break and use your vocab. Explaining all this is clearly a bit involved! I'm not sure what best practice is here. Anyone else know? -dave
Received on Thursday, 11 June 2015 14:35:53 UTC