I would like to use the closeness centrality graph algorithm with Neo4jClient a .Net client for neo4j.
The query to use closeness centrality in Cypher is:
CALL algo.closeness.stream('Node', 'LINK')
YIELD nodeId, centrality
RETURN algo.getNodeById(nodeId).id AS node, centrality
ORDER BY centrality DESC
LIMIT 20;
My attempt at a translation to C#:
var clcsCent =
_graphClient.Cypher.Call("algo.closeness.stream('SitePoint', 'SEES')")
.Yield("node,centrality")
.Return((node,centrality)=>new {
Int32 = node.As<Int32>(),
Double = centrality.As<Double>()
})
.Results;
SitePoint
is my class for nodes which have SEES
relationships between them.
The exception I get is:
SyntaxException: Unknown procedure output: `node` (line 2, column 7 (offset:
55))
"YIELD node,centrality"
^
What is the correct C# syntax for this query?