【发布时间】:2013-08-28 15:18:54
【问题描述】:
我正在 Neo4j 网站上试用 Cypher 示例,其中一个查询让我有点困惑。
共有三个电影节点,分别具有titles“黑客帝国”、“重载黑客帝国”和“黑客帝国革命”。 Matrix 节点有id“603”。
还有三个演员节点,分别是names“Keanu Reeves”、“Laurence Fishburne”和“Carrie-Anne Moss”。
所有演员和所有电影之间都有ACTS_IN关系。
这是一个应该返回所有其他电影的查询,这些电影中的演员在矩阵中演过:
START matrix=node:node_auto_index(id="603")
MATCH (matrix)<-[:ACTS_IN]-(actor)-[:ACTS_IN]->(movie)
RETURN actor.name + ' acts in ' + movie.title;
这是它的(正确)结果:
Keanu Reeves acts in The Matrix Reloaded
Keanu Reeves acts in The Matrix Revolutions
Laurence Fishburne acts in The Matrix Reloaded
Laurence Fishburne acts in The Matrix Revolutions
Carrie-Anne Moss acts in The Matrix Reloaded
Carrie-Anne Moss acts in The Matrix Revolutions
为什么矩阵节点本身没有包含在结果中?
【问题讨论】: