typeql
typeql copied to clipboard
Statements can be filled with nonsense that is only caught in toString()
Description
Statements can be filled with nonsense that is only caught in toString()
.
Environment
- OS (where Grakn server runs): Mac OS 10
- Grakn version (and platform): Grakn Core 1.8
- Grakn client: core
Reproducible Steps
Construct a StatementInstance as follows:
StatementInstance propStatement = Graql.var("x").isa("has-attribute-property")
.rel("owned", ((HasAttributeProperty) varProp).attribute());
where varProp
is a VarProperty whose attribute
has variable $name
and has [1] property, which is isa name
. (This is performed in grakn:RuleResolutionBuilder.java:137)
Expected Output
An error should be thrown attempting to build the statement instance, because $x (owned: $name isa name) isa has-attribute-property;
is not valid Graql.
Actual Output
The statement instance is built successfully and now contains nonsense. An error is thrown - later - if you try calling toString()
on it. This is weird, as we would not expect toString()
to ever throw, unless the statement instance is null
.