npm

Need private packages and team management tools?Check out npm Orgs. »

rdf-quad

1.4.0 • Public • Published

RDF Quad

npm version

A convenience constructor for RDF quads based on string-based terms, as done by RDF-String.

If the value in the object position is not a string, then it will be automatically converted to the proper RDF datatype using RDF Literal.

This produces quads according to the RDFJS specification.

Usage

const quad = require('rdf-quad');
 
// Object is an IRI
quad('http://example.org/subject', 'http://example.org/predicate', 'http://example.org/object');
 
// Object is a variable
quad('http://example.org/subject', 'http://example.org/predicate', '?variable');
 
// Object is a string literal
quad('http://example.org/subject', 'http://example.org/predicate', '"myString"', 'http://example.org/someGraph');
 
// Object is an integer
quad('http://example.org/subject', 'http://example.org/predicate', 123);
 
// Object is a boolean
quad('http://example.org/subject', 'http://example.org/predicate', true);

License

This software is written by Ruben Taelman.

This code is released under the MIT license.

install

npm i rdf-quad

Downloadsweekly downloads

147

version

1.4.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability