Interface FRuleEngineI
-
- 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Triple t)
Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.boolean
delete(Triple t)
Remove one triple to the data graph.void
fastInit(Finder inserts)
Process all available data.long
getNRulesFired()
Return the number of rules fired since this rule engine instance was created and initializedjava.lang.Object
getRuleStore()
Access the precomputed internal rule form.void
init(boolean ignoreBrules, Finder inserts)
Process all available data.void
setDerivationLogging(boolean recordDerivations)
Set to true to enable derivation cachingvoid
setRuleStore(java.lang.Object ruleStore)
Set the internal rule from a precomputed state.boolean
shouldTrace()
Return true if the internal engine state means that tracing is worthwhile.
-
-
-
Method Detail
-
init
void init(boolean ignoreBrules, Finder inserts)
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
void fastInit(Finder inserts)
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
void add(Triple t)
Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.
-
delete
boolean delete(Triple t)
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
java.lang.Object getRuleStore()
Access the precomputed internal rule form. Used when precomputing the internal axiom closures.
-
setRuleStore
void setRuleStore(java.lang.Object ruleStore)
Set the internal rule from a precomputed state.
-
-