Skip to main content

ArrowGraphStore

Struct ArrowGraphStore 

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

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.

Implementations§

Source§

impl ArrowGraphStore

Source

pub fn new() -> Self

Create a new empty store.

Source

pub fn schema(&self) -> &SchemaRef

Get the triples schema.

Source

pub fn add_triple( &mut self, triple: &Triple, namespace: Namespace, y_layer: YLayer, ) -> Result<String>

Add a single triple to the specified namespace and Y-layer.

Source

pub fn add_batch( &mut self, triples: &[Triple], namespace: Namespace, y_layer: YLayer, ) -> Result<Vec<String>>

Add a batch of triples to the specified namespace and Y-layer. Returns the generated triple IDs.

Source

pub fn query(&self, spec: &QuerySpec) -> Result<Vec<RecordBatch>>

Query triples matching the given spec.

Source

pub fn len(&self) -> usize

Total number of non-deleted triples across all namespaces.

Source

pub fn is_empty(&self) -> bool

Whether the store has no non-deleted triples.

Source

pub fn len_all(&self) -> usize

Total number of triples including deleted.

Source

pub fn delete(&mut self, triple_id: &str) -> Result<bool>

Logically delete a triple by ID (sets deleted=true).

Source

pub fn get_namespace_batches(&self, namespace: Namespace) -> &[RecordBatch]

Get all RecordBatches for a given namespace (including deleted triples).

Source

pub fn set_namespace_batches( &mut self, namespace: Namespace, batches: Vec<RecordBatch>, )

Replace all data for a namespace (used by checkout/restore).

Source

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 (triple_id, caused_by, derived_from) tuples representing the full causal ancestry of the given triple. The first element is always the queried triple itself. Traversal is breadth-first, following both caused_by and derived_from links.

Source

pub fn clear(&mut self)

Clear all data from the store.

Trait Implementations§

Source§

impl Default for ArrowGraphStore

Source§

fn default() -> Self

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

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, 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, 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.