Expand description
Validation + SHACL-AF inference execution (Layers 3, 6, 7).
Layer 3 lives here: the naive denotational evaluator that is the conformance
oracle — relational path evaluation (path), value-type checks
(value), and shape/schema satisfaction (validate). The rule/fixpoint
inference engine (Layer 6) and compiled executors (Layer 7) come later; every
execution mode must agree with this oracle.
validate owns semantic satisfaction and is the correctness oracle.
[mod@infer] owns least-fixpoint rule execution over a mutable context.
frozen, the private native executor, and private SPARQL façade form the
indexed/read-only fast path used after inference. evidence and witness
turn oracle conclusions into source-oriented coverage and repair-oriented
derivations. synthesize, enumerate, and gate keep repair
construction, choice, and validation of a proposed edit separate.
Public APIs expose shallow operations; the caches and semantic translations that make them fast and correct remain in their owning modules.
§Reusable document sessions
CompiledShapes::compile admits a loaded shapes document once and retains
its authored schema, normalized schema, function definitions, and rule
schedule. Cloning the handle shares those resources. A physical validation
plan is built lazily, so inference-only sessions do not pay for it.
Create an EvaluationSession with CompiledShapes::session, choosing
SessionData::Separate or SessionData::Embedded and fixed
SessionOptions for inference, graph mode, and engine policy. In Separate
mode, Data evaluates data alone, Union also reads shapes, and UnionAll also
selects focus nodes from shapes. Embedded mode evaluates the evolving data
graph. Every mode binds the authored shapes source as the named
$shapesGraph, including after inference.
SessionOptions::default uses Union mode, disables inference, and ignores
unsupported features. FindingOptions::default selects all entry shapes,
considers all severities, and sorts findings.
A session owns an immutable asserted-data snapshot. Inference runs at
construction; the frozen index is built on the first validation, report,
or evidence operation. EvaluationSession::with_delta edits asserted
data and creates a new session, recomputing inference under the same policy.
The original session and its results remain valid. A selected evidence pair
belongs to exactly one session; passing it to another session’s explain
returns EvaluationError::ForeignPair.
Compilation diagnostics are available from CompiledShapes::diagnostics
and inference diagnostics from EvaluationSession::diagnostics. Strict
unsupported-feature policy can reject session construction. Conformance
scans count logical failures, while finding-based validation applies its
selected minimum severity; their conforms values can therefore differ.
CompiledShapes is Send + Sync and may be shared across workers.
Sessions retain operation-local Rc/RefCell executor state and should be
created separately on each worker.
Re-exports§
pub use compact::CompactError;pub use compact::Sharing;pub use compact::compact;pub use compact::compact_value;pub use compact::expand;pub use compact::expand_value;pub use compact::expand_with_catalog;pub use compact::sharing;pub use compact::to_compact_json;pub use enumerate::EnumOptions;pub use enumerate::FixpointResult;pub use enumerate::RepairSolution;pub use enumerate::candidates;pub use enumerate::enumerate_repair;pub use enumerate::repair_to_fixpoint;pub use evidence::ConformanceOptions;pub use evidence::ConformanceRun;pub use evidence::PreparedEvidenceValidator;pub use evidence::SelectedPair;pub use evidence::validate_graphs_with_evidence;pub use evidence::validate_graphs_with_evidence_and_mode;pub use evidence::validate_graphs_with_evidence_and_mode_and_options;pub use evidence::validate_with_context_and_evidence;pub use evidence::validate_with_context_and_evidence_and_options;pub use evidence::validate_with_evidence;pub use evidence::validate_with_evidence_and_options;pub use gate::RepairOutcome;pub use gate::apply;pub use gate::gate;pub use report::PropertyWitness;pub use report::ValidationReport;pub use report::ValidationResult;pub use report::evaluate_function_expression;pub use report::property_witnesses_graphs_with_mode;pub use report::property_witnesses_graphs_with_mode_and_options;pub use report::report_to_graph;pub use report::validate_report;pub use report::validate_report_graphs;pub use report::validate_report_graphs_with_mode;pub use report::validate_report_graphs_with_mode_and_options;pub use report::validate_report_with_options;pub use sharing::ResultSharing;pub use sharing::result_sharing;pub use synthesize::EvidenceOrigin;pub use synthesize::SynthesizedRepair;pub use synthesize::synthesize;pub use synthesize::synthesize_focus;pub use synthesize::synthesize_focus_with_origins;pub use synthesize::synthesize_with_origins;pub use validate::EngineOptions;pub use validate::NonStratifiable;pub use validate::Reason;pub use validate::UnsupportedPolicy;pub use validate::ValidationGraphMode;pub use validate::ValidationOptions;pub use validate::ValidationOutcome;pub use validate::Violation;pub use validate::focus_nodes;pub use validate::graph_union;pub use validate::validate;pub use validate::validate_graphs;pub use validate::validate_graphs_with_mode;pub use validate::validate_graphs_with_mode_and_options;pub use validate::validate_plan;pub use validate::validate_plan_graphs;pub use validate::validate_plan_graphs_with_mode;pub use validate::validate_plan_graphs_with_mode_and_options;pub use validate::validate_plan_with_context;pub use validate::validate_plan_with_context_and_options;pub use validate::validate_plan_with_options;pub use validate::validate_with_context;pub use validate::validate_with_context_and_options;pub use validate::validate_with_options;pub use witness::BlockReason;pub use witness::ChildEvaluation;pub use witness::ConstraintCatalog;pub use witness::ConstraintRecord;pub use witness::EvaluationProgress;pub use witness::EvaluationStatus;pub use witness::Evidence;pub use witness::EvidenceKind;pub use witness::EvidenceNodeRef;pub use witness::EvidenceRun;pub use witness::EvidenceSummary;pub use witness::Failure;pub use witness::FocusEvaluation;pub use witness::FocusSat;pub use witness::FocusWitness;pub use witness::MissingObligation;pub use witness::PathSupport;pub use witness::QualifiedMatch;pub use witness::RejectedCandidate;pub use witness::RelKind;pub use witness::SatTrace;pub use witness::Satisfaction;pub use witness::StatementEvaluation;pub use witness::Witness;pub use witness::satisfy_shape;pub use witness::shape_id_for_iri;pub use witness::witness_node;pub use witness::witness_shape;pub use witness::witness_violations;
Modules§
- compact
- Compact, lossless encoding of an
EvidenceRun. - enumerate
- The enumeration reference driver (
docs/07-repair-drivers.md§4) and thecandidateshelper (docs/06-repair.md§3.3). - evidence
- Unified evidence-carrying validation.
- frozen
- Dictionary-encoded RDF dataset shared by inference’s native and fallback evaluators. A committed inference batch updates its indexes before the next rule group reads them. Validation selects its own default-graph view over the final inference snapshot without rebuilding the dataset.
- gate
- The re-validation gate (
docs/06-repair.md§8). - path
- Relational evaluation of the path algebra
⟦π⟧^G(doc 00 §2, Table 1). - profile
- Opt-in execution telemetry (doc §269). Collected via a thread-local so no
validation API signatures change. Enable with
enable(), consume withtake(). - report
- W3C
sh:ValidationReportgeneration (component-granular, RDF-driven). - sharing
- How much an
EvidenceRunshares across independently addressable validation results. - synthesize
- Synthesis:
FocusWitness→RepairTree(docs/06-repair.md§6). - validate
- Reference shape satisfaction
G, v ⊨ φand schema validationG ⊨ S(doc 00 §3–§4, Table 2). This is the conformance oracle: the optimized engines in later layers must agree with it. - value
- Evaluation of value types
test(τ)and the term ordering used bysh:lessThan, ranges, etc. Naive reference semantics. - witness
- The witnessing evaluator (
docs/06-repair.md§5) — the structured, lossless sibling ofexplain. For a focus node that fails a statement it returns aFailure: the failed sub-DAG ofφ, pruned to exactly what did not hold, with the structural gap at each node. Its dual,Satisfaction, records why a shape currently holds, so aNot(φ)failure can be repaired by breakingφ. One dispatcher produces both tagged polarities; they are mutually recursive only in their data grammar throughNot.
Structs§
- Compiled
Shapes - A shapes document compiled once for use with many data snapshots.
- Evaluation
Session - Evidence
Options - Execution
Diagnostic - Finding
Options - Session
Options - Sparql
Diagnostic - Debugging detail for one SPARQL-backed constraint evaluation (
sh:sparqlor a custom SPARQL-based constraint component), meant to be attached to a violating report result so a failure is never a dead end: it shows exactly what query ran, what it was bound to, and what rows it actually returned.
Enums§
- Compile
Error - Evaluation
Error - Only
explainandexplain_canonicalcan fail: every other evaluation on a constructed session is total, so those return their value directly. - Session
Data - Session
Error