public abstract class ResourceAtom extends Binary
Atom implementation defining a resource atom corresponding to a HasAttributeProperty.
The resource structure is the following:
has($varName, $predicateVariable = resource variable), type($predicateVariable)
or in graql terms:
$varName has
applicableRules| Constructor and Description |
|---|
ResourceAtom() |
| Modifier and Type | Method and Description |
|---|---|
int |
alphaEquivalenceHashCode() |
Atomic |
copy(ReasonerQuery parent) |
static ResourceAtom |
create(VarPattern pattern,
Var attributeVar,
Var relationVariable,
ConceptId predicateId,
Set<ValuePredicate> ps,
ReasonerQuery parent) |
protected Pattern |
createCombinedPattern() |
boolean |
equals(Object obj) |
java.util.stream.Stream<Predicate> |
getInnerPredicates() |
abstract com.google.common.collect.ImmutableSet<ValuePredicate> |
getMultiPredicate() |
abstract Var |
getRelationVariable() |
Unifier |
getUnifier(Atom parentAtom,
UnifierComparison unifierType)
attempt to find a UNIQUE unifier with the parent atom
|
Set<Var> |
getVarNames() |
Class<? extends VarProperty> |
getVarPropertyClass() |
int |
hashCode() |
boolean |
isResource() |
boolean |
isRuleApplicableViaAtom(Atom ruleAtom) |
boolean |
isSelectable() |
boolean |
isSpecific() |
boolean |
isUnifiableWith(Atom atom) |
java.util.stream.Stream<ConceptMap> |
materialise() |
boolean |
requiresMaterialisation() |
Atom |
rewriteToUserDefined(Atom parentAtom)
rewrites the atom to one with suitably user-defined names depending on provided parent
|
ResourceAtom |
rewriteWithRelationVariable()
rewrites the atom to one with user defined relation variable
|
Atom |
rewriteWithTypeVariable() |
IsaAtom |
toIsaAtom()
NB: this is somewhat ambiguous cause from {$x has resource $r;} we can extract:
- $x isa ???;
- $r isa resource;
We pick the latter as the type information is available.
|
RelationshipAtom |
toRelationshipAtom() |
String |
toString() |
Set<String> |
validateAsRuleHead(Rule rule) |
Set<String> |
validateOntologically() |
checkValid, getPredicateVariable, getSchemaConcept, getTypeId, getTypePredicate, isAlphaEquivalent, isDirect, isStructurallyEquivalent, structuralEquivalenceHashCodeaddType, atomOptions, getApplicableRules, getInnerPredicates, getMultiUnifier, getNeighbours, getNonSelectableConstraints, getPartialSubstitutions, getPossibleTypes, getPotentialRules, getRoleExpansionVariables, getTypeConstraints, getVarProperties, inferTypes, inferTypes, isAtom, isBounded, isDisconnected, isGround, isRecursive, isRuleResolvable, requiresDecomposition, requiresRoleExpansion, requiresSchema, rewriteToAtoms, rewriteWithTypeVariablegetCombinedPattern, getIdPredicate, getPredicate, getPredicates, getPredicates, isUserDefined, txclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetParentQuery, getPattern, getVarName, isCompatibleWith, isRelation, isTypepublic abstract Var getRelationVariable()
public abstract com.google.common.collect.ImmutableSet<ValuePredicate> getMultiPredicate()
public static ResourceAtom create(VarPattern pattern, Var attributeVar, Var relationVariable, ConceptId predicateId, Set<ValuePredicate> ps, ReasonerQuery parent)
public Atomic copy(ReasonerQuery parent)
public Class<? extends VarProperty> getVarPropertyClass()
getVarPropertyClass in class Atompublic RelationshipAtom toRelationshipAtom()
toRelationshipAtom in class Atompublic IsaAtom toIsaAtom()
public String toString()
toString in class AtomicBasepublic int alphaEquivalenceHashCode()
alphaEquivalenceHashCode in interface AtomicalphaEquivalenceHashCode in class Binaryprotected Pattern createCombinedPattern()
createCombinedPattern in class Binarypublic boolean isRuleApplicableViaAtom(Atom ruleAtom)
isRuleApplicableViaAtom in class Atompublic boolean isUnifiableWith(Atom atom)
isUnifiableWith in class Atompublic boolean isResource()
public boolean isSelectable()
public boolean isSpecific()
public boolean requiresMaterialisation()
requiresMaterialisation in class Atompublic Set<String> validateAsRuleHead(Rule rule)
validateAsRuleHead in interface AtomicvalidateAsRuleHead in class Atompublic Set<Var> getVarNames()
getVarNames in interface AtomicgetVarNames in class Binarypublic Unifier getUnifier(Atom parentAtom, UnifierComparison unifierType)
AtomgetUnifier in class BinaryparentAtom - atom to be unified withunifierType - type of unifier to be computedpublic java.util.stream.Stream<Predicate> getInnerPredicates()
getInnerPredicates in class Binarypublic java.util.stream.Stream<ConceptMap> materialise()
materialise in class Atompublic ResourceAtom rewriteWithRelationVariable()
AtomrewriteWithRelationVariable in class Atompublic Atom rewriteWithTypeVariable()
rewriteWithTypeVariable in class Atompublic Atom rewriteToUserDefined(Atom parentAtom)
AtomrewriteToUserDefined in class AtomparentAtom - parent atom that triggers rewriteCopyright © 2018 Grakn Labs Ltd. All rights reserved.