Blazegraph JavaScript API. This version has been completely rewritten and the new API is still evolving.
yarn add https://github.com/seronet-project/blazegraph-js
Many (undocumented yet) methods are available. Have a look at the source for more info.
const { prepareBlaze } = require("blazegraph");
const { SELECT, UPDATE } = prepareBlaze({
host: "localhost",
port: 9999,
namespace: "kb" // Those are the default values, passing no params yields the same result
});
// simple async example
const results = await SELECT`select * { ?s ?p ?o } limit 10`;
console.log(results);
const { pipeP, pluck } = require("ramda");
await pipeP(
() => SELECT`select * {?s ?p ?o}`, // 1. query
pluck("p"), // 2. extract only properties
pluck("value"), // 3. extract value from each property
console.log // 4. write results to console
)();
Unstable, do not use in production! The current API is quite specific to Nelson, but feel free to PR breaking changes to make it universal.
Yes, thank you. Please lint, update/write tests and add your name to the package.json file before you PR.
npm install blazegraph --save
Blazegraph-js is released under the MIT license.
Blazegraph is freely available under the GPLv2 open-source license.