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 Summary
Constructors Constructor Description LPRuleStore()
Construct an empty rule storeLPRuleStore(java.util.List<Rule> rules)
Construct a rule store containing the given rules.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAll(LPRuleStore store)
Add all the rules and tabling instructions from an existing rulestore into this one.java.util.List<RuleClauseCode>
codeFor(Node predicate)
Return an ordered list of RuleClauseCode objects to implement the given predicate.java.util.List<RuleClauseCode>
codeFor(TriplePattern goal)
Return an ordered list of RuleClauseCode objects to implement the given query pattern.boolean
isIndexedPredicate(Node predicate)
Return true if the given predicate is indexed.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.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.void
tablePredicate(Node predicate)
Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.-
Methods inherited from class org.apache.jena.reasoner.rulesys.impl.RuleStore
addAll, addRule, deleteAllRules, deleteRule, getAllRules, rulesFor
-
-
-
-
Constructor Detail
-
LPRuleStore
public LPRuleStore(java.util.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 Detail
-
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 java.util.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 java.util.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.
-
-