Skip to main content

Crate purrdf_entail

Crate purrdf_entail 

Source
Expand description

Native, wasm-clean entailment for the PurRDF RdfDataset IR.

A family of engines sits behind one façade, each the right tool for its regime. The rdfs engine is a forward-materialization (“chase”) reasoner: it closes a dataset’s default graph under a fixed RDFS / OWL-RL rule set to a fixpoint via a native semi-naive evaluator over RdfDataset terms (no Nemo, no tokio, no string round-trip), so this crate stays wasm32-clean and MIT/Apache. Simple is the identity closure; RDFS and OWL-RL run the chase.

The open-world OWL-Direct (Description-Logic tableau) and RIF (rule engine) regimes need inputs the plain materialize façade does not have (the query’s class expressions; a parsed rule set) and are served by dedicated entry points.

It mints no vocabulary IRIs: every constant in vocab is a standard rdf:/rdfs:/owl: IRI from the entailment spec itself. D (datatype) entailment remains an EntailError::Unsupported boundary, which the caller records as a typed, spec-inherent gap.

Re-exports§

pub use rif::Atom;
pub use rif::Fact;
pub use rif::RifTerm;
pub use rif::Rule;
pub use rif::RuleSet;
pub use rif::materialize_rif;

Modules§

rif
The RIF-Core rule-entailment engine.

Structs§

ParsedRifDocument
A parsed RIF document before external imports are resolved.
QTriple
One query triple pattern in the neutral representation the DL layer consumes (so the entailment crate needs no dependency on the SPARQL algebra).
RifImport
One RIF Import directive. Resolving its location is deliberately caller-owned.

Enums§

EntailError
Why a closure could not be produced.
QNode
A node of a query basic-graph-pattern triple: a variable (by name) or a concrete RDF term. Blank nodes in the query are concrete terms (QNode::Term wrapping a TermValue::Blank); the evaluator treats them as non-distinguished variables, but here they are the ground scaffold of a class expression.
Regime
A SPARQL entailment regime (sparql:entailmentRegime), by its W3C IRI’s local name.

Functions§

materialize
Compute the entailment closure of ds under regime.
materialize_dl
Compute the query-directed OWL-Direct augmentation of ds for the basic graph pattern query_bgp, returning a dataset whose simple-entailment answers to that query are the OWL Direct-Semantics certain answers.
parse_rif_xml
Parse normative RIF XML into PurRDF’s monotonic definite-Horn model.
resolve_rif_imports
Resolve imports through a caller callback and merge their materialized default-graph facts into the rule set.