Pergunta

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?

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top