KickJava   Java API By Example, From Geeks To Geeks.

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


1 /******************************************************************
2  * File: BackwardRuleInfGraphI.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: BackwardRuleInfGraphI.java,v 1.9 2005/02/21 12:16:54 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import com.hp.hpl.jena.graph.Node;
13 import com.hp.hpl.jena.graph.Triple;
14 import com.hp.hpl.jena.reasoner.InfGraph;
15 import com.hp.hpl.jena.reasoner.TriplePattern;
16 import com.hp.hpl.jena.util.iterator.ExtendedIterator;
17
18 /**
19  * This interface collects together those operations that the backchaining
20  * engine needs to invoke in the parent InfGraph. This allows different inf graphs
21  * to exploit the same core backchaining engine.
22  *
23  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
24  * @version $Revision: 1.9 $ on $Date: 2005/02/21 12:16:54 $
25  */

26 public interface BackwardRuleInfGraphI extends SilentAddI, InfGraph {
27             
28     /**
29      * Process a call to a builtin predicate
30      * @param clause the term representing the call
31      * @param env the BindingEnvironment for this call
32      * @param rule the rule which is invoking this call
33      * @return true if the predicate succeeds
34      */

35     public boolean processBuiltin(ClauseEntry clause, Rule rule, BindingEnvironment env);
36
37     /**
38      * Match a pattern just against the stored data (raw data, schema,
39      * axioms) but no backchaining derivation.
40      */

41     public ExtendedIterator findDataMatches(TriplePattern pattern);
42
43     /**
44      * Log a dervivation record against the given triple.
45      */

46     public void logDerivation(Triple t, Object JavaDoc derivation);
47
48     /**
49      * Retrieve or create a bNode representing an inferred property value.
50      * @param instance the base instance node to which the property applies
51      * @param prop the property node whose value is being inferred
52      * @param pclass the (optional, can be null) class for the inferred value.
53      * @return the bNode representing the property value
54      */

55     public Node getTemp(Node instance, Node prop, Node pclass);
56     
57 }
58
59
60 /*
61     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
62     All rights reserved.
63
64     Redistribution and use in source and binary forms, with or without
65     modification, are permitted provided that the following conditions
66     are met:
67
68     1. Redistributions of source code must retain the above copyright
69        notice, this list of conditions and the following disclaimer.
70
71     2. Redistributions in binary form must reproduce the above copyright
72        notice, this list of conditions and the following disclaimer in the
73        documentation and/or other materials provided with the distribution.
74
75     3. The name of the author may not be used to endorse or promote products
76        derived from this software without specific prior written permission.
77
78     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
79     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
80     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
81     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
82     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
83     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
84     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
85     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
87     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88 */
Popular Tags