0.8.0 • Published 4 years ago

ld-walk v0.8.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Build Status

ld-walk

This library provides a few utilities to facilitate resource location within a distributed graph of JSON-LD documents. It builds on https://github.com/goofballLogic/ld-query to enable working with JSON-LD in a manner reminiscent of a browser DOM.

For example, let's say I have a starting point of

const api = "http://test.com/api/";

and a context document like:

const context = {
   "@vocab": "http://test.com/vocab/"
};

If I initialise the walker like this:

import walker from "./Walker.js";
const apiWalker = walker.walk(context).from(api);

I could ask it to find nodes containing @id and dereference them like this:

const products = apiWalker.walk("catalog products books").toQuery();

Which would give me back a query object for the books node (or null if the walk failed at any point). Or alternatively, toJSON() would return raw JSON instead.

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago