java.lang.Object
org.apache.jena.reasoner.rulesys.impl.RETEConflictSet
Manages a set of ready-to-fire rules. For monotonic rule sets
we simply fire the rules as soon as they are triggered. For non-monotonic
rule sets we stack them up in a conflict set and fire them one-at-a-time,
propagating all changes between times.
Note, implementation is not thread-safe. Would be easy to make it so but concurrent adds to InfModel are not supported anyway.
-
Constructor Summary
ConstructorDescriptionRETEConflictSet
(RETERuleContext context, boolean isMonotonic) Construct an empty conflict set, noting whether the overall rule system is monotonic or not -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(Rule rule, BindingEnvironment env, boolean isAdd) Record a request for a rule firing.static void
execute
(RETERuleContext context, boolean isAdd) Execute a single rule firing.boolean
fireOne()
Pick on pending rule from the conflict set and fire it.boolean
isEmpty()
Return true if there are no more rules awaiting firing.
-
Constructor Details
-
RETEConflictSet
Construct an empty conflict set, noting whether the overall rule system is monotonic or not
-
-
Method Details
-
add
Record a request for a rule firing. For monotonic rulesets it may be actioned immediately, otherwise it will be stacked up. -
isEmpty
public boolean isEmpty()Return true if there are no more rules awaiting firing. -
fireOne
public boolean fireOne()Pick on pending rule from the conflict set and fire it. Return true if there was a rule to fire. -
execute
Execute a single rule firing.
-