Skip to content

verifiedPillar 4 — Validation (SHACL Core)

pgrdf.validate(data_graph_id BIGINT, shapes_graph_id BIGINT, mode TEXT DEFAULT 'native') → JSONB validates the data graph against the shapes graph and returns a W3C sh:ValidationReport-shape JSONB document.

The default mode => 'native' is genuine W3C SHACL Core — the full SHACL Core constraint set, conformant against the W3C SHACL Core test suite at 25/25. Backed by the shacl crate from the rudof project. mode => 'sparql' exposes the SHACL-SPARQL surface — see SHACL-SPARQL.

Topics in this pillar

At a glance

sql
SELECT pgrdf.validate(1, 2);
--  → { "conforms": false, "results": [ {...}, {...} ] }

Next — Mental model →

auto_storiesTraining

Validation is the simplest of the four pillars conceptually — one UDF, one report — but the SHACL Core surface is broad. Take the pages in order:

  • info Start with the Mental model — what a shapes graph is, what a validation report is, why this matters.
  • description Run the Worked example — minCount + datatype + nodeKind constraint composition, end-to-end in psql.
  • verified Read the SHACL Core components reference — what's supported and what's not. Bookmark this page.
  • fact_check Then Report as data — SHACL reports are JSONB. Querying violations with regular SQL is the gate-ingestion idiom.
  • verified Then SHACL-SPARQL — the mode => 'sparql' surface for custom constraint components defined as embedded SPARQL; shipped and honest about the upstream-gated execution engine (E-012).

Learn more

MIT licensed. Documentation for pgRDF — built with VitePress, served via GitHub Pages.