紧密中心性算法(查询结果作为输入问题)
发布于 6 年前 作者 444728248 2276 次浏览 来自 问答

第一个apoc查询语句,返回了所有的节点和关系 match (n:DNA_INFO) where n.SAMPLE_NO = '2014C5369P0001DYA2131’ call apoc.path.subgraphAll(n,{}) yield nodes,relationships return nodes,relationships 第二次我想用上面的查询结果来作为紧密中心性的输入 MATCH (node:DNA_INFO) where n.SAMPLE_NO = '2014C5369P0001S01’ call apoc.path.subgraphAll(n,{}) yield nodes,relationships WITH collect(node) AS nodes CALL apoc.algo.betweenness([‘DYA’],nodes,‘BOTH’) YIELD node, score RETURN node, score ORDER BY score DESC 这种写法是错误的,不知道该怎么写,请各位大神解答一下,谢谢?

2 回复

call apoc.path.subgraphAll(n,{}) yield nodes,relationships WITH collect(node) AS nodes collect()里面的node应该是nodes。还有,错误信息是什么?

最新写法 MATCH (node:DNA_INFO) where node.SAMPLE_NO = '2014C5369P0001S01’ call apoc.path.subgraphAll(node,{}) yield nodes,relationships WITH collect(nodes) AS nodes CALL apoc.algo.betweenness([‘DYA’],nodes,‘BOTH’) YIELD node, score RETURN node, score ORDER BY score DESC 错误信息如下: Neo.ClientError.Statement.SyntaxError Type mismatch: expected List<Node> but was List<List<Node>> (line 5, column 36 (offset: 199)) “CALL apoc.algo.betweenness([‘DYA’],nodes,‘BOTH’) YIELD node, score”

回到顶部