pub struct ArrowGraphStore { /* private fields */ }Expand description
Convenience re-export of the core store types using string-based namespaces. The core Arrow-native graph store, partitioned by namespace.
Each namespace holds a vector of RecordBatches (appended over time). Queries filter by namespace first, then by column predicates.
Namespaces are arbitrary strings defined at construction time.
Implementations§
Source§impl ArrowGraphStore
impl ArrowGraphStore
Sourcepub fn new(namespaces: &[&str]) -> ArrowGraphStore
pub fn new(namespaces: &[&str]) -> ArrowGraphStore
Create a new empty store with the given namespace partitions.
§Example
use arrow_graph_core::store::ArrowGraphStore;
// Knowledge graph with three partitions
let store = ArrowGraphStore::new(&["world", "code", "self"]);
// Document store with different partitions
let store = ArrowGraphStore::new(&["drafts", "published"]);Sourcepub fn namespaces(&self) -> &[String]
pub fn namespaces(&self) -> &[String]
Get the list of namespace names.
Sourcepub fn add_triple(
&mut self,
triple: &Triple,
namespace: &str,
layer: Option<u8>,
) -> Result<String, StoreError>
pub fn add_triple( &mut self, triple: &Triple, namespace: &str, layer: Option<u8>, ) -> Result<String, StoreError>
Add a single triple to the specified namespace and layer.
The layer parameter is optional — pass None to use layer 0 (default).
Sourcepub fn add_batch(
&mut self,
triples: &[Triple],
namespace: &str,
layer: Option<u8>,
) -> Result<Vec<String>, StoreError>
pub fn add_batch( &mut self, triples: &[Triple], namespace: &str, layer: Option<u8>, ) -> Result<Vec<String>, StoreError>
Add a batch of triples to the specified namespace and layer. Returns the generated triple IDs.
Sourcepub fn query(&self, spec: &QuerySpec) -> Result<Vec<RecordBatch>, StoreError>
pub fn query(&self, spec: &QuerySpec) -> Result<Vec<RecordBatch>, StoreError>
Query triples matching the given spec.
Sourcepub fn delete(&mut self, triple_id: &str) -> Result<bool, StoreError>
pub fn delete(&mut self, triple_id: &str) -> Result<bool, StoreError>
Logically delete a triple by ID (sets deleted=true).
Sourcepub fn get_namespace_batches(&self, namespace: &str) -> &[RecordBatch]
pub fn get_namespace_batches(&self, namespace: &str) -> &[RecordBatch]
Get all RecordBatches for a given namespace (including deleted triples).
Sourcepub fn set_namespace_batches(
&mut self,
namespace: &str,
batches: Vec<RecordBatch>,
)
pub fn set_namespace_batches( &mut self, namespace: &str, batches: Vec<RecordBatch>, )
Replace all data for a namespace (used by checkout/restore).
Sourcepub fn causal_chain(&self, triple_id: &str) -> Vec<CausalNode>
pub fn causal_chain(&self, triple_id: &str) -> Vec<CausalNode>
Follow the caused_by/derived_from chain from a triple to build a derivation graph.
Returns a list of causal nodes representing the full ancestry of the given triple. The first element is always the queried triple itself. Traversal is breadth-first.