or cypher:
start n=node(400)
match p = n-[:REL*4]-m
return distinct m
for just the nodes contained in the subgraph, or
return p
for all the paths from the start-node
Michael
Am 23.07.2012 um 20:57 schrieb Graph01:
> Try gremlin. This query will return a subgraph (just the nodes) of length 4 around node 400:
> g.v(400).as('origin').both('REL').dedup.loop('origin'){it.loops<=4}
> You can use "aggregate" to save the edges of the subgraph.
> On Monday, July 23, 2012 10:07:13 PM UTC+3, Didymus wrote:
> Hi,
> Let me first preface this by saying that I am new to using neo4j. I have looked a little bit into the docs and couldn't figure out a query that expresses exactly what I wanna do. I would like to know the easiest way to perform a query/queries that returns a subgraph of a particular relationship around a given node with a limit on the max length of an unconnected path (a path which doesn't connect back to the start).
> Thanks