Skip to main content

GraphStore

Trait GraphStore 

Source
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§

Source

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.

Source

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.

Source

fn contains_triple(&self, graph: &GraphName, triple: &Triple) -> Result<bool>

Returns true if the graph contains the triple

Source

fn triples_in_graph(&self, graph: &GraphName) -> Result<Vec<Triple>>

Returns an owned list of all triples in the graph

Source

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.

Source

fn drop_graph(&mut self, graph: &GraphName) -> Result<bool>

Delete the graph and all its triples

Returns Ok(true) if the graph existed.

Implementors§

Source§

impl GraphStore for NamedGraphManager

In-memory implementation of GraphStore backed by NamedGraphManager