Skip to content

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 ​

VerbWhat it doesFunctions
ImportLoad RDF into a graph.load_turtle, load_turtle_staged_run, parse_turtle, parse_trig, parse_nquads
SealFreeze a graph against writes and record its fingerprint.lock_graph, graph_digest, graph_manifest
CarveCopy a right-sized slice of a graph into a new graph.carve_graph
ReasonWork out what follows from the data (OWL 2 RL or RDFS) and store it beside the asserted triples.materialize
ValidateCheck a graph against SHACL shapes and get a report.validate
QueryRead and update with SPARQL 1.1.sparql, construct, describe
UnloadPackage 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 ─▶ Unload

Most chains use three or four of them. Load → Query on its own is a complete process.

How each verb scales ​

KindVerbsBehaviour
ParallelImportThe 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 sessionReason, ValidateRuns in a single database session over one graph. That graph has to fit your hardware.
Per queryQueryPlanned and run like any other SQL statement, using the indexes.
Graph operationsSeal, Carve, UnloadSingle 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:

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 ​

pgRDF is released under the MIT license. Documentation built with VitePress, served via GitHub Pages.