neo4j - 使用REDUCE函数的Cypher查询抛出未知标识符错误

时间:2014-08-25 17:36:06

标签: neo4j cypher

我正在尝试网站http://gist.neo4j.org/?8173017中的推荐样本。

从网站加载电影数据集并尝试运行查询

MATCH (p1:Person)-[x:RATED]->(m:Movie)<-[y:RATED]-(p2:Person)
WITH  SUM(x.rating * y.rating) AS xyDotProduct,
      SQRT(REDUCE(xDot = 0.0, a IN COLLECT(x.rating) | xDot + a^2)) AS xLength,
      SQRT(REDUCE(yDot = 0.0, b IN COLLECT(y.rating) | yDot + b^2)) AS yLength,
      p1, p2
MERGE (p1)-[s:SIMILARITY]-(p2)
SET   s.similarity = xyDotProduct / (xLength * yLength)

抛出以下错误

Unknown identifier `xDot`. 

Neo.ClientError.Statement.InvalidSyntax

我正在使用neo4j 2.1.2

0 个答案:

没有答案