gpt4 book ai didi

neo4j - 升级到 neo4j 2.1 破坏了 Cypher 查询

转载 作者:行者123 更新时间:2023-12-04 20:07:14 26 4
gpt4 key购买 nike

较新版本的 Cypher 不再喜欢我的 OPTIONAL MATCH 子句。
Cypher 2.1 的此查询的正确版本是什么?

Cannot add labels or properties on a node which is already bound (line 1, column 104)
"MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity)
WITH n1, r1, n2
OPTIONAL MATCH (n2:Entity)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50"

最佳答案

你能试一下吗

MATCH (n1:Entity {key:"bloomberg michael"})-[r1:RELATED_TO]-(n2:Entity) 
WITH n1, r1, n2
OPTIONAL MATCH (n2)-[r2:RELATED_TO]-(n3:Entity)
RETURN n1, r1, n2, count(n3), labels(n1), labels(n2)
ORDER BY n2.relevance DESC
LIMIT 50

关于neo4j - 升级到 neo4j 2.1 破坏了 Cypher 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24195879/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com