Trait terminus_store::Layer[][src]

pub trait Layer: Send + Sync {
    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 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 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 { ... } }

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

fn name(&self) -> [u32; 5][src]

The name of this layer.

fn parent_name(&self) -> Option<[u32; 5]>[src]

fn node_and_value_count(&self) -> usize[src]

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

fn predicate_count(&self) -> usize[src]

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

fn subject_id(&self, subject: &str) -> Option<u64>[src]

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

fn predicate_id(&self, predicate: &str) -> Option<u64>[src]

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

fn object_node_id(&self, object: &str) -> Option<u64>[src]

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

fn object_value_id(&self, object: &str) -> Option<u64>[src]

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

fn id_subject(&self, id: u64) -> Option<String>[src]

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

fn id_predicate(&self, id: u64) -> Option<String>[src]

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

fn id_object(&self, id: u64) -> Option<ObjectType>[src]

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

fn all_counts(&self) -> LayerCounts[src]

Create a struct with all the counts

fn clone_boxed(&self) -> Box<dyn Layer>[src]

Return a clone of this layer in a box.

fn triple_exists(&self, subject: u64, predicate: u64, object: u64) -> bool[src]

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

fn triples(&self) -> Box<dyn Iterator<Item = IdTriple> + Send>[src]

Iterator over all triples known to this layer.

fn triples_s(&self, subject: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>[src]

fn triples_sp(
    &self,
    subject: u64,
    predicate: u64
) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]

fn triples_p(&self, predicate: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>[src]

fn triples_o(&self, object: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>[src]

fn triple_addition_count(&self) -> usize[src]

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

fn triple_removal_count(&self) -> usize[src]

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

Loading content...

Provided methods

fn id_triple_exists(&self, triple: IdTriple) -> bool[src]

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

fn string_triple_exists(&self, triple: &StringTriple) -> bool[src]

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

fn string_triple_to_id(&self, triple: &StringTriple) -> Option<IdTriple>[src]

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

fn string_triple_to_partially_resolved(
    &self,
    triple: StringTriple
) -> PartiallyResolvedTriple
[src]

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

fn id_triple_to_string(&self, triple: &IdTriple) -> Option<StringTriple>[src]

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

fn triple_count(&self) -> usize[src]

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

Loading content...

Implementors

impl Layer for StoreLayer[src]

impl Layer for SyncStoreLayer[src]

impl<T: 'static + InternalLayerImpl + Send + Sync + Clone> Layer for T[src]

Loading content...