I have a relation like this:
context-[EXPRESSED_AS]->root
Assume that I have two contexts. The first has roots with base_forms of "temperature", "cool" and "hot". The second has roots with base_forms of "cool" and "hot". I want to find all contexts, sorted by the number of matches for the set ["cool", "temperature"].
I attempted it using this Cypher query, which doesn't work since the IN operator returns true or false instead of the matches:
"MATCH (w:`context`), s-[EXPRESSED_AS]->n1 WHERE n1.base_form in ["cool", "temperature"] WITH s, COUNT(n1.base_form in ["cool", "temperature"]) AS rootCount RETURN s.name, rootCount ORDER BY rootCount
Any help is appreciated!
Mmmh it seems like I can't visualize your model then.
2 contexts
(context1)-[:EXPRESSED_AS]->(root {base_form:"cool"})
(context1)-[:EXPRESSED_AS]->(root {base_form:"temperature"})
(context1)-[:EXPRESSED_AS]->(root {base_form:"hot"})
(context2)-[:EXPRESSED_AS]->(root {base_form:"cool"})
(context2)-[:EXPRESSED_AS]->(root {base_form:"hot"})
Is it like this ?
If yes, then your context will only match 1 time the map cool,temperature ?