同一张 RDF 图,同一套行为
PurRDF is a from-scratch RDF 1.2 toolkit built around a dependency-light Rust core and carried verbatim into Python, WebAssembly/JavaScript, and C. It covers graph primitives, native codecs, RDFC-1.0 canonicalization, SPARQL 1.1/1.2, SHACL, ShEx, entailment through OWL 2 DL, full-text and geospatial search, slice metadata, and GTS graph transport. Every published crate builds for wasm32-unknown-unknown, so the engine that answers a query on a server answers it the same way in a browser tab.
The goal is semantic consistency across runtimes. A graph moved from a Rust service to a Python pipeline to a browser should not quietly change behavior because each language chose a different RDF interpretation.
Ranked full-text search, spatial predicates, and vector similarity are answered inside PurRDF, in-process and over the same dataset, from the same SPARQL query. Those are the three jobs for which an RDF project has usually run PostgreSQL beside its triple store.
Version 1.0.0, released 2 September 2026, is the first release under full semantic versioning. It carries the same code as 0.13.0, republished across all 21 crates through Trusted Publishing; what changed is the compatibility commitment, not the behavior. The GTS container reaches Rust, the command-line tool, Python, and C, and is not exposed by the WebAssembly/JavaScript package.
Why PurRDF?
RDF tooling fragments across languages and across standard generations. Every ecosystem has its own parser, serializer, store model, and edge-case behavior, while RDF 1.2 adds triple terms, reifiers, and base-direction literals that many incumbent libraries do not carry yet.
PurRDF keeps those semantics in one core. The Rust implementation is the behavioral center; bindings and package surfaces expose that same engine rather than reimplementing the graph model per language.
What's inside
| Layer | What PurRDF provides |
|---|---|
| RDF 1.2 primitives | Interned dataset IR, triple terms, reifier side tables, and base-direction literals. |
| Pack container and paged datasets | Content-addressed, zero-copy dataset snapshots with a canonical identity digest, and paged datasets under caller-set limits. Rust and the CLI only. |
| Native codecs | Turtle, TriG, N-Triples, N-Quads, RDF/XML, TriX, HexTuples, JSON-LD star, and YAML-LD, plus bidirectional OKF Markdown bundles. Output is byte-deterministic. |
| JSON-LD 1.1 context lens | Deterministic context compilation and compaction over an offline registry. No network loader and no framing API. |
| Canonicalization | W3C RDFC-1.0 dataset canonicalization, the first-party purrdf-rdfc12 profile for RDF 1.2 constructs, and a review-friendly canonical Turtle rendering. |
| SPARQL 1.1/1.2 | Parser, algebra, and multiset evaluator: all four query forms, full Update, property paths, cost-based planning, the enforced VERSION declaration, LATERAL, temporal arithmetic, composite datatypes, custom aggregates, and a host-supplied SERVICE seam. |
| Governed execution | Every query and update entry point has a governed twin running under caller-set ceilings that returns certified partial answers rather than a wrong one, with a per-node charge ledger. |
| Search on the SPARQL seams | Deterministic full-text search with exact fixed-point BM25, float-free GeoSPARQL 1.1 over exact rationals, embedding nearest-neighbour search, and path witnesses, each registered under IRIs the caller supplies. |
| SHACL | Complete SHACL Core, SHACL-SPARQL, and SHACL-AF including SHACL Rules, aligned with the SHACL 1.2 working drafts, plus scoped support for reifier shapes. |
| Schema lanes | SHACL compiled to JSON Schema, OpenAPI, Pydantic, LinkML, TypeScript, and GraphQL, each with a reverse importer and a loss ledger. Rust only. |
| ShEx 2.1 | A from-scratch ShExC and ShExJ schema layer and validator. |
| Entailment and OWL 2 DL | RDF, RDFS, OWL 2 RL, D, RIF-Core, and an OWL 2 Direct-Semantics tableau over a deterministic fixpoint, each closure returned with a reasoning report; plus classification, realization, justification, and checkable proof terms. |
| Projections and carriers | Sixteen profiles behind one verb: Neo4j, openCypher, GraphML, CSVW, OBO Graphs, SKOS, DCAT/VoID, RO-Crate, Croissant, DataCite, Frictionless, and a byte-deterministic Parquet codec. |
| Visualization | Statement-centric deterministic SVG rendering that draws RDF 1.2 as RDF 1.2, with the machine-readable export embedded in the drawing. |
| GTS transport | Single-file, content-addressed graph transport using CBOR segments, BLAKE3 chains, and optional COSE signing/encryption. Not exposed by the WebAssembly/JavaScript package. |
| Slices and provenance | Manifested slice catalogs, content-addressed artifact IDs, RDF/GTS loss ledger, SSSOM support, and FnO function-catalog codec. |
| Zero-dependency foundations | purrdf-iri (RFC 3986/3987) and purrdf-xsd (XSD 1.1 value space) have no runtime dependencies at all. |
Install
| Runtime | Package | Install |
|---|---|---|
| Rust | purrdf | cargo add purrdf |
| Python | purrdf | pip install purrdf (Python 3.13+; pip install purrdf[rdflib] adds the drop-in rdflib shadow) |
| JavaScript / WebAssembly | @blackcatinformatics/purrdf | npm i @blackcatinformatics/purrdf |
| C | libpurrdf | make capi-build from the source checkout |
| Command line | purrdf-cli | Unpublished; built from the source checkout |
Interfaces
The public facade is the purrdf umbrella crate: it re-exports the RDF 1.2 surface at its root and carries every other published crate under a stable module, so a Rust consumer never reaches into a sub-crate. Twenty-one crates publish in lockstep, splitting the kernel, codecs, GTS, SPARQL algebra, evaluation and results, composite datatypes, SHACL, ShEx, entailment, Datalog, full-text, GeoSPARQL, columnar export, slices, IRIs, XSD values, events, and the WebAssembly engine; purrdf-validate is the shared host boundary the bindings call. Four workspace members are deliberately never published: the C ABI crate, the conformance harness, the CLI, and the Python extension crate.
The Python package ships an rdflib compatibility layer and a GTS fold view. The JavaScript package exposes an RDF/JS-shaped DataFactory, Dataset, and stream surface over the same engine, plus SHACL validation to SARIF, entailment materialization, governed SPARQL with explain receipts, and graph identity through canonicalize() and isomorphic().
The minimum supported Rust version is 1.96 on the stable channel.
cargo add purrdf
pip install purrdf
npm i @blackcatinformatics/purrdf
Conformance
Every engine is gated by its official test suite, vendored and frozen in the source repository. The full scoreboard is in CONFORMANCE.md.
| Engine | Suite | Result |
|---|---|---|
| ShEx 2.1 | shexTest v2.1.0 | 1,105 / 1,105 attempted, 0 expected-failures |
| SHACL | W3C data-shapes | 129 / 129, none ledgered |
| Syntax codecs | W3C rdf-tests round-trip | 264 / 264 |
| JSON-LD 1.1 | W3C toRDF and compaction | 73 / 73 applicable, 13 / 13 exact |
| SPARQL 1.1/1.2 | W3C sparql11 + sparql12 and first-party | 862 passing, 5 ledgered upstream errata |
| SPARQL composite datatypes | vendored SEP-0009 corpus | 658 / 658, none ledgered |
| Execution governors | first-party frozen corpus | 50 / 50, none ledgered |
| Entailment regimes | W3C sparql11 entailment group | 70 / 70, none ledgered |
| OWL 2 DL consistency | vendored W3C OWL 2 suite | 258 / 262 agreeing, 4 ledgered |
| OWL 2 RL entailment | vendored W3C OWL 2 suite | 50 / 50 agreeing, none ledgered |
| RDFC-1.0 | W3C canonicalization fixtures | green |
| RDF 1.2 canonicalization profile | first-party vectors | 5 / 5 |
| GTS | frozen cross-language vectors | 38 / 39 byte-exact, 1 ledgered divergence |
Development gates are exposed in the upstream repository as make metadata, make check, and make bench.
Place in the GMEOW family
PurRDF is the library layer under GMEOW, Blackcat Informatics' reasoning-centric ontology and grounded-memory publication stack. It also hosts the Rust GTS engine; GTS remains the graph-transport format and project surface.
PurRDF was extracted from the GMEOW ontology engine, and the consumer relationship now runs the other way: GMEOW has deleted its own RDF kernel and consumes PurRDF instead.
Documentation
- The PurRDF Book - the user guide: getting started in each language, concepts, and every engine. Published in English.
- RDF 1.2 playground - a zero-install browser console that parses, queries, validates, serializes, and canonicalizes RDF 1.2 entirely client-side on the WebAssembly build.
- docs.rs/purrdf - API reference for the umbrella crate; each member crate links its own page.
- CHANGELOG.md - every release, with breaking changes marked.
- CONFORMANCE.md - the full conformance scoreboard and how to run each suite.
- RDF12-CANON-PROFILE.md - the
purrdf-rdfc12canonicalization profile and how it differs from RDFC-1.0. - SPARQL-GOVERNOR-PROFILE.md - the normative charge schedule for governed execution.
- PURREMB.md - the embedding companion format behind nearest-neighbour search.
- GTS-SPEC.md - the normative graph-transport wire format.
- RELEASE.md - the release process, trusted publishing setup, and artifact verification.
Versioning and releases
The suite ships one version to crates.io, PyPI, and npm in lockstep. A version-coherence check fails the build if the version sources disagree.
| Surface | Registry | Release tag | Workflow |
|---|---|---|---|
| Rust crate suite | crates.io trusted publishing | rust-v* | release-cargo.yaml |
| Python | PyPI trusted publishing | py-v* | release-pypi.yaml |
| JavaScript / WebAssembly | npm trusted publishing | npm-v* | release-npm.yaml |
From 1.0.0 the suite follows semantic versioning in full: a breaking change bumps the major version, a minor bump is additive and API-compatible, and a patch bump is bugfix-only. The changelog marks each breaking entry. Raising the minimum supported Rust version rides a minor bump and never ships in a patch release.
The one exception is the C ABI. libpurrdf's purrdf.h carries its own ABI version, currently 0.7, bumped on every exported-signature change and read back at runtime. It is versioned separately from the workspace and stays 0.x; the 1.0.0 release makes no promise about it.
Publication uses Trusted Publishing through GitHub Actions OIDC rather than a long-lived registry secret. Every package receives a GitHub build-provenance attestation and an SPDX SBOM, and the release crate set is checked on wasm32-unknown-unknown before publishing. A downloaded artifact can be verified with gh attestation verify --repo Blackcat-Informatics/purrdf. Every release is listed on the GitHub releases page.
Publication facts
| Title | PurRDF: RDF 1.2 Toolkit |
|---|---|
| DOI | 10.67342/pkg8gpp4no/v1 |
| Type | Software project and technical publication surface |
| Crossmark | Check for updates |
| BII publication version | 1 |
| Package version | 1.0.0 |
| Publication date | |
| Latest package release | |
| Publisher | 黑猫信息科技 |
| License | MIT OR Apache-2.0 |
| Repository | https://github.com/Blackcat-Informatics/purrdf |
| Citation metadata | https://blackcatinformatics.ca/purrdf/cite.csl.json |
Citation: PurRDF: RDF 1.2 Toolkit. Publication version 1; package version 1.0.0. Blackcat Informatics Inc., 2026. DOI: 10.67342/pkg8gpp4no/v1. Source: https://github.com/Blackcat-Informatics/purrdf.