Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Neo4j 在一个查询中使用多个关系_Neo4j_Graph Databases_Spring Data Neo4j - Fatal编程技术网

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服务器。您能提供您的数据集吗?这样就更容易帮助你找出问题所在。