account_treeProcesses & flows
pgRDF's operating model is a set of composable verbs you chain with arrows. Each verb is one or two SQL function calls. This section is the verb reference, four worked patterns, and a method for building your own chain.
The verbs
| Verb | What it does | Functions |
|---|---|---|
| Import | Load RDF into a graph. | load_turtle, load_turtle_staged_run, parse_turtle, parse_trig, parse_nquads |
| Seal | Freeze a graph against writes and record its fingerprint. | lock_graph, graph_digest, graph_manifest |
| Carve | Copy a right-sized slice of a graph into a new graph. | carve_graph |
| Reason | Work out what follows from the data (OWL 2 RL or RDFS) and store it beside the asserted triples. | materialize |
| Validate | Check a graph against SHACL shapes and get a report. | validate |
| Query | Read and update with SPARQL 1.1. | sparql, construct, describe |
| Unload | Package a graph as verifiable files, then remove it. | export_graph, graph_manifest, drop_graph |
All seven are available. When a chain uses every verb, they run in this order:
Import ─▶ Seal ─▶ Carve ─▶ Reason ─▶ Validate ─▶ Query ─▶ UnloadMost chains use three or four of them. Load → Query on its own is a complete process.
How each verb scales
| Kind | Verbs | Behaviour |
|---|---|---|
| Parallel | Import | The staged loader spreads the work across background workers, so more cores load faster. It ingested the complete 8.2-billion-triple Wikidata dump into one instance (Scale & benchmarks). |
| One graph, one session | Reason, Validate | Runs in a single database session over one graph. That graph has to fit your hardware. |
| Per query | Query | Planned and run like any other SQL statement, using the indexes. |
| Graph operations | Seal, Carve, Unload | Single function calls that lock, fingerprint, copy, export or remove a graph. |
This is the constraint that shapes every chain: ingest is parallel, reasoning is not. When the source is larger than one session can reason over, load all of it, carve the slice you need into its own graph, and reason over the slice.
The patterns
Four worked chains cover almost every process. Pick one with Choosing a process:
- search Load → Query — the simplest chain: load RDF and query it.
- psychology Load → Reason → Query — materialize what follows from the data, then query it.
- verified Load → Validate → Query — a SHACL conformance gate.
- hub Ingest → Carve → Reason — carve a slice of a large source and reason over the slice.
Build your own
- Building a chain — the method: start from the output, work backwards to the verbs you need, decide whether to carve, and decide what to keep.
- Choosing a process — a decision table from goal and graph size to a pattern.
See also
- query_stats Scale & benchmarks — the ingest numbers these chains build on.
- storage Managing graphs — create, inventory, carve, lock and drop graphs.
- description Identity and export — digests, canonical export and manifests.
- layers_clear The four pillars — the engines the verbs map onto.