Re: [JSON] Modularization and JSON-LD

On 04/07/2011 10:11 AM, Andy Seaborne wrote:
> On 07/04/11 02:55, Manu Sporny wrote:
>> Yes, it does have to be hand-templated. Any data structure that allows
>> nesting and cycles has to be hand-templated for any real-world
>> application. It is the same problem as RDF/XML and XML parsers, but
>> that's not a problem that we're interested in solving.
>>
>> Why should we be interested in solving this problem?
> 
> This statement is rather wild.  As someone who has written a Turtle
> pretty printer, I can say that it does not have to be hand-templated for
> reasonable looking nesting and cycles.  And RDF lists.

You are responding to something that is slightly out of context, you may
want to go back and read the context a bit more carefully.

Steve said this:

> As far as I can tell, it's not possible to make an easy-to-consume
> serialisation from RDF you hold now ... it has to be hand-templated in
> order to make it pleasant to consume in Javascript.

He is correct.

The implied requirements are:

 * The publisher has an RDF graph
 * The consumer only has JSON.parse()
 * Both the publisher and consumer want to support nested data
   structures
 * The RDF graph has cycles

The order in which you serialize the graph affects how the nesting
occurs. This was one of the things we had to tackle in JSON-LD:

http://manu.sporny.org/2011/semweb-problems-1/

However, I think that given the implied requirements, you would agree
with both Steve and me.

If you have no arbitrary structural JSON constraints, you are correct.
However, Steve was stating that there are arbitrary JSON structural
constrains on the output from the publisher and therefore, you need
templating of some kind.

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny)
President/CEO - Digital Bazaar, Inc.
blog: The PaySwarm Vocabulary
http://digitalbazaar.com/2011/03/31/payswarm-vocab/

Received on Friday, 8 April 2011 02:26:56 UTC