RdfStore

Struct RdfStore 

Source
pub struct RdfStore { /* private fields */ }
Expand description

Main RDF store implementation

Implementations§

Source§

impl RdfStore

Source

pub fn new() -> Result<Self>

Create a new ultra-high performance in-memory store

Source

pub fn new_legacy() -> Result<Self>

Create a new legacy in-memory store for compatibility

Source

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.

Source

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

Insert a quad into the store

Source

pub fn bulk_insert_quads(&mut self, quads: Vec<Quad>) -> Result<Vec<u64>>

Bulk insert quads for maximum performance

Source

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

Insert a triple into the default graph

Source

pub fn insert_string_triple( &mut self, subject: &str, predicate: &str, object: &str, ) -> Result<bool>

Insert a triple into the store (legacy string interface)

Source

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

Remove a quad from the store

Source

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

Check if a quad exists in the store

Source

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.

Source

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

Source

pub fn iter_quads(&self) -> Result<Vec<Quad>>

Get all quads in the store

Source

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

Get all triples in the default graph

Source

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

Get the number of quads in the store

Source

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

Check if the store is empty

Source

pub fn stats(&self) -> Option<Arc<IndexStats>>

Get performance statistics (ultra-performance mode only)

Source

pub fn memory_usage(&self) -> Option<MemoryUsage>

Get memory usage statistics (ultra-performance mode only)

Source

pub fn clear_arena(&self)

Clear memory arena to reclaim memory (ultra-performance mode only)

Source

pub fn clear(&mut self) -> Result<()>

Clear all data from the store

Source

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

Query the store with SPARQL (delegates to QueryExecutor)

Source

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

Source

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

Remove a quad (compatibility alias for remove_quad)

Source

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

Get all quads in the store

Source

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

Get all quads from named graphs only

Source

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

Get all quads from the default graph only

Source

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

Get quads from a specific graph

Source

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

Clear all data from all graphs

Source

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

Clear all named graphs (but not the default graph)

Source

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

Clear the default graph only

Source

pub fn clear_graph(&mut self, graph: Option<&GraphName>) -> Result<usize>

Clear a specific graph

Source

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

Get all graphs (including default if it contains data)

Source

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

Get all named graphs

Source

pub fn create_graph(&mut self, graph: Option<&NamedNode>) -> Result<()>

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

Source

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

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

Source

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

Load data from a URL into a graph

Trait Implementations§

Source§

impl Debug for RdfStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RdfStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Store for RdfStore

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
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)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,