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

Hi Manu,

On 29 Aug 2011, at 03:04, Manu Sporny wrote:
>> 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.

Well, given that RDF/JSON is intended for use without a Javascript library, it would perhaps be better if the format didn't require post-processing.

>> 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.

I think this would result in a structure that makes access to the properties of specific resources quick and painless.

Could JSON-LD be changed so that one can define an “RDF geek compatibility context” that directly results in this convenient form, without need for post-processing?

Best,
Richard



> 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
> http://manu.sporny.org/2011/better-world/
> 

Received on Monday, 29 August 2011 14:08:52 UTC