pub trait GraphStore {
// Required methods
fn add_triple(&mut self, graph: &GraphName, triple: Triple) -> Result<bool>;
fn remove_triple(
&mut self,
graph: &GraphName,
triple: &Triple,
) -> Result<bool>;
fn contains_triple(
&self,
graph: &GraphName,
triple: &Triple,
) -> Result<bool>;
fn triples_in_graph(&self, graph: &GraphName) -> Result<Vec<Triple>>;
fn clear_graph(&mut self, graph: &GraphName) -> Result<usize>;
fn drop_graph(&mut self, graph: &GraphName) -> Result<bool>;
}Expand description
Trait for pluggable named-graph triple-store backends
Implementors provide the six core operations needed to manage triples
within named graphs. See NamedGraphManager for an in-memory implementation.
Required Methods§
Sourcefn add_triple(&mut self, graph: &GraphName, triple: Triple) -> Result<bool>
fn add_triple(&mut self, graph: &GraphName, triple: Triple) -> Result<bool>
Add a triple to the given graph
Returns Ok(true) if the triple was newly inserted.
Sourcefn remove_triple(&mut self, graph: &GraphName, triple: &Triple) -> Result<bool>
fn remove_triple(&mut self, graph: &GraphName, triple: &Triple) -> Result<bool>
Remove a triple from the given graph
Returns Ok(true) if the triple was present.
Sourcefn contains_triple(&self, graph: &GraphName, triple: &Triple) -> Result<bool>
fn contains_triple(&self, graph: &GraphName, triple: &Triple) -> Result<bool>
Returns true if the graph contains the triple
Sourcefn triples_in_graph(&self, graph: &GraphName) -> Result<Vec<Triple>>
fn triples_in_graph(&self, graph: &GraphName) -> Result<Vec<Triple>>
Returns an owned list of all triples in the graph
Sourcefn clear_graph(&mut self, graph: &GraphName) -> Result<usize>
fn clear_graph(&mut self, graph: &GraphName) -> Result<usize>
Remove all triples from the graph (graph entry is kept)
Returns the number of triples removed.
Sourcefn drop_graph(&mut self, graph: &GraphName) -> Result<bool>
fn drop_graph(&mut self, graph: &GraphName) -> Result<bool>
Delete the graph and all its triples
Returns Ok(true) if the graph existed.
Implementors§
impl GraphStore for NamedGraphManager
In-memory implementation of GraphStore backed by NamedGraphManager