Skip to main content

Module materialize

Module materialize 

Source
Expand description

OWL 2 RL forward-chaining materialization over NQuin-style triples.

This is the reasoner companion to super::shacl_convert (which only lowers OWL vocabularies into SHACL shapes). Here we compute the OWL 2 RL entailment closure of a triple set by datalog-style fixpoint iteration — the standard PTIME approach to OWL 2 RL — using only fixed caller-supplied buffers (zero heap; no Vec/Box). Three audit capabilities live here:

  1. OWL 2 RL partial materialization — the property/class-axiom rule subset that needs no RDF-list decoding: cax-sco, prp-spo1, prp-dom, prp-rng, prp-symp, prp-trp, prp-inv, prp-fp, prp-ifp, eq-sym, eq-trans, scm-sco, scm-spo, plus equivalence expansion (scm-eqc/scm-eqp), iterated to a fixpoint. This is the polynomial-time core of OWL 2 RL.
  2. Disjointness contradiction isolation (cax-dw) — a violating individual is recorded into a quarantine buffer and the closure keeps going. An inconsistency does NOT explode the graph into “everything entailed”; the rest of the Information-Banking ecosystem stays usable off-grid.
  3. Property-chain axiom unrollingp ⊑ p1 ∘ p2 is composed by the sparse boolean-relation product (the join form of a boolean matrix multiply), supplied as explicit ChainAxioms (the internal form an N3/OWL parser produces from owl:propertyChainAxiom (p1 p2)).

§Complexity

Each fixpoint pass scans a stable prefix of the bounded working set and inserts deduplicated derivations into the tail; iteration stops at a fixpoint or a caller max_iters cap. With a working set bounded by the caller’s buffer this is polynomial and terminates — suitable for constrained hardware.

Structs§

ChainAxiom
A 2-step property chain axiom composed ⊑ first ∘ second. An OWL/N3 parser lowers composed owl:propertyChainAxiom (first second) into this form.
DisjointnessViolation
A recorded cax-dw disjointness contradiction: individual was inferred to be a member of two owl:disjointWith classes. Reported, not fatal.
MaterializeSummary
RdfTriple
A reasoning triple — the (subject, predicate, object) projection of an NQuin. Copy and 24 bytes, so working sets live entirely in caller stack/arena buffers.

Enums§

MaterializeError

Constants§

OWL_DISJOINT_WITH
OWL_EQUIVALENT_CLASS
OWL_EQUIVALENT_PROPERTY
OWL_FUNCTIONAL_PROPERTY
OWL_INVERSE_FUNCTIONAL_PROPERTY
OWL_INVERSE_OF
OWL_SAME_AS
OWL_SYMMETRIC_PROPERTY
OWL_TRANSITIVE_PROPERTY
RDFS_DOMAIN
RDFS_RANGE
RDFS_SUBCLASS_OF
RDFS_SUBPROPERTY_OF
RDF_TYPE

Functions§

materialize_owl_rl
Compute the OWL 2 RL entailment closure of triples[..initial_len] in place.