/rete-graph:rete-clientsfrom rete — cloud-native RDF graphs
Guides setting up a rete client across Python, Pyodide, JavaScript/Node, browser script-tag, wasm, Rust, and R runtimes. Covers install, first query, and per-runtime gotchas.
Ships in rete — cloud-native RDF graphs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One engine, one file format, many runtimes. Pick by project type:
| Project | Client | Install |
|---|---|---|
| Python script / Jupyter / pipeline | rete-graph (PyPI) | pip install rete-graph |
| Browser Python (JupyterLite, marimo WASM) | same package, Pyodide wheels | piplite/micropip |
| Node app / bundled web app | rete-graph (npm) | npm install rete-graph |
| Plain HTML page | script-tag single file | one CDN <script> |
| Custom wasm host | crates/rete-wasm | wasm-pack build |
| Rust service / CLI tool | rete-core | git dependency (crates.io pending) |
| R analysis | rete package | see docs/r.md |
All clients share the same contract: opens are lazy (local positional
reads or HTTP Range), remote hosts must answer 206 with CORS, results
come back as parsed terms, and stats() shows the bytes actually fetched.
pip install rete-graph # CPython >= 3.9, Linux/macOS/Windows wheels
import rete_graph as rete
g = rete.open("https://data.graphplaza.com/boe/boe-2026-07-07.rete") # or a local path / bytes
for row in g.query("SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 3"):
print(row["s"].value) # Term: .kind/.value/.datatype/.lang/.to_python()
g.query_df("SELECT …") # pandas (pip install rete-graph[pandas])
g.card(); g.examples(); g.schema() # the file explains itself
g.shacl(shapes_ttl) # >= 0.2.2, lazy over shape targets
rete.build(nt_text) # or the Builder for card/examples/pyramid
Custom storage (authed S3/GCS): any object with read_at(offset, length)
and len() via rete.open(reader=obj) — fsspec plugs in directly.
Same package — PyPI ships pyemscripten wheels from 0.2.0:
import piplite # JupyterLite (micropip in raw Pyodide)
await piplite.install("rete-graph")
import rete_graph as rete # then identical code to native Python
Gotchas: remote opens use synchronous XHR, allowed only in web workers — JupyterLite/marimo kernels run there, so it just works; a stale cached notebook can pin an old wheel (delete it in the file browser). No SERVICE federation in-browser; fetches are sequential. Live demo + build tutorial: docs → JupyterLite.
npm install rete-graph # Node >= 18; TypeScript types included
import { open, build } from "rete-graph";
const g = await open("https://data.graphplaza.com/boe/boe-2026-07-07.rete");
for (const row of g.query("SELECT ?s ?label WHERE { ?s rdfs:label ?label } LIMIT 5")) {
console.log(row.s.value, row.label.toJS());
}
g.stats(); // { fileLength, bytes, requests } — verify laziness
Remote opens work out of the box in Node (built-in sync-fetch bridge) and
in browser web workers. On a browser main thread, pass bytes
(await open(new Uint8Array(buf))) or move the graph into a worker — the
playground's own pattern.
<script src="https://cdn.jsdelivr.net/npm/rete-graph/dist/rete-graph.min.js"></script>
<script>
(async () => {
const g = await rete.open(await rete.build("<urn:a> <urn:knows> <urn:b> ."));
console.log(g.query("ASK { <urn:a> ?p ?o }")); // true
})();
</script>
One self-contained file, engine embedded, global rete. A live worked
example (editor + D3): docs → JS lab.
When embedding the engine in a custom wasm host, build fresh from the
crates — never copy web/pkg (playground artifacts follow their own
pipeline and can lag the engine):
wasm-pack build crates/rete-wasm --target web --out-dir pkg
clients/js/build-wasm.sh is the reference invocation; the exported
surface (open/query/card/schema/shacl/…) is documented in docs/browser.md.
[dependencies] # until the crates.io release:
rete-core = { git = "https://github.com/caviri/rete" }
use rete_core::format::{parse_statements, assemble_dataset, Rete};
use rete_core::query::{eval_query, QueryOutput};
let quads = parse_statements("<urn:a> <urn:knows> <urn:b> .", "nt")?;
let (bytes, _stats) = assemble_dataset(quads, br#"{"source":"example"}"#);
let graph = Rete::open(&bytes)?;
match eval_query(&graph, "SELECT ?o WHERE { <urn:a> <urn:knows> ?o }")? {
QueryOutput::Select(vars, rows) => println!("{vars:?} {} rows", rows.len()),
_ => unreachable!(),
}
Remote/lazy: implement RangeReader (or reuse the CLI's HTTP reader) and
Rete::open_ranged_lazy. Keep a wildcard arm on non-exhaustive enums.
For shell workflows the rete CLI covers build/query/export/serve without
writing Rust.
Every published dataset — and any .rete URL — is a standard SPARQL 1.1
endpoint via the gateway (/sparql/<key-or-url>), so SPARQLWrapper, rdflib,
Jena, or a SERVICE clause need zero rete-specific code. See the
rete-catalog skill for discovery and docs/interop.md for triple-store
round-trips.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/dataset-downloadAcquire and organize a NEW raw dataset under ./data/<name>/ before it becomes a .rete — investigate a source (download page, API, S3/Tigris bucket) to find ALL of its data, scaffold the standard folder layout (raw/ + scripts/ + README + checksums), download robustly (reproducible + resumable + parallel), follow manifest→asset links (nested-JSON URLs, .cif/.png/etc.), and document the schema. Use whenever the task is "download this dataset", "grab all the data from <site>", or "get <source> into ./data" — the step that feeds the rete-from-graph skill./rete-catalogFind, inspect, and open the published .rete datasets from the rete catalog — 60+ public knowledge graphs on range-readable hosting. Use when a task needs an existing dataset (query it, download it, federate it, wire it into an app) rather than building a new one./rete-from-graphBuild a queryable `.rete` file from ANY graph-based data source — an RDF dump (.nt/.nq/.ttl/.rdf/.owl), a SPARQL endpoint, a Wikibase, an OWL ontology, GeoJSON, tabular/CSV, a GBIF Darwin-Core archive, a TEI corpus, or a JSON API. Use whenever the task is "turn this dataset/graph/ontology/endpoint into a .rete" (then hand off to the rete-publish skill to register it in the playground). Covers source→N-Triples conversion, the `rete build` flags, the Docker-only build, and verification./rete-local-queryQuery a LOCAL .rete file efficiently — the lazy range-read path that opens a multi-GB file without loading it whole, which CLI commands are lazy vs read-whole, the tuning knobs (RETE_BLOCK_KB, RETE_LOCAL_LAZY_ABOVE_MB, the 256 MiB block-cache cap), how to preview a query's byte/RAM cost (rete cost / rete why), how to prove a memory bound, and the real memory-scaling limits at billion-triple scale. Use whenever a local query is slow, OOMs, or you need to bound/preview its I/O and RAM. Complements rete-sparql (which is about writing the query)./rete-publishPublish a built `.rete` dataset to the rete playground: generate optional Parquet/DuckDB/SQLite companions, upload files to Cloudflare R2, register the dataset in the catalog, and verify the public Range/CORS contract. Use after rete-from-graph has produced and verified a `.rete` whenever the task is to make a dataset explorable in the playground./rete-sparqlWrite correct SPARQL for .rete graphs — the supported SPARQL 1.1 surface, rete's extensions (OWL 2 QL reasoning, RDF-star, SERVICE federation, text index), result formats, and the recurring gotchas that silently return 0 rows. Use whenever authoring or debugging a SPARQL query against a .rete file, the playground, the Space API, or any client.npx claudepluginhub caviri/rete --plugin rete-graphOther plugins' skills for the same job