W3C home > Mailing lists > Public > public-openannotation@w3.org > February 2013

Re: JSON-LD Context URI

From: Stian Soiland-Reyes <soiland-reyes@cs.manchester.ac.uk>
Date: Wed, 27 Feb 2013 10:56:16 +0000
Message-ID: <CAPRnXtm=buggYCspwA-wdLv5BYYJVMUgXzYAALetOHb=9gdCaA@mail.gmail.com>
To: Robert Sanderson <azaroth42@gmail.com>
Cc: public-openannotation <public-openannotation@w3.org>
It works!

I used

http://rdf-translator.appspot.com/ to parse http://www.w3.org/ns/oa.rdf

and then I pasted in our @context from the HTML spec and made:

 https://raw.github.com/stain/oa/master/oa.json

which seems to work.  I've not been able to test it properly with that
URL as @context as http://json-ld.org/playground/ don't seem to
resolve anything from the INTERNETS.


but if I paste the whole thing into the sandbox I get lots of OWL
nquads out, which compares equal to the triples of current TTL
ignoring for namespace prefixes. The only error is that it says

      "rdfs:isDefinedBy": {
        "@id": "oa"
      },

which resolves to http://json-ld.org/playground/oa - so I did a manual
search-replace for those.


The site could also do RDFa which I just pasted into the oa.html -
thus Ivan should now be happy. I had to do some manual search-replace
of " to &quot; here and there - the conversion tool is not perfect.


Obviously this is not a very reproduceable setup, but we can try to
script something. (There's a REST interface to the converter) --- and
we should also give some PROVenance of how this was made! ;-)


On Wed, Feb 27, 2013 at 10:11 AM, Stian Soiland-Reyes
<soiland-reyes@cs.manchester.ac.uk> wrote:
> That sounds like a good workaround! OWL ontologies in JSON-LD is a bit
> unusual; but I guess it would work.
>
> I'll have a look if we can do some kind of conversion (given an
> OWL/RDFS context); then we can just semi-concatenate in the @context.
> Maintaining the ontology in JSON-LD as the raw format might or might
> not work well.
>
> One issue is that JSON clients might not be good at content
> negotiations; so the official @context should probably include the
> .json extension (or equivalent) - I guess this is OK - just like we
> have http://www.w3.org/ns/oa.ttl and http://www.w3.org/ns/oa.rdf
> already.
>
>
>
> On Tue, Feb 26, 2013 at 10:42 PM, Robert Sanderson <azaroth42@gmail.com> wrote:
>> Dear all,
>>
>> A slight hiccup... the location that we specified in the most recent
>> version of the spec for the default JSON-LD context document isn't
>> actually available to use.  The W3C uses the /ns/ directory
>> exclusively for namespace documents, and the context document doesn't
>> count.  W3C doesn't have a /contexts/ yet (and may never have one), we
>> don't have a /TR/ space as a community group, so we'd be back to
>> putting it in openannotation.org.  This is undesirable for when we
>> move further into the standards process, of course.
>>
>> We could have a PURL redirect and swap it from one to the other, but
>> then we would lose the versioning information and just adds an
>> additional hop for processors to follow.
>>
>> We're discussing the issue on the JSON-LD list, please feel free to
>> join in if it's of interest to you, but one interesting proposal is as
>> below.
>> The original thread is here:
>> http://lists.w3.org/Archives/Public/public-linked-json/2013Feb/0152.html
>>
>> -----
>>> As the W3C (thank you Ivan) lets us
>>> publish our namespace documents, we figured that they'd also let us
>>> publish the JSON-LD context file, but they don't have anything in
>>> place for doing that yet.
>>
>> I didn't know that. If that's the case, why don't combine your namespace
>> document with your external context? The external context would end up being
>> slightly bigger, but that shouldn't really matter. That even has the
>> advantage that your namespace document is available as JSON-LD and there
>> won't be an additional round-trip to fetch its definitions.
>>
>> So, what I mean is this. You upload a JSON-LD document describing your
>> vocabulary. In that document you also include an @context element at the
>> top-level JSON object. You can even use that local context when describing
>> your vocab.
>>
>> {
>>   "@context": {
>>     ...
>>   },
>>   ... your vocabulary ...
>> }
>>
>> When retrieving an external context, a JSON-LD will ignore everything but
>> the context. Et voila, everything works as expected. You have your context
>> at a stable location and even reduced the number of necessary roundtrips if
>> you need, e.g., the labels for some properties.
>> -----
>>
>>
>> This seems extremely attractive to me, at least.  We wouldn't have to
>> maintain two separate files (ontology in JSON-LD and context would be
>> the same document) and processors would still do the right thing.
>>
>> Rob
>>
>
>
>
> --
> Stian Soiland-Reyes, myGrid team
> School of Computer Science
> The University of Manchester



-- 
Stian Soiland-Reyes, myGrid team
School of Computer Science
The University of Manchester
Received on Wednesday, 27 February 2013 10:57:04 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:22:03 UTC