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
Java 在Neo4j中使用cypher进行遍历_Java_Neo4j_Cypher - Fatal编程技术网

Java 在Neo4j中使用cypher进行遍历

Java 在Neo4j中使用cypher进行遍历,java,neo4j,cypher,Java,Neo4j,Cypher,我遇到了这样一种情况,即一个节点与多个节点具有外部关系。在到达叶节点之前,这些子节点可以与其他节点具有向外和向内的关系 有没有一种编写密码查询的好方法,基于起始节点,我可以遍历到节点的子节点,然后遍历到它们的相关(向内和向外)节点,依此类推,直到到达叶子。结果应返回找到的所有关系和节点。提前谢谢。也许这太贪婪了,但你可以试试 START a=node(id) //replace with the id of the node you want to start MATCH p=a-[r*]-&

我遇到了这样一种情况,即一个节点与多个节点具有外部关系。在到达叶节点之前,这些子节点可以与其他节点具有向外和向内的关系


有没有一种编写密码查询的好方法,基于起始节点,我可以遍历到节点的子节点,然后遍历到它们的相关(向内和向外)节点,依此类推,直到到达叶子。结果应返回找到的所有关系和节点。提前谢谢。

也许这太贪婪了,但你可以试试

START a=node(id) //replace with the id of the node you want to start 
MATCH p=a-[r*]->x //get all the paths to all nodes
WHERE NOT(x-->()) //exclude nodes with Direction Out Relationships
RETURN p,a,x,r //return whatever you need