KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > rulesys > ForwardRuleInfGraphI


1 /******************************************************************
2  * File: ForwardRuleInfGraphI.java
3  * Created by: Dave Reynolds
4  * Created on: 28-May-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: ForwardRuleInfGraphI.java,v 1.11 2005/03/23 13:58:14 der Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import com.hp.hpl.jena.graph.*;
13 import com.hp.hpl.jena.reasoner.InfGraph;
14 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
15
16 /**
17  * This interface collects together the operations on the InfGraph which
18  * are needed to support the forward rule engine.
19  *
20  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
21  * @version $Revision: 1.11 $ on $Date: 2005/03/23 13:58:14 $
22  */

23 public interface ForwardRuleInfGraphI extends InfGraph, SilentAddI {
24     
25     /**
26      * Return true if tracing should be acted on - i.e. if traceOn is true
27      * and we are past the bootstrap phase.
28      */

29     public boolean shouldTrace();
30         
31     /**
32      * Adds a new Backward rule as a rules of a forward rule process. Only some
33      * infgraphs support this.
34      */

35     public void addBRule(Rule brule);
36         
37     /**
38      * Deletes a new Backward rule as a rules of a forward rule process. Only some
39      * infgraphs support this.
40      */

41     public void deleteBRule(Rule brule);
42     
43     /**
44      * Return the Graph containing all the static deductions available so far.
45      * Triggers a prepare if the graph has not been prepared already.
46      */

47     public Graph getDeductionsGraph();
48     
49     /**
50      * Return the Graph containing all the static deductions available so far.
51      * Does not trigger a prepare action.
52      */

53     public Graph getCurrentDeductionsGraph();
54     
55     /**
56      * Add a new deduction to the deductions graph.
57      */

58     public void addDeduction(Triple t);
59     
60     /**
61      * Search the combination of data and deductions graphs for the given triple pattern.
62      * This may different from the normal find operation in the base of hybrid reasoners
63      * where we are side-stepping the backward deduction step.
64      */

65     public ExtendedIterator findDataMatches(Node subject, Node predicate, Node object);
66
67     /**
68      * Return true if derivation logging is enabled.
69      */

70     public boolean shouldLogDerivations();
71     
72     /**
73      * Log a dervivation record against the given triple.
74      */

75     public void logDerivation(Triple t, Object JavaDoc derivation);
76
77 }
78
79
80 /*
81     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
82     All rights reserved.
83
84     Redistribution and use in source and binary forms, with or without
85     modification, are permitted provided that the following conditions
86     are met:
87
88     1. Redistributions of source code must retain the above copyright
89        notice, this list of conditions and the following disclaimer.
90
91     2. Redistributions in binary form must reproduce the above copyright
92        notice, this list of conditions and the following disclaimer in the
93        documentation and/or other materials provided with the distribution.
94
95     3. The name of the author may not be used to endorse or promote products
96        derived from this software without specific prior written permission.
97
98     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
99     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
100     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
101     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
102     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
103     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
104     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
105     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
106     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
107     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
108 */
Popular Tags