Equivalence Relations in Grakn


#1

I am interested in building out a schema that contains many equivalence relations, as this schema would link several ontologies together. What would be the most advised way of implementing something like a ‘sameAs’ relation in the Grakn schema?


#2

@cameronrhamilton

This is a feature that could potentially be added to the define query. Would you please issue a feature request for it? :slight_smile:

In the meanwhile, there is a way to achieve this using a rule.

say we have,

define
  a sub entity;
  b sub entity;

to have b as an alias of a, we would have:

define
  b_is_alias_a sub rule,
    when {
      $x isa a;
    }, then {
      $x isa b;
    }

#3

Why and how does that rule work? If isa checks if $x is an instance of a particular type, how can it be both a and b? There would be no way to define x to be both a and b outside of inheritance, right?
Is this a case of the rule/inference semantics being more “free” than the definition semantics? Or are my assumptions wrong?