use of com.vaticle.typedb.core.graph.structure.RuleStructure in project grakn by graknlabs.
the class LogicManager method getRule.
public Rule getRule(String label) {
Rule rule = logicCache.rule().getIfPresent(label);
if (rule != null)
return rule;
RuleStructure structure = graphMgr.schema().rules().get(label);
if (structure != null)
return logicCache.rule().get(structure.label(), l -> Rule.of(this, structure));
return null;
}
use of com.vaticle.typedb.core.graph.structure.RuleStructure in project grakn by graknlabs.
the class Rule method of.
public static Rule of(String label, com.vaticle.typeql.lang.pattern.Conjunction<? extends Pattern> when, com.vaticle.typeql.lang.pattern.variable.ThingVariable<?> then, GraphManager graphMgr, ConceptManager conceptMgr, LogicManager logicMgr) {
RuleStructure structure = graphMgr.schema().rules().create(label, when, then);
Rule rule = new Rule(structure, logicMgr);
rule.conclusion().index();
rule.validate(logicMgr, conceptMgr);
return rule;
}
Aggregations