Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hp.hpl.jena.reasoner.rulesys.impl.oldCode
Class FBLPRuleInfGraph  view FBLPRuleInfGraph download FBLPRuleInfGraph.java

java.lang.Object
  extended bycom.hp.hpl.jena.graph.impl.GraphBase
      extended bycom.hp.hpl.jena.reasoner.BaseInfGraph
          extended bycom.hp.hpl.jena.reasoner.rulesys.BasicForwardRuleInfGraph
              extended bycom.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph
                  extended bycom.hp.hpl.jena.reasoner.rulesys.impl.oldCode.FBLPRuleInfGraph
All Implemented Interfaces:
com.hp.hpl.jena.reasoner.rulesys.BackwardRuleInfGraphI, com.hp.hpl.jena.util.iterator.Filter, com.hp.hpl.jena.reasoner.rulesys.ForwardRuleInfGraphI, com.hp.hpl.jena.graph.Graph, com.hp.hpl.jena.graph.GraphAdd, com.hp.hpl.jena.graph.impl.GraphWithPerform, com.hp.hpl.jena.reasoner.InfGraph, com.hp.hpl.jena.reasoner.rulesys.SilentAddI

public class FBLPRuleInfGraph
extends com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph

An inference graph that uses a mixture of forward and backward chaining rules. This is a temporary harness for testing the LP engine. When that works the content of this class will be folded into FBRuleInfGraph and this one will disappear

Version:
$Revision: 1.5 $ on $Date: 2005/02/21 12:18:03 $

Nested Class Summary
 
Nested classes inherited from class com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph
com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph.RuleStore
 
Nested classes inherited from class com.hp.hpl.jena.reasoner.BaseInfGraph
com.hp.hpl.jena.reasoner.BaseInfGraph.InfCapabilities, com.hp.hpl.jena.reasoner.BaseInfGraph.InfFindSafeCapabilities, com.hp.hpl.jena.reasoner.BaseInfGraph.InfTransactionHandler
 
Field Summary
(package private) static org.apache.commons.logging.Log logger
           
protected  com.hp.hpl.jena.reasoner.rulesys.impl.LPBRuleEngine lpbEngine
          The core backward rule engine which includes all the memoized results
 
Fields inherited from class com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph
bEngine, context, dataFind, filterFunctors, hiddenNodes, preprocessorHooks, rawRules, rules, tempNodecache, transitiveEngine, useRETE, useTGCCaching
 
Fields inherited from class com.hp.hpl.jena.reasoner.rulesys.BasicForwardRuleInfGraph
derivations, engine, fdeductions, schemaGraph, traceOn
 
Fields inherited from class com.hp.hpl.jena.reasoner.BaseInfGraph
fdata, isPrepared, reasoner, recordDerivations
 
Fields inherited from class com.hp.hpl.jena.graph.impl.GraphBase
bulkHandler, capabilities, closed, gem, pm, queryHandler, reifier, style
 
Fields inherited from interface com.hp.hpl.jena.graph.Graph
emptyGraph
 
Fields inherited from interface com.hp.hpl.jena.util.iterator.Filter
any
 
Constructor Summary
FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner, com.hp.hpl.jena.graph.Graph schema)
          Constructor.
FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner, java.util.List rules, com.hp.hpl.jena.graph.Graph schema)
          Constructor.
FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner, java.util.List rules, com.hp.hpl.jena.graph.Graph schema, com.hp.hpl.jena.graph.Graph data)
          Constructor.
 
Method Summary
 void addBRule(com.hp.hpl.jena.reasoner.rulesys.Rule brule)
          Adds a new Backward rule as a rusult of a forward rule process.
 void addBRules(java.util.List rules)
          Adds a set of new Backward rules
 void deleteBRule(com.hp.hpl.jena.reasoner.rulesys.Rule brule)
          Deletes a new Backward rule as a rules of a forward rule process.
 com.hp.hpl.jena.util.iterator.ExtendedIterator findWithContinuation(com.hp.hpl.jena.reasoner.TriplePattern pattern, com.hp.hpl.jena.reasoner.Finder continuation)
          Extended find interface used in situations where the implementator may or may not be able to answer the complete query.
 java.util.List getBRules()
          Return an ordered list of all registered backward rules.
 long getNRulesFired()
          Return the number of rules fired since this rule engine instance was created and initialized
private  void initLP(com.hp.hpl.jena.graph.Graph schema)
          Initialize the LP engine, based on an optional schema graph.
 void performAdd(com.hp.hpl.jena.graph.Triple t)
          Add one triple to the data graph, run any rules triggered by the new data item, recursively adding any generated triples.
 void performDelete(com.hp.hpl.jena.graph.Triple t)
          Removes the triple t (if possible) from the set belonging to this graph.
 void printLPProfile()
          Print a profile of LP rules used since the last reset.
 boolean processBuiltin(java.lang.Object clause, com.hp.hpl.jena.reasoner.rulesys.Rule rule, com.hp.hpl.jena.reasoner.rulesys.BindingEnvironment env)
          Process a call to a builtin predicate
 void rebind()
          Cause the inference graph to reconsult the underlying graph to take into account changes.
 void reset()
          Flush out all cached results.
 void resetLPProfile(boolean enable)
          Reset the LP engine profile.
 void setDerivationLogging(boolean recordDerivations)
          Set to true to enable derivation caching
 void setTabled(com.hp.hpl.jena.graph.Node predicate)
          Set a predicate to be tabled/memoized by the LP engine.
 void setTraceOn(boolean state)
          Set the state of the trace flag.
 
Methods inherited from class com.hp.hpl.jena.reasoner.rulesys.FBRuleInfGraph
accept, addDeduction, addPreprocessingHook, addRuleDuringPrepare, cloneWithPremises, close, find, findDataMatches, findDataMatches, findFull, getRules, getTemp, graphBaseFind, hideNode, instantiateRuleEngine, preloadDeductions, prepare, processBuiltin, setFunctorFiltering, setUseTGCCache, validate
 
Methods inherited from class com.hp.hpl.jena.reasoner.rulesys.BasicForwardRuleInfGraph
getCurrentDeductionsGraph, getDeductionsGraph, getDerivation, getSchemaGraph, graphBaseSize, logDerivation, rebind, setRuleStore, shouldLogDerivations, shouldTrace, silentAdd
 
Methods inherited from class com.hp.hpl.jena.reasoner.BaseInfGraph
discardState, find, getBulkUpdateHandler, getCapabilities, getGlobalProperty, getPrefixMapping, getRawGraph, getReasoner, getReifier, getTransactionHandler, graphBaseFind, isEmpty, testGlobalProperty
 
Methods inherited from class com.hp.hpl.jena.graph.impl.GraphBase
add, checkOpen, contains, contains, containsByFind, delete, dependsOn, find, find, getEventManager, graphBaseContains, isIsomorphicWith, notifyAdd, notifyDelete, queryHandler, reifierContains, reifierSize, reifierTriples, size, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.jena.reasoner.rulesys.BackwardRuleInfGraphI
logDerivation
 
Methods inherited from interface com.hp.hpl.jena.reasoner.rulesys.SilentAddI
silentAdd
 
Methods inherited from interface com.hp.hpl.jena.reasoner.InfGraph
find, getDeductionsGraph, getDerivation, getGlobalProperty, getRawGraph, getReasoner, rebind, testGlobalProperty
 
Methods inherited from interface com.hp.hpl.jena.graph.Graph
contains, contains, delete, dependsOn, find, find, getBulkUpdateHandler, getCapabilities, getEventManager, getPrefixMapping, getReifier, getTransactionHandler, isEmpty, isIsomorphicWith, queryHandler, size
 
Methods inherited from interface com.hp.hpl.jena.graph.GraphAdd
add
 

Field Detail

lpbEngine

protected com.hp.hpl.jena.reasoner.rulesys.impl.LPBRuleEngine lpbEngine
The core backward rule engine which includes all the memoized results


logger

static org.apache.commons.logging.Log logger
Constructor Detail

FBLPRuleInfGraph

public FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner,
                        com.hp.hpl.jena.graph.Graph schema)
Constructor.


FBLPRuleInfGraph

public FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner,
                        java.util.List rules,
                        com.hp.hpl.jena.graph.Graph schema)
Constructor.


FBLPRuleInfGraph

public FBLPRuleInfGraph(com.hp.hpl.jena.reasoner.Reasoner reasoner,
                        java.util.List rules,
                        com.hp.hpl.jena.graph.Graph schema,
                        com.hp.hpl.jena.graph.Graph data)
Constructor.

Method Detail

initLP

private void initLP(com.hp.hpl.jena.graph.Graph schema)
Initialize the LP engine, based on an optional schema graph.


processBuiltin

public boolean processBuiltin(java.lang.Object clause,
                              com.hp.hpl.jena.reasoner.rulesys.Rule rule,
                              com.hp.hpl.jena.reasoner.rulesys.BindingEnvironment env)
Process a call to a builtin predicate


addBRule

public void addBRule(com.hp.hpl.jena.reasoner.rulesys.Rule brule)
Adds a new Backward rule as a rusult of a forward rule process. Only some infgraphs support this.


deleteBRule

public void deleteBRule(com.hp.hpl.jena.reasoner.rulesys.Rule brule)
Deletes a new Backward rule as a rules of a forward rule process. Only some infgraphs support this.


addBRules

public void addBRules(java.util.List rules)
Adds a set of new Backward rules


getBRules

public java.util.List getBRules()
Return an ordered list of all registered backward rules. Includes those generated by forward productions.


setTabled

public void setTabled(com.hp.hpl.jena.graph.Node predicate)
Set a predicate to be tabled/memoized by the LP engine.


rebind

public void rebind()
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.


setTraceOn

public void setTraceOn(boolean state)
Set the state of the trace flag. If set to true then rule firings are logged out to the Log at "INFO" level.


setDerivationLogging

public void setDerivationLogging(boolean recordDerivations)
Set to true to enable derivation caching


getNRulesFired

public long getNRulesFired()
Return the number of rules fired since this rule engine instance was created and initialized


findWithContinuation

public com.hp.hpl.jena.util.iterator.ExtendedIterator findWithContinuation(com.hp.hpl.jena.reasoner.TriplePattern pattern,
                                                                           com.hp.hpl.jena.reasoner.Finder continuation)
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.


reset

public void reset()
Flush out all cached results. Future queries have to start from scratch.


performAdd

public void performAdd(com.hp.hpl.jena.graph.Triple t)
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(com.hp.hpl.jena.graph.Triple t)
Removes the triple t (if possible) from the set belonging to this graph.


resetLPProfile

public void resetLPProfile(boolean enable)
Reset the LP engine profile.


printLPProfile

public void printLPProfile()
Print a profile of LP rules used since the last reset.