Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4J中的Club Two查询_Neo4j_Cypher - Fatal编程技术网

Neo4J中的Club Two查询

Neo4J中的Club Two查询,neo4j,cypher,Neo4j,Cypher,我编写了一个单独的查询,用于查找根和最短路径。我想通过这两个查询来查找网络以及根节点和最短路径网络之间的连接。我写了一个查询作为 match (u:Port1)<-[r]-(root) where not((root)<--()) with distinct(root.id) as Node match p = ( (Node)-[]->(n)-[:LinkTo*1..]->(m) ) where id(Node)< id(n) < id(m) return

我编写了一个单独的查询,用于查找根和最短路径。我想通过这两个查询来查找网络以及根节点和最短路径网络之间的连接。我写了一个查询作为

match (u:Port1)<-[r]-(root)
where not((root)<--())
with  distinct(root.id) as Node
match p = ( (Node)-[]->(n)-[:LinkTo*1..]->(m) )
where id(Node)< id(n) < id(m)
return p, (length(p)) order by length(p) desc limit 10
匹配(u:Port1)(m))
其中id(Node)
我的问题对吗?我得到一个错误

Neo.DatabaseError.Statement.ExecutionFailed:应在节点上找到节点,但找到了2


任何人都可以更正我的CQL查询吗?

希望在节点上找到一个节点,但实际上找到了2
表示您的标识符
节点应该是节点,但不是,这是因为您正在将其设置为节点id
根.id
。 使用
根节点本身-


比赛(u:Port1)(m))
其中id(Node)

使用
和distinct(root)作为节点
我已经将该语句放入了代码中。我应该再放一遍吗?我应该把它放在哪里?你的查询中没有这个。您将
和distinct(root.id)作为节点
。然后尝试使用
节点
匹配下一行。但这会失败,因为
节点
是一个整数id,而不是节点。因此,将该行替换为:
,并使用distinct(root)作为节点
,这样变量就绑定到一个节点而不是一个整数。我认为代码已经达到了时间和空间的复杂性。它没有返回任何结果。我在GrapheneDB中试过。没有结果返回!还有什么需要进一步修改的吗?你能澄清一下吗?难道它根本就没有回来,只是永远地奔跑?或者它正在回归,但没有结果?如果它正在返回但没有结果,那么查询有问题。您可以检查以确保标签和关系的拼写和大小写正确,并且查询中确实存在您要查找的模式。