Hi,
I think that something like this should works :
MATCH p=(n:Node { name:"34" })-[:CHILD*]->()
UNWIND nodes(p) AS node
WITH node
WHERE node.name <> "34"
RETURN DISTINCT node
UNION
MATCH p=()-[:CHILD*]->(n:Node { name:"34" })
UNWIND nodes(p) AS node
WITH node
WHERE node.name <> "34"
RETURN DISTINCT node
Cheers.
Le 02/10/2015 15:42, Sukaant Chaudhary a écrit :
Hi,
I've the graph as shown in the image.
My requirement are as follows:
1. We have to search for nodes 1 to n without knowing the depth of the
graph as the depth may vary for all the nodes from 1 to n.
2. Here the relation name at the levels will be same.
3. When we search for say "2 1" then it should give the result as "all
the parents connected above that node and all the child connected
below that node with the relation".
4. The parent and child can be upto any n level and it should give all
the parents and child connected to that node directly or indirectly
with the relation.
5. Consider here for example:
5.1. If "1 1" is searched then it will give the result "2 1", "2 2",
"2 3", "n 1", "n 2", "n 3", "n 4", "n 5" with all the relations from
up to down.
5.2. If "2 3" is searched then it will give the result "1 1", "1 2",
"n 3", "n 4", "n 5" with all the relations from up to down.
5.3. If "n 4" is searched then it will give the result "1 1", "1 2",
"1 3", "2 3", "2 4" with all the relations from up to down.
Inline image 2
Any help will be really appreciated.
-Sukaant Chaudhary
<http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479>
--
You received this message because you are subscribed to the Google
Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.