<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Tool for MDD of Rule-based Web Applications based on OWL and SWRL</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Joaqu n Can~adas</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jose Palma</string-name>
          <email>jtpalma@um.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Samuel Tunez</string-name>
          <email>stunez@ual.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Information and Communications Engineering. University of Murcia.</institution>
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dept. of Languages and Computation. University of Almeria.</institution>
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>TOOL PRESENTATION?: Rule languages and inference engines incorporate reasoning capabilities to Web information systems. This demonstration paper presents a tool for the development of rulebased applications for the Web based on OWL and SWRL ontologies. The tool applies a model-driven approach to an ontology representing a domain conceptualization and inference model of the problem domain. It automatically generates a rich, functional Web architecture based on the Model-View-Control architectural pattern and the JavaServer Faces technology, embedding a Jess rule engine for reasoning and deriving new information.</p>
      </abstract>
      <kwd-group>
        <kwd>Model Driven Development</kwd>
        <kwd>OWL</kwd>
        <kwd>SWRL</kwd>
        <kwd>Rule-based systems for the Web</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        been presented, the TwoUse Toolkit 3 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. It is a free, open source tool bridging
the gap between Semantic Web and Model Driven Software Development. It has
been developed using Eclipse Modeling Project4 and implements current OMG
and W3C standards for developing ontology-based software models and
modelbased OWL ontologies. Among its functionality, TwoUse provides a graphical
editor for specifying OWL and SWRL models based on the Ontology De nition
Metamodel (ODM) [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], and an textual editor for the OWL functional syntax [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
Since it is deployed as an Eclipse plugin, other Eclipse-based tools for designing
and executing transformations can be straightforwardly applied to ontologies
created in TwoUse, enabling us to design an MDD process based on OWL and
SWRL models.
      </p>
      <p>This demo presents a tool which provides a model-driven approach to develop
rule-based Web applications based on OWL and SWRL models created with
TwoUse. The tool applies MDD to produce the implementation of a functional,
rich Web architecture which embeds the Jess rule engine for inferencing tasks.
The functionality for the generated rule-based Web application is prede ned
to enable end-users to create, retrieve, update and delete instances (CRUD). In
contrast to current tools for automatic generation of CRUD systems that perform
those functions on relational databases, our contribution is that this functionality
is executed on the rule engine working memory, enabling the execution of a
forward-chaining inference mechanism to drive the reasoning process.</p>
      <p>This paper is organized as follows: Section 2 introduces the model-driven
approach applied in the tool. Next, Section 3 describes the architecture for the
rule-based Web application generated. Finally, the main conclusions and future
work are summarized.
2</p>
      <p>Model-driven process implemented in the tool
The proposed tool uses OWL and SWRL ontologies created with TwoUse as
source models for the model-driven approach. We focus on OWL DL
sublanguage of OWL. Classes, properties, and individuals de ne the structure of data,
whereas rules describe logical dependencies between the elements of the ontology
refereed in the rule's antecedent and consequent.</p>
      <p>
        Figure 1 shows a simpli ed schema of the MDD process implemented in the
proposed tool. Two di erent results are found from the single ontology model.
On one hand, a Jess [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] rule base is generated, a text le that contains the rules
converted to Jess syntax. On the other hand, a set of JavaBeans and JSP web
pages, making up a JavaServer Faces (JSF) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] architecture that embodies the
Jess rule engine into the Web application.
      </p>
      <p>Both MDD processes can be executed separately, enabling the decision logic
of rule-based applications to be changed regardless of the ontology structure.
When the rule model changes, the new rule base can be regenerated and deployed</p>
      <sec id="sec-1-1">
        <title>3 http://code.google.com/p/twouse/ 4 http://www.eclipse.org/modeling/</title>
        <p>Platform
Independent</p>
        <p>Models
EMF IPnrteesraecnttiaotnio&amp;n</p>
        <p>OWL + SWRL
TwoUse Toolkit
for OWL &amp; SWRL</p>
        <p>Eclipse Modeling</p>
        <p>M2M
Transformations</p>
        <p>Platform
Specific
Models
Java and JSF
Web model
Jess Rule
model</p>
        <p>Default Presentation,
Navigation, Functionality</p>
        <p>M2T
Transformations</p>
        <p>JET</p>
        <p>Code
Rule-based
Web application
Java classes
JSF pages</p>
        <p>integration
Jess rule base
into the Web application without a ecting the full architecture. This approach
makes Web applications easier to maintain and evolve.</p>
        <p>The tool was developed using MDD tools provided in Eclipse, and it is
supported by the TwoUse toolkit for the creation of ontology and rule models.
Metamodels for representing platform-speci c models in Jess and the Java/JSF
are de ned using EMF5 (Eclipse Modeling Framework).</p>
        <p>Model-to-model (M2M) transformations are designed with ATL6 (Atlas
Transformation Language). The rst one (bottom ow in Fig. 1) maps an ontology
and rule model to a Jess platform-speci c model. The second one (top ow in
Fig. 1) transforms the ontology model into a Java/JSF Web speci c model.</p>
        <p>
          The outputs of both ATL transformations are the respective inputs of two
model-to-text (M2T) transformations implemented in JET7 (Java Emitter
Templates). As a result, the code for the rule-based Web application is obtained. On
one hand, source les with Jess rules and facts, and on the other hand, the Web
application components, the con guration les, the Java classes, and a
JessEngine Bean which uses the Jess API (Application Programming Interface) to
embed the rule engine into the architecture. Moreover, a set of JSP/JSF web
pages is generated for the user interface which are based on the RichFaces
library [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] framework that adds AJAX capability to JSF applications. Default
con guration is injected to provide presentation templates for pages, prede ned
navigation between them and default functionality for the generated application.
3
        </p>
        <p>Architecture of rule-based Web applications</p>
      </sec>
      <sec id="sec-1-2">
        <title>5 http://www.eclipse.org/modeling/emf/ 6 http://www.eclipse.org/m2m/atl/ 7 http://www.eclipse.org/modeling/m2t/?project=jet</title>
        <p>Apache Tomcat
business logic</p>
        <p>Java Classes
JSF + RichFaces
pages</p>
        <p>Jess
Rule
set
rule
engine
working
memory
(facts)</p>
        <p>Jess facts</p>
        <p>The embedded rule engine manages the Jess rule base and the text le of
persistent instances of concepts, called facts. Basically, the rule engine consists
of three parts: the working memory contains all the information or facts, the
rule set are all the rules, and the rule engine checks whether the rules match the
working memory and executes them then.</p>
        <p>The Web application enables the user to perform basic functions for instance
management (create, list, update and delete instances). Current tools for
automatic generation of that kind of Web applications perform those operations on
relational databases. The contribution of our approach is that instance
management is executed on the rule engine working memory. The rule engine executes a
forward-chaining inference mechanism to drive the reasoning process, ring the
rules with conditions evaluated as true, and executing their actions to infer new
values or modify existing ones.</p>
        <p>The use of both rules and AJAX technology improves instance management
since each single value is validated and submitted as it is entered by the user,
then the rule engine can re suitable rules and deduce new information on the
y, driving the instance creation or edition.
4</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Conclusion and future work</title>
      <p>This tool presentation paper presents a tool that applies MDD to rich Web
system development, incorporating a rule engine for deduction and inference.
OWL and SWRL formalisms are used as modeling languages by the
modeldriven approach.</p>
      <p>
        Since expressiveness in rule-based production systems such as Jess is poorer
than OWL and SWRL semantics, only a subset of those formalisms is currently
supported. Issues related with the combination of rules and ontologies have also
an e ect on the proposed approach. For example, the semantics of OWL and
SWRL adopts an open world assumption, while logic programming languages
such as Jess are based on a closed world assumption. As a consequence, only
DL-Safe SWRL rules [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] are transformed to Jess. DL-Safe SWRL rules are a
restricted subset of SWRL rules that has the desirable property of decidability,
by restricting rules to operate only on known individuals in an OWL ontology.
Similarly, Jess rules only operate on facts in the working memory.
      </p>
      <p>Another semantic di erence between OWL and classic rule engines such as
Jess is related to the fact base and state assertions. While in OWL the ABox
containing the assertions about the individuals in the domain can not be modi ed,
on the other hand, in a rule-based systems facts can be asserted and modi ed
during the inference.</p>
      <p>Although these semantic di erences are present, the proposed tool
demonstrates how OWL and SWRL can be used as speci cation formalisms in
rulebased Web applications development. The bene ts come from the widely use of
these formalisms and the many tools available for editing and reasoning over
OWL and SWRL speci cations.</p>
      <p>The tool is planned to be evaluated in several domains such as pest control
in agriculture and medical diagnosis. Future work extends the generated Web
application with semantic Web functionalities, such as semantic search based on
ontology classes hierarchy as well as instance search.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. W3C OWL Working Group:
          <article-title>OWL 2 Web Ontology Language: Document Overview</article-title>
          . W3C
          <string-name>
            <surname>Recommendation</surname>
          </string-name>
          (
          <year>2009</year>
          ) Available at http://www.w3.org/TR/owl2-overview/.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tabet</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grosof</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>SWRL: A Semantic Web Rule Language combining OWL and RuleML</article-title>
          . W3C Member Submission (
          <year>2004</year>
          ) Available at http://www.w3.org/Submission/SWRL/.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Rules and ontologies for the semantic web</article-title>
          . In Baroglio,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Bonatti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.A.</given-names>
            ,
            <surname>Maluszynski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Marchiori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Polleres</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          , Scha ert, S., eds.
          <source>: Reasoning Web</source>
          . Volume
          <volume>5224</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2008</year>
          )
          <volume>1</volume>
          {
          <fpage>53</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. W3C:
          <article-title>A Semantic Web Primer for Object-Oriented Software Developers</article-title>
          .
          <source>W3C Working Draft</source>
          (
          <year>2006</year>
          ) Available at http://www.w3.org/TR/sw-oosd-primer/.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Parreiras</surname>
            ,
            <given-names>F.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Staab</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Winter</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>TwoUse: integrating UML models and OWL ontologies</article-title>
          .
          <source>Technical report</source>
          , Universitat Koblenz-Landau (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Object Management Group: Ontology De nition Metamodel.
          <source>Version 1</source>
          .0.
          <string-name>
            <surname>OMG</surname>
          </string-name>
          (
          <year>2009</year>
          ) Available at http://www.omg.org/spec/ODM/1.0/.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. W3C OWL Working Group:
          <article-title>OWL 2 Web Ontology Language: Structural Specication and Functional-Style Syntax</article-title>
          .
          <source>W3C Recommendation</source>
          (
          <year>2009</year>
          ) Available at http://www.w3.org/TR/owl-syntax/.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Friedman-Hill</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          : Jess in Action:
          <source>Java Rule-Based Systems. Manning Publications</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Geary</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horstmann</surname>
            ,
            <given-names>C.S.</given-names>
          </string-name>
          : Core JavaServer Faces.
          <volume>2</volume>
          <fpage>edn</fpage>
          . Prentice Hall (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10. JBoss: RichFaces (
          <year>2007</year>
          ) http://www.jboss.org/jbossrichfaces/.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Studer</surname>
          </string-name>
          , R.:
          <article-title>Query Answering for OWL-DL with rules</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>3</volume>
          (
          <issue>1</issue>
          ) (
          <year>2005</year>
          )
          <volume>41</volume>
          {
          <fpage>60</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>