Skip to content

science-periodicals/jsonld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@scipe/jsonld

CircleCI

styled with prettier

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.

Context

import { context, contextUrl } from '@scipe/jsonld';

JSON-LD

import { jsonld } from '@scipe/jsonld';

Convenience methods

These methods will return a promise if the last argument is not a callback.

flatten

flatten doc, relabel blank nodes to uuid and compact result to science.ai context.

import { flatten } from '@scipe/jsonld';

frame

import { frame } from '@scipe/jsonld';

purge

import { purge } from '@scipe/jsonld';

createNash

import { createNash } from '@scipe/jsonld';

embed

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 a nodeMap. 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).

and more...

License

@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.

About

JSON-LD utils for sci.pe

Resources

Stars

Watchers

Forks

Packages

No packages published