pub struct ArrowGraph {
pub nodes: RecordBatch,
pub edges: RecordBatch,
pub indexes: GraphIndexes,
}Fields§
§nodes: RecordBatch§edges: RecordBatch§indexes: GraphIndexesImplementations§
Source§impl ArrowGraph
impl ArrowGraph
Sourcepub fn new(nodes: RecordBatch, edges: RecordBatch) -> Result<Self>
pub fn new(nodes: RecordBatch, edges: RecordBatch) -> Result<Self>
Create a new graph from nodes and edges RecordBatches
Sourcepub fn from_edges(edges: RecordBatch) -> Result<Self>
pub fn from_edges(edges: RecordBatch) -> Result<Self>
Create a graph from just edges (nodes will be inferred)
Sourcepub async fn from_files<P: AsRef<Path>>(
_nodes_path: P,
_edges_path: P,
) -> Result<Self>
pub async fn from_files<P: AsRef<Path>>( _nodes_path: P, _edges_path: P, ) -> Result<Self>
Load graph from Arrow/Parquet files
Sourcepub fn from_tables(nodes: RecordBatch, edges: RecordBatch) -> Result<Self>
pub fn from_tables(nodes: RecordBatch, edges: RecordBatch) -> Result<Self>
Create graph from RecordBatches (alias for new)
Sourcepub async fn sql(&self, _query: &str) -> Result<RecordBatch>
pub async fn sql(&self, _query: &str) -> Result<RecordBatch>
Execute SQL query with graph functions
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Get number of nodes in the graph
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Get number of edges in the graph
Sourcepub fn predecessors(&self, node_id: &str) -> Option<&Vec<String>>
pub fn predecessors(&self, node_id: &str) -> Option<&Vec<String>>
Get predecessors of a node (incoming edges)
Sourcepub fn edge_weight(&self, source: &str, target: &str) -> Option<f64>
pub fn edge_weight(&self, source: &str, target: &str) -> Option<f64>
Get edge weight between two nodes
Sourcepub fn remove_node(&mut self, node_id: &str) -> Result<()>
pub fn remove_node(&mut self, node_id: &str) -> Result<()>
Remove a node from the graph (also removes all incident edges)
Trait Implementations§
Source§impl Clone for ArrowGraph
impl Clone for ArrowGraph
Source§fn clone(&self) -> ArrowGraph
fn clone(&self) -> ArrowGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ArrowGraph
impl !RefUnwindSafe for ArrowGraph
impl Send for ArrowGraph
impl Sync for ArrowGraph
impl Unpin for ArrowGraph
impl !UnwindSafe for ArrowGraph
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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