| 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 <iknewt...@yahoo.com> wrote:
|
| 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...@neotechnology.com> wrote: |
| 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? |
| 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 |
| 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 |
| Thanks Michael. |