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