public interface Var extends Pattern
A Var may be given a variable name, or left as an "anonymous" variable. Graql provides
static methods for constructing Var objects.
The methods on Var are used to set its properties. A Var behaves differently depending on the type of
query its used in. In a MatchQuery, a Var describes the properties any matching concept must have. In
an InsertQuery, it describes the properties that should be set on the inserted concept. In a
DeleteQuery, it describes the properties that should be deleted.
| Modifier and Type | Method and Description |
|---|---|
VarAdmin |
admin() |
Var |
ako(String type) |
Var |
ako(Var type) |
Var |
datatype(ResourceType.DataType<?> datatype) |
Var |
has(String type) |
Var |
has(String type,
Object value)
the variable must have a resource or name of the given type with an exact matching value
|
Var |
has(String type,
ValuePredicate predicate)
the variable must have a resource or name of the given type that matches the given predicate
|
Var |
has(String type,
Var var)
the variable must have a resource or name of the given type that matches the given predicate
|
Var |
hasResource(String type) |
Var |
hasResource(Var type) |
Var |
hasRole(String type) |
Var |
hasRole(Var type) |
Var |
hasScope(Var type) |
Var |
id(String id) |
Var |
isa(String type) |
Var |
isa(Var type) |
Var |
isAbstract()
set this concept type variable as abstract, meaning it cannot have direct instances
|
Var |
lhs(String lhs) |
Var |
playsRole(String type) |
Var |
playsRole(Var type) |
Var |
regex(String regex)
Specify the regular expression instances of this resource type must match
|
Var |
rel(String roleplayer)
the variable must be a relation with the given roleplayer
|
Var |
rel(String roletype,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
Var |
rel(String roletype,
Var roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
Var |
rel(Var roleplayer)
the variable must be a relation with the given roleplayer
|
Var |
rel(Var roletype,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
Var |
rel(Var roletype,
Var roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
Var |
rhs(String rhs) |
Var |
value()
this variable must have a value
|
Var |
value(Object value) |
Var |
value(ValuePredicate predicate) |
Var value()
Var value(Object value)
value - a value that this variable's value must exactly matchVar value(ValuePredicate predicate)
predicate - a predicate this variable's value must matchVar has(String type)
type - a resource type that this variable must have an instance ofVar has(String type, Object value)
type - a resource type in the ontologyvalue - a value of a resourceVar has(String type, ValuePredicate predicate)
type - a resource type in the ontologypredicate - a predicate on the value of a resourceVar has(String type, Var var)
type - a resource type in the ontologyvar - a variable representing a resourceVar isa(String type)
type - a concept type id that the variable must be of this typeVar isa(Var type)
type - a concept type that this variable must be an instance ofVar ako(String type)
type - a concept type id that this variable must be a kind ofVar ako(Var type)
type - a concept type that this variable must be a kind ofVar hasRole(String type)
type - a role type id that this relation type variable must haveVar hasRole(Var type)
type - a role type that this relation type variable must haveVar playsRole(String type)
type - a role type id that this concept type variable must playVar playsRole(Var type)
type - a role type that this concept type variable must playVar hasScope(Var type)
type - a scope that this variable must haveVar hasResource(String type)
type - a resource type that this type variable can be related toVar hasResource(Var type)
type - a resource type that this type variable can be related toVar rel(String roleplayer)
roleplayer - a variable representing a roleplayerVar rel(Var roleplayer)
roleplayer - a variable representing a roleplayerVar rel(String roletype, String roleplayer)
roletype - a role type in the ontologyroleplayer - a variable representing a roleplayerVar rel(Var roletype, String roleplayer)
roletype - a variable representing a roletyperoleplayer - a variable representing a roleplayerVar rel(String roletype, Var roleplayer)
roletype - a role type in the ontologyroleplayer - a variable representing a roleplayerVar rel(Var roletype, Var roleplayer)
roletype - a variable representing a roletyperoleplayer - a variable representing a roleplayerVar isAbstract()
Var datatype(ResourceType.DataType<?> datatype)
datatype - the datatype to set for this resource type variableVar regex(String regex)
regex - the regex to set for this resource type variableCopyright © 2016. All rights reserved.