GraphStorage

Trait GraphStorage 

Source
pub trait GraphStorage: Send + Sync {
Show 13 methods // Required methods fn store_graph<'life0, 'life1, 'async_trait>( &'life0 self, graph: &'life1 KnowledgeGraph, ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn load_graph<'life0, 'life1, 'async_trait>( &'life0 self, graph_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<KnowledgeGraph>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn store_nodes<'life0, 'life1, 'async_trait>( &'life0 self, nodes: &'life1 [GraphNode], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn store_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [GraphEdge], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn query_nodes<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 NodeQuery, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn query_edges<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 EdgeQuery, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphEdge>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphNode>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_edge<'life0, 'life1, 'async_trait>( &'life0 self, edge_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphEdge>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_neighbors<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, direction: EdgeDirection, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_edges<'life0, 'life1, 'async_trait>( &'life0 self, edge_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn clear<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Graph storage trait for different storage backends

Required Methods§

Source

fn store_graph<'life0, 'life1, 'async_trait>( &'life0 self, graph: &'life1 KnowledgeGraph, ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store a complete knowledge graph

Source

fn load_graph<'life0, 'life1, 'async_trait>( &'life0 self, graph_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<KnowledgeGraph>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load a complete knowledge graph

Source

fn store_nodes<'life0, 'life1, 'async_trait>( &'life0 self, nodes: &'life1 [GraphNode], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store individual nodes

Source

fn store_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [GraphEdge], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store individual edges

Source

fn query_nodes<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 NodeQuery, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query nodes by criteria

Source

fn query_edges<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 EdgeQuery, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphEdge>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query edges by criteria

Source

fn get_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get node by ID

Source

fn get_edge<'life0, 'life1, 'async_trait>( &'life0 self, edge_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RragResult<Option<GraphEdge>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get edge by ID

Source

fn get_neighbors<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, direction: EdgeDirection, ) -> Pin<Box<dyn Future<Output = RragResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get neighbors of a node

Source

fn delete_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete nodes

Source

fn delete_edges<'life0, 'life1, 'async_trait>( &'life0 self, edge_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete edges

Source

fn clear<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RragResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Clear all data

Source

fn get_stats<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RragResult<StorageStats>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get storage statistics

Implementors§