rdf-store-stream

Create an RDF store from an RDF stream

Usage no npm install needed!

<script type="module">
  import rdfStoreStream from 'https://cdn.skypack.dev/rdf-store-stream';
</script>

README

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 an N3.Store.

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.