/rete-graph:rete-sparqlfrom rete — cloud-native RDF graphs
Guides writing correct SPARQL 1.1 queries for .rete graphs, covering rete extensions (OWL 2 QL reasoning, RDF-star, SERVICE federation, text index), result formats, and common gotchas that silently return 0 rows.
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.
.rete graphsThe engine speaks SPARQL 1.1 with a few opt-in extensions. This skill is
the practical dialect guide; docs/sparql.md and docs/conformance.md
are the full references.
.rete files are self-describing — never guess vocabulary:
(Client calls: g.card()/schema()/examples(); Space:
/api/datasets/<key>/{card,schema,examples}; CLI: rete card|schema.)
&&/||/!, arithmetic, BOUND,
COALESCE, CONTAINS, STRLEN, SUBSTR, CONCAT, STR, isIRI/isLiteral/
isBlank, DATATYPE, LANG, REGEX.p+ p* p? ^p a/b a|b — evaluated goal-directed
from a bound endpoint; anchor one end (an IRI or an already-bound
variable) or the path enumerates far too much.GRAPH <iri> / GRAPH ?g, FROM, FROM NAMED.<< s p o >> patterns (inner variables allowed) +
isTRIPLE/TRIPLE/SUBJECT/PREDICATE/OBJECT.SERVICE <endpoint> { … } (+ SILENT) against any
SPARQL 1.1 endpoint — including other .rete files via the gateway's
/sparql/<key-or-url> endpoints.reason=true
(clients/Space), --entail (CLI), 🧠 toggle (playground).Rejected loudly, never mis-evaluated: SERVICE ?var, and ORDER BY
key expressions (bare variables/constants only — compute the key in a
BIND first).
?s a bx:Ley silently matches nothing
if bx: isn't the dataset's actual namespace. The schema profile is
the source of truth — copy, don't reconstruct.PREFIX line;
there are no baked-in defaults. When in doubt use full IRIs in
angle brackets — rdf:type has the shortcut a, which always works.COUNT(?x) over-counts under reason=true. Use
COUNT(DISTINCT ?x).?a p+ ?b with both ends free explodes
on big graphs — bind one endpoint.CONTAINS(LCASE(STR(?x)), "…") — or better, the text index.FILTER(CONTAINS(...)) scans every literal. Files built with
--text-index carry a word index that is ~40× faster. SPARQL uses it by
itself where it covers the query (FILTER(CONTAINS(?o, "…")) on a pattern
whose ?o it indexed). The index holds literals only: through STR()
an IRI's text matches too, so CONTAINS(LCASE(STR(?x)), "…") keeps the fast
path only when ?x is provably a literal — add FILTER(isLiteral(?x)), or
search a predicate whose objects are all literals (titles, labels). It is
also a separate API: g.text_search([...]), rete search --contains, the
Space's find_entities, or the playground's search box.
query_raw, Space /api/query):
{kind: select|ask|construct, vars, rows, …} with terms as N-Triples
tokens (<iri>, "lit"^^<dt>, _:b0); clients parse them into Terms.head/results.bindings with
uri/literal/bnode typing): CLI --json, the Space's results field,
and the SPARQL 1.1 protocol endpoints (/sparql/<key>), where
CONSTRUCT/DESCRIBE answer N-Triples.stats() should show a small
fraction of fileLength fetched. Always LIMIT while exploring.PREFIX eli: <http://data.europa.eu/eli/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?law ?title (COUNT(DISTINCT ?amendment) AS ?amendments) WHERE {
?law a eli:LegalResource ; # class IRI copied from schema()
eli:title ?title .
OPTIONAL { ?amendment eli:amends ?law }
}
GROUP BY ?law ?title
ORDER BY DESC(?amendments)
LIMIT 10
With reason=true the same a eli:LegalResource also matches every
subclass (bx:Ley, bx:RealDecreto, …) — that is the reasoning payoff.
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-clientsSet up a rete client in a NEW project — Python, Pyodide/JupyterLite, JavaScript/Node, browser script-tag, your own wasm build, or Rust. Use when wiring .rete querying into an application, notebook, or script; covers install, a verified first query, and the per-runtime gotchas./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.npx claudepluginhub caviri/rete --plugin rete-graphOther plugins' skills for the same job