During schema introspection I need to know from what super-type (if any) every field came from.
E.g.
define
name sub attribute, value string;
description sub attribute, value string;
supertype sub entity, owns name;
subtype sub supertype, owns description;
When I do match $x sub entity; $x owns $attr; the result doesn’t seem to have the information from what super-type name or description came from. Is there a native way to find it?
We should extend the language with owns! which would help resolve this pretty quickly!
However in the meantime:
match $x sub entity, owns $attr-type; $x sub $super-owner; $super-owner owns $attr-type; not { $super-owner sub! $super-super-owner; $super-super-owner owns $attr-type;};
In other words, find the ownership, then find a supertype that also has the ownership, such that it doesn’t have a supertype that also owns the attribute-type.