sparq
Back to Capabilities

SHACL

Validate RDF data against shapes — SHACL Core, SHACL-SPARQL, the W3C validation report, and a live SHACL Compact Syntax view.

Live in your tab
Live SHACL validator
Engine loading…

sparq-shacl validates a graph against SHACL Core + SHACL-SPARQL constraints and returns a W3C validation report (conformance plus per-violation results); the playground above runs the validator in your tab via the SHACL-enabled wasm bundle that @jeswr/sparq ships.

What it does

  • SHACL Core constraintsclass, datatype, cardinality, value ranges, node/property shapes, paths, plus and / or / not / xone, qualified & closed shapes.
  • SHACL-SPARQL (§5.2)sh:sparql constraints expressed as SPARQL SELECT over the engine.
  • Custom constraint components (§6)Define new sh:ConstraintComponent backed by SPARQL.
  • W3C validation reportConformance boolean + sh:result violations, as Turtle or human text.
  • SHACL Compact Syntax (in + out)Author shapes in the W3C compact notation (parsed in-tab to a shapes graph) and render any shapes graph back to compact form.

Live in your browser tab — the validator is pure Rust over the engine compiled to the SHACL-enabled wasm bundle, so the conformance flag and per-violation report come back with no network round-trip.

Reproduce: cargo test -p sparq-shacl

Caveats & limitations

SHACL-SPARQL constraints rely on the engine’s REGEX, which the SHACL bundle keeps (the lean SPARQL REPL bundle compiles it out), so sh:sparql validates in-tab too. The in-tab validator is sized for small documents (~10–100 triples); validate large graphs server-side via the sparq-server HTTP validate path.

SHACL Compact Syntax works both ways. The input direction (compact text → shapes) parses in-tab via the engine’s parseShaclCompact binding — switch the shapes editor to Compact to author shapes in the terser notation and validate against them unchanged. The display direction (shapes → compact) is best-effort: the notation has no form for logical constraints or shape references, which the view lists explicitly rather than dropping.

Crate READMESKILL.mdSource on GitHub