Permalink
Browse files

better cypher query

  • Loading branch information...
1 parent f793d43 commit cd1228f3c719bf0fbe85ed885165ad8cb88ecfcf @peterneubauer committed Jun 11, 2012
@@ -61,9 +61,9 @@ Therefore the clustering coefficient of node 1 is `1/6`.
`n` and `r` are quite simple to retrieve via the follwoing query:""",
queryText = "START a = node(1) " +
"MATCH (a)--(b) " +
- "==== a, b as neighbours ====" +
+ "==== a, count(distinct b) as n ====" +
"MATCH (a)--()-[r]-()--(a) " +
- "RETURN count(distinct neighbours) as n, count(distinct r) as r",
+ "RETURN n, count(distinct r) as r",
returns = "Returns `n` and `r` for the above calculations",
assertions = (p) => assertEquals(List(
Map("n" -> 4, "r" -> 1)), p.toList))

0 comments on commit cd1228f

Please sign in to comment.