If this property is owned by a class associated with a binary association, and the other end of the association is also owned by a class, then opposite gives the other end.

Source

opposite =
if owningAssociation->isEmpty() and association.memberEnd->size() = 2 then
let otherEnd = (association.memberEnd - self)->any() in
if otherEnd.owningAssociation->isEmpty() then otherEnd else Set{} endif
else Set {}
endif

Owning metaclass
Package
Related snippets