Open JonThom opened 2 years ago
Very interesting! Does look like erroneous behaviour.
Edited example slightly: adds super_rel_role_2 to avoid raising unrelated exception due to undefining last role
Something very similar was spotted in the IAM schema. We declare the following:
action sub entity, abstract,
plays set-membership:member;
But in the TypeDB Studio, it says that action
plays membership:member
. The role member
, as you might have guessed is inherited from the membership relation.
set-membership sub membership,
relates set as parent;
membership sub relation,
relates parent,
relates member;
@flyingsilverfin With the following schema:
define
person sub entity;
membership sub relation;
membership relates member;
club-membership sub membership;
person plays club-membership:member;
person
instances can play the member
role in both membership
and club-membership
instances. Querying:
match
$x plays $y;
returns:
{
$x type person sub entity;
$y type membership:member sub relation:role;
}
If I define person plays club-membership:member;
then person
should only be able to play member
in instances of club-membership
.
Description
As we know, when subtyping a relation, any roles that are not explicitly subtyped are implicitly inherited by the subtype:
So far so good.
But now,
undefine sub_rel relates super_rel_role;
should lead to an error sincesub_rel
has inheritedsuper_rel_role
.However, what happens is equivalent to
undefine super_rel relates super_rel_role
, i.e. the role is undefined.Environment
Reproducible Steps
See above.
Expected Output
Exception
Actual Output
The
super_rel_role
is undefined.