public interface Rule extends Instance
A rule which defines how implicit knowledge can extracted.
It can behave like any other Instance but primarily serves as a way of extracting
implicit data from the graph. By defining the LHS (if statment) and RHS (then conclusion) it is possible to
automatically materialise new concepts based on these rules.
| Modifier and Type | Method and Description |
|---|---|
Rule |
addConclusion(Type type)
Add a conclusion of the specified Type to the Rule.
|
Rule |
addHypothesis(Type type)
Add a hypothesis of the specified Type to the Rule.
|
Collection<Type> |
getConclusionTypes()
Retrieve a set of Types that constitue a part of the conclusion of the Rule.
|
Collection<Type> |
getHypothesisTypes()
Retrieve a set of Types that constitute a part of the hypothesis of this Rule.
|
Pattern |
getLHS()
Retrieves the Left Hand Side of a Graql query.
|
Pattern |
getRHS()
Retrieves the Right Hand Side of a Graql query.
|
RuleType |
type()
Return the Type of the Concept.
|
hasResource, playsRoles, relations, resourcesasEntity, asEntityType, asInstance, asRelation, asRelationType, asResource, asResourceType, asRoleType, asRule, asRuleType, asType, delete, getId, isEntity, isEntityType, isInstance, isRelation, isRelationType, isResource, isResourceType, isRoleType, isRule, isRuleType, isTypecompareToPattern getLHS()
Pattern getRHS()
Rule addHypothesis(Type type)
type - The Type which this Rule applies to.Rule addConclusion(Type type)
type - The Type which is the conclusion of this Rule.Collection<Type> getHypothesisTypes()
Collection<Type> getConclusionTypes()
Copyright © 2017 Grakn Labs Ltd. All rights reserved.