Skip to main content

PathBackend

Trait PathBackend 

Source
pub trait PathBackend {
    // Required methods
    fn objects(&self, subject: &Term, predicate: &NamedNode) -> HashSet<Term>;
    fn subjects(&self, predicate: &NamedNode, object: &Term) -> HashSet<Term>;
    fn out_predicates(&self, subject: &Term) -> BTreeSet<NamedNode>;
}
Expand description

Storage backend for path evaluation. Exposes the three adjacency primitives succ/pred/sh:closed need, so path evaluation can dispatch to either a linear oxrdf::Graph or the indexed FrozenIndexedDataset.

Required Methods§

Source

fn objects(&self, subject: &Term, predicate: &NamedNode) -> HashSet<Term>

{ o | (subject, predicate, o) ∈ G } — forward step.

Source

fn subjects(&self, predicate: &NamedNode, object: &Term) -> HashSet<Term>

{ s | (s, predicate, object) ∈ G } — backward step.

Source

fn out_predicates(&self, subject: &Term) -> BTreeSet<NamedNode>

Predicates of the outgoing triples of subject (used by sh:closed).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl PathBackend for Graph

Linear backend over oxrdf’s B-tree indexes. Used by inference, whose graph grows during forward chaining and so cannot share an immutable snapshot.

Source§

fn objects(&self, subject: &Term, predicate: &NamedNode) -> HashSet<Term>

Source§

fn subjects(&self, predicate: &NamedNode, object: &Term) -> HashSet<Term>

Source§

fn out_predicates(&self, subject: &Term) -> BTreeSet<NamedNode>

Implementors§

Source§

impl PathBackend for FrozenIndexedDataset

Indexed backend over the dictionary-encoded post-inference snapshot. Built once at the inference→validation boundary and shared across focus nodes; the u32-keyed sorted indexes replace per-call term hashing and B-tree walks. Unknown terms intern to fresh ids that match no stored triple — exactly the empty-result semantics path evaluation needs.