public interface VarPattern extends Pattern
A VarPattern may be given a variable, or use an "anonymous" variable. Graql provides
static methods for constructing VarPattern objects.
The methods on VarPattern are used to set its properties. A VarPattern behaves differently depending
on the type of query its used in. In a MatchQuery, a VarPattern 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 |
|---|---|
VarPatternAdmin |
admin() |
VarPattern |
datatype(ResourceType.DataType<?> datatype) |
VarPattern |
has(Label type,
VarPattern varPattern)
the variable must have a resource of the given type that matches the given atom
|
VarPattern |
has(String type) |
VarPattern |
has(String type,
Object value)
the variable must have a resource of the given type with an exact matching value
|
VarPattern |
has(String type,
ValuePredicate predicate)
the variable must have a resource of the given type that matches the given atom
|
VarPattern |
has(String type,
VarPattern varPattern)
the variable must have a resource of the given type that matches the given atom
|
VarPattern |
has(VarPattern type) |
VarPattern |
hasScope(VarPattern type) |
VarPattern |
id(ConceptId id) |
VarPattern |
isa(String type) |
VarPattern |
isa(VarPattern type) |
VarPattern |
isAbstract()
set this concept type variable as abstract, meaning it cannot have direct instances
|
VarPattern |
key(String type) |
VarPattern |
key(VarPattern type) |
VarPattern |
label(Label label) |
VarPattern |
label(String label) |
VarPattern |
lhs(Pattern lhs) |
VarPattern |
neq(String var)
Specify that the variable is different to another variable
|
VarPattern |
neq(VarPattern varPattern)
Specify that the variable is different to another variable
|
VarPattern |
plays(String type) |
VarPattern |
plays(VarPattern type) |
VarPattern |
regex(String regex)
Specify the regular expression instances of this resource type must match
|
VarPattern |
rel(String roleplayer)
the variable must be a relation with the given roleplayer
|
VarPattern |
rel(String roletype,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
VarPattern |
rel(String roletype,
VarPattern roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
VarPattern |
rel(VarPattern roleplayer)
the variable must be a relation with the given roleplayer
|
VarPattern |
rel(VarPattern roletype,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
VarPattern |
rel(VarPattern roletype,
VarPattern roleplayer)
the variable must be a relation with the given roleplayer playing the given roletype
|
VarPattern |
relates(String type) |
VarPattern |
relates(VarPattern type) |
VarPattern |
rhs(Pattern rhs) |
VarPattern |
sub(String type) |
VarPattern |
sub(VarPattern type) |
VarPattern |
val(Object value) |
VarPattern |
val(ValuePredicate predicate) |
@CheckReturnValue VarPatternAdmin admin()
admin in interface PatternVarPattern@CheckReturnValue VarPattern id(ConceptId id)
id - a ConceptId that this variable's ID must match@CheckReturnValue VarPattern label(String label)
label - a string that this variable's label must match@CheckReturnValue VarPattern label(Label label)
label - a type label that this variable's label must match@CheckReturnValue VarPattern val(Object value)
value - a value that this variable's value must exactly match@CheckReturnValue VarPattern val(ValuePredicate predicate)
predicate - a atom this variable's value must match@CheckReturnValue VarPattern has(String type, Object value)
type - a resource type in the ontologyvalue - a value of a resource@CheckReturnValue VarPattern has(String type, ValuePredicate predicate)
type - a resource type in the ontologypredicate - a atom on the value of a resource@CheckReturnValue VarPattern has(String type, VarPattern varPattern)
type - a resource type in the ontologyvarPattern - a variable pattern representing a resource@CheckReturnValue VarPattern has(Label type, VarPattern varPattern)
type - a resource type in the ontologyvarPattern - a variable pattern representing a resource@CheckReturnValue VarPattern isa(String type)
type - a concept type id that the variable must be of this type@CheckReturnValue VarPattern isa(VarPattern type)
type - a concept type that this variable must be an instance of@CheckReturnValue VarPattern sub(String type)
type - a concept type id that this variable must be a kind of@CheckReturnValue VarPattern sub(VarPattern type)
type - a concept type that this variable must be a kind of@CheckReturnValue VarPattern relates(String type)
type - a role type id that this relation type variable must have@CheckReturnValue VarPattern relates(VarPattern type)
type - a role type that this relation type variable must have@CheckReturnValue VarPattern plays(String type)
type - a role type id that this concept type variable must play@CheckReturnValue VarPattern plays(VarPattern type)
type - a role type that this concept type variable must play@CheckReturnValue VarPattern hasScope(VarPattern type)
type - a scope that this variable must have@CheckReturnValue VarPattern has(String type)
type - a resource type that this type variable can be related to@CheckReturnValue VarPattern has(VarPattern type)
type - a resource type that this type variable can be related to@CheckReturnValue VarPattern key(String type)
type - a resource type that this type variable can be one-to-one related to@CheckReturnValue VarPattern key(VarPattern type)
type - a resource type that this type variable can be one-to-one related to@CheckReturnValue VarPattern rel(String roleplayer)
roleplayer - a variable representing a roleplayer@CheckReturnValue VarPattern rel(VarPattern roleplayer)
roleplayer - a variable pattern representing a roleplayer@CheckReturnValue VarPattern rel(String roletype, String roleplayer)
roletype - a role type in the ontologyroleplayer - a variable representing a roleplayer@CheckReturnValue VarPattern rel(VarPattern roletype, String roleplayer)
roletype - a variable pattern representing a roletyperoleplayer - a variable representing a roleplayer@CheckReturnValue VarPattern rel(String roletype, VarPattern roleplayer)
roletype - a role type in the ontologyroleplayer - a variable pattern representing a roleplayer@CheckReturnValue VarPattern rel(VarPattern roletype, VarPattern roleplayer)
roletype - a variable pattern representing a roletyperoleplayer - a variable pattern representing a roleplayer@CheckReturnValue VarPattern isAbstract()
@CheckReturnValue VarPattern datatype(ResourceType.DataType<?> datatype)
datatype - the datatype to set for this resource type variable@CheckReturnValue VarPattern regex(String regex)
regex - the regex to set for this resource type variable@CheckReturnValue VarPattern lhs(Pattern lhs)
lhs - the left-hand side of this rule@CheckReturnValue VarPattern rhs(Pattern rhs)
rhs - the right-hand side of this rule@CheckReturnValue VarPattern neq(String var)
var - the variable that this variable should not be equal to@CheckReturnValue VarPattern neq(VarPattern varPattern)
varPattern - the variable pattern that this variable should not be equal toCopyright © 2017 Grakn Labs Ltd. All rights reserved.