I have a graph where green nodes may be linked to one or many red nodes which then link to a set of blue nodes. Red nodes also have an amt property which indicate the minimum number of blue nodes in the set which need to be matched in order to 'satisfy' the red node. A given set of blue nodes 'qualify' for a green node if the set satisfies all of the green node's red neighbours.
Example
How would a write a cypher query to return all qualifying green nodes for a given set of blue nodes?
I came up with the following that returns green nodes if all blue nodes of its red neighbours are matched. However, I don't need to match all but rather the amt specified for each red node.
MATCH (g:Green)-->(r:Red)-->(b:Blue)
WITH g, COLLECT(b.name) AS myset
WHERE ALL(n in myset where n in ["1", "2", "3", "4", "8", "9", "11"])
RETURN p

