pub struct RdfStore { /* private fields */ }
Expand description
Main RDF store implementation
Implementations§
Source§impl RdfStore
impl RdfStore
Sourcepub fn new_legacy() -> Result<Self>
pub fn new_legacy() -> Result<Self>
Create a new legacy in-memory store for compatibility
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new persistent store at the given path
Loads existing data from disk if present, otherwise creates a new store.
Sourcepub fn insert_quad(&mut self, quad: Quad) -> Result<bool>
pub fn insert_quad(&mut self, quad: Quad) -> Result<bool>
Insert a quad into the store
Sourcepub fn bulk_insert_quads(&mut self, quads: Vec<Quad>) -> Result<Vec<u64>>
pub fn bulk_insert_quads(&mut self, quads: Vec<Quad>) -> Result<Vec<u64>>
Bulk insert quads for maximum performance
Sourcepub fn insert_triple(&mut self, triple: Triple) -> Result<bool>
pub fn insert_triple(&mut self, triple: Triple) -> Result<bool>
Insert a triple into the default graph
Sourcepub fn insert_string_triple(
&mut self,
subject: &str,
predicate: &str,
object: &str,
) -> Result<bool>
pub fn insert_string_triple( &mut self, subject: &str, predicate: &str, object: &str, ) -> Result<bool>
Insert a triple into the store (legacy string interface)
Sourcepub fn remove_quad(&mut self, quad: &Quad) -> Result<bool>
pub fn remove_quad(&mut self, quad: &Quad) -> Result<bool>
Remove a quad from the store
Sourcepub fn contains_quad(&self, quad: &Quad) -> Result<bool>
pub fn contains_quad(&self, quad: &Quad) -> Result<bool>
Check if a quad exists in the store
Sourcepub fn query_quads(
&self,
subject: Option<&Subject>,
predicate: Option<&Predicate>,
object: Option<&Object>,
graph_name: Option<&GraphName>,
) -> Result<Vec<Quad>>
pub fn query_quads( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, graph_name: Option<&GraphName>, ) -> Result<Vec<Quad>>
Query quads matching the given pattern
None values act as wildcards matching any term.
Sourcepub fn query_triples(
&self,
subject: Option<&Subject>,
predicate: Option<&Predicate>,
object: Option<&Object>,
) -> Result<Vec<Triple>>
pub fn query_triples( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, ) -> Result<Vec<Triple>>
Query triples in the default graph matching the given pattern
Sourcepub fn iter_quads(&self) -> Result<Vec<Quad>>
pub fn iter_quads(&self) -> Result<Vec<Quad>>
Get all quads in the store
Sourcepub fn stats(&self) -> Option<Arc<IndexStats>>
pub fn stats(&self) -> Option<Arc<IndexStats>>
Get performance statistics (ultra-performance mode only)
Sourcepub fn memory_usage(&self) -> Option<MemoryUsage>
pub fn memory_usage(&self) -> Option<MemoryUsage>
Get memory usage statistics (ultra-performance mode only)
Sourcepub fn clear_arena(&self)
pub fn clear_arena(&self)
Clear memory arena to reclaim memory (ultra-performance mode only)
Sourcepub fn query(&self, sparql: &str) -> Result<OxirsQueryResults>
pub fn query(&self, sparql: &str) -> Result<OxirsQueryResults>
Query the store with SPARQL (delegates to QueryExecutor)
pub fn insert(&mut self, quad: &Quad) -> Result<()>
Sourcepub fn remove(&mut self, quad: &Quad) -> Result<bool>
pub fn remove(&mut self, quad: &Quad) -> Result<bool>
Remove a quad (compatibility alias for remove_quad)
Sourcepub fn named_graph_quads(&self) -> Result<Vec<Quad>>
pub fn named_graph_quads(&self) -> Result<Vec<Quad>>
Get all quads from named graphs only
Sourcepub fn default_graph_quads(&self) -> Result<Vec<Quad>>
pub fn default_graph_quads(&self) -> Result<Vec<Quad>>
Get all quads from the default graph only
Sourcepub fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>>
pub fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>>
Get quads from a specific graph
Sourcepub fn clear_named_graphs(&mut self) -> Result<usize>
pub fn clear_named_graphs(&mut self) -> Result<usize>
Clear all named graphs (but not the default graph)
Sourcepub fn clear_default_graph(&mut self) -> Result<usize>
pub fn clear_default_graph(&mut self) -> Result<usize>
Clear the default graph only
Sourcepub fn clear_graph(&mut self, graph: Option<&GraphName>) -> Result<usize>
pub fn clear_graph(&mut self, graph: Option<&GraphName>) -> Result<usize>
Clear a specific graph
Sourcepub fn graphs(&self) -> Result<Vec<NamedNode>>
pub fn graphs(&self) -> Result<Vec<NamedNode>>
Get all graphs (including default if it contains data)
Sourcepub fn named_graphs(&self) -> Result<Vec<NamedNode>>
pub fn named_graphs(&self) -> Result<Vec<NamedNode>>
Get all named graphs
Sourcepub fn create_graph(&mut self, graph: Option<&NamedNode>) -> Result<()>
pub fn create_graph(&mut self, graph: Option<&NamedNode>) -> Result<()>
Create a new graph (if it doesn’t exist)
Trait Implementations§
Source§impl Store for RdfStore
impl Store for RdfStore
Source§fn find_quads(
&self,
subject: Option<&Subject>,
predicate: Option<&Predicate>,
object: Option<&Object>,
graph_name: Option<&GraphName>,
) -> Result<Vec<Quad>>
fn find_quads( &self, subject: Option<&Subject>, predicate: Option<&Predicate>, object: Option<&Object>, graph_name: Option<&GraphName>, ) -> Result<Vec<Quad>>
Source§fn prepare_query(&self, sparql: &str) -> Result<PreparedQuery>
fn prepare_query(&self, sparql: &str) -> Result<PreparedQuery>
Source§fn insert_triple(&self, triple: Triple) -> Result<bool>
fn insert_triple(&self, triple: Triple) -> Result<bool>
Source§fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>>
fn graph_quads(&self, graph: Option<&NamedNode>) -> Result<Vec<Quad>>
Source§fn clear_named_graphs(&self) -> Result<usize>
fn clear_named_graphs(&self) -> Result<usize>
Source§fn clear_default_graph(&self) -> Result<usize>
fn clear_default_graph(&self) -> Result<usize>
Source§fn create_graph(&self, _graph: Option<&NamedNode>) -> Result<()>
fn create_graph(&self, _graph: Option<&NamedNode>) -> Result<()>
Source§fn drop_graph(&self, _graph: Option<&GraphName>) -> Result<()>
fn drop_graph(&self, _graph: Option<&GraphName>) -> Result<()>
Auto Trait Implementations§
impl Freeze for RdfStore
impl !RefUnwindSafe for RdfStore
impl Send for RdfStore
impl Sync for RdfStore
impl Unpin for RdfStore
impl !UnwindSafe for RdfStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more