KickJava   Java API By Example, From Geeks To Geeks.

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


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

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import java.util.*;
13
14 import com.hp.hpl.jena.graph.Capabilities;
15 import com.hp.hpl.jena.reasoner.BaseInfGraph;
16 import com.hp.hpl.jena.reasoner.ReasonerFactory;
17
18 /**
19  * A backward chaining implementation of the RDFS closure rules
20  * based upon the basic backward rule interpreter.
21  *
22  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
23  * @version $Revision: 1.7 $ on $Date: 2005/02/21 12:17:02 $
24  */

25 public class RDFSFBRuleReasoner extends FBRuleReasoner {
26     
27     /** The location of the OWL rule definitions on the class path */
28     public static final String JavaDoc RULE_FILE = "etc/rdfs-fb.rules";
29     
30     /** The parsed rules */
31     protected static List ruleSet;
32     
33     /**
34      * Constructor
35      */

36     public RDFSFBRuleReasoner(ReasonerFactory parent) {
37         super(loadRules(), parent);
38     }
39     
40     /**
41      * Return the RDFS rule set, loading it in if necessary
42      */

43     public static List loadRules() {
44         if (ruleSet == null) ruleSet = loadRules( RULE_FILE );
45         return ruleSet;
46     }
47
48     /**
49      * Return the Jena Graph Capabilties that the inference graphs generated
50      * by this reasoner are expected to conform to.
51      */

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