Open PatLechevallier opened 2 years ago
Moving to TypeQL repository
We can introduce a set of value restriction annotations in TypeQL.
@range(start inclusive, end inclusive)
@regex
(change from the current regex keyword)
and others we can think of in the future.
@flyingsilverfin I can't find documentation on the regex syntax supported. Just referencing the regex engine used would be helpful already.
@sanmai-NL is this for 2.0 or 3.0? We basically push the execution to Java in (in 2.x) or Rust (3.x)
Both are relevant but for now 2 is of immediate concern to us. So the java.util.regex
package applies?
Yep!
Problem to Solve
TypeDB has regex for string attributes but no Numeric Attribute Validation (min, max, range)
Current Workaround
An idea should be to
And to evaluate the statement on the client side.
Or define an max-error entity in TypeDB and define a rule that would raise an error (create a relation between the attribute and error code). But still require the client to pull the error entity.
Proposed Solution
Support Natively the constraint if possible of course.
define item owns measure, must-be <= {numeric value};
ordefine item owns measure, max {numerix value};
or more original, let the modeler define his own rules that raise error in the system as described above.