public abstract class AbstractVarPattern extends Object 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 |
lhs(Pattern lhs) |
<T extends VarProperty> |
mapProperty(Class<T> type,
java.util.function.UnaryOperator<T> mapper)
Return this
VarPattern with instances of the given VarProperty modified. |
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 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) |
VarPatternAdmin |
setVarName(Var name) |
VarPattern |
sub(String type) |
VarPattern |
sub(VarPattern type) |
VarPattern |
val(Object value) |
VarPattern |
val(ValuePredicate predicate) |
clone, 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 type id that this relation type variable must havepublic final VarPattern relates(VarPattern type)
relates in interface VarPatterntype - a role type that this relation type variable must havepublic final VarPattern plays(String type)
plays in interface VarPatterntype - a role type id that this concept type variable must playpublic final VarPattern plays(VarPattern type)
plays in interface VarPatterntype - a role type 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 roletype, String roleplayer)
VarPatternrel in interface VarPatternroletype - a role type in the ontologyroleplayer - a variable representing a roleplayerpublic final VarPattern rel(VarPattern roletype, String roleplayer)
VarPatternrel in interface VarPatternroletype - a variable pattern representing a roletyperoleplayer - a variable representing a roleplayerpublic final VarPattern rel(String roletype, VarPattern roleplayer)
VarPatternrel in interface VarPatternroletype - a role type in the ontologyroleplayer - a variable pattern representing a roleplayerpublic final VarPattern rel(VarPattern roletype, VarPattern roleplayer)
VarPatternrel in interface VarPatternroletype - a variable pattern representing a roletyperoleplayer - 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 lhs(Pattern lhs)
lhs in interface VarPatternlhs - the left-hand side of this rulepublic final VarPattern rhs(Pattern rhs)
rhs in interface VarPatternrhs - 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 VarPatternAdmin setVarName(Var name)
setVarName in interface VarPatternAdminname - the new variable name of this variablepublic final String getPrintableName()
getPrintableName in interface VarPatternAdminpublic final java.util.stream.Stream<VarProperty> getProperties()
VarPatternAdmingetProperties in interface VarPatternAdminpublic final <T extends VarProperty> VarPatternAdmin mapProperty(Class<T> type, java.util.function.UnaryOperator<T> mapper)
VarPatternAdminVarPattern with instances of the given VarProperty modified.mapProperty in interface VarPatternAdminT - the type of the VarPropertytype - the type of the VarPropertyVarPattern has a VarProperty of the given typeCopyright © 2017 Grakn Labs Ltd. All rights reserved.