pub struct Store { /* private fields */ }Expand description
Oxigraph-compatible store implementation
This provides the same API as oxigraph::Store for compatibility
Uses interior mutability to match Oxigraph’s API where mutations take &self
Implementations§
Source§impl Store
impl Store
Sourcepub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>
Opens a persistent store at the given path
This matches oxigraph::Store::open()
Sourcepub fn insert<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
pub fn insert<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
Inserts a quad into the store
Returns true if the quad was not already present
Sourcepub fn extend<'a>(
&self,
quads: impl IntoIterator<Item = impl Into<QuadRef<'a>>>,
) -> Result<()>
pub fn extend<'a>( &self, quads: impl IntoIterator<Item = impl Into<QuadRef<'a>>>, ) -> Result<()>
Extends the store with an iterator of quads
Sourcepub fn remove<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
pub fn remove<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
Removes a quad from the store
Returns true if the quad was present
Sourcepub fn load_from_reader<R: BufRead>(
&self,
reader: R,
format: RdfFormat,
base_iri: Option<&str>,
graph: Option<impl Into<GraphName>>,
) -> Result<()>
pub fn load_from_reader<R: BufRead>( &self, reader: R, format: RdfFormat, base_iri: Option<&str>, graph: Option<impl Into<GraphName>>, ) -> Result<()>
Loads a file into the store
Sourcepub fn dump_to_writer<'a, W: Write>(
&self,
writer: W,
format: RdfFormat,
graph: Option<impl Into<GraphNameRef<'a>>>,
) -> Result<()>
pub fn dump_to_writer<'a, W: Write>( &self, writer: W, format: RdfFormat, graph: Option<impl Into<GraphNameRef<'a>>>, ) -> Result<()>
Dumps the store content to a writer
Sourcepub fn contains<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
pub fn contains<'a>(&self, quad: impl Into<QuadRef<'a>>) -> Result<bool>
Checks if the store contains a given quad
Sourcepub fn quads_for_pattern<'a>(
&self,
subject: Option<impl Into<SubjectRef<'a>>>,
predicate: Option<impl Into<PredicateRef<'a>>>,
object: Option<impl Into<ObjectRef<'a>>>,
graph_name: Option<impl Into<GraphNameRef<'a>>>,
) -> QuadIter ⓘ
pub fn quads_for_pattern<'a>( &self, subject: Option<impl Into<SubjectRef<'a>>>, predicate: Option<impl Into<PredicateRef<'a>>>, object: Option<impl Into<ObjectRef<'a>>>, graph_name: Option<impl Into<GraphNameRef<'a>>>, ) -> QuadIter ⓘ
Returns an iterator over all quads matching a pattern
Sourcepub fn named_graphs(&self) -> GraphNameIter ⓘ
pub fn named_graphs(&self) -> GraphNameIter ⓘ
Returns all named graphs in the store
Sourcepub fn contains_named_graph<'a>(
&self,
graph_name: impl Into<NamedOrBlankNodeRef<'a>>,
) -> Result<bool>
pub fn contains_named_graph<'a>( &self, graph_name: impl Into<NamedOrBlankNodeRef<'a>>, ) -> Result<bool>
Checks if the store contains a given named graph
Sourcepub fn clear_graph<'a>(
&self,
graph_name: impl Into<GraphNameRef<'a>>,
) -> Result<()>
pub fn clear_graph<'a>( &self, graph_name: impl Into<GraphNameRef<'a>>, ) -> Result<()>
Clears a specific graph
Sourcepub fn query(&self, query: &str) -> Result<QueryResults>
pub fn query(&self, query: &str) -> Result<QueryResults>
Executes a SPARQL query
Sourcepub fn transaction<T, E>(
&self,
f: impl FnOnce(&mut AcidTransaction) -> Result<T, E>,
) -> Result<T, E>where
E: From<OxirsError>,
pub fn transaction<T, E>(
&self,
f: impl FnOnce(&mut AcidTransaction) -> Result<T, E>,
) -> Result<T, E>where
E: From<OxirsError>,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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
Mutably borrows from an owned value. Read more
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>
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 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>
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