Revert "Revert "Prevent creation of relationship with same entity as existing relationship #521""

This reverts commit 506fa015e96011124aacc58e9ede3c4ced2af116.
orphans