跳至主要内容

PurRDF

RDF 1.2 Toolkit

Crossmark - Check for updates

PurRDF project and software publication

同一张 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.

PurRDF logo - black cat holding an RDF triple
PurRDF logo: the RDF toolkit layer under the GMEOW stack.

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

LayerWhat PurRDF provides
RDF 1.2 primitivesInterned dataset IR, triple terms, reifier side tables, and base-direction literals.
Pack container and paged datasetsContent-addressed, zero-copy dataset snapshots with a canonical identity digest, and paged datasets under caller-set limits. Rust and the CLI only.
Native codecsTurtle, 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 lensDeterministic context compilation and compaction over an offline registry. No network loader and no framing API.
CanonicalizationW3C 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.2Parser, 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 executionEvery 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 seamsDeterministic 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.
SHACLComplete 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 lanesSHACL compiled to JSON Schema, OpenAPI, Pydantic, LinkML, TypeScript, and GraphQL, each with a reverse importer and a loss ledger. Rust only.
ShEx 2.1A from-scratch ShExC and ShExJ schema layer and validator.
Entailment and OWL 2 DLRDF, 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 carriersSixteen profiles behind one verb: Neo4j, openCypher, GraphML, CSVW, OBO Graphs, SKOS, DCAT/VoID, RO-Crate, Croissant, DataCite, Frictionless, and a byte-deterministic Parquet codec.
VisualizationStatement-centric deterministic SVG rendering that draws RDF 1.2 as RDF 1.2, with the machine-readable export embedded in the drawing.
GTS transportSingle-file, content-addressed graph transport using CBOR segments, BLAKE3 chains, and optional COSE signing/encryption. Not exposed by the WebAssembly/JavaScript package.
Slices and provenanceManifested slice catalogs, content-addressed artifact IDs, RDF/GTS loss ledger, SSSOM support, and FnO function-catalog codec.
Zero-dependency foundationspurrdf-iri (RFC 3986/3987) and purrdf-xsd (XSD 1.1 value space) have no runtime dependencies at all.

Install

RuntimePackageInstall
Rustpurrdfcargo add purrdf
Pythonpurrdfpip install purrdf (Python 3.13+; pip install purrdf[rdflib] adds the drop-in rdflib shadow)
JavaScript / WebAssembly@blackcatinformatics/purrdfnpm i @blackcatinformatics/purrdf
Clibpurrdfmake capi-build from the source checkout
Command linepurrdf-cliUnpublished; 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.

EngineSuiteResult
ShEx 2.1shexTest v2.1.01,105 / 1,105 attempted, 0 expected-failures
SHACLW3C data-shapes129 / 129, none ledgered
Syntax codecsW3C rdf-tests round-trip264 / 264
JSON-LD 1.1W3C toRDF and compaction73 / 73 applicable, 13 / 13 exact
SPARQL 1.1/1.2W3C sparql11 + sparql12 and first-party862 passing, 5 ledgered upstream errata
SPARQL composite datatypesvendored SEP-0009 corpus658 / 658, none ledgered
Execution governorsfirst-party frozen corpus50 / 50, none ledgered
Entailment regimesW3C sparql11 entailment group70 / 70, none ledgered
OWL 2 DL consistencyvendored W3C OWL 2 suite258 / 262 agreeing, 4 ledgered
OWL 2 RL entailmentvendored W3C OWL 2 suite50 / 50 agreeing, none ledgered
RDFC-1.0W3C canonicalization fixturesgreen
RDF 1.2 canonicalization profilefirst-party vectors5 / 5
GTSfrozen cross-language vectors38 / 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-rdfc12 canonicalization 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.

SurfaceRegistryRelease tagWorkflow
Rust crate suitecrates.io trusted publishingrust-v*release-cargo.yaml
PythonPyPI trusted publishingpy-v*release-pypi.yaml
JavaScript / WebAssemblynpm trusted publishingnpm-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

TitlePurRDF: RDF 1.2 Toolkit
DOI10.67342/pkg8gpp4no/v1
TypeSoftware project and technical publication surface
CrossmarkCheck for updates
BII publication version1
Package version1.0.0
Publication date
Latest package release
Publisher黑猫信息科技
LicenseMIT OR Apache-2.0
Repositoryhttps://github.com/Blackcat-Informatics/purrdf
Citation metadatahttps://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.