001: /******************************************************************
002: * File: DAMLMicroReasonerFactory.java
003: * Created by: Dave Reynolds
004: * Created on: 23-Jul-2003
005: *
006: * (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
007: * [See end of file]
008: * $Id: DAMLMicroReasonerFactory.java,v 1.10 2008/01/02 12:07:47 andy_seaborne Exp $
009: *****************************************************************/package com.hp.hpl.jena.reasoner.rulesys;
010:
011: import com.hp.hpl.jena.reasoner.*;
012: import com.hp.hpl.jena.rdf.model.*;
013: import com.hp.hpl.jena.vocabulary.*;
014:
015: /**
016: * We do not support DAML inference. This factory creates a reasoner which is
017: * a slightly extended variant
018: * of the RDFS reasoner to support some interesting subsets of DAML
019: * that correspond roughly to what was there in Jena1. We hope.
020: *
021: * @author <a href="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
022: * @version $Revision: 1.10 $ on $Date: 2008/01/02 12:07:47 $
023: */
024: public class DAMLMicroReasonerFactory implements ReasonerFactory {
025:
026: /** Single global instance of this factory */
027: private static ReasonerFactory theInstance = new DAMLMicroReasonerFactory();
028:
029: /** Static URI for this reasoner type */
030: public static final String URI = "http://jena.hpl.hp.com/2003/DAMLMicroReasonerFactory";
031:
032: /** Cache of the capabilities description */
033: protected Model capabilities;
034:
035: /**
036: * Return the single global instance of this factory
037: */
038: public static ReasonerFactory theInstance() {
039: return theInstance;
040: }
041:
042: /**
043: * Constructor method that builds an instance of the associated Reasoner
044: * @param configuration a set of arbitrary configuration information for the reasoner, this will be
045: * ignored in this case because the micro reasoner is not configurable
046: */
047: public Reasoner create(Resource configuration) {
048: return new DAMLMicroReasoner(this );
049: }
050:
051: /**
052: * Return a description of the capabilities of this reasoner encoded in
053: * RDF. This method is normally called by the ReasonerRegistry which caches
054: * the resulting information so dynamically creating here is not really an overhead.
055: */
056: public Model getCapabilities() {
057: if (capabilities == null) {
058: capabilities = ModelFactory.createDefaultModel();
059: Resource base = capabilities.createResource(getURI());
060: base
061: .addProperty(ReasonerVocabulary.nameP,
062: "DAML micro Rule Reasoner")
063: .addProperty(ReasonerVocabulary.descriptionP,
064: "RDFS rule set with small extensions to support DAML")
065: .addProperty(ReasonerVocabulary.supportsP,
066: RDFS.subClassOf).addProperty(
067: ReasonerVocabulary.supportsP,
068: RDFS.subPropertyOf).addProperty(
069: ReasonerVocabulary.supportsP, RDFS.member)
070: .addProperty(ReasonerVocabulary.supportsP,
071: RDFS.range).addProperty(
072: ReasonerVocabulary.supportsP, RDFS.domain)
073: .addProperty(ReasonerVocabulary.supportsP,
074: DAML_OIL.subClassOf).addProperty(
075: ReasonerVocabulary.supportsP,
076: DAML_OIL.subPropertyOf).addProperty(
077: ReasonerVocabulary.supportsP,
078: DAML_OIL.range).addProperty(
079: ReasonerVocabulary.supportsP,
080: DAML_OIL.domain).addProperty(
081: ReasonerVocabulary.supportsP,
082: ReasonerVocabulary.individualAsThingP)
083: .addProperty(ReasonerVocabulary.versionP, "0.1");
084: }
085: return capabilities;
086: }
087:
088: /**
089: * Return the URI labelling this type of reasoner
090: */
091: public String getURI() {
092: return URI;
093: }
094:
095: }
096:
097: /*
098: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
099: All rights reserved.
100:
101: Redistribution and use in source and binary forms, with or without
102: modification, are permitted provided that the following conditions
103: are met:
104:
105: 1. Redistributions of source code must retain the above copyright
106: notice, this list of conditions and the following disclaimer.
107:
108: 2. Redistributions in binary form must reproduce the above copyright
109: notice, this list of conditions and the following disclaimer in the
110: documentation and/or other materials provided with the distribution.
111:
112: 3. The name of the author may not be used to endorse or promote products
113: derived from this software without specific prior written permission.
114:
115: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
116: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
117: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
118: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
119: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
120: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
121: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
122: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
124: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
125: */
|