public abstract class PropertyExecutor extends Object
VarProperty.
The behaviour is executed via a QueryOperationExecutor using execute(ai.grakn.graql.internal.query.QueryOperationExecutor). The class also
report its requiredVars() before it can run and its producedVars(), that will be available to
other PropertyExecutors after it has run.
For example:
SubProperty property = SubProperty.of(y);
PropertyExecutor executor = property.define(x);
executor.requiredVars(); // returns `{y}`
executor.producedVars(); // returns `{x}`
// apply the `sub` property between `x` and `y`
// because it requires `y`, it will call `queryOperationExecutor.get(y)`
// because it produces `x`, it will call `queryOperationExecutor.builder(x)`
executor.execute(queryOperationExecutor);
| Constructor and Description |
|---|
PropertyExecutor() |
| Modifier and Type | Method and Description |
|---|---|
static ai.grakn.graql.internal.pattern.property.PropertyExecutor.Builder |
builder(ai.grakn.graql.internal.pattern.property.PropertyExecutor.Method executeMethod) |
void |
execute(QueryOperationExecutor executor)
Apply the given property, if possible.
|
abstract com.google.common.collect.ImmutableSet<Var> |
producedVars()
|
abstract com.google.common.collect.ImmutableSet<Var> |
requiredVars()
|
public static ai.grakn.graql.internal.pattern.property.PropertyExecutor.Builder builder(ai.grakn.graql.internal.pattern.property.PropertyExecutor.Method executeMethod)
public void execute(QueryOperationExecutor executor)
executor - a class providing a map of concepts that are accessible and methods to build new concepts.
This method can expect any key to be here that is returned from
requiredVars(). The method may also build a concept provided that key is returned
from producedVars().
public abstract com.google.common.collect.ImmutableSet<Var> requiredVars()
Vars whose Concept must exist for the subject Var to be applied.
For example, for IsaProperty the type must already be present before an instance can be created.
When calling execute(ai.grakn.graql.internal.query.QueryOperationExecutor), the method can expect any Var returned here to be available by calling
QueryOperationExecutor.get(ai.grakn.graql.Var).
public abstract com.google.common.collect.ImmutableSet<Var> producedVars()
Vars whose Concept can only be created after this property is applied.
When calling execute(ai.grakn.graql.internal.query.QueryOperationExecutor), the method must help build a Concept for every Var returned
from this method, using QueryOperationExecutor.builder(ai.grakn.graql.Var).
Copyright © 2017 Grakn Labs Ltd. All rights reserved.