Well, EA "usually" (but as EA is, not always) puts embedded elements inside or attached to their parents. Whether or not elements are graphically overlapping can only be detected by their position (top, left, bottom, right). That's quite simple geometry to use here. There is no attribute where you can detect that a diagram object is embedded or not (except via the parent relation of the underlying objects).
q.