java.lang.Object
org.apache.jena.reasoner.rulesys.impl.RuleStore
Direct Known Subclasses:
LPRuleStore

public class RuleStore extends Object
Indexes a collection of rule. The currently implementation is a crude first version aimed at supporting the backchaining interpreter. It only indexes on predicate.

The rules are normalized to only contain a single head element by duplicating any multi headed rules.

  • Constructor Details

    • RuleStore

      public RuleStore()
      Constructor. Create an empty rule store.
    • RuleStore

      public RuleStore(List<Rule> rules)
      Constructor. Stores and indexes a list of rules.
  • Method Details

    • addAll

      public void addAll(RuleStore store)
      Add all the rules and from an existing rulestore into this one.
    • addRule

      public void addRule(Rule rule)
      Add a single rule to the store.
    • deleteRule

      public void deleteRule(Rule rule)
      Remove a single rule from the store
    • rulesFor

      public List<Rule> rulesFor(TriplePattern goal)
      Return a list of rules that match the given goal pattern
      Parameters:
      goal - the goal being matched
    • getAllRules

      public List<Rule> getAllRules()
      Return an ordered list of all registered rules.
    • deleteAllRules

      public void deleteAllRules()
      Delete all the rules.