Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Fw: [Neo4j] Cypher Query Filtering Friends of Friends nodes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Bolton  
View profile  
 More options Jul 31 2012, 5:34 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Tue, 31 Jul 2012 14:34:54 -0700 (PDT)
Local: Tues, Jul 31 2012 5:34 pm
Subject: Fw: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com> wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Cypher Query Filtering Friends of Friends nodes" by Michael Hunger
Michael Hunger  
View profile  
 More options Jul 31 2012, 5:41 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Tue, 31 Jul 2012 23:41:16 +0200
Local: Tues, Jul 31 2012 5:41 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

No, thats pretty good, until cypher gets some more functiions/operators to work with paths.

Is this the depth you need in the end?

Michael

Am 31.07.2012 um 23:34 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Jul 31 2012, 5:43 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Tue, 31 Jul 2012 14:43:15 -0700 (PDT)
Local: Tues, Jul 31 2012 5:43 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Jul 31 2012, 6:24 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Wed, 1 Aug 2012 00:24:36 +0200
Local: Tues, Jul 31 2012 6:24 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

What do you mean by removing the initial node?

Michael

Am 31.07.2012 um 23:43 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Jul 31 2012, 6:26 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Tue, 31 Jul 2012 15:26:24 -0700 (PDT)
Local: Tues, Jul 31 2012 6:26 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

http://console.neo4j.org/?id=elexsz
This returns z, which results in two rows, the reference node and the result node. How do I get it to omit the reference node?

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 3:24 PM

What do you mean by removing the initial node?
Michael
Am 31.07.2012 um 23:43 schrieb Chris Bolton:
I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to
 work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns
 the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Jul 31 2012, 6:36 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Wed, 1 Aug 2012 00:36:58 +0200
Local: Tues, Jul 31 2012 6:36 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

add an

AND z<>n

in your where clause.

Michael

Am 01.08.2012 um 00:26 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Jul 31 2012, 6:36 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Tue, 31 Jul 2012 15:36:59 -0700 (PDT)
Local: Tues, Jul 31 2012 6:36 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 3:36 PM

add an 
AND z<>n
in your where clause.
Michael
Am 01.08.2012 um 00:26 schrieb Chris Bolton:
http://console.neo4j.org/?id=elexsz
This returns z, which results in two rows, the reference node and the result node. How do I get it to omit the reference node?

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date:
 Tuesday, July 31, 2012, 3:24 PM

What do you mean by removing the initial node?
Michael
Am 31.07.2012 um 23:43 schrieb Chris Bolton:
I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to
 work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns
 the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Aug 1 2012, 1:35 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Wed, 1 Aug 2012 10:35:35 -0700 (PDT)
Local: Wed, Aug 1 2012 1:35 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Michael (or anyone else who might be able to help),
I added the z<>n and now it only returns the reference node...twice.
In the console it works perfectly but in my Neo4j shell it's breaking (http://console.neo4j.org/?id=elexsz).
START n=node(4) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) AND z<>n RETURN z
I'm using Neo4j - Graph Database Kernel 1.7
Any help would be appreciated.
Chris 

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 3:36 PM

add an 
AND z<>n
in your where clause.
Michael
Am 01.08.2012 um 00:26 schrieb Chris Bolton:
http://console.neo4j.org/?id=elexsz
This returns z, which results in two rows, the reference node and the result node. How do I get it to omit the reference node?

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date:
 Tuesday, July 31, 2012, 3:24 PM

What do you mean by removing the initial node?
Michael
Am 31.07.2012 um 23:43 schrieb Chris Bolton:
I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to
 work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns
 the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Aug 1 2012, 3:57 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Wed, 1 Aug 2012 21:57:57 +0200
Local: Wed, Aug 1 2012 3:57 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

can you put n<>z at the beginning of the where

in 1.7 there was an issue with NOT and parentheses which grabbed too much of an expression.

Michael

Am 01.08.2012 um 19:35 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Aug 1 2012, 4:20 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Wed, 1 Aug 2012 13:20:30 -0700 (PDT)
Local: Wed, Aug 1 2012 4:20 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Michael,
Okay the z <> n is working but I realized my blocked_friends is not working. I tried re-writing the query with your original suggestion of using WITH but I don't think it's supported in 1.7. Mind taking a look. Again it works in the play console but in the shell it breaks.
START n=node(4) MATCH (n)-[:friends]->(x)-[:friends]->(z) WHERE n <>z AND (x-[:friends]->n AND z-[:friends]->x) AND NOT(n-[:blocked_friends]->x OR x-[:blocked_friends]->z) RETURN z
Chris

--- On Wed, 8/1/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Wednesday, August 1, 2012, 12:57 PM

can you put n<>z at the beginning of the where
in 1.7 there was an issue with NOT and parentheses which grabbed too much of an expression.
Michael 
Am 01.08.2012 um 19:35 schrieb Chris Bolton:
Michael (or anyone else who might be able to help),
I added the z<>n and now it only returns the reference node...twice.
In the console it works perfectly but in my Neo4j shell it's breaking (http://console.neo4j.org/?id=elexsz).
START n=node(4) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) AND z<>n RETURN z
I'm using Neo4j - Graph Database Kernel 1.7
Any help would be appreciated.
Chris 

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 3:36
 PM

add an 
AND z<>n
in your where clause.
Michael
Am 01.08.2012 um 00:26 schrieb Chris Bolton:
http://console.neo4j.org/?id=elexsz
This returns z, which results in two rows, the reference node and the result node. How do I get it to omit the reference node?

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date:
 Tuesday, July 31, 2012, 3:24 PM

What do you mean by removing the initial node?
Michael
Am 31.07.2012 um 23:43 schrieb Chris Bolton:
I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to
 work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns
 the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Aug 1 2012, 5:02 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Wed, 1 Aug 2012 23:02:00 +0200
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

No with is not supported in 1.7
and the NOT() issue was also only fixed in 1.8

Sorry

Michael

Am 01.08.2012 um 22:20 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Hunger  
View profile  
 More options Aug 1 2012, 5:02 pm
From: Michael Hunger <michael.hun...@neotechnology.com>
Date: Wed, 1 Aug 2012 23:02:21 +0200
Local: Wed, Aug 1 2012 5:02 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Btw. you can set the console to a certain version in the upper right corner.

Michael

Am 01.08.2012 um 22:20 schrieb Chris Bolton:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Bolton  
View profile  
 More options Aug 1 2012, 5:07 pm
From: Chris Bolton <iknewthis...@yahoo.com>
Date: Wed, 1 Aug 2012 14:07:27 -0700 (PDT)
Local: Wed, Aug 1 2012 5:07 pm
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes

Thanks Michael.

--- On Wed, 8/1/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Wednesday, August 1, 2012, 2:02 PM

Btw. you can set the console to a certain version in the upper right corner.
Michael
Am 01.08.2012 um 22:20 schrieb Chris Bolton:
Michael,
Okay the z <> n is working but I realized my blocked_friends is not working. I tried re-writing the query with your original suggestion of using WITH but I don't think it's supported in 1.7. Mind taking a look. Again it works in the play console but in the shell it breaks.
START n=node(4) MATCH (n)-[:friends]->(x)-[:friends]->(z) WHERE n <>z AND (x-[:friends]->n AND z-[:friends]->x) AND NOT(n-[:blocked_friends]->x OR x-[:blocked_friends]->z) RETURN z
Chris

--- On Wed, 8/1/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Wednesday, August 1, 2012, 12:57 PM

can you put n<>z at the beginning of the where
in 1.7 there was an issue with NOT and parentheses which grabbed too much of an expression.
Michael 
Am 01.08.2012 um 19:35 schrieb Chris Bolton:
Michael (or anyone else who might be able to help),
I added the z<>n and now it only returns the reference node...twice.
In the console it works perfectly but in my Neo4j shell it's breaking (http://console.neo4j.org/?id=elexsz).
START n=node(4) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND
 NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) AND z<>n RETURN z
I'm using Neo4j - Graph Database Kernel 1.7
Any help would be appreciated.
Chris 

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 3:36
 PM

add an 
AND z<>n
in your where clause.
Michael
Am 01.08.2012 um 00:26 schrieb Chris Bolton:
http://console.neo4j.org/?id=elexsz
This returns z, which results in two rows, the reference node and the result node. How do I get it to omit the reference node?

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date:
 Tuesday, July 31, 2012, 3:24 PM

What do you mean by removing the initial node?
Michael
Am 31.07.2012 um 23:43 schrieb Chris Bolton:
I realized after I sent the initial email that I copied my query from my code into the email which uses lower case as opposed to the console where I used upper case (don't ask me why). Sorry about that.
What about removing the initial node in my results? 
That's the depth I need. Thanks Michael.

--- On Tue, 7/31/12, Michael Hunger <michael.hun...@neotechnology.com> wrote:

From: Michael Hunger <michael.hun...@neotechnology.com>
Subject: Re: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:41 PM

No, thats pretty good, until cypher gets some more functiions/operators to
 work with paths.
Is this the depth you need in the end?
Michael
Am 31.07.2012 um 23:34 schrieb Chris Bolton:
Okay I started tinkering with this the console (http://console.neo4j.org/r/glfxa4) more and came up with this:
START n=node(1) MATCH (n)-[:FRIENDS]->(x)-[:FRIENDS]->(z) WHERE (x-[:FRIENDS]->n AND z-[:FRIENDS]->x) AND NOT(n-[:BLOCKED_FRIENDS]->x AND x-[:BLOCKED_FRIENDS]->z) RETURN z
It returns
 the starting node and the desired result node. Is there something obvious I'm missing?
Chris 

--- On Tue, 7/31/12, Chris Bolton <iknewthis...@yahoo.com>

 wrote:

From: Chris Bolton <iknewthis...@yahoo.com>
Subject: [Neo4j] Cypher Query Filtering Friends of Friends nodes
To: neo4j@googlegroups.com
Date: Tuesday, July 31, 2012, 2:26 PM

Afternoon all,
I'm looking for some help writing a query.
I've built this query so that it finds all friends that have a
 reciprocated relationship and are not blocked friends.
START n=node(1) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n<-[:blocked_friends]-x) RETURN x
I'm now trying to go one layer deeper and pull the friends of friends filtered by the same criteria on the first level and the second level.
I set up the Neo4j console (http://console.neo4j.org/?id=j6cyp4) in hopes that it would be easier to visualize. I am trying to return just Mike starting with Bob.  
Any help would be greatly appreciated.
Thanks.Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »