Java Doc for LPBRuleEngine.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » rulesys » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 » com.hp.hpl.jena.reasoner.rulesys.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.hp.hpl.jena.reasoner.rulesys.impl.LPBRuleEngine

LPBRuleEngine
public class LPBRuleEngine (Code)
LP version of the core backward chaining engine. For each parent inference graph (whether pure backward or hybrid) there should be one LPBRuleEngine instance. The shared instance holds any common result caching, rule store and global state data. However, all the processing is done by instances of the LPInterpreter - one per query.
author:
   Dave Reynolds
version:
   $Revision: 1.13 $ on $Date: 2008/01/02 12:06:16 $

Inner Class :static class Count implements Comparable

Field Summary
final public static  intCYCLES_BETWEEN_COMPLETION_CHECK
     The number of generator cycles to wait before running a completion check. If set to 0 then checks will be done in the generator each time.
protected  ListactiveInterpreters
    
protected  LinkedListagenda
    
protected  BackwardRuleInfGraphIinfGraph
    
static  Loglogger
    
protected  HashMapprofile
    
protected  booleanrecordDerivations
    
protected  LPRuleStoreruleStore
    
protected  HashMaptabledGoals
     Table mapping tabled goals to generators for those goals. This is here so that partial goal state can be shared across multiple queries.
protected  booleantraceOn
    

Constructor Summary
public  LPBRuleEngine(BackwardRuleInfGraphI infGraph, LPRuleStore rules)
     Constructor.
public  LPBRuleEngine(BackwardRuleInfGraphI infGraph)
     Constructor.

Method Summary
public synchronized  voidaddRule(Rule rule)
     Add a single rule to the store. N.B.
public  voidcheckForCompletions()
     Check all known interpeter contexts to see if any are complete.
public  voidcheckSafeToUpdate()
     Check that there are no currently processing queries. Could throw an exception here but often this can be caused by simply leaving an unclosed iterator.
public synchronized  voiddeleteAllRules()
     Delete all the rules.
public synchronized  voiddeleteRule(Rule rule)
     Remove a single rule from the store. N.B.
public synchronized  voiddetach(LPInterpreter engine)
    
public synchronized  ExtendedIteratorfind(TriplePattern goal)
     Start a new interpreter running to answer a query.
public synchronized  GeneratorgeneratorFor(TriplePattern goal, List clauses)
     Return a generator for the given goal (assumes that the caller knows that the goal should be tabled).
public synchronized  GeneratorgeneratorFor(TriplePattern goal)
     Return a generator for the given goal (assumes that the caller knows that the goal should be tabled).
public synchronized  ListgetAllRules()
     Return an ordered list of all registered rules.
public  booleangetDerivationLogging()
     Return true in derivations should be logged.
public  BackwardRuleInfGraphIgetInfGraph()
    
public  LPRuleStoregetRuleStore()
    
public synchronized  voidhalt()
     Stop the current work.
public  voidincrementProfile(RuleClauseCode clause)
     Record a rule invocation in the profile count.
public  booleanisTraceOn()
     Return true if traces of rule firings should be logged.
public  voidprintProfile()
     Print a profile of rules used since the last reset.
public synchronized  voidpump(LPInterpreterContext gen)
     Run the scheduled generators until the given generator is ready to run.
public synchronized  voidreset()
     Clear all tabled results.
public  voidresetProfile(boolean enable)
     Reset the profile.
public  voidschedule(LPAgendaEntry state)
     Register that a generator or specific generator state (Consumer choice point) is now ready to run.
public  voidsetDerivationLogging(boolean recordDerivations)
    
public  voidsetTraceOn(boolean state)
     Set the state of the trace flag.
public synchronized  voidtablePredicate(Node predicate)
     Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.

Field Detail
CYCLES_BETWEEN_COMPLETION_CHECK
final public static int CYCLES_BETWEEN_COMPLETION_CHECK(Code)
The number of generator cycles to wait before running a completion check. If set to 0 then checks will be done in the generator each time.



activeInterpreters
protected List activeInterpreters(Code)
List of engine instances which are still processing queries



agenda
protected LinkedList agenda(Code)
Set of generators waiting to be run



infGraph
protected BackwardRuleInfGraphI infGraph(Code)
The parent inference graph to which this engine is attached



logger
static Log logger(Code)



profile
protected HashMap profile(Code)
Optional profile of number of time each rule is entered, set to non-null to profile



recordDerivations
protected boolean recordDerivations(Code)
Set to true to flag that derivations should be logged



ruleStore
protected LPRuleStore ruleStore(Code)
Store which holds the raw and compiled rules



tabledGoals
protected HashMap tabledGoals(Code)
Table mapping tabled goals to generators for those goals. This is here so that partial goal state can be shared across multiple queries.



traceOn
protected boolean traceOn(Code)
True if debug information should be written out




Constructor Detail
LPBRuleEngine
public LPBRuleEngine(BackwardRuleInfGraphI infGraph, LPRuleStore rules)(Code)
Constructor.
Parameters:
  infGraph - the parent inference graph which is using this engine
Parameters:
  rules - the indexed set of rules to process



LPBRuleEngine
public LPBRuleEngine(BackwardRuleInfGraphI infGraph)(Code)
Constructor. Creates an empty engine to which rules must be added.
Parameters:
  infGraph - the parent inference graph which is using this engine




Method Detail
addRule
public synchronized void addRule(Rule rule)(Code)
Add a single rule to the store. N.B. This will invalidate current partial results and the engine should be reset() before future queries.



checkForCompletions
public void checkForCompletions()(Code)
Check all known interpeter contexts to see if any are complete.



checkSafeToUpdate
public void checkSafeToUpdate()(Code)
Check that there are no currently processing queries. Could throw an exception here but often this can be caused by simply leaving an unclosed iterator. So instead we try to close the iterators and assume the rest of the context will be reset by the add call.

Should be called from within a synchronized block.




deleteAllRules
public synchronized void deleteAllRules()(Code)
Delete all the rules.



deleteRule
public synchronized void deleteRule(Rule rule)(Code)
Remove a single rule from the store. N.B. This will invalidate current partial results and the engine should be reset() before future queries.



detach
public synchronized void detach(LPInterpreter engine)(Code)
Detatch the given engine from the list of active engines for this inf graph



find
public synchronized ExtendedIterator find(TriplePattern goal)(Code)
Start a new interpreter running to answer a query.
Parameters:
  goal - the query to be processed a closable iterator over the query results



generatorFor
public synchronized Generator generatorFor(TriplePattern goal, List clauses)(Code)
Return a generator for the given goal (assumes that the caller knows that the goal should be tabled).
Parameters:
  goal - the goal whose results are to be generated
Parameters:
  clauses - the precomputed set of code blocks used to implement the goal



generatorFor
public synchronized Generator generatorFor(TriplePattern goal)(Code)
Return a generator for the given goal (assumes that the caller knows that the goal should be tabled).
Parameters:
  goal - the goal whose results are to be generated



getAllRules
public synchronized List getAllRules()(Code)
Return an ordered list of all registered rules.



getDerivationLogging
public boolean getDerivationLogging()(Code)
Return true in derivations should be logged.



getInfGraph
public BackwardRuleInfGraphI getInfGraph()(Code)
Return the parent infernce graph associated with this engine



getRuleStore
public LPRuleStore getRuleStore()(Code)
Return the rule store associated with the inference graph



halt
public synchronized void halt()(Code)
Stop the current work. Forcibly stop all current query instances over this engine.



incrementProfile
public void incrementProfile(RuleClauseCode clause)(Code)
Record a rule invocation in the profile count.



isTraceOn
public boolean isTraceOn()(Code)
Return true if traces of rule firings should be logged.



printProfile
public void printProfile()(Code)
Print a profile of rules used since the last reset.



pump
public synchronized void pump(LPInterpreterContext gen)(Code)
Run the scheduled generators until the given generator is ready to run.



reset
public synchronized void reset()(Code)
Clear all tabled results.



resetProfile
public void resetProfile(boolean enable)(Code)
Reset the profile.
Parameters:
  enable - it true then profiling will continue with a new empty profile table,if false profiling will stop all current data lost.



schedule
public void schedule(LPAgendaEntry state)(Code)
Register that a generator or specific generator state (Consumer choice point) is now ready to run.



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



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.



tablePredicate
public synchronized void tablePredicate(Node predicate)(Code)
Register an RDF predicate as one whose presence in a goal should force the goal to be tabled.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w___w__w_.__j__a___va___2__s.__c_o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.