001: /******************************************************************
002: * File: ForwardRuleInfGraphI.java
003: * Created by: Dave Reynolds
004: * Created on: 28-May-2003
005: *
006: * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
007: * [See end of file]
008: * $Id: ForwardRuleInfGraphI.java,v 1.14 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.InfGraph;
013: import com.hp.hpl.jena.util.iterator.ExtendedIterator;
014:
015: /**
016: * This interface collects together the operations on the InfGraph which
017: * are needed to support the forward rule engine.
018: *
019: * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
020: * @version $Revision: 1.14 $ on $Date: 2008/01/02 12:07:47 $
021: */
022: public interface ForwardRuleInfGraphI extends InfGraph, SilentAddI {
023:
024: /**
025: * Return true if tracing should be acted on - i.e. if traceOn is true
026: * and we are past the bootstrap phase.
027: */
028: public boolean shouldTrace();
029:
030: /**
031: * Adds a new Backward rule as a rules of a forward rule process. Only some
032: * infgraphs support this.
033: */
034: public void addBRule(Rule brule);
035:
036: /**
037: * Deletes a new Backward rule as a rules of a forward rule process. Only some
038: * infgraphs support this.
039: */
040: public void deleteBRule(Rule brule);
041:
042: /**
043: * Return the Graph containing all the static deductions available so far.
044: * Triggers a prepare if the graph has not been prepared already.
045: */
046: public Graph getDeductionsGraph();
047:
048: /**
049: * Return the Graph containing all the static deductions available so far.
050: * Does not trigger a prepare action.
051: */
052: public Graph getCurrentDeductionsGraph();
053:
054: /**
055: * Add a new deduction to the deductions graph.
056: */
057: public void addDeduction(Triple t);
058:
059: /**
060: * Search the combination of data and deductions graphs for the given triple pattern.
061: * This may different from the normal find operation in the base of hybrid reasoners
062: * where we are side-stepping the backward deduction step.
063: */
064: public ExtendedIterator findDataMatches(Node subject,
065: Node predicate, Node object);
066:
067: /**
068: * Return true if derivation logging is enabled.
069: */
070: public boolean shouldLogDerivations();
071:
072: /**
073: * Log a dervivation record against the given triple.
074: */
075: public void logDerivation(Triple t, Object derivation);
076:
077: }
078:
079: /*
080: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
081: All rights reserved.
082:
083: Redistribution and use in source and binary forms, with or without
084: modification, are permitted provided that the following conditions
085: are met:
086:
087: 1. Redistributions of source code must retain the above copyright
088: notice, this list of conditions and the following disclaimer.
089:
090: 2. Redistributions in binary form must reproduce the above copyright
091: notice, this list of conditions and the following disclaimer in the
092: documentation and/or other materials provided with the distribution.
093:
094: 3. The name of the author may not be used to endorse or promote products
095: derived from this software without specific prior written permission.
096:
097: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
098: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
099: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
100: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
101: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
102: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
103: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
104: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
105: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
106: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
107: */
|