Re: Reference @context via URL with something with type @id

In general, relying on @vocab is dangerous if you're using contexts from
multiple sources. You should only rely on it if you know it's not going to
be overridden. As a best practice, all terms should have an explicit @id.
On Jun 11, 2015 7:36 AM, "David I. Lehn" <dil@lehn.org> wrote:

> 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 15:17:59 UTC