usergraphtheory's picture
Sync from erdostack/bench at a7805c45d77258d316383c92bdc9f472498d255f (part 52)
013f624 verified
Raw History Blame Contribute Delete
224 Bytes
// Species that lose every prey if $species disappears.
MATCH (gone:Species {id: $species})<-[:EATS]-(pred:Species)
WHERE NOT EXISTS { MATCH (pred)-[:EATS]->(other:Species) WHERE other <> gone }
RETURN pred.name AS at_risk;