Skip to main content

GraphDBTrait

Trait GraphDBTrait 

Source
pub trait GraphDBTrait: Send + Sync {
Show 32 methods // Required methods fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn is_empty<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: '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 = Result<Vec<Vec<Value>>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn delete_graph<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn has_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn add_node_raw<'life0, 'async_trait>( &'life0 self, node: Value, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn add_nodes_raw<'life0, 'async_trait>( &'life0 self, nodes: Vec<Value>, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn delete_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn delete_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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 = Result<bool, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait; fn has_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [(String, String, String, HashMap<Cow<'static, str>, Value>)], ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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 = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait; fn add_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [(String, String, String, HashMap<Cow<'static, str>, Value>)], ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_edges<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_neighbors<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_connections<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(HashMap<Cow<'static, str>, Value>, HashMap<Cow<'static, str>, Value>, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait; fn get_graph_data<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait; fn get_graph_metrics<'life0, 'async_trait>( &'life0 self, include_optional: bool, ) -> Pin<Box<dyn Future<Output = Result<HashMap<Cow<'static, str>, Value>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: '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 = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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 = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait; // Provided methods fn get_degree_one_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_all_relationship_names<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashSet<String>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_zero_degree_edge_type_nodes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, Self: '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 = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: '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 = Result<(), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, Self: 'async_trait { ... } fn get_node_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn set_node_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, updates: &'life1 HashMap<String, f64>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_edge_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, edge_keys: &'life1 [(String, String, String)], ) -> Pin<Box<dyn Future<Output = Result<HashMap<(String, String, String), f64>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn set_edge_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, updates: &'life1 HashMap<(String, String, String), f64>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<(String, String, String), bool>, GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait { ... } fn get_id_filtered_graph_data<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>> where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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 schema
  • is_empty() - Check if database is empty
  • query() - Execute raw query
  • delete_graph() - Remove all data

§Node Operations

  • add_node() - Add single node
  • add_nodes() - Add multiple nodes
  • delete_node() - Delete single node
  • delete_nodes() - Delete multiple nodes
  • get_node() - Get single node
  • get_nodes() - Get multiple nodes
  • has_node() - Check node existence

§Edge Operations

  • add_edge() - Add single edge
  • add_edges() - Add multiple edges
  • has_edge() - Check edge existence
  • has_edges() - Check multiple edges existence
  • get_edges() - Get all edges for a node

§Graph Queries

  • get_neighbors() - Get neighboring nodes
  • get_connections() - Get all connections (nodes + edges)
  • get_graph_data() - Get all nodes and edges
  • get_graph_metrics() - Get graph statistics
  • get_filtered_graph_data() - Get filtered subgraph
  • get_nodeset_subgraph() - Get subgraph for specific nodes

Required Methods§

Source

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

Initialize the database schema.

Creates necessary tables, indexes, and constraints.

Source

fn is_empty<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Check if the database is empty (no nodes).

Source

fn query<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, params: Option<HashMap<Cow<'static, str>, Value>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Value>>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Execute a raw database query.

§Arguments
  • query - Query string (Cypher-like for Ladybug)
  • params - Query parameters
Source

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

Delete the entire graph (all nodes and edges).

Source

fn has_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Check if a node exists by ID.

Source

fn add_node_raw<'life0, 'async_trait>( &'life0 self, node: Value, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Add a single node (type-erased). Takes a pre-serialized JSON value. Prefer GraphDBTraitExt::add_node for typed access.

Source

fn add_nodes_raw<'life0, 'async_trait>( &'life0 self, nodes: Vec<Value>, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Add multiple nodes (type-erased). Takes pre-serialized JSON values. Prefer GraphDBTraitExt::add_nodes for typed access.

Source

fn delete_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Delete a node by ID.

Source

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

Delete multiple nodes by IDs.

Source

fn get_node<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get a single node by ID.

Returns None if node doesn’t exist.

Source

fn get_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get multiple nodes by IDs.

Source

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 = Result<bool, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Check if an edge exists between two nodes.

§Arguments
  • source_id - Source node ID
  • target_id - Target node ID
  • relationship_name - Edge label/relationship type
Source

fn has_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [(String, String, String, HashMap<Cow<'static, str>, Value>)], ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Check which edges exist from a list.

Returns only edges that exist in the database.

Source

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 = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Add a single edge between two nodes.

§Arguments
  • source_id - Source node ID
  • target_id - Target node ID
  • relationship_name - Edge label/relationship type
  • properties - Optional edge properties
Source

fn add_edges<'life0, 'life1, 'async_trait>( &'life0 self, edges: &'life1 [(String, String, String, HashMap<Cow<'static, str>, Value>)], ) -> Pin<Box<dyn Future<Output = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Add multiple edges in a batch operation.

§Arguments
  • edges - Vector of EdgeData tuples
Source

fn get_edges<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get all edges connected to a node.

Returns edges in format: (source_id, target_id, relationship_name, properties)

Source

fn get_neighbors<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<Cow<'static, str>, Value>>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get all neighboring nodes (directly connected).

Source

fn get_connections<'life0, 'life1, 'async_trait>( &'life0 self, node_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(HashMap<Cow<'static, str>, Value>, HashMap<Cow<'static, str>, Value>, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get all connections (nodes + edges) for a node.

Returns: Vec<(source_node, edge_properties, target_node)>

Source

fn get_graph_data<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: '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)>
Source

fn get_graph_metrics<'life0, 'async_trait>( &'life0 self, include_optional: bool, ) -> Pin<Box<dyn Future<Output = Result<HashMap<Cow<'static, str>, Value>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Get graph metrics and statistics.

Returns metrics like node count, edge count, density, etc.

Source

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 = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Get a filtered subgraph based on attribute filters.

§Arguments
  • attribute_filters - Filters as key-value pairs
Source

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 = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Get subgraph for a specific set of nodes.

§Arguments
  • node_type - Type name of nodes to retrieve
  • node_names - Names of specific nodes
  • node_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§

Source

fn get_degree_one_nodes<'life0, 'life1, 'async_trait>( &'life0 self, node_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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.

Source

fn get_all_relationship_names<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HashSet<String>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: '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.

Source

fn get_zero_degree_edge_type_nodes<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, HashMap<Cow<'static, str>, Value>)>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: '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.

Source

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 = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Update a single property on a node.

§Arguments
  • node_id - The node identifier
  • key - Property name
  • value - 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.

Source

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 = Result<(), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, Self: 'async_trait,

Update a single property on an edge.

§Arguments
  • source_id - Source node ID
  • target_id - Target node ID
  • relationship_name - Edge label/relationship type
  • key - Property name
  • value - 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.

Source

fn get_node_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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.

Source

fn set_node_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, updates: &'life1 HashMap<String, f64>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, bool>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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.

Source

fn get_edge_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, edge_keys: &'life1 [(String, String, String)], ) -> Pin<Box<dyn Future<Output = Result<HashMap<(String, String, String), f64>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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.

Source

fn set_edge_feedback_weights<'life0, 'life1, 'async_trait>( &'life0 self, updates: &'life1 HashMap<(String, String, String), f64>, ) -> Pin<Box<dyn Future<Output = Result<HashMap<(String, String, String), bool>, GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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).

Source

fn get_id_filtered_graph_data<'life0, 'life1, 'async_trait>( &'life0 self, node_ids: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<(Vec<(String, HashMap<Cow<'static, str>, Value>)>, Vec<(String, String, String, HashMap<Cow<'static, str>, Value>)>), GraphDBError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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".

Implementors§