public abstract class AbstractVarPattern extends AbstractPattern implements VarPatternAdmin
VarPatternAdmin.| Constructor and Description |
|---|
AbstractVarPattern() |
| Modifier and Type | Method and Description |
|---|---|
VarPatternAdmin |
admin() |
Set<Var> |
commonVarNames()
Get all common, user-defined variable names in the pattern.
|
VarPattern |
datatype(ResourceType.DataType<?> datatype) |
Disjunction<Conjunction<VarPatternAdmin>> |
getDisjunctiveNormalForm()
Get the disjunctive normal form of this pattern group.
|
Optional<ConceptId> |
getId() |
Collection<VarPatternAdmin> |
getImplicitInnerVars()
Get all inner variables, including implicit variables such as in a has property
|
Collection<VarPatternAdmin> |
getInnerVars() |
String |
getPrintableName() |
java.util.stream.Stream<VarProperty> |
getProperties()
Get a stream of all properties on this variable
|
<T extends VarProperty> |
getProperties(Class<T> type)
Get a stream of all properties of a particular type on this variable
|
<T extends UniqueVarProperty> |
getProperty(Class<T> type)
Get a unique property of a particular type on this variable, if it exists
|
Optional<Label> |
getTypeLabel() |
Set<Label> |
getTypeLabels() |
abstract Var |
getVarName() |
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) |
<T extends VarProperty> |
hasProperty(Class<T> type)
Get whether this
VarPattern has a VarProperty of the given 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 |
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) |
protected abstract Set<VarProperty> |
properties() |
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 role,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given
Role |
VarPattern |
rel(String role,
VarPattern roleplayer)
the variable must be a relation with the given roleplayer playing the given
Role |
VarPattern |
rel(VarPattern roleplayer)
the variable must be a relation with the given roleplayer
|
VarPattern |
rel(VarPattern role,
String roleplayer)
the variable must be a relation with the given roleplayer playing the given
Role |
VarPattern |
rel(VarPattern role,
VarPattern roleplayer)
the variable must be a relation with the given roleplayer playing the given
Role |
VarPattern |
relates(String type) |
VarPattern |
relates(VarPattern type) |
VarPattern |
sub(String type) |
VarPattern |
sub(VarPattern type) |
VarPattern |
then(Pattern then) |
VarPattern |
val(Object value) |
VarPattern |
val(ValuePredicate predicate) |
VarPattern |
when(Pattern when) |
and, orclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasVar, isVarasConjunction, asDisjunction, getVars, isConjunction, isDisjunctionpublic abstract Var getVarName()
getVarName in interface VarPatternAdminprotected abstract Set<VarProperty> properties()
public final VarPatternAdmin admin()
admin in interface Patternadmin in interface VarPatternpublic final Optional<ConceptId> getId()
getId in interface VarPatternAdminpublic final Optional<Label> getTypeLabel()
getTypeLabel in interface VarPatternAdminpublic final <T extends VarProperty> java.util.stream.Stream<T> getProperties(Class<T> type)
VarPatternAdmingetProperties in interface VarPatternAdminT - the type of VarProperty to returntype - the class of VarProperty to returnpublic final <T extends UniqueVarProperty> Optional<T> getProperty(Class<T> type)
VarPatternAdmingetProperty in interface VarPatternAdminT - the type of VarProperty to returntype - the class of VarProperty to returnpublic final <T extends VarProperty> boolean hasProperty(Class<T> type)
VarPatternAdminVarPattern has a VarProperty of the given typehasProperty in interface VarPatternAdminT - the type of the VarPropertytype - the type of the VarPropertyVarPattern has a VarProperty of the given typepublic final Collection<VarPatternAdmin> getInnerVars()
getInnerVars in interface VarPatternAdminpublic final Collection<VarPatternAdmin> getImplicitInnerVars()
VarPatternAdmingetImplicitInnerVars in interface VarPatternAdminpublic final Set<Label> getTypeLabels()
getTypeLabels in interface VarPatternAdminpublic final Disjunction<Conjunction<VarPatternAdmin>> getDisjunctiveNormalForm()
PatternAdmingetDisjunctiveNormalForm in interface PatternAdminpublic final Set<Var> commonVarNames()
PatternAdmincommonVarNames in interface PatternAdminpublic final VarPattern id(ConceptId id)
id in interface VarPatternid - a ConceptId that this variable's ID must matchpublic final VarPattern label(String label)
label in interface VarPatternlabel - a string that this variable's label must matchpublic final VarPattern label(Label label)
label in interface VarPatternlabel - a type label that this variable's label must matchpublic final VarPattern val(Object value)
val in interface VarPatternvalue - a value that this variable's value must exactly matchpublic final VarPattern val(ValuePredicate predicate)
val in interface VarPatternpredicate - a atom this variable's value must matchpublic final VarPattern has(String type, Object value)
VarPatternhas in interface VarPatterntype - a resource type in the ontologyvalue - a value of a resourcepublic final VarPattern has(String type, ValuePredicate predicate)
VarPatternhas in interface VarPatterntype - a resource type in the ontologypredicate - a atom on the value of a resourcepublic final VarPattern has(String type, VarPattern varPattern)
VarPatternhas in interface VarPatterntype - a resource type in the ontologyvarPattern - a variable pattern representing a resourcepublic final VarPattern has(Label type, VarPattern varPattern)
VarPatternhas in interface VarPatterntype - a resource type in the ontologyvarPattern - a variable pattern representing a resourcepublic final VarPattern isa(String type)
isa in interface VarPatterntype - a concept type id that the variable must be of this typepublic final VarPattern isa(VarPattern type)
isa in interface VarPatterntype - a concept type that this variable must be an instance ofpublic final VarPattern sub(String type)
sub in interface VarPatterntype - a concept type id that this variable must be a kind ofpublic final VarPattern sub(VarPattern type)
sub in interface VarPatterntype - a concept type that this variable must be a kind ofpublic final VarPattern relates(String type)
relates in interface VarPatterntype - a Role id that this relation type variable must havepublic final VarPattern relates(VarPattern type)
relates in interface VarPatterntype - a Role that this relation type variable must havepublic final VarPattern plays(String type)
plays in interface VarPatterntype - a Role id that this concept type variable must playpublic final VarPattern plays(VarPattern type)
plays in interface VarPatterntype - a Role that this concept type variable must playpublic final VarPattern hasScope(VarPattern type)
hasScope in interface VarPatterntype - a scope that this variable must havepublic final VarPattern has(String type)
has in interface VarPatterntype - a resource type that this type variable can be related topublic final VarPattern has(VarPattern type)
has in interface VarPatterntype - a resource type that this type variable can be related topublic final VarPattern key(String type)
key in interface VarPatterntype - a resource type that this type variable can be one-to-one related topublic final VarPattern key(VarPattern type)
key in interface VarPatterntype - a resource type that this type variable can be one-to-one related topublic final VarPattern rel(String roleplayer)
VarPatternrel in interface VarPatternroleplayer - a variable representing a roleplayerpublic final VarPattern rel(VarPattern roleplayer)
VarPatternrel in interface VarPatternroleplayer - a variable pattern representing a roleplayerpublic final VarPattern rel(String role, String roleplayer)
VarPatternRolerel in interface VarPatternrole - a Role in the ontologyroleplayer - a variable representing a roleplayerpublic final VarPattern rel(VarPattern role, String roleplayer)
VarPatternRolerel in interface VarPatternrole - a variable pattern representing a Roleroleplayer - a variable representing a roleplayerpublic final VarPattern rel(String role, VarPattern roleplayer)
VarPatternRolerel in interface VarPatternrole - a Role in the ontologyroleplayer - a variable pattern representing a roleplayerpublic final VarPattern rel(VarPattern role, VarPattern roleplayer)
VarPatternRolerel in interface VarPatternrole - a variable pattern representing a Roleroleplayer - a variable pattern representing a roleplayerpublic final VarPattern isAbstract()
VarPatternisAbstract in interface VarPatternpublic final VarPattern datatype(ResourceType.DataType<?> datatype)
datatype in interface VarPatterndatatype - the datatype to set for this resource type variablepublic final VarPattern regex(String regex)
VarPatternregex in interface VarPatternregex - the regex to set for this resource type variablepublic final VarPattern when(Pattern when)
when in interface VarPatternwhen - the left-hand side of this rulepublic final VarPattern then(Pattern then)
then in interface VarPatternthen - the right-hand side of this rulepublic final VarPattern neq(String var)
VarPatternneq in interface VarPatternvar - the variable that this variable should not be equal topublic final VarPattern neq(VarPattern varPattern)
VarPatternneq in interface VarPatternvarPattern - the variable pattern that this variable should not be equal topublic final String getPrintableName()
getPrintableName in interface VarPatternAdminpublic final java.util.stream.Stream<VarProperty> getProperties()
VarPatternAdmingetProperties in interface VarPatternAdminCopyright © 2017 Grakn Labs Ltd. All rights reserved.