Class LPRuleStore

java.lang.Object
org.apache.jena.reasoner.rulesys.impl.RuleStore
org.apache.jena.reasoner.rulesys.impl.LPRuleStore

public class LPRuleStore extends RuleStore
Holds the set of backward rules used by an LPEngine. Is responsible for compile the rules into internal byte codes before use.
  • Constructor Details

    • LPRuleStore

      public LPRuleStore(List<Rule> rules)
      Construct a rule store containing the given rules.
      Parameters:
      rules - the rules to initialize the store with.
    • LPRuleStore

      public LPRuleStore()
      Construct an empty rule store
  • Method Details

    • addAll

      public void addAll(LPRuleStore store)
      Add all the rules and tabling instructions from an existing rulestore into this one.
    • tablePredicate

      public void tablePredicate(Node predicate)
      Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.
    • codeFor

      public List<RuleClauseCode> codeFor(Node predicate)
      Return an ordered list of RuleClauseCode objects to implement the given predicate.
      Parameters:
      predicate - the predicate node or Node_RuleVariable.WILD for wildcards.
    • codeFor

      public List<RuleClauseCode> codeFor(TriplePattern goal)
      Return an ordered list of RuleClauseCode objects to implement the given query pattern. This may use indexing to narrow the rule set more that the predicate-only case.
      Parameters:
      goal - the triple pattern that makes up the query
    • isIndexedPredicate

      public boolean isIndexedPredicate(Node predicate)
      Return true if the given predicate is indexed.
    • isTabled

      public boolean isTabled(TriplePattern goal)
      Return true if the given goal is tabled, currently this is true if the predicate is a tabled predicate or the predicate is a wildcard and some tabled predicates exist.
    • isTabled

      public boolean isTabled(Node predicate)
      Return true if the given predicated is tabled, currently this is true if the predicate is a tabled predicate or the predicate is a wildcard and some tabled predicates exist.