KickJava   Java API By Example, From Geeks To Geeks.

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


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

10 package com.hp.hpl.jena.reasoner.rulesys;
11
12 import java.util.*;
13
14 import com.hp.hpl.jena.graph.Capabilities;
15 import com.hp.hpl.jena.reasoner.BaseInfGraph;
16 import com.hp.hpl.jena.reasoner.ReasonerFactory;
17
18 /**
19  * We do not support DAML inference. This is a slightly extended version
20  * of the RDFS reasoner to support some interesting subsets of DAML
21  * that correspond roughly to what was there in Jena1. We hope.
22  *
23  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
24  * @version $Revision: 1.6 $ on $Date: 2005/02/21 12:16:57 $
25  */

26 public class DAMLMicroReasoner extends GenericRuleReasoner {
27    
28     /** The location of the OWL rule definitions on the class path */
29     public static final String JavaDoc RULE_FILE = "etc/daml-micro.rules";
30     
31     /** The parsed rules */
32     protected static List ruleSet;
33     
34     /**
35      * Constructor
36      */

37     public DAMLMicroReasoner(ReasonerFactory parent) {
38         super(loadRules(), parent);
39         setMode(HYBRID);
40         setTransitiveClosureCaching(true);
41     }
42     
43     /**
44      * Return the RDFS rule set, loading it in if necessary
45      */

46     public static List loadRules() {
47         if (ruleSet == null) ruleSet = loadRules( RULE_FILE );
48         return ruleSet;
49     }
50
51     /**
52      * Return the Jena Graph Capabilties that the inference graphs generated
53      * by this reasoner are expected to conform to.
54      */

55     public Capabilities getGraphCapabilities() {
56         if (capabilities == null) {
57             capabilities = new BaseInfGraph.InfFindSafeCapabilities();
58         }
59         return capabilities;
60     }
61 }
62
63
64 /*
65     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
66     All rights reserved.
67
68     Redistribution and use in source and binary forms, with or without
69     modification, are permitted provided that the following conditions
70     are met:
71
72     1. Redistributions of source code must retain the above copyright
73        notice, this list of conditions and the following disclaimer.
74
75     2. Redistributions in binary form must reproduce the above copyright
76        notice, this list of conditions and the following disclaimer in the
77        documentation and/or other materials provided with the distribution.
78
79     3. The name of the author may not be used to endorse or promote products
80        derived from this software without specific prior written permission.
81
82     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
83     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
84     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
85     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
86     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
87     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
88     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
89     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
90     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
91     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
92 */
Popular Tags