Trait terminus_store::Layer

source ·
pub trait Layer: Send + Sync {
Show 32 methods fn name(&self) -> [u32; 5]; fn parent_name(&self) -> Option<[u32; 5]>; fn node_and_value_count(&self) -> usize; fn predicate_count(&self) -> usize; fn subject_id(&self, subject: &str) -> Option<u64>; fn predicate_id(&self, predicate: &str) -> Option<u64>; fn object_node_id(&self, object: &str) -> Option<u64>; fn object_value_id(&self, object: &str) -> Option<u64>; fn id_subject(&self, id: u64) -> Option<String>; fn id_predicate(&self, id: u64) -> Option<String>; fn id_object(&self, id: u64) -> Option<ObjectType>; fn id_object_is_node(&self, id: u64) -> Option<bool>; fn all_counts(&self) -> LayerCounts; fn clone_boxed(&self) -> Box<dyn Layer>; fn triple_exists(&self, subject: u64, predicate: u64, object: u64) -> bool; fn triples(&self) -> Box<dyn Iterator<Item = IdTriple> + Send>; fn triples_s(
        &self,
        subject: u64
    ) -> Box<dyn Iterator<Item = IdTriple> + Send>; fn triples_sp(
        &self,
        subject: u64,
        predicate: u64
    ) -> Box<dyn Iterator<Item = IdTriple> + Send>; fn triples_p(
        &self,
        predicate: u64
    ) -> Box<dyn Iterator<Item = IdTriple> + Send>; fn triples_o(&self, object: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>; fn triple_addition_count(&self) -> usize; fn triple_removal_count(&self) -> usize; fn single_triple_sp(&self, subject: u64, predicate: u64) -> Option<IdTriple>; fn id_object_node(&self, id: u64) -> Option<String> { ... } fn id_object_value(&self, id: u64) -> Option<String> { ... } fn id_object_is_value(&self, id: u64) -> Option<bool> { ... } fn id_triple_exists(&self, triple: IdTriple) -> bool { ... } fn string_triple_exists(&self, triple: &StringTriple) -> bool { ... } fn string_triple_to_id(&self, triple: &StringTriple) -> Option<IdTriple> { ... } fn string_triple_to_partially_resolved(
        &self,
        triple: StringTriple
    ) -> PartiallyResolvedTriple { ... } fn id_triple_to_string(&self, triple: &IdTriple) -> Option<StringTriple> { ... } fn triple_count(&self) -> usize { ... }
}
Expand description

A layer containing dictionary entries and triples.

A layer can be queried. To answer queries, layers will check their own data structures, and if they have a parent, the parent is queried as well.

Required Methods§

The name of this layer.

The amount of nodes and values known to this layer. This also counts entries in the parent.

The amount of predicates known to this layer. This also counts entries in the parent.

The numerical id of a subject, or None if the subject cannot be found.

The numerical id of a predicate, or None if the predicate cannot be found.

The numerical id of a node object, or None if the node object cannot be found.

The numerical id of a value object, or None if the value object cannot be found.

The subject corresponding to a numerical id, or None if it cannot be found.

The predicate corresponding to a numerical id, or None if it cannot be found.

The object corresponding to a numerical id, or None if it cannot be found.

Check if the given id refers to a node.

This will return None if the id doesn’t refer to anything.

Create a struct with all the counts

Return a clone of this layer in a box.

Returns true if the given triple exists, and false otherwise.

Iterator over all triples known to this layer.

Returns the total amount of triple additions in this layer and all its parents.

Returns the total amount of triple removals in this layer and all its parents.

Provided Methods§

The object node corresponding to a numerical id, or None if it cannot be found. Panics if the object is actually a value.

The object value corresponding to a numerical id, or None if it cannot be found. Panics if the object is actually a node.

Check if the given id refers to a value.

This will return None if the id doesn’t refer to anything.

Returns true if the given triple exists, and false otherwise.

Returns true if the given triple exists, and false otherwise.

Convert a StringTriple to an IdTriple, returning None if any of the strings in the triple could not be resolved.

Convert all known strings in the given string triple to ids.

Convert an id triple to the corresponding string version, returning None if any of those ids could not be converted.

Returns the total amount of triples in this layer and all its parents.

Implementors§