MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / graph_pagerank_impl

Method graph_pagerank_impl

nodedb-client/src/native/client/graph.rs:108–123  ·  view source on GitHub ↗
(
        &self,
        collection: &str,
        personalization: Option<&std::collections::HashMap<String, f64>>,
        damping: Option<f64>,
        max_iterations: Option<u32>,
    )

Source from the content-addressed store, hash-verified

106 }
107
108 pub(super) async fn graph_pagerank_impl(
109 &self,
110 collection: &str,
111 personalization: Option<&std::collections::HashMap<String, f64>>,
112 damping: Option<f64>,
113 max_iterations: Option<u32>,
114 ) -> NodeDbResult<Vec<(String, f64)>> {
115 let sql = crate::graph_dsl::build_pagerank_sql(
116 collection,
117 personalization,
118 damping,
119 max_iterations,
120 )?;
121 let result = self.query(&sql).await?;
122 crate::graph_dsl::parse_pagerank_rows(&result.columns, &result.rows)
123 }
124}
125
126/// Build the SQL for `SHOW GRAPH STATS` for the native protocol. Collection

Callers 1

graph_pagerankMethod · 0.45

Calls 3

build_pagerank_sqlFunction · 0.85
parse_pagerank_rowsFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected