Re: where to put json-ld context for LDP

Hi Gregg,



> On July 29, 2014 at 5:20 PM Gregg Kellogg <gregg@greggkellogg.net> wrote:
> 
>  On Jul 29, 2014, at 1:21 AM, "john.walker" < john.walker@semaku.com
> <mailto:john.walker@semaku.com> > wrote:
> 
> 
>      > >      Hi Gregg
> > 
> >       > > > On July 29, 2014 at 2:08 AM Gregg Kellogg <
> >       > > > gregg@greggkellogg.net <mailto:gregg@greggkellogg.net> > wrote:
> > > 
> > >       We could consider a boilerplate context, which would gather such
> > > common definitions together, then you could do something like the
> > > following:
> > > 
> > >       {
> > >         "@context": [
> > >           " http://www.w3.org/ns/rdfs",
> > >           {
> > >             "@vocab": " http://www.w3.org/ns/ldp#",
> > >             "ldp":  " http://www.w3.org/ns/ldp#",
> > >             ...
> > >           }
> > >         }
> > >       }
> > > 
> > >       And put all of the RDFS-related definitions in a single location.
> > > 
> > >      > > 
> >      I understood "duplicate context terms are overridden using a
> > most-recently-defined-wins mechanism".
> > 
> >  > Contexts are merged, not overridden.
> 

Sorry to be a pedant, but I copied the above text (added quotes to delineate)
from ยง6.7 of the JSON-LD spec [1].

If I understood correctly then it would be correct to combine both these
statements: Contexts are merged where any duplicate context terms are overridden
using a most-recently-defined-wins mechanism

I already had some interchange with Markus Lanthaler about how this would work
in another thread [2].

[1] http://www.w3.org/TR/json-ld/#advanced-context-usage
[2] http://lists.w3.org/Archives/Public/public-hydra/2014Jul/0171.html

> 
>      > > 
> >      So if I was using the above LDP example as an external context and the
> > referenced RDFS context was defined in a similar way.
> > 
> >      Imagine there were some terms with 'the same' name, say rdfs:comment
> > and ldp:comment. If I used the term "comment" in my JSON-LD document, I
> > assume this would be expanded to "http://www.w3.org/ns/ldp#comment" as this
> > is the most recently defined.
> > 
> >  > If you define @vocab, it can be used to expand something like 'comment'
> >  > to, say 'ldp:comment'. You could also define a term 'comment', as an
> >  > expanded term definition; the last one wins.
> 
>  I would use 'rdfs:comment' in the vocabulary definition, for this very
> reason.
> 
>      > > 
> >      Also if I wanted to use any RDFS term in my document, then i would HAVE
> > to prefix them with rdfs: otherwise they would be expanded again the @vocab
> > from LDP context.
> > 
> >  > Yes, in general, I would avoid using non-prefix terms in the vocabulary
> >  > definition, itself; average those for users of the LDP context.
> 
>      > > 
> >      Do I understand that correctly?
> > 
> >      Reminds me of XML namespaces...
> > 
> >  > IMO, prefixes are much simpler than namespaces. In JSON-LD, you can use
> >  > compact IRIs, terms, or even terms which look like compact IRIs.
> 
>  Gregg
> 
>      > > 
> >      Cheers
> > 
> >      John
> > 
> >  > 

 John

Received on Wednesday, 30 July 2014 19:24:42 UTC