Skip to main content

Crate purrdf_validate

Crate purrdf_validate 

Source
Expand description

purrdf-validate — the SARIF 2.1.0 reporting boundary for PurRDF.

PurRDF keeps its kernel (purrdf-core) structured but SARIF-free: parse failures are RdfDiagnostics, SHACL results are ValidationReports, and neither knows anything about SARIF or serde. This crate is where that structured data crosses the boundary into a source-traced, byte-deterministic SARIF 2.1.0 log for editors, CI, and code-scanning dashboards.

§What lives here (and why here)

  • The hand-rolled SARIF serde model (no heavyweight SARIF dependency).
  • The mappings from PurRDF severities/rules/locations to SARIF level/ruleId/physicalLocation/logicalLocation.
  • The resolution of runtime-only provenance ids (UnitId) to public slice IRIs — this is the serialization boundary where S0.5 permits it; the numeric ids never enter the emitted JSON.

Hosting the writer in this leaf keeps the kernel ring-fence intact: purrdf-core and purrdf-shapes never gain a SARIF or serde-derive concern.

§The shared string boundary

SARIF is the crate’s origin, not the whole of it. This is also where the language bindings’ string-in / string-out entry points live, so the C-ABI, WASM and PyO3 callers share one implementation instead of three:

§Portability

Pure serde over the report types — no PyO3, no oxigraph-family edge, no ambient I/O — so the crate stays wasm32-unknown-unknown-clean like every release crate.

Re-exports§

pub use build::SarifOptions;
pub use build::SarifReport;
pub use build::SarifSources;
pub use build::build_diagnostics_sarif;
pub use build::build_report_sarif;
pub use build::build_report_sarif_with;
pub use build::diagnostics_to_sarif_string;
pub use build::report_to_sarif_string;
pub use entail::entail_to_ntriples_string;
pub use model::Level;
pub use model::SARIF_SCHEMA;
pub use model::SARIF_VERSION;
pub use model::SarifLog;
pub use model::to_json_pretty;
pub use regime::ABSENT_DL_PROOF;
pub use regime::DL_PROOF_BANNER;
pub use regime::DL_PROOF_CHECK_BANNER;
pub use regime::DL_PROOF_GOLDEN_VECTORS;
pub use regime::DlProofVector;
pub use regime::INCONSISTENT_DOCUMENT;
pub use regime::ImportList;
pub use regime::PROGRAM_REGIME_NAMES;
pub use regime::PROOF_SERVICE_NAMES;
pub use regime::REGIME_GOLDEN_VECTORS;
pub use regime::REGIME_NAMES;
pub use regime::REPORT_FORMAT_BANNER;
pub use regime::RegimeClosure;
pub use regime::RegimeVector;
pub use regime::certain_answers_to_string;
pub use regime::check_absent_proof_is_not_verifiable;
pub use regime::check_dl_proof;
pub use regime::check_dl_proof_golden_vectors;
pub use regime::check_inconsistent_refusal;
pub use regime::check_regime_golden_vectors;
pub use regime::decode_dl_proof;
pub use regime::dl_proof_golden_vectors;
pub use regime::graph_entails_to_string;
pub use regime::implemented_rules_string;
pub use regime::materialize_to_nquads_string;
pub use regime::parse_regime;
pub use regime::prove_to_string;
pub use regime::regime_golden_vectors;
pub use regime::regime_name;
pub use regime::regime_plan;
pub use regime::regime_rule_set;
pub use regime::render_dl_proof;
pub use regime::render_entail_error;
pub use regime::render_reasoning_report;
pub use regime::rules_string;
pub use regime::verify_entailment_to_string;
pub use shacl::validate_to_sarif_string;

Modules§

build
Map PurRDF reports and diagnostics onto the SARIF model.
entail
SHACL rule entailment → canonical N-Triples in one call — the shared boundary the language bindings (C-ABI, WASM, and the Python caller) all route through.
model
The hand-rolled SARIF 2.1.0 object model PurRDF emits.
path_syntax
Render a SHACL Path as SPARQL property-path syntax.
regime
Entailment-regime materialization → canonical N-Quads and a rendered report, in one call — the shared string boundary every language binding routes through; plus the OWL 2 Direct-Semantics reasoning services, each with its own certificate rendered beside its answer.
rules
SARIF rule metadata for PurRDF rule ids.
shacl
SHACL validation → SARIF 2.1.0 in one call — the shared boundary the language bindings (C-ABI, WASM, and a future Python caller) all route through.