KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > transitiveReasoner > TransitiveReasonerFactory


1 /******************************************************************
2  * File: TransitiveReasonerFactory.java
3  * Created by: Dave Reynolds
4  * Created on: 19-Jan-03
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: TransitiveReasonerFactory.java,v 1.13 2005/02/21 12:18:37 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.transitiveReasoner;
11
12 import com.hp.hpl.jena.rdf.model.*;
13 import com.hp.hpl.jena.vocabulary.*;
14 import com.hp.hpl.jena.reasoner.*;
15
16 /**
17  * Factory class for creating blank instances of the transitive reasoner.
18  *
19  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
20  * @version $Revision: 1.13 $ on $Date: 2005/02/21 12:18:37 $
21  */

22 public class TransitiveReasonerFactory implements ReasonerFactory {
23     
24     /** Single global instance of this factory */
25     private static ReasonerFactory theInstance = new TransitiveReasonerFactory();
26     
27     /** Cache of the capabilities description */
28     protected Model capabilities;
29     
30     /** Static URI for this reasoner type */
31     public static final String JavaDoc URI = "http://jena.hpl.hp.com/2003/TransitiveReasoner";
32     
33     /**
34      * Return the single global instance of this factory
35      */

36     public static ReasonerFactory theInstance() {
37         return theInstance;
38     }
39     
40     /**
41      * Constructor method that builds an instance of the associated Reasoner
42      * @param configuration a set of arbitrary configuration information to be
43      * passed the reasoner encoded within an RDF graph. This reasoner has no
44      * configuration parameters so this arg is always ignored.
45      */

46     public Reasoner create(Resource configuration) {
47         return new TransitiveReasoner();
48     }
49    
50     /**
51      * Return a description of the capabilities of this reasoner encoded in
52      * RDF. This method is normally called by the ReasonerRegistry which caches
53      * the resulting information so dynamically creating here is not really an overhead.
54      */

55     public Model getCapabilities() {
56         if (capabilities == null) {
57             capabilities = ModelFactory.createDefaultModel();
58             Resource base = capabilities.createResource(getURI());
59             base.addProperty(ReasonerVocabulary.nameP, "Transitive Reasoner")
60                 .addProperty(ReasonerVocabulary.descriptionP, "Provides reflexive-transitive closure of subClassOf and subPropertyOf")
61                 .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf)
62                 .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf)
63                 .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubClassOf)
64                 .addProperty(ReasonerVocabulary.supportsP, ReasonerVocabulary.directSubPropertyOf)
65                 .addProperty(ReasonerVocabulary.versionP, "0.1");
66         }
67         return capabilities;
68     }
69     
70     /**
71      * Return the URI labelling this type of reasoner
72      */

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

108
109
Popular Tags