should it be possible to have two
should it be possible to have two attributes on an entity with an
@key
annotation? I somehow ended up in that situation hahaha5 Replies
many entities are sub Versionable, Versionable owns contentHash
@key
, and then some entities that are sub Versionable also have an @key
annotationThe key is declared on the ownership.
If you declare
a owns b @key
, then $a isa a,has b $b
should return exactly one $b per $a. If separately a owns c @key
, then $a isa a, has c $c
should also return exactly one $c per $a
.^ to elaborate, yes you can have as many keys as you want. They don't affect each other as long as
not { c sub b; };
. If c sub b;
, both constraints will work on instances of c
Was this the problem case?
Yes, you require exactly one
b
, but you also require exactly one b1
and exactly one b2
. Thus, you require at most one b
and at least two b
s at the same time