| I currently have multiple Cypher queries that are being stored in variables and then being added or subtracted from one another. My understanding is that it would probably process faster if I was able to string together one really big query. Is it possible? All the queries start from the same node, the queries are just returning various collections of nodes based on their relationship and their reciprocal values (i.e. oof = Neo4j._query("START n=node(#{self.id}) MATCH (n)-[:outer_only_friends]->(x) RETURN x") bf = Neo4j._query("START n=node(#{self.id}) MATCH (n)-[:blocked_friends]->(x) RETURN x") otif = Neo4j._query("START n=node(#{self.id}) MATCH(n)-[:outer_only_friends]->(x) WHERE (x-[:friends]->n) RETURN x") itof = Neo4j._query("START n=node(#{self.id}) MATCH(n)-[:friends]->(x) WHERE (x-[:outer_only_friends]->n) RETURN x") icic = START n=node(4) MATCH (n)-[:friends]->(x)-[:friends]->(z) WHERE z<>n AND (x-[:friends]->n AND z-[:friends]->x) AND NOT(n-[:blocked_friends]->x AND x-[:blocked_friends]->z) RETURN z ic = Neo4j._query("START n=node(#{self.id}) MATCH (n)-[:friends]->(x) WHERE (x-[:friends]->n) AND NOT(n-[:blocked_friends]->x) RETURN distinct x") Any ideas? I appreciate any help. Chris
|
| Good morning Michael (although I don't think it's morning where you are), The queries are each individually stored in variables and then subtracted from one another. results = oof - icic + ic ... Why would you not use #{self.id}? Security concerns? I am going to work on the solutions this morning. Thanks for the help. I'll circle back with any questions. Chris --- On Thu, 8/9/12, Michael Hunger <michael...@neotechnology.com> wrote: |