Hi all, according to the documentation, regex constraints can be applied within the owning definition of entities and relations.
Documentation Example:
define
full-name sub attribute, value string;
office-location sub attribute, value string;
id sub attribute, value string;
email sub id;
employee-id sub id;
user sub entity,
owns full-name,
owns email @unique, regex "^(.+)@(\\S+)$";
employee sub user,
owns employee-id @key,
owns office-location, regex "^(London|Paris|Dublin)$";
However, when I execute this define query:
define product sub entity, owns price, regex "^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z]{2,}$", owns size, owns identifier @key, plays selling:sold;
I get this error:
[TYR01] Invalid Type Read: Invalid concept conversion from 'product' to 'AttributeType'.
which I interpret as “Regex constraints should be within the attribute definition” but maybe I just have an error in my define query?
I would highly appreciate your help!