- From: James Langley <jdhlangley@gmail.com>
- Date: Thu, 13 Feb 2014 19:46:34 +0000
- To: public-hydra@w3.org
Received on Thursday, 13 February 2014 19:47:02 UTC
> So you want to manipulate the JSON representation directly instead of
> mapping it to domain POJOs, right? In my JSON-LD processor [1] I've
> implemented a first version of a "node API" as I call it. That's very
> similar to the FluentBuilder API you talk about. It's in PHP but I'm sure
> you get the idea:
>
> // get the default graph from the JSON-LD request doc.
> $graph = $request->getGraph();
>
> $graph->getNode('http://example.com/node1')
> ->setType('http://example.com/vocab#SomeClass')
> ->setProperty('http://example.com/vocab#propertyA', 'A')
> ->removeProperty('http://example.com/vocab#propertyB');
>
> $serialized = JsonLD::toString($graph->toJsonLd());
>
> Is that more or less what you are looking for?
Yes, that's the approach we're thinking of taking.
Received on Thursday, 13 February 2014 19:47:02 UTC