W3C home > Mailing lists > Public > public-rdf-comments@w3.org > May 2012

Re: JSON-LD Syntax request for FPWD via RDF WG

From: Richard Cyganiak <richard.cyganiak@deri.org>
Date: Wed, 23 May 2012 00:07:46 +0100
Cc: Markus Lanthaler <markus.lanthaler@gmx.net>, "public-rdf-comments@w3.org" <public-rdf-comments@w3.org>
Message-Id: <9BEF027F-D894-4336-9DFF-3B5E94AA654C@deri.org>
To: Gregg Kellogg <gregg@greggkellogg.net>
On 22 May 2012, at 20:00, Gregg Kellogg wrote:
>> There is a line about producing a JSON syntax for RDF in the RDF-WG charter. The JSON-LD syntax spec, on its own, is not sufficient to be called a JSON syntax for RDF. I'm sure you see the problem with saying that the missing piece (to- and from-RDF algorithms) will be delivered by some other WG at some future date.
> 
> If moving the algorithm here helps, then we should probably do that. In this case, it should probably be divorced from the WebIDL constraints of the API document, and can directly represent RDF Concepts.

+1

> The algorithmic issues for representing empty names graphs are pretty much the same as for TriG. The syntactic representation is not an issue in either syntax. Perhaps a type mapping in the default graph that asserts that the graph name is some kind of rdf:Graph; it's not specifically a JSON-LD issue.

Assuming the RDF algorithms are represented directly using RDF Concepts as we considered above, I think the algorithms should just directly use whatever abstract syntax RDF Concepts ends up defining for quads/named graphs/multigraphs/datasets/whatever. It will probably *not* be called “statement” with an optional fourth element though.

>> Are there specific use cases that you have considered in order to design the quads/context feature of JSON-LD? We might want to add them to our list of use cases for the multigraph stuff.
> 
> Yhe two main use cases were PaySwarm graph signing and Wikidata provenance representation. I think these are both items in your wiki now.

Ok, now I know which ones you mean, thanks.

>> Just speaking for myself, and without having considered the issue deeply, I'd prefer having everything that is required to convert between JSON-LD and an RDF graph in a single document.
> 
> Out intended audience was Linked Data developers, for whom RDF is not always appreciated. Keeping these details in the "Advanced Concepts" section, or a normative appendix will probably suffice. I'll let other CG members chime in.

+1

>> JSON-LD is all about linked data, right? So I'd expect to see hyperlinks (that is, full URLs) in [4] and [5].
> 
> Similar to RDFa or Turtle, JSON-LD supports relative IRIs. If you resolve those references relative to the manifest location, you'll get the full IRI.

Ok, right. I should have figured this out by myself. The context says that the @type of this key is  "@id", and that means the value is a URL. Since it's not an absolute URL, it's a relative one.

(Note: Section 1.2 of the Syntax spec claims that @type is defined in the Typed Values section, but another use of @type is defined in the Type Coercion section. This should be mentioned too in 1.2.)

> You can turn it into RDF using my distiller (at http://rdf.greggkellogg.net/distiller. You could also use that to turn arbitrary RDF into JSON-LD.

Thanks, but this doesn't seem to work for me. I pasted http://json-ld.org/test-suite/tests/fromRdf-manifest.jsonld into the URI box and clicked Submit. I got: NoMethodError: undefined method `empty?' for nil:NilClass

Best,
Richard



> 
> Gregg
> 
>>> The fact that manifests are all represented using JSON should make this a fairly easy thing to do within the HTML page itself, perhaps using the <script type="application/ld+json"> similar to that used in the Turtle spec.
>> 
>> Sounds useful.
>> 
>> Thanks,
>> Richard
>> 
>> 
>> 
>>> 
>>> Gregg
>>> 
>>>>> 3. Is it possible to serialize an RDF graph into a "pretty" JSON-LD
>>>>> document using a context? I presume the answer is "yes" and involves
>>>>> Compaction of the basic serialized output.
>>>> 
>>>> Yes, exactly either by compacting or by framing.
>>>> 
>>>> 
>>>> [1] https://github.com/json-ld/json-ld.org/issues/125
>>>> [2] http://json-ld.org/spec/latest/json-ld-syntax/#markup-examples
>>> [3] http://www.w3.org/TR/2011/WD-rdf-interfaces-20110510/
>>> [4] http://json-ld.org/test-suite/tests/fromRdf-manifest.jsonld
>>> [5] http://json-ld.org/test-suite/tests/toRdf-manifest.jsonld
>>> 
>>>> --
>>>> Markus Lanthaler
>>>> @markuslanthaler
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> 
>> 
Received on Tuesday, 22 May 2012 23:08:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 23:08:39 GMT