Source Code Cross Referenced for RETERuleInfGraph.java in  » RSS-RDF » Jena-2.5.5 » com » hp » hpl » jena » reasoner » rulesys » 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 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************
002:         * File:        RETERuleInfGraph.java
003:         * Created by:  Dave Reynolds
004:         * Created on:  12-Jun-2003
005:         * 
006:         * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
007:         * [See end of file]
008:         * $Id: RETERuleInfGraph.java,v 1.11 2008/01/02 12:07:47 andy_seaborne Exp $
009:         *****************************************************************/package com.hp.hpl.jena.reasoner.rulesys;
010:
011:        import com.hp.hpl.jena.graph.*;
012:        import com.hp.hpl.jena.reasoner.*;
013:        import com.hp.hpl.jena.reasoner.rulesys.impl.*;
014:
015:        import java.util.*;
016:
017:        /**
018:         * RETE implementation of the forward rule infernce graph.
019:         * 
020:         * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
021:         * @version $Revision: 1.11 $ on $Date: 2008/01/02 12:07:47 $
022:         */
023:        public class RETERuleInfGraph extends BasicForwardRuleInfGraph {
024:
025:            /**
026:             * Constructor. Creates a new inference graph to which a (compiled) rule set
027:             * and a data graph can be attached. This separation of binding is useful to allow
028:             * any configuration parameters (such as logging) to be set before the data is added.
029:             * Note that until the data is added using {@link #rebind rebind} then any operations
030:             * like add, remove, find will result in errors.
031:             * 
032:             * @param reasoner the parent reasoner 
033:             * @param schema the (optional) schema data which is being processed
034:             */
035:            public RETERuleInfGraph(Reasoner reasoner, Graph schema) {
036:                super (reasoner, schema);
037:            }
038:
039:            /**
040:             * Constructor. Creates a new inference graph based on the given rule set. 
041:             * No data graph is attached at this stage. This is to allow
042:             * any configuration parameters (such as logging) to be set before the data is added.
043:             * Note that until the data is added using {@link #rebind rebind} then any operations
044:             * like add, remove, find will result in errors.
045:             * 
046:             * @param reasoner the parent reasoner 
047:             * @param rules the list of rules to use this time
048:             * @param schema the (optional) schema or preload data which is being processed
049:             */
050:            public RETERuleInfGraph(Reasoner reasoner, List rules, Graph schema) {
051:                super (reasoner, rules, schema);
052:            }
053:
054:            /**
055:             * Constructor. Creates a new inference graph based on the given rule set
056:             * then processes the initial data graph. No precomputed deductions are loaded.
057:             * 
058:             * @param reasoner the parent reasoner 
059:             * @param rules the list of rules to use this time
060:             * @param schema the (optional) schema or preload data which is being processed
061:             * @param data the data graph to be processed
062:             */
063:            public RETERuleInfGraph(Reasoner reasoner, List rules,
064:                    Graph schema, Graph data) {
065:                super (reasoner, rules, schema, data);
066:            }
067:
068:            /**
069:             * Instantiate the forward rule engine to use.
070:             * Subclasses can override this to switch to, say, a RETE imlementation.
071:             * @param rules the rule set or null if there are not rules bound in yet.
072:             */
073:            protected void instantiateRuleEngine(List rules) {
074:                if (rules != null) {
075:                    engine = new RETEEngine(this , rules);
076:                } else {
077:                    engine = new RETEEngine(this );
078:                }
079:            }
080:
081:            /**
082:             * Add one triple to the data graph, run any rules triggered by
083:             * the new data item, recursively adding any generated triples.
084:             */
085:            public synchronized void performAdd(Triple t) {
086:                if (!isPrepared)
087:                    prepare();
088:                fdata.getGraph().add(t);
089:                engine.add(t);
090:            }
091:
092:            /** 
093:             * Removes the triple t (if possible) from the set belonging to this graph. 
094:             */
095:            public void performDelete(Triple t) {
096:                if (!isPrepared)
097:                    prepare();
098:                if (fdata != null) {
099:                    Graph data = fdata.getGraph();
100:                    if (data != null) {
101:                        data.delete(t);
102:                    }
103:                }
104:                engine.delete(t);
105:                fdeductions.getGraph().delete(t);
106:            }
107:
108:        }
109:
110:        /*
111:         (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
112:         All rights reserved.
113:
114:         Redistribution and use in source and binary forms, with or without
115:         modification, are permitted provided that the following conditions
116:         are met:
117:
118:         1. Redistributions of source code must retain the above copyright
119:         notice, this list of conditions and the following disclaimer.
120:
121:         2. Redistributions in binary form must reproduce the above copyright
122:         notice, this list of conditions and the following disclaimer in the
123:         documentation and/or other materials provided with the distribution.
124:
125:         3. The name of the author may not be used to endorse or promote products
126:         derived from this software without specific prior written permission.
127:
128:         THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
129:         IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
130:         OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
131:         IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
132:         INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
133:         NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
134:         DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
135:         THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
136:         (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
137:         THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
138:         */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.