Re: [Serialization] Integration and @id/@type

Rob,

first of all, thanks for reaching out to the social web wg. It is good to do that.

For the essence: I wonder whether this is not a more general problem that I am not sure how we would avoid. The good and bad thing of the @context mechanism in JSON-LD is that it makes namespaces disappear, mainly because (alas! I would say) the concept of namespaces have become anathema in many circles. The practical consequence is that if there is a term in AS that is identical to OA (in the sense of the 'local' name!), and those are both mapped via the respective contexts to the full URI of the terms, we would have a clash when reading those files through some JSON-LD/SW aware tool. Isn't it the same issue, albeit more general, than what you refer to?

And, honestly, I am not sure what to do about it:-(

Ivan


> On 02 Sep 2015, at 21:33 , Robert Sanderson <azaroth42@gmail.com> wrote:
> 
> 
> A concern I have with the current proposed change to the JSON-LD context is the mapping of @id and @type to id and type, respectively.
> 
> Given just a single annotation, this poses no significant problem.  When compacting data according to the JSON-LD algorithm, it respects the id and type definitions as expected.
> 
> However, when we come to integrate annotations within other JSON-LD systems, we run into potential issues.  Notably, if we want to reuse the Collections class [1] from ActivityStreams in the Social Web WG work, and both contexts are provided, it will generate unexpected results.  The same would apply to any other use of our context in systems that did not also make the mapping from @id to id.... or worse used id or type for something other than the URI of the resource.
> 
> [1] http://www.w3.org/TR/activitystreams-core/#collections
> 
> For example, we have a requirement for collections of Annotations.  In order to use AS Collections, we would add our context document along with theirs and expect to produce something like:
> 
> {
>   "@context": ["http://www.w3.org/ns/activitystreams", "http://www.w3.org/ns/oa.jsonld"],
>   "@id": "http://example.org/collection1",
>   "@type": "OrderedCollection",
>   "totalItems": 1000,
>   "orderedItems": [
>     {
>       "id": "http://example.org/anno1",
>       "type": "Annotation",
>       "body": "Some comment",
>       "target": "http://www.example.com/index.html"
>     }, ...
>   ]
> }
> 
> But /actually/ our context would override the activitystreams context, and the serialization would use "id" and "type" at the top level as well, where JSON based AS consumers would not expect those keys.
> 
> The context can be added at the Annotation level, however there is a known issue that when compacting / expanding, the context will disappear. See this thread:
>     https://lists.w3.org/Archives/Public/public-linked-json/2014Jul/0011.html
> 
> My proposal is to discuss this issue with the Social Web WG and the Linked JSON Community Group, and see what the community at large thinks.  And that we should go with the broader consensus of what is best practice, rather than potentially making a cosmetic change that has the unintended side effect of limiting integration.
> 
> I'm happy to start that conversation if you all think it would be valuable?
> 
> Rob
> 
> --
> Rob Sanderson
> Information Standards Advocate
> Digital Library Systems and Services
> Stanford, CA 94305


----
Ivan Herman, W3C
Digital Publishing Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
ORCID ID: http://orcid.org/0000-0003-0782-2704

Received on Thursday, 3 September 2015 04:59:48 UTC