W3C home > Mailing lists > Public > public-rdf-wg@w3.org > August 2011

Re: Can JSON-LD cater for Talis' RDF/JSON design goals?

From: Manu Sporny <msporny@digitalbazaar.com>
Date: Sun, 28 Aug 2011 22:04:39 -0400
Message-ID: <4E5AF3B7.1010306@digitalbazaar.com>
To: Richard Cyganiak <richard@cyganiak.de>
CC: Thomas Steiner <tomac@google.com>, Ian Davis <ian.davis@talis.com>, RDF WG <public-rdf-wg@w3.org>, public-linked-json@w3.org
On 08/26/2011 06:54 AM, Richard Cyganiak wrote:
> On 26 Aug 2011, at 10:32, Thomas Steiner wrote:
>>> This gives me hope that there could be a way forward to produce
>>> only a single JSON spec.
>> I think this is the most important part of your email :-) Me too,
>> I strongly believe in the fact that both needs (RDF geek's, Web
>> developer's) can be addressed by one spec.
> The way to do this might be to define in the spec some sort of “RDF
> geek compatibility context” that could be used by anyone who wants a
> very regular and direct representation of RDF triples in JSON-LD. For
> example, my SPARQL store could use that context when serializing a
> CONSTRUCT result to JSON-LD.

I think a few lines of JavaScript could transform JSON-LD normalized 
form into the Talis RDF/JSON form.

> If that would be possible, then I'd consider JSON-LD as addressing
> the use cases that motivate RDF/JSON [1].

I think it's possible... basically, you'd write a loop to go through 
each array item in JSON-LD normalized form array and create a new map 
that looks like the Talis RDF/JSON serialization:

for obj in jsonld_normalized:
    map[obj["@subject"]] = obj;
    delete obj["@subject"];

I think that pseudocode above basically gives you the Talis RDF/JSON 
format. Do you want a proof in code? If you do, I would just need to 
find the time to hack something together.

-- manu

Manu Sporny (skype: msporny, twitter: manusporny)
Founder/CEO - Digital Bazaar, Inc.
blog: Building a Better World with Web Payments
Received on Monday, 29 August 2011 02:05:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:08 UTC