Class AbstractRuleApplier<RW extends MaterializedData & Writable>
java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.rule_applier.AbstractRuleApplier<RW>
- Type Parameters:
RW- the writable materialized data type handled by the rule applier Abstract class
- All Implemented Interfaces:
RuleApplier<RW>
- Direct Known Subclasses:
BreadthFirstTriggerRuleApplier, MultiThreadRuleApplier, ParallelTriggerRuleApplier
public abstract class AbstractRuleApplier<RW extends MaterializedData & Writable>
extends Object
implements RuleApplier<RW>
Base implementation for rule appliers composed of a transformer, computer, checker, and applier.
- Author:
- Florent Tornil
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TriggerApplier<RW> How to effectively apply the triggerprotected final TriggerChecker<RW> How to check the trigger should be appliedprotected final TriggerComputer<RW> How to evaluate the rule's bodyprotected org.slf4j.LoggerLogger used by concrete rule appliers.protected final BodyToQueryTransformerTransformation of the rule's body to a query -
Constructor Summary
ConstructorsConstructorDescriptionAbstractRuleApplier(BodyToQueryTransformer transformer, TriggerComputer<RW> computer, TriggerChecker<RW> checker, TriggerApplier<RW> applier) Constructor -
Method Summary
Modifier and TypeMethodDescriptiondescribe()Defautl method to describe the rule schedulerReturns a JSON description of the rule applier.protected Map<FOQuery<?>, Collection<FORule>> groupRulesByBodyQuery(Collection<FORule> rules) Re-groups the rules with the same bodyvoidInitialize the rule applier for the given chaseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RuleApplier
apply
-
Field Details
-
LOG
protected org.slf4j.Logger LOGLogger used by concrete rule appliers. -
transformer
Transformation of the rule's body to a query -
computer
How to evaluate the rule's body -
checker
How to check the trigger should be applied -
applier
How to effectively apply the trigger
-
-
Constructor Details
-
AbstractRuleApplier
public AbstractRuleApplier(BodyToQueryTransformer transformer, TriggerComputer<RW> computer, TriggerChecker<RW> checker, TriggerApplier<RW> applier) Constructor- Parameters:
transformer- the BodyToQueryTransformercomputer- the TriggerComputerchecker- the TriggerCheckerapplier- the TriggerApplier
-
-
Method Details
-
describe
Defautl method to describe the rule scheduler- Specified by:
describein interfaceRuleApplier<RW extends MaterializedData & Writable>- Returns:
- a textual description of the composed trigger-processing pipeline
-
describeJSON
Description copied from interface:RuleApplierReturns a JSON description of the rule applier.- Specified by:
describeJSONin interfaceRuleApplier<RW extends MaterializedData & Writable>- Returns:
- a JSON description of the rule applier
-
init
Description copied from interface:RuleApplierInitialize the rule applier for the given chase- Specified by:
initin interfaceRuleApplier<RW extends MaterializedData & Writable>- Parameters:
c- the chase object
-
groupRulesByBodyQuery
Re-groups the rules with the same body- Parameters:
rules- rules to re-group- Returns:
- the map of query to rules
-