rdf-store-stream
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

RDF Store Stream

Build status Coverage Status npm version

This package exposes a convenience function that allows RDF(JS) streams to be encapsulated into an RDF(JS) store.

The Store that will be returned is the default store from rdf-stores.

This library accepts RDFJS-compliant quads.

Installation

$ yarn install rdf-store-stream

This package also works out-of-the-box in browsers via tools such as webpack and browserify.

Require

import {storeStream} from "rdf-store-stream";

or

const storeStream = require("rdf-store-stream").storeStream;

Usage

Short example:

const store = await storeStream(quadStream);

Full example:

// Create an RDF stream
import rdfParser from "rdf-parse";
const quadStream = rdfParser.parse(fs.createReadStream('cartoons.ttl'), { contentType: 'text/turtle' });

// Import the stream into a store
const store = await storeStream(quadStream);

// Use the store
const resultStream = store.match(namedNode('http://example.org/subject'));

License

This software is written by Ruben Taelman.

This code is released under the MIT license.

Package Sidebar

Install

npm i rdf-store-stream

Weekly Downloads

2,476

Version

2.0.1

License

MIT

Unpacked Size

7.66 kB

Total Files

6

Last publish

Collaborators

  • rubensworks