KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > rulesys > RDFSRuleReasonerFactory


1 /******************************************************************
2  * File: RDFSExptRuleReasonerFactory.java
3  * Created by: Dave Reynolds
4  * Created on: 16-Jun-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: RDFSRuleReasonerFactory.java,v 1.12 2005/02/21 12:17:04 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import com.hp.hpl.jena.reasoner.*;
13 import com.hp.hpl.jena.rdf.model.*;
14 import com.hp.hpl.jena.vocabulary.*;
15
16 /**
17  * Factory class for creating blank instances of the hybrid rule RDFS reasoner
18  * with TGC support.
19  *
20  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
21  * @version $Revision: 1.12 $ on $Date: 2005/02/21 12:17:04 $
22  */

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

37     public static ReasonerFactory theInstance() {
38         return theInstance;
39     }
40     
41     /**
42      * Constructor method that builds an instance of the associated Reasoner
43      * @param configuration a set of arbitrary configuration information for the reasoner
44      */

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

54     public Model getCapabilities() {
55         if (capabilities == null) {
56             capabilities = ModelFactory.createDefaultModel();
57             Resource base = capabilities.createResource(getURI());
58             base.addProperty(ReasonerVocabulary.nameP, "RDFS FB-TGC Rule Reasoner")
59                 .addProperty(ReasonerVocabulary.descriptionP, "Complete RDFS implementation supporting metalevel statements.\n"
60                                             + "Can separate tbox and abox data if desired to reuse tbox caching or mix them.")
61                 .addProperty(ReasonerVocabulary.supportsP, RDFS.subClassOf)
62                 .addProperty(ReasonerVocabulary.supportsP, RDFS.subPropertyOf)
63                 .addProperty(ReasonerVocabulary.supportsP, RDFS.member)
64                 .addProperty(ReasonerVocabulary.supportsP, RDFS.range)
65                 .addProperty(ReasonerVocabulary.supportsP, RDFS.domain)
66                 .addProperty(ReasonerVocabulary.versionP, "0.1");
67         }
68         return capabilities;
69     }
70     
71     /**
72      * Return the URI labelling this type of reasoner
73      */

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