KickJava   Java API By Example, From Geeks To Geeks.

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


1 /******************************************************************
2  * File: RDFSBRuleReasonerFactory.java
3  * Created by: Dave Reynolds
4  * Created on: 12-May-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: RDFSFBRuleReasonerFactory.java,v 1.8 2005/02/21 12:17:03 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  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
19  * @version $Revision: 1.8 $ on $Date: 2005/02/21 12:17:03 $
20  */

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

35     public static ReasonerFactory theInstance() {
36         return theInstance;
37     }
38     
39     /**
40      * Constructor method that builds an instance of the associated Reasoner
41      * @param configuration a set of arbitrary configuration information to be
42      * passed the reasoner encoded within an RDF graph, the current implemenation
43      * is not configurable and will ignore this parameter.
44      */

45     public Reasoner create(Resource configuration) {
46         return new RDFSFBRuleReasoner(this);
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 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