KickJava   Java API By Example, From Geeks To Geeks.

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


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

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import com.hp.hpl.jena.graph.Capabilities;
13 import com.hp.hpl.jena.reasoner.*;
14
15 import java.util.*;
16
17 /**
18  * Reasoner configuration for the OWL mini reasoner.
19  * Key limitations over the normal OWL configuration are:
20  * <UL>
21  * <li>omits the someValuesFrom => bNode entailments</li>
22  * <li>avoids any guard clauses which would break the find() contract</li>
23  * <li>omits inheritance of range implications for XSD datatype ranges</li>
24  * </UL>
25  *
26  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
27  * @version $Revision: 1.5 $ on $Date: 2005/02/21 12:17:02 $
28  */

29 public class OWLMiniReasoner extends GenericRuleReasoner implements Reasoner {
30
31     /** The location of the OWL rule definitions on the class path */
32     protected static final String JavaDoc MINI_RULE_FILE = "etc/owl-fb-mini.rules";
33     
34     /** The parsed rules */
35     protected static List miniRuleSet;
36     
37     /**
38      * Return the rule set, loading it in if necessary
39      */

40     public static List loadRules() {
41         if (miniRuleSet == null) miniRuleSet = loadRules( MINI_RULE_FILE );
42         return miniRuleSet;
43     }
44     
45     
46     /**
47      * Constructor
48      */

49     public OWLMiniReasoner(ReasonerFactory factory) {
50         super(loadRules(), factory);
51         setOWLTranslation(true);
52         setMode(HYBRID);
53 // setTransitiveClosureCaching(true);
54
}
55     
56
57     /**
58      * Return the Jena Graph Capabilties that the inference graphs generated
59      * by this reasoner are expected to conform to.
60      */

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