pub trait AnalysisDatabase: Send + Sync {
Show 17 methods
// Required methods
fn create_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
params: &'life1 GraphProjectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn check_graph_projection_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_node_degrees<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeMetrics>, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_graph_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<GraphMetrics, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_weakly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_strongly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_louvain_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LouvainConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn calculate_label_propagation_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LabelPropagationConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn calculate_modularity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
community_property: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<f64, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn classify_components_by_geography<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn classify_components_by_asn<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn classify_components_by_family<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_betweenness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
sampling_size: Option<usize>,
sampling_seed: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_closeness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn calculate_combined_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
betweenness_sampling_size: Option<usize>,
betweenness_sampling_seed: Option<u64>,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn analyze_paths_between_communities<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
source_nodes: &'life2 [String],
target_nodes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PathAnalysisResult, AnalysisError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}
Expand description
Trait defining the interface for database operations required by the eRPC analysis engine.
Required Methods§
sourcefn create_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
params: &'life1 GraphProjectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
params: &'life1 GraphProjectionParams,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates or recreates a GDS graph projection. If a projection with the same name exists, it should ideally be dropped and recreated.
sourcefn delete_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_graph_projection<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes an existing GDS graph projection if it exists. Should succeed even if the projection does not exist (making it idempotent).
sourcefn check_graph_projection_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn check_graph_projection_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Checks if a GDS graph projection with the given name exists.
sourcefn calculate_node_degrees<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeMetrics>, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_node_degrees<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<NodeMetrics>, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates node-level degree metrics for all nodes in a given GDS projection. Returns a vector of NodeMetrics containing in-degree, out-degree, and total degree for each node in the graph.
sourcefn calculate_graph_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<GraphMetrics, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_graph_metrics<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<GraphMetrics, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates comprehensive graph metrics for a given GDS projection including basic counts, degree distribution, and degree statistics.
sourcefn calculate_weakly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_weakly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates weakly connected components using Neo4j GDS WCC algorithm. Returns analysis results containing components, sizes, and statistics.
sourcefn calculate_strongly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_strongly_connected_components<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates strongly connected components using Neo4j GDS SCC algorithm. Returns analysis results containing components, sizes, and statistics.
sourcefn calculate_louvain_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LouvainConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn calculate_louvain_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LouvainConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Calculates communities using Neo4j GDS Louvain algorithm. Returns analysis results containing communities, sizes, and statistics.
sourcefn calculate_label_propagation_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LabelPropagationConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn calculate_label_propagation_communities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
params: &'life2 LabelPropagationConfig,
) -> Pin<Box<dyn Future<Output = Result<ComponentAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Calculates communities using Neo4j GDS Label Propagation algorithm. Returns analysis results containing communities, sizes, and statistics.
sourcefn calculate_modularity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
community_property: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<f64, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn calculate_modularity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
community_property: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<f64, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Calculates modularity score for a given community assignment. Higher modularity indicates better community structure.
sourcefn classify_components_by_geography<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn classify_components_by_geography<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Classifies connected components by geographic location (country). Groups relays by country and analyzes their distribution across components.
sourcefn classify_components_by_asn<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn classify_components_by_asn<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Classifies connected components by ASN. Groups relays by ASN and analyzes their distribution across components.
sourcefn classify_components_by_family<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn classify_components_by_family<'life0, 'life1, 'async_trait>(
&'life0 self,
components: &'life1 [ConnectedComponent],
) -> Pin<Box<dyn Future<Output = Result<PartitionClassificationResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Classifies connected components by relay family relationships. Groups relays by family membership and analyzes their distribution across components.
sourcefn calculate_betweenness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
sampling_size: Option<usize>,
sampling_seed: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_betweenness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
sampling_size: Option<usize>,
sampling_seed: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates betweenness centrality for nodes in a GDS projection. Uses Neo4j GDS betweenness centrality algorithm to identify nodes that act as bridges between other nodes.
sourcefn calculate_closeness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_closeness_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates closeness centrality for nodes in a GDS projection. Uses Neo4j GDS closeness centrality algorithm to identify nodes that are close to all other nodes in the network.
sourcefn calculate_combined_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
betweenness_sampling_size: Option<usize>,
betweenness_sampling_seed: Option<u64>,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn calculate_combined_centrality<'life0, 'life1, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
betweenness_sampling_size: Option<usize>,
betweenness_sampling_seed: Option<u64>,
use_wasserman_faust: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<CentralityAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Calculates both betweenness and closeness centrality
sourcefn analyze_paths_between_communities<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
source_nodes: &'life2 [String],
target_nodes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PathAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn analyze_paths_between_communities<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
projection_name: &'life1 str,
source_nodes: &'life2 [String],
target_nodes: &'life3 [String],
) -> Pin<Box<dyn Future<Output = Result<PathAnalysisResult, AnalysisError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Analyzes shortest paths between nodes from different communities. Uses Neo4j GDS shortest path algorithms to understand inter-community connectivity.