01: package org.mandarax.zkb.framework;
02:
03: /**
04: * Copyright (C) 1999-2004 Jens Dietrich (mailto:mandarax@jbdietrich.com)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2 of the License, or (at your option) any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: */
20:
21: /**
22: * ZKB driver. It uses a simpler DTD than the 1_0 driver and therefore facilitates writing
23: * kbs directly in xml. On the other hand, it is less similar to RuleML.
24: * We keep a version name in the class name since we will maintain
25: * drivers in order to migrate data between drivers. New in thisversion is the support for
26: * built-in validation (test cases).
27: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
28: * @version 3.4 <7 March 05>
29: * @since 3.4
30: */
31: public final class ZKBDriver_2_0 extends GenericDriver {
32:
33: /**
34: * Constructor.
35: */
36: public ZKBDriver_2_0() {
37: super ();
38: initialize();
39: }
40:
41: /**
42: * Initialize the object.
43: */
44: private void initialize() {
45: install(new Adapter4KnowledgeBases_2_0());
46: install(new Adapter4Comparators());
47: install(new Adapter4Rules_1_1());
48: install(new Adapter4Queries_1_1());
49: install(new Adapter4Facts_1_1());
50: install(new Adapter4SQLClauseSets());
51: install(new Adapter4CustomClauseSets());
52: install(new Adapter4Prerequisites_1_1());
53: install(new Adapter4Predicates());
54: install(new Adapter4ComplexTerms());
55: install(new Adapter4ConstantTerms());
56: install(new Adapter4VariableTerms());
57: install(new Adapter4Functions());
58: install(new Adapter4DerivationEventListeners());
59: install(new Adapter4TestCases_2_0());
60: }
61:
62: /**
63: * Indicates whether the driver (and the underlying xml format (=dtd))
64: * supports queries.
65: * @return a boolean
66: */
67: public boolean supportsQueries() {
68: return true;
69: }
70:
71: /**
72: * Get the location (URL) of the associated DTD.
73: * @return an url
74: */
75: public String getURL4DTD() {
76: return null; // todo generate dtd and deploy here: "http://www.mandarax.org/dtd/zkb_2_0.dtd";
77: }
78:
79: /**
80: * Get the name of the driver.
81: * @return a text
82: */
83: public String getName() {
84: return "ZKBDriver_2_0";
85: }
86:
87: /**
88: * Get the root element type.
89: * @return the name of the root element
90: */
91: public String getRootElementType() {
92: return KNOWLEDGE_BASE;
93: }
94: }
|