pub struct GraphStore { /* private fields */ }Expand description
In-memory graph store with indexing for fast queries
Implementations§
Source§impl GraphStore
impl GraphStore
pub fn new() -> Self
Sourcepub fn add_triple(&mut self, triple: Triple)
pub fn add_triple(&mut self, triple: Triple)
Add a triple to the default graph
Sourcepub fn add_triple_to_graph(&mut self, graph_name: &str, triple: Triple)
pub fn add_triple_to_graph(&mut self, graph_name: &str, triple: Triple)
Add a triple to a named graph
Sourcepub fn add_triples_to_graph(&mut self, graph_name: &str, triples: Vec<Triple>)
pub fn add_triples_to_graph(&mut self, graph_name: &str, triples: Vec<Triple>)
Add multiple triples to a named graph
Sourcepub fn get_default_graph(&self) -> &NamedGraph
pub fn get_default_graph(&self) -> &NamedGraph
Get all triples from default graph
Sourcepub fn get_graph(&self, name: &str) -> Option<&NamedGraph>
pub fn get_graph(&self, name: &str) -> Option<&NamedGraph>
Get a named graph
Sourcepub fn graph_names(&self) -> Vec<String>
pub fn graph_names(&self) -> Vec<String>
Get all graph names
Sourcepub fn find_triples(
&self,
subject: Option<&str>,
predicate: Option<&str>,
object: Option<&str>,
) -> Vec<&Triple>
pub fn find_triples( &self, subject: Option<&str>, predicate: Option<&str>, object: Option<&str>, ) -> Vec<&Triple>
Find triples matching a pattern (SPARQL-like) - optimized with indexing
Sourcepub fn to_jsonld(&self) -> Result<JsonLdDocument>
pub fn to_jsonld(&self) -> Result<JsonLdDocument>
Convert store to JSON-LD document
Trait Implementations§
Source§impl Clone for GraphStore
impl Clone for GraphStore
Source§impl Debug for GraphStore
impl Debug for GraphStore
Auto Trait Implementations§
impl Freeze for GraphStore
impl RefUnwindSafe for GraphStore
impl Send for GraphStore
impl Sync for GraphStore
impl Unpin for GraphStore
impl UnsafeUnpin for GraphStore
impl UnwindSafe for GraphStore
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