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".
> 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".
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?
> 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".
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
> 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
> On Mon, May 7, 2012 at 6:19 PM, Michael Hunger <michael.hun...@neotechnology.com> wrote:
> b/c there are two paths along which you can reach u1 and you output all the paths.
> Michael
> Am 07.05.2012 um 18:04 schrieb Marc de Verdelhan:
>> 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".
> 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.
START gw1=node(6)
MATCH gw1-[:B]->c<-[:B]-mp-[?:B]-p
WHERE p is null or p.name!="u1"
RETURN mp
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.
> On Mon, May 7, 2012 at 11:50 PM, Michael Hunger <
> michael.hun...@neotechnology.com> wrote:
>> 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.
> START gw1=node(6)
> MATCH gw1-[:B]->c<-[:B]-mp-[?:B]-p
> WHERE p is null or p.name!="u1"
> RETURN mp
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
On Tue, May 8, 2012 at 9:28 AM, Marc de Verdelhan <
> 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
> On Tue, May 8, 2012 at 8:28 AM, Andres Taylor <
> andres.tay...@neotechnology.com> wrote:
>> On Mon, May 7, 2012 at 11:50 PM, Michael Hunger <
>> michael.hun...@neotechnology.com> wrote:
>>> 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.
>> START gw1=node(6)
>> MATCH gw1-[:B]->c<-[:B]-mp-[?:B]-p
>> WHERE p is null or p.name!="u1"
>> RETURN mp
<marc.deverdel...@yahoo.com> wrote:
> 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
> On Tue, May 8, 2012 at 9:28 AM, Marc de Verdelhan
> <marc.deverdel...@yahoo.com> wrote:
>> 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
>> On Tue, May 8, 2012 at 8:28 AM, Andres Taylor
>> <andres.tay...@neotechnology.com> wrote:
>>> On Mon, May 7, 2012 at 11:50 PM, Michael Hunger
>>> <michael.hun...@neotechnology.com> wrote:
>>>> 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.
>>> START gw1=node(6)
>>> MATCH gw1-[:B]->c<-[:B]-mp-[?:B]-p
>>> WHERE p is null or p.name!="u1"
>>> RETURN mp