public class RuleUtils extends Object
Convenience class providing methods for operating with the rule graph.
| Constructor and Description |
|---|
RuleUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Set<InferenceRule> |
getDependentRules(ReasonerQueryImpl query) |
static Set<Rule> |
getDependentRules(Set<Type> topTypes) |
static java.util.stream.Stream<Rule> |
getRules(GraknTx graph) |
static java.util.stream.Stream<Rule> |
getRulesWithType(SchemaConcept type,
GraknTx graph) |
static boolean |
hasRules(GraknTx graph) |
static boolean |
subGraphHasLoops(Set<InferenceRule> rules,
GraknTx graph) |
static boolean |
subGraphHasLoopsWithNegativeFlux(Set<InferenceRule> rules,
GraknTx graph) |
static boolean |
subGraphHasRulesWithHeadSatisfyingBody(Set<InferenceRule> rules) |
public static java.util.stream.Stream<Rule> getRules(GraknTx graph)
graph - of interestpublic static boolean hasRules(GraknTx graph)
graph - of interestpublic static java.util.stream.Stream<Rule> getRulesWithType(SchemaConcept type, GraknTx graph)
type - for which rules containing it in the head are soughtgraph - of interestpublic static boolean subGraphHasLoops(Set<InferenceRule> rules, GraknTx graph)
rules - set of rules of interest forming a rule subgraphgraph - of interestpublic static boolean subGraphHasLoopsWithNegativeFlux(Set<InferenceRule> rules, GraknTx graph)
rules - set of rules of interest forming a rule subgraphgraph - of interestpublic static boolean subGraphHasRulesWithHeadSatisfyingBody(Set<InferenceRule> rules)
rules - set of rules of interest forming a rule subgraphpublic static Set<Rule> getDependentRules(Set<Type> topTypes)
topTypes - entry types in the rule graphpublic static Set<InferenceRule> getDependentRules(ReasonerQueryImpl query)
query - top queryCopyright © 2017 Grakn Labs Ltd. All rights reserved.