-2

Is there a way to extract a subgraph from a neo4j graph database,base on the nodes which I want to exist in my subgraph,so the subgraph will include the declared nodes and their relationships with each other?

I am using neo4j java embedding database.

I searched but did not find about subgraph extraction based on nodes,so I will be really thankful for your great help.

fereshteh
  • 499
  • 5
  • 18
  • The java classes `Node`, `Relationship`, `Path` etc all represent subsections of your graph. If you want to learn how to return nodes and their relationships, please read the tutorial. If you want something else, please explain in more detail what that is. – jjaderberg Oct 24 '13 at 18:11

1 Answers1

0

The below returns all child nodes with their relationships starting from node 0

START n=node(0) 
MATCH n-[r*]->(x) 
RETURN x, r
Aravind Yarram
  • 78,777
  • 46
  • 231
  • 327