public class Relation extends TypeAtom
Atom implementation defining a relation atom corresponding to a combined RelationProperty
and (optional) IsaProperty.
applicableRules, typeIdatomPattern| Constructor and Description |
|---|
Relation(VarPatternAdmin pattern,
IdPredicate predicate,
ReasonerQuery par) |
Relation(Var name,
Var typeVariable,
Map<Var,VarPattern> roleMap,
IdPredicate pred,
ReasonerQuery par) |
| Modifier and Type | Method and Description |
|---|---|
Relation |
addType(Type type) |
int |
computePriority(Set<Var> subbedVars)
compute resolution priority based on provided substitution variables
|
Atomic |
copy() |
boolean |
equals(Object obj) |
int |
equivalenceHashCode() |
protected Var |
extractValueVariableName(VarPatternAdmin var) |
Set<TypeAtom> |
getMappedTypeConstraints() |
Set<IdPredicate> |
getPartialSubstitutions() |
Set<Unifier> |
getPermutationUnifiers(Atom headAtom) |
Set<Var> |
getRolePlayers() |
com.google.common.collect.Multimap<RoleType,Var> |
getRoleVarMap() |
Unifier |
getUnifier(Atom pAtom)
find unifier with parent atom
|
Set<IdPredicate> |
getUnmappedIdPredicates() |
Set<Var> |
getUnmappedRolePlayers() |
Set<TypeAtom> |
getUnmappedTypeConstraints() |
Set<Var> |
getVarNames() |
int |
hashCode() |
List<RelationType> |
inferPossibleRelationTypes(Answer sub)
infer relation types that this relation atom can potentially have
NB: entity types and role types are treated separately as they behave differently:
entity types only play the explicitly defined roles (not the relevant part of the hierarchy of the specified role)
|
void |
inferTypes()
infers types (type, role types) fo the atom if applicable/possible
|
boolean |
isAllowedToFormRuleHead() |
boolean |
isEquivalent(Object obj) |
boolean |
isRelation() |
boolean |
isRuleApplicable(InferenceRule child) |
boolean |
isSelectable() |
boolean |
isType() |
boolean |
requiresMaterialisation() |
Atom |
rewriteToUserDefined()
rewrites the atom to one with user defined name
|
protected void |
setValueVariable(Var var) |
String |
toString() |
extractTypeId, getType, unifygetCombinedPattern, getPredicate, hasEquivalentPredicatesWith, setParentQuerygetValueVariablebaseResolutionPriority, computePriority, getApplicableRules, getIdPredicates, getNeighbours, getNonSelectableConstraints, getPredicates, getTypeConstraints, getTypeId, getValuePredicates, isAtom, isRecursive, isResource, isRuleResolvablecontainsVar, getParentQuery, getPattern, getVarName, graph, isUserDefinedNameclone, finalize, getClass, notify, notifyAll, wait, wait, waitisPredicatepublic Relation(VarPatternAdmin pattern, IdPredicate predicate, ReasonerQuery par)
public Relation(Var name, Var typeVariable, Map<Var,VarPattern> roleMap, IdPredicate pred, ReasonerQuery par)
protected Var extractValueVariableName(VarPatternAdmin var)
extractValueVariableName in class TypeAtomprotected void setValueVariable(Var var)
setValueVariable in class TypeAtompublic boolean isEquivalent(Object obj)
isEquivalent in interface AtomicisEquivalent in class BinaryBasepublic int equivalenceHashCode()
equivalenceHashCode in interface AtomicequivalenceHashCode in class Binarypublic boolean isRelation()
isRelation in class Atompublic boolean isSelectable()
isSelectable in interface AtomicisSelectable in class TypeAtompublic boolean isType()
public boolean requiresMaterialisation()
requiresMaterialisation in class TypeAtompublic boolean isAllowedToFormRuleHead()
isAllowedToFormRuleHead in class TypeAtompublic int computePriority(Set<Var> subbedVars)
AtomcomputePriority in class TypeAtomsubbedVars - variables having a substitutionpublic Set<IdPredicate> getPartialSubstitutions()
getPartialSubstitutions in class Atompublic boolean isRuleApplicable(InferenceRule child)
isRuleApplicable in class TypeAtompublic List<RelationType> inferPossibleRelationTypes(Answer sub)
public void inferTypes()
AtominferTypes in class Atompublic Set<Var> getVarNames()
getVarNames in interface AtomicgetVarNames in class BinaryBasepublic Set<Var> getUnmappedRolePlayers()
public Set<IdPredicate> getUnmappedIdPredicates()
getUnmappedIdPredicates in class Atompublic Set<TypeAtom> getMappedTypeConstraints()
getMappedTypeConstraints in class Atompublic Set<TypeAtom> getUnmappedTypeConstraints()
getUnmappedTypeConstraints in class Atompublic Set<Unifier> getPermutationUnifiers(Atom headAtom)
getPermutationUnifiers in class Atompublic Unifier getUnifier(Atom pAtom)
AtomgetUnifier in class BinaryBasepAtom - atom to be unified withpublic Atom rewriteToUserDefined()
AtomrewriteToUserDefined in class AtomCopyright © 2017 Grakn Labs Ltd. All rights reserved.