Im very confused with what's going wrong....here's my database

CREATE (queen:Gliese { name : 'Queen'}),(eva:Human { name : 
'Eva'}),(lisha:Human { name : 
'Lisha'}),(queen)<-[:ENEMY_OF]-(eva),(queen)<-[:FRIEND_OF]-(eva),(queen)<-[:FRIEND_OF]-(lisha),(queen)<-[:ENEMY_OF]-(lisha),(lisha)-[:KILLED]->(eva);

I wanted to return any friend of the queen who killed an enemy of the 
queen. 

So I wrote the following query


MATCH (queen:Gliese{name:'Queen'})
WITH queen
MATCH (a)-[:FRIEND_OF]->(queen),(b)-[:ENEMY_OF]->(queen),(a)-[:KILLED]->(b)
RETURN a.name, count(*) as count;


Instead of getting lisha, 1, as expected, I get (No rows).


Strangely if I do 

MATCH (a)-[:FRIEND_OF]->(queen),(b)-[:ENEMY_OF]->(queen),(a)-[:KILLED]->(b)
RETURN a.name, count(*) as count;

alone, I get the expected result. In addition if I do 


MATCH (queen:Gliese{name:'Queen'})
WITH queen
MATCH (a)-[:FRIEND_OF]->(n),(b)-[:ENEMY_OF]->(n),(a)-[:KILLED]->(b)
RETURN a.name, count(*) as count;


I get Lisha, 1 and Eva, 1! I don't really understand these differences! 

In older versions my code seems to work, unless there's some other problem 
I don't get. 


What's going on here? 

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to