| com.hp.hpl.jena.reasoner.BaseInfGraph com.hp.hpl.jena.reasoner.rulesys.impl.oldCode.BasicBackwardRuleInfGraph
BasicBackwardRuleInfGraph | public class BasicBackwardRuleInfGraph extends BaseInfGraph implements BackwardRuleInfGraphI(Code) | | An inference graph that runs a set of rules using a tabled
backward chaining interpreter.
author: Dave Reynolds version: $Revision: 1.11 $ on $Date: 2008/01/02 12:09:44 $ |
Method Summary | |
public void | dump() Dump an a summary of the goal table state to stdout. | protected void | extractAxioms() Find any axioms (rules with no body) in the rule set and
add those to the auxilliary graph to be included in searches. | public ExtendedIterator | find(TriplePattern pattern) Basic pattern lookup interface. | public ExtendedIterator | findDataMatches(TriplePattern pattern) Match a pattern just against the stored data (raw data, schema,
axioms) but no derivation. | public ExtendedIterator | findWithContinuation(TriplePattern pattern, Finder continuation) Extended find interface used in situations where the implementator
may or may not be able to answer the complete query. | public Iterator | getDerivation(Triple t) Return the derivation of at triple. | public Graph | getSchemaGraph() Return the schema graph, if any, bound into this inference graph. | public Node | getTemp(Node instance, Node prop, Node pclass) Retrieve or create a bNode representing an inferred property value.
Parameters: instance - the base instance node to which the property applies Parameters: prop - the property node whose value is being inferred Parameters: pclass - the (optional, can be null) class for the inferred value. | public ExtendedIterator | graphBaseFind(Node subject, Node property, Node object) Returns an iterator over Triples. | public boolean | isTraceOn() | public void | logDerivation(Triple t, Object derivation) Log a dervivation record against the given triple. | public synchronized void | performAdd(Triple t) Add one triple to the data graph, run any rules triggered by
the new data item, recursively adding any generated triples. | public void | performDelete(Triple t) Removes the triple t (if possible) from the set belonging to this graph. | public void | prepare() Perform any initial processing and caching. | public boolean | processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env) | public void | rebind(Graph data) Replace the underlying data graph for this inference graph and start any
inferences over again. | public void | rebind() Cause the inference graph to reconsult the underlying graph to take
into account changes. | public void | reset() Flush out all cached results. | public void | setDerivationLogging(boolean recordDerivations) | public void | setRuleThreshold(long threshold) Change the threshold on the number of rule firings
allowed during a single operation. | public void | setTraceOn(boolean state) Set the state of the trace flag. | public void | silentAdd(Triple t) Assert a new triple in the deduction graph, bypassing any processing machinery. |
DEFAULT_RULES_THRESHOLD | final public static long DEFAULT_RULES_THRESHOLD(Code) | | Default setting for rules threshold
|
context | protected BBRuleContext context(Code) | | Single context for the reasoner, used when passing information to builtins
|
dataFind | protected Finder dataFind(Code) | | A finder that searches across the data, schema and axioms
|
derivations | protected OneToManyMap derivations(Code) | | Table of derivation records, maps from triple to RuleDerivation
|
engine | protected BRuleEngine engine(Code) | | The core rule engine which includes all the memoized results
|
fdeductions | protected FGraph fdeductions(Code) | | Cache of deductions made from the rules
|
fschema | protected FGraph fschema(Code) | | An optional graph of separate schema assertions that should also be processed
|
nRulesFired | long nRulesFired(Code) | | performance stats - number of rules fired
|
nRulesThreshold | long nRulesThreshold(Code) | | threshold on the numbers of rule firings allowed in a single operation
|
nRulesTriggered | int nRulesTriggered(Code) | | performance stats - number of rules passing initial trigger
|
rules | protected List rules(Code) | | Set for rules being used
|
tempNodecache | protected TempNodeCache tempNodecache(Code) | | Cache of temporary property values inferred through getTemp calls
|
traceOn | boolean traceOn(Code) | | Flag which, if true, enables tracing of rule actions to logger.info
|
BasicBackwardRuleInfGraph | public BasicBackwardRuleInfGraph(Reasoner reasoner, RuleStore ruleStore, Graph data, Graph schema)(Code) | | Constructor. Create a new backward inference graph to process
the given data. The parent reasoner supplies the ruleset and
any additional schema graph.
Parameters: reasoner - the parent reasoner Parameters: ruleStore - the indexed set of rules to use Parameters: data - the data graph to be processed Parameters: schema - optional precached schema (use null if not required) |
dump | public void dump()(Code) | | Dump an a summary of the goal table state to stdout.
Just debugging, do not use for real.
|
extractAxioms | protected void extractAxioms()(Code) | | Find any axioms (rules with no body) in the rule set and
add those to the auxilliary graph to be included in searches.
|
find | public ExtendedIterator find(TriplePattern pattern)(Code) | | Basic pattern lookup interface.
This implementation assumes that the underlying findWithContinuation
will have also consulted the raw data.
Parameters: pattern - a TriplePattern to be matched against the data a ExtendedIterator over all Triples in the data setthat match the pattern |
findWithContinuation | public ExtendedIterator findWithContinuation(TriplePattern pattern, Finder continuation)(Code) | | Extended find interface used in situations where the implementator
may or may not be able to answer the complete query. It will
attempt to answer the pattern but if its answers are not known
to be complete then it will also pass the request on to the nested
Finder to append more results.
Parameters: pattern - a TriplePattern to be matched against the data Parameters: continuation - either a Finder or a normal Graph whichwill be asked for additional match results if the implementormay not have completely satisfied the query. |
getDerivation | public Iterator getDerivation(Triple t)(Code) | | Return the derivation of at triple.
The derivation is a List of DerivationRecords
|
getSchemaGraph | public Graph getSchemaGraph()(Code) | | Return the schema graph, if any, bound into this inference graph.
|
getTemp | public Node getTemp(Node instance, Node prop, Node pclass)(Code) | | Retrieve or create a bNode representing an inferred property value.
Parameters: instance - the base instance node to which the property applies Parameters: prop - the property node whose value is being inferred Parameters: pclass - the (optional, can be null) class for the inferred value. the bNode representing the property value |
graphBaseFind | public ExtendedIterator graphBaseFind(Node subject, Node property, Node object)(Code) | | Returns an iterator over Triples.
This implementation assumes that the underlying findWithContinuation
will have also consulted the raw data.
|
isTraceOn | public boolean isTraceOn()(Code) | | Return true if tracing is switched on
|
logDerivation | public void logDerivation(Triple t, Object derivation)(Code) | | Log a dervivation record against the given triple.
|
performAdd | public synchronized void performAdd(Triple t)(Code) | | Add one triple to the data graph, run any rules triggered by
the new data item, recursively adding any generated triples.
|
performDelete | public void performDelete(Triple t)(Code) | | Removes the triple t (if possible) from the set belonging to this graph.
|
prepare | public void prepare()(Code) | | Perform any initial processing and caching. This call is optional. Most
engines either have negligable set up work or will perform an implicit
"prepare" if necessary. The call is provided for those occasions where
substantial preparation work is possible (e.g. running a forward chaining
rule system) and where an application might wish greater control over when
this prepration is done.
|
processBuiltin | public boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env)(Code) | | Process a call to a builtin predicate
Parameters: clause - the Functor representing the call Parameters: env - the BindingEnvironment for this call Parameters: rule - the rule which is invoking this call true if the predicate succeeds |
rebind | public void rebind(Graph data)(Code) | | Replace the underlying data graph for this inference graph and start any
inferences over again. This is primarily using in setting up ontology imports
processing to allow an imports multiunion graph to be inserted between the
inference graph and the raw data, before processing.
Parameters: data - the new raw data graph |
rebind | public void rebind()(Code) | | Cause the inference graph to reconsult the underlying graph to take
into account changes. Normally changes are made through the InfGraph's add and
remove calls are will be handled appropriately. However, in some cases changes
are made "behind the InfGraph's back" and this forces a full reconsult of
the changed data.
|
reset | public void reset()(Code) | | Flush out all cached results. Future queries have to start from scratch.
|
setDerivationLogging | public void setDerivationLogging(boolean recordDerivations)(Code) | | Set to true to enable derivation caching
|
setRuleThreshold | public void setRuleThreshold(long threshold)(Code) | | Change the threshold on the number of rule firings
allowed during a single operation.
Parameters: threshold - the new cutoff on the number rules firings per external op |
setTraceOn | public void setTraceOn(boolean state)(Code) | | Set the state of the trace flag. If set to true then rule firings
are logged out to the Log at "INFO" level.
|
silentAdd | public void silentAdd(Triple t)(Code) | | Assert a new triple in the deduction graph, bypassing any processing machinery.
|
|
|