Re: JSON-LD and Drupal

Hi,

On Fri, Jun 15, 2012 at 12:50 PM, Markus Lanthaler
<markus.lanthaler@gmx.net> wrote:
> What exactly do you mean by the lack of hypermedia support? JSON-LD is all
> about links and thus hypermedia.. You are right, the tool space is still a
> bit sparse but I expect that to change quite quickly when the spec gets
> finalized.

Yep. VIE (http://viejs.org) makes all references in loaded JSON-LD
traversable (of course, cross-site restrictions may apply). So you can
do things like:

var bergie = vie.entities.get('<http://bergie.iki.fi/#me>');
var nemein = bergie.get('worksFor').at(0); // First company I work for
// If "nemein" isn't loaded to graph, you can follow the reference with:
nemein.fetch()
// after which (async handled by a callback), you could fetch all employees with
var employees = nemein.get('employees');
// and again populate them from the server:
employees.fetch()
// etc. etc.

Note that VIE still follows the older JSON-LD spec with < and >
surrounding URIs, and @subject instead of @id. This will change as
soon as JSON-LD spec is finalized. Tracking bug for it is in:
https://github.com/bergie/VIE/issues/110

> Markus Lanthaler

/Henri

-- 
Henri Bergius
Motorcycle Adventures and Free Software
http://bergie.iki.fi/

Jabber: henri.bergius@gmail.com
Microblogs: @bergie

Received on Friday, 15 June 2012 17:01:46 UTC