Struct rdftk_memgraph::MemGraph [−][src]
pub struct MemGraph { /* fields omitted */ }
Expand description
A very simple in-memory implementation of the Graph
and NamedGraph
traits.
Implementations
impl<'a> MemGraph
[src]
impl<'a> MemGraph
[src]pub fn with(&mut self, statements: StatementList) -> &mut Self
[src]
pub fn with(&mut self, statements: StatementList) -> &mut Self
[src]Construct a new MemGraph
from the list of statements.
pub fn mappings(&mut self, mappings: Rc<dyn PrefixMappings>) -> &mut Self
[src]
pub fn mappings(&mut self, mappings: Rc<dyn PrefixMappings>) -> &mut Self
[src]Construct a new empty MemGraph
with the provided mappings.
Trait Implementations
impl<'a> DataSet<'a, MemGraph> for MemDataSet
[src]
impl<'a> DataSet<'a, MemGraph> for MemDataSet
[src]type GraphIter = Iter<'a, GraphNameRef, MemGraph>
type GraphIter = Iter<'a, GraphNameRef, MemGraph>
The type used to return an iterator over the graph name/graph pairs in this data set. Read more
fn is_empty(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]Returns true
if there are no graphs in this data set, else false
. Read more
fn has_default_graph(&self) -> bool
[src]
fn has_default_graph(&self) -> bool
[src]Return true
if this data set has a default graph, else false
. Read more
fn default_graph(&self) -> &Option<MemGraph>
[src]
fn default_graph(&self) -> &Option<MemGraph>
[src]Return the default graph for this data set, if it exists. Read more
fn has_graph_named(&self, name: &GraphNameRef) -> bool
[src]
fn has_graph_named(&self, name: &GraphNameRef) -> bool
[src]Return true
if this data set has a graph with the provided name, else false
. Read more
fn graph_named(&self, name: &GraphNameRef) -> Option<&MemGraph>
[src]
fn graph_named(&self, name: &GraphNameRef) -> Option<&MemGraph>
[src]Return the graph with the provided name from this data set, if it exists. Read more
fn graphs(&'a self) -> Self::GraphIter
[src]
fn graphs(&'a self) -> Self::GraphIter
[src]Return an iterator over graph name/graph pairs. Read more
fn has_index(&self, _: &DataSetIndex) -> bool
[src]
fn has_index(&self, _: &DataSetIndex) -> bool
[src]Returns true
if this data set has an index of the specified kind, else false
. Read more
fn has_indices(&self, indices: &[DataSetIndex]) -> bool
[src]
fn has_indices(&self, indices: &[DataSetIndex]) -> bool
[src]Returns true
if this data set has *all the specified index kinds, else false
. Read more
impl From<Vec<Rc<Statement>, Global>> for MemGraph
[src]
impl From<Vec<Rc<Statement>, Global>> for MemGraph
[src]fn from(sts: StatementList) -> Self
[src]
fn from(sts: StatementList) -> Self
[src]Performs the conversion.
impl<'a> Graph<'a> for MemGraph
[src]
impl<'a> Graph<'a> for MemGraph
[src]type StatementIter = Iter<'a, StatementRef>
type StatementIter = Iter<'a, StatementRef>
The type used to return an iterator over the statements in this graph. Read more
type FilteredIter = Filter<Iter<'a, StatementRef>, fn(_: &&StatementRef) -> bool>
type FilteredIter = Filter<Iter<'a, StatementRef>, fn(_: &&StatementRef) -> bool>
The type used to return an filtered iterator over the statements in this graph. Read more
fn is_empty(&self) -> bool
[src]
fn is_empty(&self) -> bool
[src]Returns true
if there are no statements in this graph, else false
. Read more
fn contains_subject(&self, subject: &SubjectNodeRef) -> bool
[src]
fn contains_subject(&self, subject: &SubjectNodeRef) -> bool
[src]Returns true
if this graph contains any statement with the provided subject, else false
. Read more
fn contains_individual(&self, subject: &IRIRef) -> bool
[src]
fn contains_individual(&self, subject: &IRIRef) -> bool
[src]Returns true
if this graph contains any statement with the provided IRI as subject, else
false
. Read more
fn contains(&self, statement: &StatementRef) -> bool
[src]
fn contains(&self, statement: &StatementRef) -> bool
[src]Returns true
if this graph contains the provided statement, else false
. Read more
fn contains_all(
&self,
subject: &SubjectNodeRef,
predicate: &IRIRef,
object: &ObjectNodeRef
) -> bool
[src]
fn contains_all(
&self,
subject: &SubjectNodeRef,
predicate: &IRIRef,
object: &ObjectNodeRef
) -> bool
[src]Returns true
if this graph contains the any statement with the provided subject,
predicate, and object, else false
. Read more
fn statements(&'a self) -> Self::StatementIter
[src]
fn statements(&'a self) -> Self::StatementIter
[src]Return an iterator over all the statements in the graph. Read more
fn filter(&'a self, filter: fn(_: &&StatementRef) -> bool) -> Self::FilteredIter
[src]
fn filter(&'a self, filter: fn(_: &&StatementRef) -> bool) -> Self::FilteredIter
[src]Return an iterator over the statements in the graph that match the provided predicate. Read more
fn subjects(&self) -> HashSet<&SubjectNodeRef>
[src]
fn subjects(&self) -> HashSet<&SubjectNodeRef>
[src]Return a set of all subjects in the graph, note that this is a set so that it removes duplicates. Read more
fn predicates(&self) -> HashSet<&IRIRef>
[src]
fn predicates(&self) -> HashSet<&IRIRef>
[src]Return a set of all predicate in the graph, note that this is a set so that it removes duplicates. Read more
fn predicates_for(&self, subject: &SubjectNodeRef) -> HashSet<&IRIRef>
[src]
fn predicates_for(&self, subject: &SubjectNodeRef) -> HashSet<&IRIRef>
[src]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. Read more
fn objects(&self) -> HashSet<&ObjectNodeRef>
[src]
fn objects(&self) -> HashSet<&ObjectNodeRef>
[src]Return a set of all objects in the graph, note that this is a set so that it removes duplicates. Read more
fn objects_for(
&self,
subject: &SubjectNodeRef,
predicate: &IRIRef
) -> HashSet<&ObjectNodeRef>
[src]
fn objects_for(
&self,
subject: &SubjectNodeRef,
predicate: &IRIRef
) -> HashSet<&ObjectNodeRef>
[src]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. Read more
fn has_index(&self, _: &GraphIndex) -> bool
[src]
fn has_index(&self, _: &GraphIndex) -> bool
[src]Returns true
if this graph has an index of the specified kind, else false
. Read more
fn prefix_mappings(&self) -> Rc<dyn PrefixMappings>
[src]
fn prefix_mappings(&self) -> Rc<dyn PrefixMappings>
[src]Returns the set of prefix mappings held by the graph. Read more
fn has_indices(&self, indices: &[GraphIndex]) -> bool
[src]
fn has_indices(&self, indices: &[GraphIndex]) -> bool
[src]Returns true
if this graph has *all the specified index kinds, else false
. Read more
fn value_factory(&self) -> Option<Rc<dyn ValueFactory + 'static>>
[src]
fn value_factory(&self) -> Option<Rc<dyn ValueFactory + 'static>>
[src]Returns the value factory that is associated with this graph, if present. Read more
impl<'a> MutableDataSet<'a, MemGraph> for MemDataSet
[src]
impl<'a> MutableDataSet<'a, MemGraph> for MemDataSet
[src]fn set_default_graph(&mut self, graph: MemGraph)
[src]
fn set_default_graph(&mut self, graph: MemGraph)
[src]Set the provided graph as the default, unnamed graph, for this data set. Only one graph may be the default. Read more
fn unset_default_graph(&mut self)
[src]
fn unset_default_graph(&mut self)
[src]Remove any graph that may be set as the current default. This operation has no effect if no default graph is present. Read more
fn insert(&mut self, name: GraphNameRef, graph: MemGraph)
[src]
fn insert(&mut self, name: GraphNameRef, graph: MemGraph)
[src]Insert a new graph with it’s associated name into the data set. Read more
fn remove(&mut self, name: &GraphNameRef)
[src]
fn remove(&mut self, name: &GraphNameRef)
[src]Remove the graph with the provided name from this data set. This operation has no effect if no such graph is present. Read more
impl<'a> MutableGraph<'a> for MemGraph
[src]
impl<'a> MutableGraph<'a> for MemGraph
[src]fn insert(&mut self, statement: StatementRef)
[src]
fn insert(&mut self, statement: StatementRef)
[src]Insert a new statement into the graph. Read more
fn merge(
&mut self,
other: &'a Rc<dyn Graph<'a, StatementIter = Self::StatementIter, FilteredIter = Self::FilteredIter>>
)
[src]
fn merge(
&mut self,
other: &'a Rc<dyn Graph<'a, StatementIter = Self::StatementIter, FilteredIter = Self::FilteredIter>>
)
[src]Merge another graph into this one. Note that the graphs are required to have the same
implementation type based in the type qualifiers for StatementIter
and FilteredIter
. Read more
fn dedup(&mut self)
[src]
fn dedup(&mut self)
[src]Remove any duplicates within the graph, replacing any number of identical statements with just one. Read more
fn remove(&mut self, statement: &StatementRef)
[src]
fn remove(&mut self, statement: &StatementRef)
[src]Remove any statement that matches the provided. If a graph has duplicates this method does not differentiate between them. Read more
fn remove_all_for(&mut self, subject: &SubjectNodeRef)
[src]
fn remove_all_for(&mut self, subject: &SubjectNodeRef)
[src]Remove all statements from this graph that have the provided subject. Read more
Auto Trait Implementations
impl !RefUnwindSafe for MemGraph
impl !Send for MemGraph
impl !Sync for MemGraph
impl Unpin for MemGraph
impl !UnwindSafe for MemGraph
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more