How to prevent a repetitive relationship


When establishing a new relationship between two instances $x $y, how to confirm whether already exists the same relationship $x $y, like this:

test_rule sub rule
{if ($x, $y) isa not relationship;}
{($x, $y) isa relationship;};


Sorry we forgot to reply to this, @peterluck3

If you want to make sure Relationships are unique, you should assign a key to a relation-type. e.g.

marriage isa relationship,
key identifier,
relates husband,
relates wife;

You then check if an marriage relationship already exists with a given identifier.