pub struct SimpleTripleStore { /* private fields */ }Expand description
Lightweight Arrow-native triple store.
Wraps ArrowGraphStore with defaults for namespace and layer,
providing a simplified API.
Implementations§
Source§impl SimpleTripleStore
impl SimpleTripleStore
Sourcepub fn with_defaults(namespace: &str, layer: Option<u8>) -> Self
pub fn with_defaults(namespace: &str, layer: Option<u8>) -> Self
Create with custom namespace and layer defaults.
Sourcepub fn add(
&mut self,
subject: &str,
predicate: &str,
object: &str,
confidence: f64,
source: &str,
) -> Result<String, StoreError>
pub fn add( &mut self, subject: &str, predicate: &str, object: &str, confidence: f64, source: &str, ) -> Result<String, StoreError>
Add a triple. Returns the generated triple ID.
Sourcepub fn add_batch(
&mut self,
triples: &[(&str, &str, &str, f64, &str)],
) -> Result<Vec<String>, StoreError>
pub fn add_batch( &mut self, triples: &[(&str, &str, &str, f64, &str)], ) -> Result<Vec<String>, StoreError>
Add a batch of triples. Returns generated IDs.
Sourcepub fn remove(&mut self, triple_id: &str) -> Result<bool, StoreError>
pub fn remove(&mut self, triple_id: &str) -> Result<bool, StoreError>
Remove a triple by ID. Returns true if found.
Sourcepub fn query(
&self,
subject: Option<&str>,
predicate: Option<&str>,
object: Option<&str>,
) -> Result<Vec<StoredTriple>, StoreError>
pub fn query( &self, subject: Option<&str>, predicate: Option<&str>, object: Option<&str>, ) -> Result<Vec<StoredTriple>, StoreError>
Query triples matching pattern. None means wildcard (match all).
Sourcepub fn count(
&self,
subject: Option<&str>,
predicate: Option<&str>,
object: Option<&str>,
) -> usize
pub fn count( &self, subject: Option<&str>, predicate: Option<&str>, object: Option<&str>, ) -> usize
Count triples matching pattern.
Sourcepub fn get(&self, triple_id: &str) -> Option<StoredTriple>
pub fn get(&self, triple_id: &str) -> Option<StoredTriple>
Get a single triple by ID.
Sourcepub fn update_confidence(
&mut self,
triple_id: &str,
confidence: f64,
) -> Result<bool, StoreError>
pub fn update_confidence( &mut self, triple_id: &str, confidence: f64, ) -> Result<bool, StoreError>
Update confidence on an existing triple. Returns true if found.
Sourcepub fn group_by(
&self,
field: &str,
) -> Result<HashMap<String, usize>, StoreError>
pub fn group_by( &self, field: &str, ) -> Result<HashMap<String, usize>, StoreError>
Group and count triples by a field (“subject”, “predicate”, or “object”).
Sourcepub fn stats(&self) -> StoreStats
pub fn stats(&self) -> StoreStats
Get store statistics.
Sourcepub fn inner(&self) -> &ArrowGraphStore
pub fn inner(&self) -> &ArrowGraphStore
Get a reference to the underlying ArrowGraphStore.
Sourcepub fn inner_mut(&mut self) -> &mut ArrowGraphStore
pub fn inner_mut(&mut self) -> &mut ArrowGraphStore
Get a mutable reference to the underlying ArrowGraphStore.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SimpleTripleStore
impl !RefUnwindSafe for SimpleTripleStore
impl Send for SimpleTripleStore
impl Sync for SimpleTripleStore
impl Unpin for SimpleTripleStore
impl UnsafeUnpin for SimpleTripleStore
impl !UnwindSafe for SimpleTripleStore
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