pub trait GraphView {
// Required methods
fn objects(&self, subject: &str, predicate: &str) -> Vec<String>;
fn subjects_with(&self, predicate: &str, object: &str) -> Vec<String>;
fn subjects_of(&self, predicate: &str) -> Vec<String>;
fn objects_of(&self, predicate: &str) -> Vec<String>;
fn predicates_for_subject(&self, subject: &str) -> Vec<String>;
fn all_nodes(&self) -> Vec<String>;
// Provided methods
fn is_subclass_of(&self, child: &str, parent: &str) -> bool { ... }
fn subclasses_of(&self, parent: &str) -> BTreeSet<String> { ... }
fn instances_of(&self, class: &str) -> Vec<String> { ... }
fn is_instance_of(&self, node: &str, class: &str) -> bool { ... }
}Expand description
A read-only view of the data graph for SHACL validation. The validator only
ever asks targeted questions — a focus node’s values, the subjects of a
predicate, the instances of a class — so this surface is small enough to back
two ways: an in-memory triple set (DataGraph, eager) or a .rete file’s
index directly (ReteGraph), which routes each lookup as a range read so a
remote validation faults only the tiles holding the shapes’ targets, not the
whole graph. The class/instance helpers are derived from the primitives, so a
backend only implements the six lookups.
Required Methods§
Sourcefn objects(&self, subject: &str, predicate: &str) -> Vec<String>
fn objects(&self, subject: &str, predicate: &str) -> Vec<String>
Objects of (subject, predicate, ?).
Sourcefn subjects_with(&self, predicate: &str, object: &str) -> Vec<String>
fn subjects_with(&self, predicate: &str, object: &str) -> Vec<String>
Subjects of (?, predicate, object).
Sourcefn subjects_of(&self, predicate: &str) -> Vec<String>
fn subjects_of(&self, predicate: &str) -> Vec<String>
Distinct subjects of (?, predicate, ?).
Sourcefn objects_of(&self, predicate: &str) -> Vec<String>
fn objects_of(&self, predicate: &str) -> Vec<String>
Distinct objects of (?, predicate, ?).
Sourcefn predicates_for_subject(&self, subject: &str) -> Vec<String>
fn predicates_for_subject(&self, subject: &str) -> Vec<String>
Distinct predicates of (subject, ?, ?).
Provided Methods§
Sourcefn is_subclass_of(&self, child: &str, parent: &str) -> bool
fn is_subclass_of(&self, child: &str, parent: &str) -> bool
Is child a reflexive/transitive rdfs:subClassOf of parent?
Sourcefn subclasses_of(&self, parent: &str) -> BTreeSet<String>
fn subclasses_of(&self, parent: &str) -> BTreeSet<String>
The (transitive) subclasses of parent.
Sourcefn instances_of(&self, class: &str) -> Vec<String>
fn instances_of(&self, class: &str) -> Vec<String>
Instances of class (direct, or via a subclass).
Sourcefn is_instance_of(&self, node: &str, class: &str) -> bool
fn is_instance_of(&self, node: &str, class: &str) -> bool
Is node an instance of class (direct, or via a subclass)?
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".