Then when I execute this query: START gp=node(6) MATCH gp-[:B]->c<-[:B]-mp<-[:SW|G]-u WHERE u.name <> "u1" RETURN mp
... it returns p1 and p2.
Could you explain why I'm getting "p1"?
Or in other terms: I would like to remove p1 from these results because this node is related to a node whose "name" property is "u1".
Cheers,
Marc
Michael Hunger
unread,
May 7, 2012, 12:19:37 PM5/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
b/c there are two paths along which you can reach u1 and you output all the paths.
Michael
Marc de Verdelhan
unread,
May 7, 2012, 3:26:46 PM5/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Ok. I wasn't thinking in graph traversal way.
So now, as I tried to do with my query: starting from gw1, I want to retrieve all the nodes which are related to c1 except those which are related to at least one node whose the "name" property equals "u1". What would be the query for that?
Cheers,
Marc
Michael Hunger
unread,
May 7, 2012, 5:50:02 PM5/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Marc,
the best I came up with is:
START gp=node(6) MATCH gp-[:B]->c<-[:B]-mp<-[:SW|G]-u with mp, collect(u) as us where NONE(n in us where n.name ='u1') return mp
This is my shot at it. There are plans to make this nicer - I'd like to skip the last part of the match (mp-[?]-p) and move that entirely to the WHERE, but not yet.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Andrés,
It seems you misunderstood what I'd like to do. I don't want to keep p1 but to remove it. Michael's solution works on this little graph. I'll test it on a bigger one tomorrow. However there should be a more elegant way to do this.
BTW you're right: moving the last part of the MATCH clause to the WHERE would be nicer.
Thank you guys.
Marc
Marc de Verdelhan
unread,
May 9, 2012, 4:12:47 AM5/9/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ne...@googlegroups.com
Just for saying I found simpler: start gp=node(6) match gp-[:B]->c<-[:B]-mp<-[:SW|G]-u with mp, collect(u.name) as uns where not('u1' in uns) return mp Works well.
Cheers,
Marc
Peter Neubauer
unread,
May 9, 2012, 4:18:14 AM5/9/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message