Store

Trait Store 

Source
pub trait Store: Send + Sync {
Show 25 methods // Required methods fn insert_quad(&self, quad: Quad) -> Result<bool>; fn remove_quad(&self, quad: &Quad) -> Result<bool>; fn find_quads( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, graph_name: Option<&GraphName>, ) -> Result<Vec<Quad>>; fn is_ready(&self) -> bool; fn len(&self) -> Result<usize>; fn is_empty(&self) -> Result<bool>; fn query(&self, sparql: &str) -> Result<OxirsQueryResults>; fn prepare_query(&self, sparql: &str) -> Result<PreparedQuery>; // Provided methods fn insert_triple(&self, triple: Triple) -> Result<bool> { ... } fn insert(&self, quad: &Quad) -> Result<()> { ... } fn remove(&self, quad: &Quad) -> Result<bool> { ... } fn quads(&self) -> Result<Vec<Quad>> { ... } fn named_graphs(&self) -> Result<Vec<NamedNode>> { ... } fn graphs(&self) -> Result<Vec<NamedNode>> { ... } fn named_graph_quads(&self) -> Result<Vec<Quad>> { ... } fn default_graph_quads(&self) -> Result<Vec<Quad>> { ... } fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>> { ... } fn clear_all(&self) -> Result<usize> { ... } fn clear_named_graphs(&self) -> Result<usize> { ... } fn clear_default_graph(&self) -> Result<usize> { ... } fn clear_graph(&self, _graph: Option<&GraphName>) -> Result<usize> { ... } fn create_graph(&self, _graph: Option<&NamedNode>) -> Result<()> { ... } fn drop_graph(&self, _graph: Option<&GraphName>) -> Result<()> { ... } fn load_from_url( &self, _url: &str, _graph: Option<&NamedNode>, ) -> Result<usize> { ... } fn triples(&self) -> Result<Vec<Triple>> { ... }
}
Expand description

Store trait for RDF operations

Required Methods§

Source

fn insert_quad(&self, quad: Quad) -> Result<bool>

Insert a quad into the store

Source

fn remove_quad(&self, quad: &Quad) -> Result<bool>

Remove a quad from the store

Source

fn find_quads( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, graph_name: Option<&GraphName>, ) -> Result<Vec<Quad>>

Find quads matching the given pattern

Source

fn is_ready(&self) -> bool

Check if the store is ready for operations

Source

fn len(&self) -> Result<usize>

Get the number of quads in the store

Source

fn is_empty(&self) -> Result<bool>

Check if the store is empty

Source

fn query(&self, sparql: &str) -> Result<OxirsQueryResults>

Query the store with SPARQL

Source

fn prepare_query(&self, sparql: &str) -> Result<PreparedQuery>

Prepare a SPARQL query for execution

Provided Methods§

Source

fn insert_triple(&self, triple: Triple) -> Result<bool>

Insert a triple into the default graph

Source

fn insert(&self, quad: &Quad) -> Result<()>

Insert a quad (compatibility method)

Source

fn remove(&self, quad: &Quad) -> Result<bool>

Remove a quad (compatibility method)

Source

fn quads(&self) -> Result<Vec<Quad>>

Get all quads in the store

Source

fn named_graphs(&self) -> Result<Vec<NamedNode>>

Get all named graphs

Source

fn graphs(&self) -> Result<Vec<NamedNode>>

Get all graphs

Source

fn named_graph_quads(&self) -> Result<Vec<Quad>>

Get quads from named graphs only

Source

fn default_graph_quads(&self) -> Result<Vec<Quad>>

Get quads from the default graph only

Source

fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>>

Get quads from a specific graph

Source

fn clear_all(&self) -> Result<usize>

Clear all data from all graphs

Source

fn clear_named_graphs(&self) -> Result<usize>

Clear all named graphs (but not the default graph)

Source

fn clear_default_graph(&self) -> Result<usize>

Clear the default graph only

Source

fn clear_graph(&self, _graph: Option<&GraphName>) -> Result<usize>

Clear a specific graph

Source

fn create_graph(&self, _graph: Option<&NamedNode>) -> Result<()>

Create a new graph (if it doesn’t exist)

Source

fn drop_graph(&self, _graph: Option<&GraphName>) -> Result<()>

Drop a graph (remove the graph and all its quads)

Source

fn load_from_url(&self, _url: &str, _graph: Option<&NamedNode>) -> Result<usize>

Load data from a URL into a graph

Source

fn triples(&self) -> Result<Vec<Triple>>

Get all triples in the store (converts quads to triples)

Implementors§