@qaecy/rudof
v0.3.1
Published
Node.js bindings for Rudof — RDF, ShEx, SHACL, SPARQL in Rust
Readme
@qaecy/rudof
Native Node.js bindings for rudof — an RDF, ShEx, SHACL, and SPARQL toolkit written in Rust.
Fork notice: This package is built from qaecy/rudof, a fork of rudof-project/rudof at commit
6e770ec(v0.3.1). The only addition is thisnode/directory with napi-rs bindings.
Installation
npm install @qaecy/rudofUsage
import { Rudof, RudofConfig } from '@qaecy/rudof';
const config = new RudofConfig();
const rudof = new Rudof(config);
// Load RDF data (string, file path, or URL)
rudof.readData('<http://example.org/s> <http://example.org/p> <http://example.org/o> .');
// Load SHACL shapes
rudof.readShacl(shapesString);
// Validate
rudof.validateShacl();
// Get results as compact JSON
const results = rudof.serializeShaclValidationResults('Json');
console.log(results);API
All methods are synchronous. SPARQL endpoint queries block the calling thread —
offload with node:worker_threads or a thread pool for use in async services.
See index.d.ts for the full TypeScript API.
Building from source
Requires Rust (stable) and Node.js ≥ 18.
cd node
npm install
npm run build # release build
npm run build:debug # debug buildPublishing
npm run publish:npm # builds and publishes to npm as @qaecy/rudofLicense
MIT OR Apache-2.0 — same as the upstream rudof project.
