- All Known Implementing Classes:
FRuleEngine
,RETEEngine
public interface FRuleEngineI
Rule engines implement the internals of forward rule inference
graphs and the forward part of hybrid graphs. This interface
abstracts the interface onto such engines to allow a graph to
switch between direct and RETE style implementations.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.boolean
Remove one triple to the data graph.void
Process all available data.long
Return the number of rules fired since this rule engine instance was created and initializedAccess the precomputed internal rule form.void
Process all available data.void
setDerivationLogging
(boolean recordDerivations) Set to true to enable derivation cachingvoid
setRuleStore
(Object ruleStore) Set the internal rule from a precomputed state.boolean
Return true if the internal engine state means that tracing is worthwhile.
-
Method Details
-
init
Process all available data. This should be called once a deductions graph has be prepared and loaded with any precomputed deductions. It will process the rule axioms and all relevant existing exiting data entries.- Parameters:
ignoreBrules
- set to true if rules written in backward notation should be ignoredinserts
- the set of triples to be processed, normally this is the raw data graph but may include additional deductions made by preprocessing hooks
-
fastInit
Process all available data. This version expects that all the axioms have already be preprocessed and the rules have been compiled- Parameters:
inserts
- the set of triples to be processed, normally this is the raw data graph but may include additional deductions made by preprocessing hooks
-
add
Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples. -
delete
Remove one triple to the data graph.- Returns:
- true if the effects could be correctly propagated or false if not (in which case the entire engine should be restarted).
-
getNRulesFired
long getNRulesFired()Return the number of rules fired since this rule engine instance was created and initialized -
shouldTrace
boolean shouldTrace()Return true if the internal engine state means that tracing is worthwhile. It will return false during the axiom bootstrap phase. -
setDerivationLogging
void setDerivationLogging(boolean recordDerivations) Set to true to enable derivation caching -
getRuleStore
Object getRuleStore()Access the precomputed internal rule form. Used when precomputing the internal axiom closures. -
setRuleStore
Set the internal rule from a precomputed state.
-