pub trait GraphDBTrait: Send + Sync {
Show 32 methods
// Required methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
params: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<Vec<Value>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_graph<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn has_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_node_raw<'life0, 'async_trait>(
&'life0 self,
node: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_nodes_raw<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Value>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + 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 = GraphDBResult<()>> + 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 = GraphDBResult<Option<NodeData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn has_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn has_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn add_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
properties: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn add_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + 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,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_connections<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<(NodeData, HashMap<Cow<'static, str>, Value>, NodeData)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_graph_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_graph_metrics<'life0, 'async_trait>(
&'life0 self,
include_optional: bool,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<Cow<'static, str>, Value>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
attribute_filters: &'life1 HashMap<Cow<'static, str>, Vec<Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_nodeset_subgraph<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
node_names: &'life2 [String],
node_name_filter_operator: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
// Provided methods
fn get_degree_one_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_all_relationship_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashSet<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_zero_degree_edge_type_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn update_node_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
key: &'life2 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn update_edge_property<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
key: &'life4 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait { ... }
fn get_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, f64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn set_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, bool>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_keys: &'life1 [EdgeKey],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, f64>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn set_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<EdgeKey, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, bool>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn get_id_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Graph database interface trait.
This trait defines the complete set of operations for graph database interaction, providing a consistent API for any graph database backend.
§Methods
§Core Operations
initialize()- Set up database schemais_empty()- Check if database is emptyquery()- Execute raw querydelete_graph()- Remove all data
§Node Operations
add_node()- Add single nodeadd_nodes()- Add multiple nodesdelete_node()- Delete single nodedelete_nodes()- Delete multiple nodesget_node()- Get single nodeget_nodes()- Get multiple nodeshas_node()- Check node existence
§Edge Operations
add_edge()- Add single edgeadd_edges()- Add multiple edgeshas_edge()- Check edge existencehas_edges()- Check multiple edges existenceget_edges()- Get all edges for a node
§Graph Queries
get_neighbors()- Get neighboring nodesget_connections()- Get all connections (nodes + edges)get_graph_data()- Get all nodes and edgesget_graph_metrics()- Get graph statisticsget_filtered_graph_data()- Get filtered subgraphget_nodeset_subgraph()- Get subgraph for specific nodes
Required Methods§
Sourcefn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Initialize the database schema.
Creates necessary tables, indexes, and constraints.
Sourcefn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if the database is empty (no nodes).
Sourcefn query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
params: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<Vec<Value>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
params: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<Vec<Value>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute a raw database query.
§Arguments
query- Query string (Cypher-like for Ladybug)params- Query parameters
Sourcefn delete_graph<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_graph<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete the entire graph (all nodes and edges).
Sourcefn has_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a node exists by ID.
Sourcefn add_node_raw<'life0, 'async_trait>(
&'life0 self,
node: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_node_raw<'life0, 'async_trait>(
&'life0 self,
node: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add a single node (type-erased). Takes a pre-serialized JSON value.
Prefer GraphDBTraitExt::add_node for typed access.
Sourcefn add_nodes_raw<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Value>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_nodes_raw<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Value>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add multiple nodes (type-erased). Takes pre-serialized JSON values.
Prefer GraphDBTraitExt::add_nodes for typed access.
Sourcefn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete a node by ID.
Sourcefn delete_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + 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 = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete multiple nodes by IDs.
Sourcefn get_node<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Option<NodeData>>> + 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 = GraphDBResult<Option<NodeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a single node by ID.
Returns None if node doesn’t exist.
Sourcefn get_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get multiple nodes by IDs.
Sourcefn has_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn has_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Check if an edge exists between two nodes.
§Arguments
source_id- Source node IDtarget_id- Target node IDrelationship_name- Edge label/relationship type
Sourcefn has_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check which edges exist from a list.
Returns only edges that exist in the database.
Sourcefn add_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
properties: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_edge<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
properties: Option<HashMap<Cow<'static, str>, Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a single edge between two nodes.
§Arguments
source_id- Source node IDtarget_id- Target node IDrelationship_name- Edge label/relationship typeproperties- Optional edge properties
Sourcefn add_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
edges: &'life1 [EdgeData],
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn get_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_edges<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<EdgeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all edges connected to a node.
Returns edges in format: (source_id, target_id, relationship_name, properties)
Sourcefn get_neighbors<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + 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,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<NodeData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all neighboring nodes (directly connected).
Sourcefn get_connections<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<(NodeData, HashMap<Cow<'static, str>, Value>, NodeData)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_connections<'life0, 'life1, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<(NodeData, HashMap<Cow<'static, str>, Value>, NodeData)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get all connections (nodes + edges) for a node.
Returns: Vec<(source_node, edge_properties, target_node)>
Sourcefn get_graph_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_graph_data<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all nodes and edges in the graph.
Returns: (nodes, edges) where:
- nodes: Vec<(node_id, properties)>
- edges: Vec<(source_id, target_id, relationship_name, properties)>
Sourcefn get_graph_metrics<'life0, 'async_trait>(
&'life0 self,
include_optional: bool,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<Cow<'static, str>, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_graph_metrics<'life0, 'async_trait>(
&'life0 self,
include_optional: bool,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<Cow<'static, str>, Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get graph metrics and statistics.
Returns metrics like node count, edge count, density, etc.
Sourcefn get_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
attribute_filters: &'life1 HashMap<Cow<'static, str>, Vec<Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
attribute_filters: &'life1 HashMap<Cow<'static, str>, Vec<Value>>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a filtered subgraph based on attribute filters.
§Arguments
attribute_filters- Filters as key-value pairs
Sourcefn get_nodeset_subgraph<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
node_names: &'life2 [String],
node_name_filter_operator: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_nodeset_subgraph<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
node_names: &'life2 [String],
node_name_filter_operator: &'life3 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Get subgraph for a specific set of nodes.
§Arguments
node_type- Type name of nodes to retrievenode_names- Names of specific nodesnode_name_filter_operator- “OR” to include neighbors of ANY named node, “AND” to include only neighbors connected to ALL named nodes
Returns nodes and edges connecting them.
Provided Methods§
Sourcefn get_degree_one_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_degree_one_nodes<'life0, 'life1, 'async_trait>(
&'life0 self,
node_type: &'life1 str,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find nodes of the given type that have exactly one edge (any direction).
Used by hard-delete mode to locate orphaned Entity/EntityType nodes that are no longer meaningfully connected after a soft deletion.
Default implementation fetches the full graph and computes degree in memory (O(N+E)). Backends may override with an efficient Cypher/SQL query.
Sourcefn get_all_relationship_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashSet<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_relationship_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashSet<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return the set of all unique relationship names from edges in the graph.
Used by orphan cleanup to determine which EdgeType nodes still have
corresponding edges. Default implementation fetches the full graph via
get_graph_data() and collects distinct relationship names.
Backends may override with a more efficient query.
Sourcefn get_zero_degree_edge_type_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_zero_degree_edge_type_nodes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = GraphDBResult<Vec<GraphNode>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find EdgeType nodes in the graph that have zero edges (degree 0).
Used by hard-delete orphan sweep to find EdgeType nodes whose relationship name no longer appears in any edge.
Default implementation fetches the full graph and filters in memory. Backends may override with a more efficient query.
Sourcefn update_node_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
key: &'life2 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_node_property<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
node_id: &'life1 str,
key: &'life2 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update a single property on a node.
§Arguments
node_id- The node identifierkey- Property namevalue- New property value
Default implementation fetches the node and its edges, modifies the
property, removes the old node (which may cascade-delete edges), re-adds
the node, and restores the edges. Backends should override with an
in-place SET operation for better performance and atomicity.
Sourcefn update_edge_property<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
key: &'life4 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn update_edge_property<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
source_id: &'life1 str,
target_id: &'life2 str,
relationship_name: &'life3 str,
key: &'life4 str,
value: Value,
) -> Pin<Box<dyn Future<Output = GraphDBResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Update a single property on an edge.
§Arguments
source_id- Source node IDtarget_id- Target node IDrelationship_name- Edge label/relationship typekey- Property namevalue- New property value
Default implementation is a no-op that logs a warning. Backends that support in-place edge property updates should override this method.
Sourcefn get_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, f64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, f64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Batch-fetch feedback_weight values for the given node IDs.
Returns only IDs that exist and have a numeric feedback_weight
property. IDs missing from the graph or missing the property are
omitted from the result map.
Default implementation calls [get_node] per id; backends should
override with a single batch query for efficiency.
Sourcefn set_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_node_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<String, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<String, bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Batch-write feedback_weight values on the given nodes.
Returns a map node_id -> success indicating whether each update
succeeded. Default implementation delegates to update_node_property
for each id; backends should override with a single batch query.
Sourcefn get_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_keys: &'life1 [EdgeKey],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, f64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
edge_keys: &'life1 [EdgeKey],
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, f64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Batch-fetch feedback_weight values for the given edges.
Default implementation returns an empty map and logs a warning,
because the generic GraphDBTrait does not expose a per-edge
property read. Backends that support edge-property queries should
override this method.
Sourcefn set_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<EdgeKey, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_edge_feedback_weights<'life0, 'life1, 'async_trait>(
&'life0 self,
updates: &'life1 HashMap<EdgeKey, f64>,
) -> Pin<Box<dyn Future<Output = GraphDBResult<HashMap<EdgeKey, bool>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Batch-write feedback_weight values on the given edges.
Default implementation delegates to [update_edge_property] per
edge. Backends with no edge-update support will silently succeed
(because the default update_edge_property returns Ok(()) with
a warning).
Sourcefn get_id_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_id_filtered_graph_data<'life0, 'life1, 'async_trait>(
&'life0 self,
node_ids: &'life1 [String],
) -> Pin<Box<dyn Future<Output = GraphDBResult<(Vec<GraphNode>, Vec<EdgeData>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a subgraph containing only the specified nodes and edges between them.
Default implementation fetches the full graph and filters in memory. Backends may override this with a more efficient query.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".