- From: Gregg Kellogg <gregg@greggkellogg.net>
- Date: Tue, 29 Jul 2014 08:20:29 -0700
- To: "john.walker" <john.walker@semaku.com>
- Cc: Robert Sanderson <azaroth42@gmail.com>, Sandro Hawke <sandro@hawke.org>, JSON-LD CG <public-linked-json@w3.org>, Sandro Hawke <sandro@w3.org>
- Message-Id: <3C048106-EB69-4503-93B1-18082A51F0D1@greggkellogg.net>
On Jul 29, 2014, at 1:21 AM, "john.walker" <john.walker@semaku.com> wrote:
>
> Hi Gregg
>> On July 29, 2014 at 2:08 AM Gregg Kellogg <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.
> 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
Received on Tuesday, 29 July 2014 15:21:14 UTC