explaingit

blackcat-informatics/purrdf

Analysis updated 2026-05-18

10RustAudience · researcherComplexity · 5/5LicenseSetup · moderate

TLDR

A Rust-core RDF 1.2 library with Python, WebAssembly, and C bindings that gives all four languages the same SPARQL, SHACL, and codec behavior from one engine.

Mindmap

mindmap
  root((purrdf))
    Core
      RDF 1.2 primitives
      Interned dataset IR
      One engine everywhere
    Codecs
      Turtle TriG N-Quads
      JSON-LD YAML-LD
      RDF XML
    Query and validation
      SPARQL 1.1 and 1.2
      SHACL Core
      ShEx 2.1
    Bindings
      Python pip
      WebAssembly npm
      C FFI
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Parse and query RDF knowledge graphs in Python using SPARQL without behavior differences between environments

USE CASE 2

Validate RDF data against SHACL shapes in Rust, Python, or the browser with identical results

USE CASE 3

Export linked data graphs from RDF to SQLite, DuckDB, or Parquet for analysis pipelines

USE CASE 4

Use PurRDF as a drop-in rdflib replacement in an existing Python project via the compatibility shim

What is it built with?

RustPythonWebAssemblySPARQLJSON-LD

How does it compare?

blackcat-informatics/purrdfyethesamartaka-foxy/foxy2arons/agent-git
Stars101011
LanguageRustRustRust
Setup difficultymoderateeasyeasy
Complexity5/52/53/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Simple cargo/pip/npm install, deeper use requires understanding RDF graph concepts (triples, quads, SPARQL) which have a steep learning curve.

Use freely for any purpose including commercial use, choose either MIT or Apache 2.0 terms.

In plain English

PurRDF is a library for working with RDF (Resource Description Framework) data, which is a standard format for representing information as connected triples of subject, predicate, and object. It is built in Rust but exposes the same functionality to Python, JavaScript (via WebAssembly), and C. The key design goal is that all four language bindings use the same core engine, so data parsed or processed in Rust produces byte-identical results to the same operation in Python or the browser. RDF tooling has traditionally been fragmented: each programming language has its own implementation with its own subtle differences, meaning a graph transferred between a Rust service, a Python pipeline, and a browser could silently change meaning. PurRDF addresses this by compiling one Rust implementation and wrapping it for each target language rather than maintaining separate codebases. The library covers the full RDF 1.2 processing stack. It can read and write Turtle, TriG, N-Triples, N-Quads, RDF/XML, JSON-LD, and YAML-LD formats. It includes a SPARQL 1.1 and 1.2 query engine with support for property paths, aggregates, and federated queries. It provides SHACL validation (for checking that graph data conforms to a shape schema) and ShEx 2.1 validation. It also implements a graph transport format called GTS, which is an append-only container for storing RDF graphs alongside binary attachments using cryptographic content-addressing. For Python users, PurRDF includes a compatibility shim that makes existing code written for the popular rdflib library work without changes, and adds helpers for exporting graph data to SQLite, DuckDB, and Parquet. For JavaScript users, it implements the standard RDF/JS interface so it drops into existing JavaScript RDF tooling. The Rust library installs with a single cargo command. Python installs via pip. JavaScript via npm. There are no optional feature flags: the authors chose to ship the full feature set everywhere rather than allow consumers to diverge on subsets. The project is MIT or Apache 2.0 licensed.

Copy-paste prompts

Prompt 1
I have an RDF dataset in Turtle format and want to run a SPARQL SELECT query on it in Python using purrdf. Show me how to parse the dataset and execute the query.
Prompt 2
How does PurRDF's SHACL Core validator work? Show me how to validate an RDF graph against a shapes graph in Python and read the conforms field from the report.
Prompt 3
I want to use purrdf in a browser JavaScript project. How do I install the npm package, initialize the DataFactory, and run a query using the RDF/JS API?
Prompt 4
Show me how to migrate an existing Python project from rdflib to purrdf using the compatibility shim without changing any import statements.

Frequently asked questions

What is purrdf?

A Rust-core RDF 1.2 library with Python, WebAssembly, and C bindings that gives all four languages the same SPARQL, SHACL, and codec behavior from one engine.

What language is purrdf written in?

Mainly Rust. The stack also includes Rust, Python, WebAssembly.

What license does purrdf use?

Use freely for any purpose including commercial use, choose either MIT or Apache 2.0 terms.

How hard is purrdf to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is purrdf for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub blackcat-informatics on gitmyhub

Verify against the repo before relying on details.