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.

§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 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.
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.