What I'm trying to get is nodes having certain property values for any property name (key) and not having some other values for any property.
So in short, pseudo-google query be like:
+Tom +val1 +val2 (...) -Cruise -valX -valY (...)
and Cypher query be like:
MATCH (n) WHERE (
ANY ( p in KEYS(n) WHERE n[p] CONTAINS 'Tom' ) AND
NONE ( p in KEYS(n) WHERE n[p] CONTAINS 'Cruise')
)
RETURN n
But the test result with movie database (:play movie graph) was just an empty list, while there are other actors named 'Tom' in the database, such as Tom Hanks. (match (n) where (any( p in KEYS(n) WHERE n[p] contains 'Tom')) return n gives [Tom Tykwer, Tom Hanks, Tom Cruise, Tom Skerritt])
So I experimented with 'om' instead of 'Tom', and this time, the result is a incomplete list of 'om's:
match (n) where (
any( p in KEYS(n) WHERE n[p] contains 'om') and
none( p in Keys(n) WHERE n[p] contains 'Cruise')
)
return n
gives
[Romantic (genre), Naomie Harris, James Thompson, Jessica Thompson]
(No Tom's -- why?)
Also tried NOT ANY() in place of NONE() and had same results.
Where does this inconsistency come from?