Trait rdftk_core::graph::Graph[][src]

pub trait Graph<'a> {
    type StatementIter: Iterator<Item = &'a StatementRef>;
    type FilteredIter: Iterator<Item = &'a StatementRef>;
Show methods fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn contains_subject(&self, subject: &SubjectNodeRef) -> bool;
fn contains_individual(&self, subject: &IRIRef) -> bool;
fn contains(&self, statement: &StatementRef) -> bool;
fn contains_all(
        &self,
        subject: &SubjectNodeRef,
        predicate: &IRIRef,
        object: &ObjectNodeRef
    ) -> bool;
fn statements(&'a self) -> Self::StatementIter;
fn filter(
        &'a self,
        predicate: fn(_: &&StatementRef) -> bool
    ) -> Self::FilteredIter;
fn subjects(&self) -> HashSet<&SubjectNodeRef>;
fn predicates(&self) -> HashSet<&IRIRef>;
fn predicates_for(&self, subject: &SubjectNodeRef) -> HashSet<&IRIRef>;
fn objects(&self) -> HashSet<&ObjectNodeRef>;
fn objects_for(
        &self,
        subject: &SubjectNodeRef,
        predicate: &IRIRef
    ) -> HashSet<&ObjectNodeRef>;
fn has_index(&self, index: &GraphIndex) -> bool;
fn prefix_mappings(&self) -> Rc<dyn PrefixMappings>; fn has_indices(&self, indices: &[GraphIndex]) -> bool { ... }
fn value_factory(&self) -> Option<Rc<dyn ValueFactory>> { ... }
}
Expand description

A graph is an unordered list of statements and may include duplicates. Note that this trait represents an immutable graph, a type should also implement the MutableGraph trait for mutation.

Associated Types

type StatementIter: Iterator<Item = &'a StatementRef>[src]

Expand description

The type used to return an iterator over the statements in this graph.

type FilteredIter: Iterator<Item = &'a StatementRef>[src]

Expand description

The type used to return an filtered iterator over the statements in this graph.

Loading content...

Required methods

fn is_empty(&self) -> bool[src]

Expand description

Returns true if there are no statements in this graph, else false.

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

Expand description

Return the number of statements in this graph.

fn contains_subject(&self, subject: &SubjectNodeRef) -> bool[src]

Expand description

Returns true if this graph contains any statement with the provided subject, else false.

fn contains_individual(&self, subject: &IRIRef) -> bool[src]

Expand description

Returns true if this graph contains any statement with the provided IRI as subject, else false.

fn contains(&self, statement: &StatementRef) -> bool[src]

Expand description

Returns true if this graph contains the provided statement, else false.

fn contains_all(
    &self,
    subject: &SubjectNodeRef,
    predicate: &IRIRef,
    object: &ObjectNodeRef
) -> bool
[src]

Expand description

Returns true if this graph contains the any statement with the provided subject, predicate, and object, else false.

fn statements(&'a self) -> Self::StatementIter[src]

Expand description

Return an iterator over all the statements in the graph.

fn filter(
    &'a self,
    predicate: fn(_: &&StatementRef) -> bool
) -> Self::FilteredIter
[src]

Expand description

Return an iterator over the statements in the graph that match the provided predicate.

fn subjects(&self) -> HashSet<&SubjectNodeRef>[src]

Expand description

Return a set of all subjects in the graph, note that this is a set so that it removes duplicates.

fn predicates(&self) -> HashSet<&IRIRef>[src]

Expand description

Return a set of all predicate in the graph, note that this is a set so that it removes duplicates.

fn predicates_for(&self, subject: &SubjectNodeRef) -> HashSet<&IRIRef>[src]

Expand description

Return a set of all predicate referenced by the provided subject in the graph, note that this is a set so that it removes duplicates.

fn objects(&self) -> HashSet<&ObjectNodeRef>[src]

Expand description

Return a set of all objects in the graph, note that this is a set so that it removes duplicates.

fn objects_for(
    &self,
    subject: &SubjectNodeRef,
    predicate: &IRIRef
) -> HashSet<&ObjectNodeRef>
[src]

Expand description

Return a set of all objects referenced by the provided subject and predicate in the graph, note that this is a set so that it removes duplicates.

fn has_index(&self, index: &GraphIndex) -> bool[src]

Expand description

Returns true if this graph has an index of the specified kind, else false.

fn prefix_mappings(&self) -> Rc<dyn PrefixMappings>[src]

Expand description

Returns the set of prefix mappings held by the graph.

Loading content...

Provided methods

fn has_indices(&self, indices: &[GraphIndex]) -> bool[src]

Expand description

Returns true if this graph has *all the specified index kinds, else false.

fn value_factory(&self) -> Option<Rc<dyn ValueFactory>>[src]

Expand description

Returns the value factory that is associated with this graph, if present.

Loading content...

Implementors

Loading content...