I didn't just want to match on something being called a Stage. That seemed problematic, because you probably shouldn't be able to contain something from a different stage. Now that I think about it, a safe check might be, when containing B in A, and B is already contained in C, remove the B->C edge if A is also contained in C.