n-quads-parser v2.0.3-ontologies-2
NQuads parser
This is a basic, but fast pure-js n-quads parser. It has no dependencies to node and can be run in the browser without any additional packages.
Installation
yarn add n-quads-parser
npm i n-quads-parser
Usage
This was written as a faster n-quads parser for link-lib and designed to work with rdflib.js.
If you're looking for a way to build linked-data enabled RDF applications fast, check out link-redux.
RDFlib doesn't have (at the time of writing) dependency injection, one must either fork and modify rdflib or use our fork. Note that the latter has performance patches over the native RDFlib, but is also more strict in object creation.
Plain javascript:
import { IndexedFormula } from 'rdflib';
// Doesn't have to be from rdflib, check the parser file for the handful methods required
const store = new IndexedFormula();
const parser = new NQuadsParser();
fetch(url)
.then((req) => req.text())
.then((body) => parser.loadBuf(body));
// The statements should be loaded into the store.TODO:
- Implement the whatwg streams interface
- Add the spec test suite
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago