Neo4j Cypher 1.8版:可能存在关系标识符错误
在上图中,查询Neo4j Cypher 1.8版:可能存在关系标识符错误,neo4j,cypher,Neo4j,Cypher,在上图中,查询 start n=node(7,8,9) match n-[objectScore:score]->o-[:object_of_destination]->d<-[:destination_score]-n, o-[:instance_of]->ot, o-[:date]->oDate, d-[:date]->dDate where ot.name='HOTEL' return n, o, objectScore, d; start
start n=node(7,8,9)
match n-[objectScore:score]->o-[:object_of_destination]->d<-[:destination_score]-n,
o-[:instance_of]->ot, o-[:date]->oDate, d-[:date]->dDate where ot.name='HOTEL'
return n, o, objectScore, d;
start n=节点(7,8,9)
匹配n-[objectScore:score]->o-[:object\u of_destination]->dot,o-[:date]->oDate,d-[:date]->dDate其中ot.name='HOTEL'
返回n,o,objectScore,d;
将o返回为null
更改查询以删除关系标识符-objectScore
start n=node(7,8,9)
match n-[:score]->o-[:object_of_destination]->d<-[:destination_score]-n,
o-[:instance_of]->ot, o-[:date]->oDate, d-[:date]->dDate where ot.name='HOTEL'
return n, o, objectScore, d;
start n=节点(7,8,9)
匹配n-[:得分]->o-[:目标对象]->dot,o-[:日期]->oDate,d-[:日期]->dDate其中ot.name='HOTEL'
返回n,o,objectScore,d;
并且输出正确返回o节点
对于我的场景,我需要两者。不知道怎么做?有什么建议吗。很好。我们在github上跟踪密码问题,因此我在那里发布了一个关于密码的问题: 非常感谢您的报道 编辑:我发现了问题。讽刺的是,一个简单的解决方法是引入一个可选关系。问题在于Cypher可以使用的匹配器之一,通过将模式的一部分标记为可选,您可以强制Cypher使用不同的匹配器。如果你想 因此,请将您的匹配更改为:
match n-[objectScore:score]->o-[:object_of_destination]->d<-[:destination_score]-n,
o-[:instance_of]->ot,
o-[:date]->oDate,
d-[?:date]->dDate
匹配n-[objectScore:score]->o-[:object\u of_destination]->dot,
o-[:日期]->oDate,
d-[?:日期]->dDate
一个真正的解决办法正在进行中。很好的发现。我很想听到答案,但我认为您需要删除
返回。。。objectScore
让它运行第二个查询。只是注释:这在1.9-SNAPSHOT版本中已经修复。该死:自从neo4j存储库合并以来,这个问题已经丢失了。我在哪里可以看到它?