0

我更新了与属性的关系 Expirydate。我想在我的遍历路径中排除所有过期的关系。查询条件是检查Expirydate路径中的所有关系。我得到了错误:

==> SyntaxException: ==> ==> 认为我们应该在这里有更好的错误信息?通过将此查询发送到 cypher@neo4j.org 来帮助我们。

这是查询:

START sNode=node(530) 
MATCH sNode-[r:hasRegisteredPlate|inHouseHoldWith*1..2]->eNode 
WHERE eNode.NodeType = "Plate" and (rel in r:(not has(rel.ExpiryDate) or 
    (has(rel.ExpiryDate) and (rel.ExpiryDate<>'' or rel.ExpiryDate >'2013-10-04')))) 
RETURN eNode LIMIT 20

任何帮助深表感谢

4

1 回答 1

0

You could try using the predicate all.

START sNode=node(530)
MATCH sNode-[r:hasRegisteredPlate|inHouseHoldWith*1..2]->eNode
WHERE eNode.NodeType = "Plate" and all(rel in r
  WHERE (not(has(rel.ExpiryDate)) or (has(rel.ExpiryDate) and (rel.ExpiryDate<>'' or rel.ExpiryDate>'2013-10-04')))
)
RETURN eNode LIMIT 20

You could also try the inverse

WHERE eNode.NodeType = "Plate" and none(rel in r
  WHERE (has(rel.ExpiryDate) and rel.ExpiryDate<'2013-10-04')
)

Note that I haven't tried these, if they don't work perhaps you could setup a sample graph in the neo4j console.

于 2013-10-08T12:39:15.003 回答