Re: What is the JSON-LD API?

On 31 August 2011 22:37, Dave Longley <dlongley@digitalbazaar.com> wrote:

> This is the point of JSON-LD framing:
>
> Regular JSON developer version:
>
>   var object = JSON.parse( /* JSON */ );
>   var title = object.book.title;
>
> JSON-LD developer version:
>
>   var frame = {/* custom frame for an object containing a book */ };
>   var object = jsonld.frame(JSON.parse( /* JSON-LD */ ), frame);
>   var title = object.book.title;
>
> A JSON-LD frame allows a developer to provide the specific structure they
> would like the incoming object to take on. The frame API then essentially
> "fills out" the frame using the incoming JSON-LD data.

So essentially this is a transformation language & engine. Doesn't the
fact that this level of engineering is needed suggest that the input
format is too complex?

If significant transformation is to take place, surely e.g. a kind of
J-triples syntax could be used for the interchange format. At least
that simplifies things for the producer.

Wouldn't it be better to simplify the format so the developer can
"rely on structure" (as you put it) directly?

I really fail to see how this is taking advantage of the simplicity of
JSON. I mean, the same end result could be fulfilled by passing Turtle
format over the wire and providing developers with a parsing &
templating library that makes JSON objects.

I don't know, this seems to be so contrary to what I imagine would be
a good design that I can only assume I'm looking at it the wrong way.
So I'm going to just sit back and watch what happens :)

Cheers,
Danny.

-- 
http://dannyayers.com

Received on Wednesday, 31 August 2011 22:24:08 UTC