At the moment, whenever we want to provide a variable into a Statement builder, we must construct a full Statement object that only contains that one Variable. For example:
type("marriage").relates(var("x"))
In the case above, Graql.var("x") returns a Statement object, in which StatementTypeBuilder.relates() accepts.
This is problematic for various reasons:
Wherever a query builder expects a variable, the user can pass a Statement with more information leaked into the query, which may not be semantically correct
We cannot differentiate different scenarios of query building, for example:
A concept type has a type followed by a default value: type("person").has("age", 0)
A concept type has a var cannot be followed by anything: type("person").has(var("x"))
At the moment, whenever we want to provide a variable into a
Statement
builder, we must construct a fullStatement
object that only contains that oneVariable
. For example:In the case above,
Graql.var("x")
returns aStatement
object, in whichStatementTypeBuilder.relates()
accepts.This is problematic for various reasons:
Statement
with more information leaked into the query, which may not be semantically correcthas
atype
followed by a default value:type("person").has("age", 0)
has
avar
cannot be followed by anything:type("person").has(var("x"))