2.1.1 • Published 4 years ago
n-quads-parser v2.1.1
NQuads parser
This is a basic, but fast pure-js n-quads/triples parser. It has no dependencies to node and can be run in the browser.
Installation
yarn add n-quads-parser @ontologies/core
npm i n-quads-parser @ontologies/core
Usage
This was written as a faster n-quads parser for link-lib and designed to work with rdflib.js.
The parser is already integrated into link-lib which can also consume linked-delta payloads in addition to plain n-quads.
If you're looking for a quick and easy way to build linked-data based RDF applications, check out link-redux.
Plain javascript:
import rdf from '@ontologies/core';
// Can also be IndexedFormula from rdflib.js or RDFStore from link-lib.
const store = {
rdfFactory: rdf,
quads: [],
add(s, p, o, g) {
this.quads.push(rdf.quad(s, p, o, g));
}
}
const parser = new NQuadsParser(store);
fetch(url)
.then((req) => req.text())
.then((body) => parser.loadBuf(body));
// The quads should be loaded into the store.
TODO:
- Implement the whatwg streams interface
- Add the spec test suite
2.1.1
4 years ago
2.1.0
4 years ago
2.1.0-3
4 years ago
2.1.0-2
4 years ago
2.1.0-1
4 years ago
2.1.0-0
4 years ago
2.0.3-ontologies-2
4 years ago
2.0.3-ontologies
5 years ago
2.0.3
5 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.3.0
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.0
5 years ago