sci.pe context and a version of jsonld.js bundled with jsonldRdfaParser and a custom document loader aware of science.ai context.
Note: this module is auto published to npm on CircleCI. Only run npm version patch|minor|major
and let CI do the rest.
import { context, contextUrl } from '@scipe/jsonld';
import { jsonld } from '@scipe/jsonld';
These methods will return a promise if the last argument is not a callback.
flatten doc, relabel blank nodes to uuid and compact result to science.ai context.
import { flatten } from '@scipe/jsonld';
import { frame } from '@scipe/jsonld';
import { purge } from '@scipe/jsonld';
import { createNash } from '@scipe/jsonld';
embed
can be used to re-create trees from the nodes of a JSON-LD
flattened document. embed
is not as flexible as JSON-LD framing but
does not require a @context
and can be performed efficiently as a
sync operation.
import { embed } from '@scipe/jsonld';
const tree = embed(node, graph);
graph
: A graph or anodeMap
. Note that the@id
of the document nodes must be valid CURIEs (including blank nodes) or URLs.node
: A node of the graph (or an@id
as a string).
@scipe/jsonld
is dual-licensed under commercial and open source licenses
(AGPLv3) based on the intended
use case. Contact us to learn which license applies to your use case.