npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blackcatinformatics/purrdf

v0.6.0

Published

A wasm32, in-memory RDF 1.2 engine with an idiomatic RDF/JS (DataFactory/Dataset/Stream) API. Quoted-triple terms and directional literals included.

Readme

@blackcatinformatics/purrdf

PurRDF — an in-memory RDF 1.2 engine for JavaScript, compiled to WebAssembly from the purrdf Rust workspace, with an idiomatic RDF/JS (DataFactory / DatasetCore / Stream) API.

It is the same engine, byte-for-byte behavior, that ships as the purrdf Rust crates, the purrdf PyPI package, and libpurrdf — PurRDF's rule is one engine, one behavior, every language.

Try it live — the RDF-1.2 playground runs this package in your browser: parse, SPARQL, SHACL, serialize, and canonicalize/compare RDF-1.2 graphs client-side, with no install.

Why this instead of an incumbent RDF/JS library?

No incumbent RDF/JS library carries the RDF 1.2 features:

  • Quoted-triple terms (RDF-star / RDF 1.2 triple terms), usable in the object position;
  • Base-direction literals (rdf:dirLangString) — language plus ltr/rtl direction;
  • Byte-deterministic serializers backed by W3C conformance corpora (SPARQL 1.1, RDFC-1.0 canonicalization fixtures) in the parent workspace.

Install

npm install @blackcatinformatics/purrdf

Runs in Node ≥ 18 and modern browsers (ESM, web-target wasm-bindgen).

The wasm artifact is built with WebAssembly SIMD (+simd128) for higher parse throughput, so it requires a runtime with wasm SIMD support: every major browser since ~2021 (Chrome/Edge 91+, Firefox 89+, Safari 16.4+) and Node ≥ 18.

Quickstart

import { ready, DataFactory, Dataset, QueryEngine } from "@blackcatinformatics/purrdf";

await ready(); // one-time async wasm instantiation

const f = new DataFactory();

// A quoted triple, usable as a subject/object (RDF-star / RDF 1.2).
const quoted = f.quotedTriple(
  f.namedNode("https://ex/alice"),
  f.namedNode("https://ex/knows"),
  f.namedNode("https://ex/bob"),
);

// A base-direction literal (rdf:dirLangString).
const rtl = f.directionalLiteral("مرحبا", "ar", "rtl");

const ds = new Dataset();
ds.add(f.quad(f.namedNode("https://ex/s"), f.namedNode("https://ex/says"), rtl));
ds.add(f.quad(f.namedNode("https://ex/stmt"), f.namedNode("https://ex/asserts"), quoted));

// Quoted triples + directions survive a round-trip through N-Quads.
const nq = ds.serialize("nquads");
const reparsed = Dataset.parse(nq, "nquads");

const engine = new QueryEngine();
const names = engine.select(
  reparsed,
  "SELECT ?message WHERE { <https://ex/s> <https://ex/says> ?message }",
);
console.log(names.rows.take(0)?.message.value);

API surface

  • ready(bytesOrUrl?) — one-time async wasm instantiation.
  • DataFactorynamedNode, blankNode, literal, typedLiteral, directionalLiteral, variable, defaultGraph, quad, quotedTriple, fromTerm, fromQuad.
  • DatasetDataset.parse(input, format, base?), serialize(format), add / delete / has / match / quads / size, iteration. Formats: turtle, ntriples, nquads, trig, rdfxml (serialize also jsonld).
  • Dataset.canonicalize() / Dataset.isomorphic(other) — RDFC-1.0 canonical N-Quads and RDF graph-identity (isomorphism under blank-node relabeling).
  • Dataset.visualModel(options?) / visualExport(options?) / visualSvg(options?) — the renderer-neutral RDF 1.2 model, complete semantic scene and deterministic geometry, or self-contained SVG paired with that export. Returned objects are structured-clone-safe and preserve triple-term identity, assertion graphs, reifier/annotation graph context, nesting, and diagnostics.
  • QueryEngine — a reusable SPARQL execution context with a native plan cache, typed select / ask / construct / describe helpers, atomic update, and queryRaw serialization for SPARQL Results JSON/XML/CSV/TSV plus graph formats. SELECT rows are a single-owner iterable; use take(index), toArray(), or iteration, and call free() when abandoning unconsumed rows. Dataset.query(...) remains as the compatibility raw-string helper.
  • shaclValidateToSarif(shapesTtl, dataNt) / shaclEntail(shapesTtl, dataNt) — SHACL validation to a SARIF 2.1.0 report and SHACL-AF sh:rule entailment to N-Triples.
  • Sink, datasetToStream, streamToDataset — the async RDF/JS Stream/Sink primitives over the synchronous engine surface.
  • SPARQL evaluation over the in-memory dataset (no server required).

Full typings ship in index.d.ts.

const { svg, export: graph } = reparsed.visualSvg({
  mode: "compact",
  vocabulary: [{ prefix: "ex", namespace: "https://ex/" }],
  svg: { title: "RDF 1.2 graph", embedMetadata: true },
});

console.log(graph.model.statements, graph.model.relations);
document.querySelector("#graph").innerHTML = svg;

Compact mode keeps ordinary asserted RDF as directed predicate-labelled edges and promotes statements only when they need identity. Incidence mode exposes exact subject/predicate/object ports. Table mode scales statement inspection without discarding the same underlying model.

Scope

In-memory only, by design: no persistent store and no network I/O inside the wasm module. This package provides no network resolver, so remote SERVICE and LOAD fail explicitly. For the container transport (GTS), native APIs, and the rest of the toolkit, see the main repository.

Supply chain

Published from GitHub Actions via npm trusted publishing with sigstore provenance, a GitHub build-provenance attestation, and an SPDX SBOM per release.

License

MIT OR Apache-2.0, © 2026 Blackcat Informatics® Inc.