Skip to main content

Module validate

Module validate 

Source
Expand description

Reference shape satisfaction G, v ⊨ φ and schema validation G ⊨ S (doc 00 §3–§4, Table 2). This is the conformance oracle: the optimized engines in later layers must agree with it.

Two evaluators share the logic: holds returns a bare bool (used for target selection and counting), while explain returns the specific atomic constraints that failed, with the value node and path at which they failed — enough for per-constraint reporting. The ∀π = ∃≤0 π.¬φ encoding lets a failed universal drill straight into the offending value node’s inner constraint.

ShapeEvaluator is the deep module behind every validation-facing API. Its callers provide a graph/path backend, one finalized arena, and a SPARQL executor; they ask only whether a (focus, ShapeId) holds. The evaluator centralizes path traversal, qualified counting, short-circuit Boolean logic, class/value comparisons, opaque SPARQL leaves, and recursion semantics so these concerns are not reimplemented in reporting, inference, or evidence.

Completed judgments are memoized across a whole graph snapshot. The active set is different: encountering an active positive recursive judgment returns the coinductive provisional truth needed for the greatest fixpoint, and that context-dependent answer is deliberately not memoized. This separation is the crucial invariant—cache only conclusions independent of the current recursion proof, while making the recursion rule explicit in one place.

Structs§

EngineOptions
Optional, forward-looking engine configuration. New feature toggles are added here as fields; both validation (ValidationOptions) and compiled inference sessions accept it, so callers configure behavior in one place.
NonStratifiable
The schema is not stratifiable: it recurses through genuine negation, so it has no defined 2-valued semantics (docs/03-recursion-semantics.md). We diagnose rather than guess. Carries the offending shape components.
Reason
A single failed atomic constraint.
ValidationOptions
Controls which retained findings make a validation outcome non-conforming.
ValidationOutcome
The outcome of validating a data graph against a schema.
Violation
One focus node that failed its statement’s shape, with the reasons why.

Enums§

UnsupportedPolicy
How the engine treats SHACL features it only partially supports (rather than silently producing a best-effort, possibly wrong, result).
ValidationGraphMode
Which RDF graph(s) validation uses for focus discovery and evaluation.

Functions§

focus_nodes
The focus nodes selected by a selector.
graph_union
The RDF merge of two graphs (left ∪ right). The standard way to build the context graph the *_with_context repair entry points expect: the union of a data graph and a shapes/ontology graph.
validate
Validate data against schema.
validate_graphs
Validate split data and shapes graphs using the selected graph mode.
validate_graphs_with_mode
Validate split data and shapes graphs using an explicit graph mode.
validate_graphs_with_mode_and_options
Validate split graphs using an explicit graph mode and severity policy.
validate_plan
Validate using a PhysicalPlan (Layer 5): focus nodes come from compiled FocusSources (so class targets seed backward from the constant instead of scanning every node) and checks run over the plan’s cost-ordered arena. The result is identical to validate on the same schema — the W3C harness cross-checks this.
validate_plan_graphs
Validate a physical plan over split graphs using the default graph mode.
validate_plan_graphs_with_mode
Validate a physical plan over split graphs using an explicit graph mode.
validate_plan_graphs_with_mode_and_options
Validate a physical plan over split graphs with an explicit severity policy.
validate_plan_with_context
Validate plan focus nodes from data against the supplied execution context.
validate_plan_with_context_and_options
Validate plan focus nodes against a context with a severity policy.
validate_plan_with_options
Validate a physical plan using an explicit severity policy.
validate_with_context
Validate focus nodes from data while evaluating paths, class hierarchy, and SPARQL against context. For split data/shapes inputs, context should be their RDF union.
validate_with_context_and_options
Validate with separate focus/context graphs and an explicit severity policy.
validate_with_options
Validate data against schema using an explicit severity policy.