KickJava   Java API By Example, From Geeks To Geeks.

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


1 /******************************************************************
2  * File: OWLMicroReasoner.java
3  * Created by: Dave Reynolds
4  * Created on: 21-Mar-2004
5  *
6  * (c) Copyright 2004, 2005 Hewlett-Packard Development Company, LP, all rights reserved.
7  * [See end of file]
8  * $Id: OWLMicroReasoner.java,v 1.5 2005/02/21 12:17:01 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 micro reasoner.
19  * This only supports:
20  * <ul>
21  * <li>RDFS entailments</li>
22  * <li>basic OWL axioms like ObjectProperty subClassOf Property</li>
23  * <li>intersectionOf, equivalentClass and forward implication of unionOf sufficient for traversal
24  * of explicit class hierachies<.li>
25  * <li>Property axioms (inversOf, SymmetricProperty, TransitiveProperty, equivalentProperty)</li>
26  * </ul>
27  * There is some experimental support for the cheaper class restriction handlingly which
28  * should not be relied on at this point.
29  *
30  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
31  * @version $Revision: 1.5 $ on $Date: 2005/02/21 12:17:01 $
32  */

33 public class OWLMicroReasoner extends GenericRuleReasoner implements Reasoner {
34
35     /** The location of the OWL rule definitions on the class path */
36     protected static final String JavaDoc MICRO_RULE_FILE = "etc/owl-fb-micro.rules";
37     
38     /** The parsed rules */
39     protected static List microRuleSet;
40     
41     /**
42      * Return the rule set, loading it in if necessary
43      */

44     public static List loadRules() {
45         if (microRuleSet == null) microRuleSet = loadRules( MICRO_RULE_FILE );
46         return microRuleSet;
47     }
48     
49     
50     /**
51      * Constructor
52      */

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

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