01: /******************************************************************
02: * File: OWLMiniReasoner.java
03: * Created by: Dave Reynolds
04: * Created on: 19-Mar-2004
05: *
06: * (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
07: * [See end of file]
08: * $Id: OWLMiniReasoner.java,v 1.8 2008/01/02 12:07:47 andy_seaborne Exp $
09: *****************************************************************/package com.hp.hpl.jena.reasoner.rulesys;
10:
11: import com.hp.hpl.jena.graph.Capabilities;
12: import com.hp.hpl.jena.reasoner.*;
13:
14: import java.util.*;
15:
16: /**
17: * Reasoner configuration for the OWL mini reasoner.
18: * Key limitations over the normal OWL configuration are:
19: * <UL>
20: * <li>omits the someValuesFrom => bNode entailments</li>
21: * <li>avoids any guard clauses which would break the find() contract</li>
22: * <li>omits inheritance of range implications for XSD datatype ranges</li>
23: * </UL>
24: *
25: * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
26: * @version $Revision: 1.8 $ on $Date: 2008/01/02 12:07:47 $
27: */
28: public class OWLMiniReasoner extends GenericRuleReasoner implements
29: Reasoner {
30:
31: /** The location of the OWL rule definitions on the class path */
32: protected static final String 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)
42: miniRuleSet = loadRules(MINI_RULE_FILE);
43: return miniRuleSet;
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: * Return the Jena Graph Capabilties that the inference graphs generated
58: * by this reasoner are expected to conform to.
59: */
60: public Capabilities getGraphCapabilities() {
61: if (capabilities == null) {
62: capabilities = new BaseInfGraph.InfFindSafeCapabilities();
63: }
64: return capabilities;
65: }
66:
67: }
68:
69: /*
70: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
71: All rights reserved.
72:
73: Redistribution and use in source and binary forms, with or without
74: modification, are permitted provided that the following conditions
75: are met:
76:
77: 1. Redistributions of source code must retain the above copyright
78: notice, this list of conditions and the following disclaimer.
79:
80: 2. Redistributions in binary form must reproduce the above copyright
81: notice, this list of conditions and the following disclaimer in the
82: documentation and/or other materials provided with the distribution.
83:
84: 3. The name of the author may not be used to endorse or promote products
85: derived from this software without specific prior written permission.
86:
87: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
88: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
90: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
91: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
92: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
93: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
94: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
96: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
97: */
|