Re: JSON-LD Context

Tim,

you may indeed be right. As I said, my JSON-LD is fairly rusty… However, isn't it true that for this to work, we should also have a

"@vocab" : "http://www.w3.org/ns/oa#:,

set in the context file? That is what sets the "active context's vocabulary mapping", afaik.

Also, we should probably be consistent; the same change should be applied for all other properties where the value is one of several possible URI id-s.

Ivan


> On 08 Aug 2015, at 19:52 , Timothy Cole <t-cole3@illinois.edu> wrote:
> 
> Ivan-
> 
> I'm going off of the following paragraph from Section 6.5 of the JSON-LD 1.0 Recommendation [http://www.w3.org/TR/json-ld/#type-coercion], which says:
> 
> ***Type coercion is specified within an expanded term definition using the @type key. The value of this key expands to an IRI. Alternatively, the keywords @id or @vocab may be used as value to indicate that within the body of a JSON-LD document, a string value of a term coerced to @id or @vocab is to be interpreted as an IRI. The difference between @id and @vocab is how values are expanded to absolute IRIs. @vocab first tries to expand the value by interpreting it as term. If no matching term is found in the active context, it tries to expand it as compact IRI or absolute IRI if there's a colon in the value; otherwise, it will expand the value using the active context's vocabulary mapping, if present, or by interpreting it as relative IRI. Values coerced to @id in contrast are expanded as compact IRI or absolute IRI if a colon is present; otherwise, they are interpreted as relative IRI.***
> 
> Assuming that the Range of oa:motivatedBy is meant to include terms defined in our context document, e.g.:
> 
>    bookmarking: "oa:bookmarking"
> 
> then we should use @vocab.  This allows the correct mapping of the following line in the json-ld instance:
> 
>    "motivation": "bookmarking"
> 
> If we leave type as @id in our context document, then we are limited to using only this form in the json-ld instance:
> 
>    "motivation": "oa:bookmarking"
> 
> Note, the latter form does work correctly even if we use @vocab -- which also means that other communities can still extend our oa:Motivation ontology in their own namespaces, but the former form without the namespace prefix on the term does not.
> 
> Is there a downside to using @vocab that I am not recognizing?
> 
> Thanks,
> 
> Tim Cole
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Ivan Herman [mailto:ivan@w3.org]
> Sent: Friday, August 07, 2015 11:09 PM
> To: Tim Cole <t-cole3@illinois.edu>
> Cc: Robert Sanderson <azaroth42@gmail.com>; W3C Public Annotation List <public-annotation@w3.org>
> Subject: Re: JSON-LD Context
> 
> Tim,
> 
> I am just the messenger… and my JSON-LD is a bit rusty. But my first reaction is that what is there, ie, the first line is correct. What it says (I think) is that the value (range) of 'motivation' is a URI reference in RDF jargon, and that the property itself is oa:motivatedBy…
> 
> Ivan
> 
>> On 07 Aug 2015, at 23:39 , Timothy Cole <t-cole3@illinois.edu> wrote:
>> 
>> Rob, Ivan-
>> 
>> Shouldn't this line in the context document:
>>   "motivation":   {"@type":"@id", "@id" : "oa:motivatedBy"},
>> 
>> Be this instead:
>>   "motivation":   {"@type":"@vocab", "@id" : "oa:motivatedBy"},
>> 
>> This seems to be needed in order for motivation values without the oa: prefix to be recognized as in the oa ontology.
>> 
>> Regardless, agree with Randall that it is very helpful to have this up.
>> 
>> Thanks,
>> 
>> -Tim Cole
>> 
>> 
>> 
>> From: Randall Leeds [mailto:randall@bleeds.info]
>> Sent: Thursday, August 06, 2015 6:42 PM
>> To: Ivan Herman <ivan@w3.org>; Robert Sanderson <azaroth42@gmail.com>
>> Cc: W3C Public Annotation List <public-annotation@w3.org>
>> Subject: Re: JSON-LD Context
>> 
>> That looks wonderful.
>> 
>> On Wed, Aug 5, 2015 at 10:12 PM Ivan Herman <ivan@w3.org> wrote:
>>> There were some minor syntax problems that I took care of (and pushed
>>> on the repo); the files are now also available as
>>> 
>>> http://www.w3.org/ns/anno.jsonld
>>> 
>>> Ivan
>>> 
>>>> On 06 Aug 2015, at 24:54 , Robert Sanderson <azaroth42@gmail.com> wrote:
>>>> 
>>>> 
>>>> A draft context, that we can put up on w3.org with Ivan's help:
>>>> 
>>>>    http://w3c.github.io/web-annotation/jsonld/anno.jsonld
>>>> 
>>>> Please cast an eye over it and see if there's any bugs :)
>>>> 
>>>> As we haven't decided yet on the property names for the relationships, I've left them alone. I did add the classes, with some hopefully friendly names, per issues.  Also xsd, xsi, iana, and ldp from Protocol and even further issues.
>>>> 
>>>> Rob
>>>> 
>>>> 
>>>> --
>>>> Rob Sanderson
>>>> Information Standards Advocate
>>>> Digital Library Systems and Services Stanford, CA 94305
>>> 
>>> 
>>> ----
>>> Ivan Herman, W3C
>>> Digital Publishing Activity Lead
>>> Home: http://www.w3.org/People/Ivan/
>>> mobile: +31-641044153
>>> ORCID ID: http://orcid.org/0000-0003-0782-2704
>>> 
> 
> 
> ----
> Ivan Herman, W3C
> Digital Publishing Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> ORCID ID: http://orcid.org/0000-0003-0782-2704
> 
> 
> 
> 
> 
> 


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

Received on Sunday, 9 August 2015 08:33:54 UTC