001: /******************************************************************
002: * File: OWLMicroReasoner.java
003: * Created by: Dave Reynolds
004: * Created on: 21-Mar-2004
005: *
006: * (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
007: * [See end of file]
008: * $Id: OWLMicroReasoner.java,v 1.8 2008/01/02 12:07:47 andy_seaborne Exp $
009: *****************************************************************/package com.hp.hpl.jena.reasoner.rulesys;
010:
011: import com.hp.hpl.jena.graph.Capabilities;
012: import com.hp.hpl.jena.reasoner.*;
013:
014: import java.util.*;
015:
016: /**
017: * Reasoner configuration for the OWL micro reasoner.
018: * This only supports:
019: * <ul>
020: * <li>RDFS entailments</li>
021: * <li>basic OWL axioms like ObjectProperty subClassOf Property</li>
022: * <li>intersectionOf, equivalentClass and forward implication of unionOf sufficient for traversal
023: * of explicit class hierachies<.li>
024: * <li>Property axioms (inversOf, SymmetricProperty, TransitiveProperty, equivalentProperty)</li>
025: * </ul>
026: * There is some experimental support for the cheaper class restriction handlingly which
027: * should not be relied on at this point.
028: *
029: * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
030: * @version $Revision: 1.8 $ on $Date: 2008/01/02 12:07:47 $
031: */
032: public class OWLMicroReasoner extends GenericRuleReasoner implements
033: Reasoner {
034:
035: /** The location of the OWL rule definitions on the class path */
036: protected static final String MICRO_RULE_FILE = "etc/owl-fb-micro.rules";
037:
038: /** The parsed rules */
039: protected static List microRuleSet;
040:
041: /**
042: * Return the rule set, loading it in if necessary
043: */
044: public static List loadRules() {
045: if (microRuleSet == null)
046: microRuleSet = loadRules(MICRO_RULE_FILE);
047: return microRuleSet;
048: }
049:
050: /**
051: * Constructor
052: */
053: public OWLMicroReasoner(ReasonerFactory factory) {
054: super (loadRules(), factory);
055: setOWLTranslation(true);
056: setMode(HYBRID);
057: setTransitiveClosureCaching(true);
058: }
059:
060: /**
061: * Return the Jena Graph Capabilties that the inference graphs generated
062: * by this reasoner are expected to conform to.
063: */
064: public Capabilities getGraphCapabilities() {
065: if (capabilities == null) {
066: capabilities = new BaseInfGraph.InfFindSafeCapabilities();
067: }
068: return capabilities;
069: }
070:
071: }
072:
073: /*
074: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
075: All rights reserved.
076:
077: Redistribution and use in source and binary forms, with or without
078: modification, are permitted provided that the following conditions
079: are met:
080:
081: 1. Redistributions of source code must retain the above copyright
082: notice, this list of conditions and the following disclaimer.
083:
084: 2. Redistributions in binary form must reproduce the above copyright
085: notice, this list of conditions and the following disclaimer in the
086: documentation and/or other materials provided with the distribution.
087:
088: 3. The name of the author may not be used to endorse or promote products
089: derived from this software without specific prior written permission.
090:
091: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
092: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
093: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
094: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
095: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
096: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
097: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
098: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
099: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
100: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
101: */
|