01: /******************************************************************
02: * File: BackchainFRule.java
03: * Created by: Dave Reynolds
04: * Created on: 26-Jan-03
05: *
06: * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
07: * [See end of file]
08: * $Id: BackchainFRule.java,v 1.10 2008/01/02 12:06:44 andy_seaborne Exp $
09: *****************************************************************/package com.hp.hpl.jena.reasoner.rdfsReasoner1;
10:
11: import com.hp.hpl.jena.reasoner.*;
12:
13: /**
14: * Variant on a forward rule which instantiates a backward rule
15: * and registers it with the reasoner.
16: *
17: * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
18: * @version $Revision: 1.10 $ on $Date: 2008/01/02 12:06:44 $
19: */
20: public class BackchainFRule extends BaseFRule {
21:
22: /**
23: * Constructor
24: */
25: public BackchainFRule(String spec) {
26: super (spec);
27: }
28:
29: /**
30: * Assert each of the instantiated Triples into the reasoner
31: * triple cache.
32: */
33: void fire(TriplePattern[] body, RDFSInfGraph reasoner) {
34: reasoner.addBRule(new BRWRule(body[0], body[1]));
35: }
36:
37: }
38:
39: /*
40: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
41: All rights reserved.
42:
43: Redistribution and use in source and binary forms, with or without
44: modification, are permitted provided that the following conditions
45: are met:
46:
47: 1. Redistributions of source code must retain the above copyright
48: notice, this list of conditions and the following disclaimer.
49:
50: 2. Redistributions in binary form must reproduce the above copyright
51: notice, this list of conditions and the following disclaimer in the
52: documentation and/or other materials provided with the distribution.
53:
54: 3. The name of the author may not be used to endorse or promote products
55: derived from this software without specific prior written permission.
56:
57: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
58: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
59: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
60: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
61: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
62: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
63: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
64: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
65: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
66: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
67: */
|