KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > rulesys > impl > FRuleEngineI


1 /******************************************************************
2  * File: FRuleEngineI.java
3  * Created by: Dave Reynolds
4  * Created on: 11-Jun-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: FRuleEngineI.java,v 1.6 2005/02/21 12:17:40 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys.impl;
11
12 import com.hp.hpl.jena.graph.Triple;
13 import com.hp.hpl.jena.reasoner.Finder;
14 //import java.util.List;
15

16 /**
17  * Rule engines implement the internals of forward rule inference
18  * graphs and the forward part of hybrid graphs. This interface
19  * abstracts the interface onto such engines to allow a graph to
20  * switch between direct and RETE style implementations.
21  *
22  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
23  * @version $Revision: 1.6 $ on $Date: 2005/02/21 12:17:40 $
24  */

25 public interface FRuleEngineI {
26     
27     /**
28      * Process all available data. This should be called once a deductions graph
29      * has be prepared and loaded with any precomputed deductions. It will process
30      * the rule axioms and all relevant existing exiting data entries.
31      * @param ignoreBrules set to true if rules written in backward notation should be ignored
32      * @param inserts the set of triples to be processed, normally this is the
33      * raw data graph but may include additional deductions made by preprocessing hooks
34      */

35     public void init(boolean ignoreBrules, Finder inserts);
36     
37     /**
38      * Process all available data. This version expects that all the axioms
39      * have already be preprocessed and the rules have been compiled
40      * @param inserts the set of triples to be processed, normally this is the
41      * raw data graph but may include additional deductions made by preprocessing hooks
42      */

43     public void fastInit(Finder inserts);
44     
45     /**
46      * Add one triple to the data graph, run any rules triggered by
47      * the new data item, recursively adding any generated triples.
48      */

49     public void add(Triple t);
50     
51     /**
52      * Remove one triple to the data graph.
53      * @return true if the effects could be correctly propagated or
54      * false if not (in which case the entire engine should be restarted).
55      */

56     public boolean delete(Triple t);
57     
58     /**
59      * Return the number of rules fired since this rule engine instance
60      * was created and initialized
61      */

62     public long getNRulesFired();
63     
64     /**
65      * Return true if the internal engine state means that tracing is worthwhile.
66      * It will return false during the axiom bootstrap phase.
67      */

68     public boolean shouldTrace();
69
70     /**
71      * Set to true to enable derivation caching
72      */

73     public void setDerivationLogging(boolean recordDerivations);
74     
75     /**
76      * Access the precomputed internal rule form. Used when precomputing the
77      * internal axiom closures.
78      */

79     public Object JavaDoc getRuleStore();
80     
81     /**
82      * Set the internal rule from from a precomputed state.
83      */

84     public void setRuleStore(Object JavaDoc ruleStore);
85     
86     /**
87      * Compile a list of rules into the internal rule store representation.
88      * @param rules the list of Rule objects
89      * @param ignoreBrules set to true if rules written in backward notation should be ignored
90      * @return an object that can be installed into the engine using setRuleStore.
91      */

92 // public void compile(List rules, boolean ignoreBrules);
93

94 }
95
96
97
98 /*
99     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
100     All rights reserved.
101
102     Redistribution and use in source and binary forms, with or without
103     modification, are permitted provided that the following conditions
104     are met:
105
106     1. Redistributions of source code must retain the above copyright
107        notice, this list of conditions and the following disclaimer.
108
109     2. Redistributions in binary form must reproduce the above copyright
110        notice, this list of conditions and the following disclaimer in the
111        documentation and/or other materials provided with the distribution.
112
113     3. The name of the author may not be used to endorse or promote products
114        derived from this software without specific prior written permission.
115
116     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
117     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
119     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
120     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
121     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
122     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
123     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
124     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
125     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
126 */
Popular Tags