Re: where to put json-ld context for LDP

On Jul 28, 2014, at 11:23 AM, Robert Sanderson <azaroth42@gmail.com> wrote:

> 
> Hi Sandro,
> 
> Any thoughts on where they should go?
> If the context is part of a JSON-LD encoding of the vocabulary, then retrieving the vocabulary from it's published location with content-negotiation for JSON-LD will also retrieve the context.
> 
> Hmmm.   I would have thought the context use in a vocabulary description document would be a context that was good for describing vocabularies.  But now you're saying it should actually be one that's good for describing whatever the vocabulary describes.  How do we make this work?
> 
> You would just need to include owl, rdf, rdfs, skos (as appropriate) in the context along with whatever LDP needs.

Yes, you can do this with basic prefix mappings (don't forget xsd), but it is also useful to include some things that aren't specifically part of the vocabulary being defined as well. I include the following in contexts I generate:

{
  "@context": {
    "@vocab": "-- uri of this vocabulary --",
    "owl": "...",
    "rdf": "....",
    "rdfs": "....",
    "xsd": "....",
    "rdfs:domain": {"@type": "@id", "@container": "@list"},
    "rdfs:range": {"@type": "@id", "@container": "@list"},
    "rdfs:subClassOf": {"@type": "@id", "@container": "@list"},
    "rdfs:subPropertyOf": {"@type": "@id", "@container": "@list"},
    ...
  }
}

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.

>  Do we have the context include stuff not needed by LDP?
> 
> Yes.
>  
>  Do we have the LDP namespace document be written so that it doesn't actually make any use of the context provided?
> 
> You could do this -- just include the full URIs for all of the predicates needed, and then no need to include even prefix mapping in the context. I'm not sure that there's any benefit to doing this though.
>  
>   Do we use multiple contexts?
> 
> No (see previous discussion about multiple contexts and framing / compaction)

+1 What Rob said.

Gregg

> Rob
> 
> -- 
> Rob Sanderson
> Technology Collaboration Facilitator
> Digital Library Systems and Services
> Stanford, CA 94305

Received on Tuesday, 29 July 2014 00:08:41 UTC