Python绑定中Neo4j的Cypher查询,在WHERE子句中进行算术运算

Python绑定中Neo4j的Cypher查询,在WHERE子句中进行算术运算,python,where-clause,neo4j,cypher,arithmetic-expressions,Python,Where Clause,Neo4j,Cypher,Arithmetic Expressions,在python binding v 1.6中对我的neo4j数据库运行以下Cypher查询时遇到问题: START n0 = node:my_nodes(label='1'), n1 = node:my_nodes(label='1'), n2 = node:my_nodes(label='2'), n3 = node:my_nodes(label='2'), n4 = node:my_nodes(label='2') MATCH (n0)-[r0]-(n1),

在python binding v 1.6中对我的neo4j数据库运行以下Cypher查询时遇到问题:

START  n0 = node:my_nodes(label='1'), n1 = node:my_nodes(label='1'), 
       n2 = node:my_nodes(label='2'), n3 = node:my_nodes(label='2'), 
       n4 = node:my_nodes(label='2')
MATCH (n0)-[r0]-(n1),(n0)-[r1]-(n4),(n1)-[r2]-(n2),(n2)-[r3]-(n3)
WHERE (r1.year - r0.year = 1) AND (r2.year - r1.year = 0) AND 
      (r3.year - r2.year = 0)
RETURN count(distinct n0), count(distinct n1),
       count(distinct n2), count(distinct n3),
       count(distinct n4)
我的数据库具有具有索引属性标签的节点,以及具有整数属性年的关系。 执行此查询时,我得到一个错误

in decorator return fn(*args, **kwargs)
org.neo4j.cypher.CypherExceptionPyRaisable: Unclosed parenthesis
"WHERE (r1.label - r0.label = 1) AND 
(r2.label - r1.label = 0) AND (r3.label - r2.label = 0)"
                                                               ^
我已经在这个查询中使用了括号,但没有成功。 有人能帮我解决这个错误吗

编辑:我原以为问题出在使用neo4j嵌入式版本1.6上,但我将其升级到从github编译的版本1.9.dev0,但我仍然得到相同的错误

Edit2:感谢ulkas的评论,我发现了交互式密码控制台,并创建了一个示例图和密码查询,但没有索引部分。查询有问题:

 Error: java.lang.RuntimeException: org.neo4j.helpers.ThisShouldNotHappenError: 
 Developer: Andres claims that: Unexpected traversal state encountered.
Edit3:在玩了控制台之后,我发现它不允许无向关系和菱形模式匹配,而这应该是可以使用的。这就是我在控制台中的工作。在Python中,此查询失败,并显示相同的错误消息Unclosed圆括号。
我仍然可以匹配neo4j中的菱形图案吗?python绑定有什么问题?

您在控制台中尝试过cypher查询吗?无论是cypher还是python相关的问题。