Neo4j 在一个查询中使用多个关系
我似乎无法让这个问题发挥作用。我要做的就是在数据库中查找与Neo4j 在一个查询中使用多个关系,neo4j,graph-databases,spring-data-neo4j,Neo4j,Graph Databases,Spring Data Neo4j,我似乎无法让这个问题发挥作用。我要做的就是在数据库中查找与类别和关键字匹配的节点 match (n:SiteEntry)-[r:ClassifiedAs]->(c:Category)<-[h:HasKeyword]->(k:Keyword) where c.Label=~'.*Business.*' AND k.Keyword=~'a.*' return n.Url, c.Label, k.Keyword limit 100 匹配(n:SiteEntry)-[r:Clas
类别
和关键字
匹配的节点
match (n:SiteEntry)-[r:ClassifiedAs]->(c:Category)<-[h:HasKeyword]->(k:Keyword)
where c.Label=~'.*Business.*' AND k.Keyword=~'a.*'
return n.Url, c.Label, k.Keyword limit 100
匹配(n:SiteEntry)-[r:ClassifiedAs]->(c:Category)(k:Keyword)
其中c.Label=~'.*Business.*'和k.Keyword=~'a.'
返回n.Url、c.标签、k.关键字限制100
谢谢您没有任何错误吗?除了查询没有优化之外,我已经看到relationship:HasKeyword使用了两个方向,我认为这是不允许的。正如@ChristopherWillemsen所说,
在Cypher中是不合法的。您最多可以从关系实例中退出一个箭头。有趣的是,至少在neo4j 2.1.5中,您的查询不会生成错误,但显然挂起了neo4j服务器。您能提供您的数据集吗?这样就更容易帮助你找出问题所在。