问题
I have a graph in neo4j database. I want to extract a sub graph given a particular node and a particular depth.
I tried using the traversal framework, but it only returns a set of paths. It gives path up to a particular depth.
How can i construct a sub graph based on the set of paths that i get? Is there any other way to get the required result?
回答1:
In case that, by subgraph, you mean a list of nodes, and you've got the Path objects from the traversal already, you could just collect the end nodes of each path in a list.
来源:https://stackoverflow.com/questions/15587173/extracting-subgraph-from-neo4j-database