<!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>Towards an Eclipse Ontology Framework: Integrating OWL and the Eclipse Modeling Framework</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Carsten Schneider</string-name>
          <email>caschneider@uni-koblenz.de</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute for Web Science and Technologies, University of Koblenz-Landau Universitaetsstrasse 1</institution>
          ,
          <addr-line>Koblenz 56070</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Model driven software development and semantic web technologies are spreading increasingly. But today semantic web technologies are rarely used in the software development, even though the additional use of these technologies could improve the software development process. One reason for the rare use of these technologies in the software development is that semantic web technologies are barely integrated with the established software development tools. This paper proposes an approach for integrating semantic web technologies with model driven software development.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        In today's software development models have an important role. The developers
create several models, which they write down in modeling languages like UML
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or Ecore [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. These models are used for the speci cation and documentation
of software. Therefore the relevance of the models in the software development
already is comparable to the relevance of an architect's plan in putting up a
building.
      </p>
      <p>
        In model driven software development a further step is taken. In addition
the developers use the models as input for a code generator. The generator
implements a skeletal structure for the software on the basis of the models. The
generated code can be modi ed and extended by the developer. The Eclipse
Modeling Framework (EMF) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] is a framework for model driven software
development, which is frequently used. The Eclipse Modeling Framework uses its own
metamodel Ecore and provides mappings from some other modeling languages
like UML to Ecore. The Ecore models are the basis for the generation of the
Java code.
      </p>
      <p>
        During the last years semantic web technologies, which are based on
ontologies, have spread increasingly. With the spread of these technologies the desire
for using these technologies also for the software development arised. It was
begun to deal with ontology driven software development. In the ontology driven
software development ontologies are used as basis for the code generation. An
ontology is a formal representation of knowledge. The knowledge is described by
concepts and the relations between these concepts. The Web Ontology Language
(OWL) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] is a language for the de nition of ontologies. OWL allows the de
nition of classes by constraints on the properties of their members. It is possible
to execute queries on ontologies by using a query language like SPARQL [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
Although ontologies also are models, any mention of models in this paper refers
to classical UML-like models, if there is no other comment.
      </p>
      <p>Both models and ontologies have di erent advantages and disadvantages.
Ontologies de ne classes with logical expressions. The classes, which are de ned
by an ontology, have a very exible, dynamic class membership. But ontologies
do not provide an opportunity to specify the dynamic behaviour. In contrast
models enable the developer to specify the dynamic behaviour. But models use
a static class membership.</p>
      <p>
        For future development it is desirable to combine model driven software
development and ontology driven software development with each other to use the
advantages of both and to avoid their restrictions. Such a combination must
take the di erences of models and ontologies into account. These di erences and
approaches how they can be bridged are handled by [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ]. The question is how
model driven software development and ontology driven software development
can be combined so that the functionality of the model driven development is
maintained, the model driven developers can use a familiar environment and
some advantages of the ontology driven development are additionally available.
      </p>
      <p>This paper proposes an approach for such a combination. This approach
extends the functionality of the Eclipse Modeling Framework by the possibility to
use semantic web technologies. It provides additional features to developers of the
model driven community like de ning OWL property restrictions for attributes
and references or attaching queries to operations. The generated code prohibits
the violation of the property restrictions and executes the attached query during
an execution of the operation. Developers of the ontology driven community get
a framework, which provides them the opportunity to develop software ontology
driven, to model the dynamic behaviour and to attach queries to operations.
The framework could also be used to create an ontology and to populate the
created ontology with instances.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Running Example</title>
      <p>This section introduces a simple purchase order example as running example.
Figure 1 shows an Ecore diagram for the example. The example includes three
classes: Store, Customer and Order. There are containment references from
Store to Customer, from Store to Order and from Customer to Store. In
addition there is an reference previousOrders from Order to Order. An order
has one operation called getOrders. We want that a SPARQL query is executed
during a call of getOrders and we want that previousOrders is transitive.
The challenge is to generate the whole code of this example. With model driven
development frameworks we had to implement both the code for the transitivity
of previousOrders and the code for the query execution by hand. With ontology
driven development frameworks we could generate the code for previousOrders,
but we had to write the whole code of getOrders by hand. With the approach
of this paper it would be possible to generate the code for both getOrders and
previousOrders.
2.2</p>
      <sec id="sec-2-1">
        <title>Advantages</title>
        <p>The proposed approach has several advantages for developers. Developers of
the ontology driven community get the opportunity to model the behaviour.
This makes it possible to generate more code and reduces the programming
e ort. By describing the behaviour of an operation with a SPARQL query the
opportunity to query a generated ontology is provided. This could simplify the
implementation of operations for developers of the ontology driven community
and the model driven community.</p>
        <p>Developers of model driven software get the opportunity to use property
restrictions for attributes and references. For instance this allows the de nition
of transitive references. The maintenance of the EMF functionalities improves
the acceptance in the EMF community and the use of UML-like models simpli es
the entry in the approach for software developers.</p>
        <p>The approach provides the opportunity to create ontologies based on a class
diagram to developers, who are not from the semantic web area. Editors for the
creation of ontologies and the population of these ontologies are provided. These
editors could simplify the creation of ontologies and support the avoidance of
inconsistencies.
3.1</p>
      </sec>
      <sec id="sec-2-2">
        <title>Objectives</title>
        <p>The proposed work should be an approach for combining model driven
software development and ontology driven software development. A tool should be
implemented that ful lls the following requirements:</p>
        <p>It generates Java code based on models and semantic web technologies.
It uses an Ecore model with annotations of the semantic web area as input
for the code generator.</p>
        <p>It should be possible to annotate property restrictions to attributes and
references and to annotate queries to operations.</p>
        <p>The generated code extensively implements the semantics of the Ecore model
and its annotations.</p>
        <p>Its code generator extends the EMF Generator and supports code
regeneration like the EMF Generator does.</p>
        <p>
          It is integrated into the TwoUse Toolkit [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
3.2
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Annotated Ecore Model</title>
        <p>The tool uses an Ecore model with annotations of the semantic web area as
basis for the code generation. For instance it should be possible to annotate a
SPARQL query to an operation of an Ecore class to describe the behaviour of
this operation. The generated code of this operation contains code that executes
this SPARQL query. The Ecore annotation connects the SPARQL query le
with the operation. The path of the SPARQL query is derived from the source
property of the annotation and inserted into the generated code during the code
generation.</p>
        <p>In addition references and attributes of an Ecore class can be annotated by
OWL property restrictions. For instance it should be possible to de ne that
a reference or an attribute should be transitive. Therefore Ecore annotations
are attached to the reference respectively the attribute. The value of the source
properties of these annotations de ne the types of the restrictions. The references
properties of the annotations can be used to de ne other elements of the Ecore
models as parameters for the restrictions.</p>
        <p>For the purchase order example we would create the SPARQL query for
getOrders and add an EAnnotation to getOrders in the Ecore model, whose
source property we set to the path of the SPARQL query. In addition we would
add an EAnnotation with source #ObjectProperty to previousOrders and an
EAnnotation with source #TransitiveObjectProperty to this Annotation.
3.3</p>
      </sec>
      <sec id="sec-2-4">
        <title>Extension of the EMF Generator</title>
        <p>
          The tool extends the EMF generator with the facility of generating code
corresponding to the annotations of the semantic web area. In addition the tool
should provide the possibility to use the original functionality of the EMF
Generator. For the implementation of the code generator the JET templates [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] of
the EMF generator are extended. The code generator of the tool should use
code merging like the EMF generator to support the regeneration of the code
so that developers can mark hand-modi ed code to prevent overwriting of the
hand-modi ed code.
3.4
        </p>
      </sec>
      <sec id="sec-2-5">
        <title>Generated Code</title>
        <p>The generated code extensively implements the semantics of the Ecore model
and its annotations of the semantic web area. The generated code is based on the
code, which the EMF generator would generate for the Ecore model. An ontology
that models the semantics of the Ecore model and its annotations is generated.
The Ecore model is transformed into the TBox of the ontology. The ABox of
the ontology includes the instances of the Ecore model. For the purchase order
example the TBox would include the Store, Customer and Order classes and
their properties and the ABox would include the Store, Customer and Order
instances and their properties.</p>
        <p>The generated code uses the generated ontology for implementing the
semantics of the annotated Ecore model. The generated code for an operation, that
is associated with a SPARQL query, includes code that executes the annotated
query on the generated ontology. The path of the query is derived from the
source property of the annotation and stored into a variable of the generated
code.</p>
        <p>The generated ontology is also used to ensure that the property restrictions,
which are associated with a reference or an attribute are not violated. According
to the EMF code generation the generated code for multiplicity-many attributes
and references includes only a get method, which retrieves an EList, and no set
method. For multiplicity-many attributes and references, which are associated
with property restrictions, the retrieved list is a special list, whose methods
prohibit the violation of these restrictions. For the purchase order example the
get method for previousOrders would retrieve a TransEList, whose methods
use the generated ontology to ensure, that the transitivity is maintained.</p>
      </sec>
      <sec id="sec-2-6">
        <title>3.5 Integration into the TwoUse Toolkit</title>
        <p>The tool will be implemented as an Eclipse plugin. Therefore it can be integrated
into the TwoUse Toolkit without much e ort. The TwoUse Toolkit is a toolkit
that already provides many features that support the model driven development
and the ontology engineering. Because of the integration into the TwoUse Toolkit
the tool can use these features. For instance the OWLizer of the TwoUse Toolkit
can be used for the generation of an ontology from an annotated Ecore model.
By the integration of the tool into the TwoUse Toolkit a software development
environment is provided that supports model driven software development as well
as a combination of model driven and ontology driven software development.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Related Work</title>
      <p>There are several works that deal with the use of semantic web technologies in
the software development. In this section some of these works are presented and
brie y summarized.</p>
      <p>
        The work of Andreas Eberhart [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] deals with the automatic generation of
inference systems from RDF-Schema and RuleML sources. The generation is
performed by a compiler, which was especially developed for this purpose. One
can choose between the OntoJava compiler and the OntoSQL compiler. The
OntoJava compiler generates Java code for an object database with a built-in system
of rules. The OntoSQL compiler generates SQL code for an IBM DB2 database
server. Within this work several mappings from RDF-Schema and RuleML into
Java code respectively SQL code are described. The work of Andreas Eberhart
focusses on the ontology driven software development. Therefore it does not
provide support for the model driven software development.
      </p>
      <p>
        In the work of Kalyanpur et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] a mapping from OWL sources to Java
code is presented. In this approach OWL classes are mapped to Java classes and
Java interfaces. Moreover it is described how OWL properties can be embedded
into the Java classes and Java interfaces. The restrictions, which are de ned
by the OWL properties, are modeled by several listener implementations. The
mapping of this work was used in the Ontology Creator module of the HarmonIA
Framework. This work focusses on the ontology driven software development. It
does not provide the advantages of the model driven software development like
the possibility to model the dynamic behaviour.
      </p>
      <p>
        Holger Knublauch [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] treats the question how a semantic web application
can be wisely developed in an ontology driven way. Therefore an example of
the tourism domain is used to introduce the developed software architecture.
Knublauch divides the application into a semantic web layer and an internal
layer. The semantic web layer contains the ontologies and provides them to
other applications. In addition the ontologies serve as control for the internal
behaviour and can be used for the generation of some internal components. The
internal layer contains control and reasoning mechanisms. It is recommended
that Protege with the OWL Plugin is used for the development. Therewith it
is possible to create ontologies, check their consistency and generate the
corresponding Java classes. Holger Knublauch focusses on the development of
semantic web applications and does not treat the question how the semantic web
technologies could be used for the development of other applications.
      </p>
      <p>
        Puleston et al. [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] are concerned with the integration of objectoriented and
ontological representations. They consider three possible approaches for the
combination of OWL and Java: a direct approach, an indirect approach and a hybrid
approach. The direct approach uses the ontology as draft for the program classes.
The OWL model is statically transformed into a corresponding Java
representation. In the indirect approach the java classes do not model the concepts of the
domain. Instead of that the Java classes access an external OWL model. The
third approach is a hybrid of the direct and indirect ones. In the hybrid model
the Java classes model a limited part of the ontology. This part is dynamically
extended by an OWL model. The work of Puleston et al. focuses on the hybrid
approach and illustrates the hybrid approach with the help of a case study of a
medical records system. Puleston et al. treat the integration of ontological
representations with programs but do not use them for the development process of
the programs.
      </p>
      <p>
        Hillairet et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] treat an approach how EMF applications and RDF data
sources can cooperate with each other. They present a system, which allows to
instantiate an EMF object from a RDF data source and to serialize EMF objects
into RDF data sources. Therefore a domain speci c mapping language is o ered
that allows to de ne mappings between elements in the EMF domain model and
elements in an OWL/RDF ontology. This mapping language can also be used
to de ne how an ontology should be built from a domain model. Because of
this it is possible to create a RDF data source from a domain model and store
model objects in the created RDF data source. Hillairet et al. do only treat
the cooperation between EMF applications and RDF data source and not the
question how the ontologies could be used during the creation of applications.
      </p>
      <p>
        The work Ontology De nition Metamodel of the OMG [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] de nes
metamodels and UML pro les for OWL, RDF and Topic Maps. In addition this work
describes several mappings like mappings from an UML model into an OWL
model. This work focusses on making the concepts of the model driven
development applicable to the engineering of ontologies, but does not cover the question
how ontologies could improve the model driven development.
5
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>This paper proposes an approach for combining model driven and ontology
driven development. The approach is based on the Eclipse Modeling
Framework and its metamodel Ecore. It is intended to extend the EMF generator by
adding the possibility to use semantic web technologies for the code generation
and within the generated code. Therefore the extended code generator gets Ecore
models with annotations of the semantic web area as input.</p>
      <p>The integration of the extended generator into the TwoUse Toolkit achieves
that a rich software development environment is provided, which could improve
the software development process. In addition it could be used to create an
ontology and to ll the created ontology with instances. The proposed approach
provides additional features to developers of the model driven community and of
the ontology driven community. Because developers of the model driven
community can use the semantic web technologies in a familiar environment, it could
support a broader adoption of these technologies in this community.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. OMG: Uni ed Modeling Language: Superstructure, version
          <volume>2</volume>
          .2. Object Modeling Group. (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Steinberg</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Budinsky</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paternostro</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Merks</surname>
          </string-name>
          , E.: EMF:
          <article-title>Eclipse Modeling Framework 2.0</article-title>
          .
          <string-name>
            <surname>Addison-Wesley Professional</surname>
          </string-name>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Knublauch</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Oberle</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tetlow</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wallace</surname>
          </string-name>
          , E.:
          <article-title>A Semantic Web Primer for Object-Oriented Software Developers</article-title>
          . W3c working group note,
          <source>W3C</source>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Prud'hommeaux</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>SPARQL Query Language for RDF (Working Draft)</article-title>
          .
          <source>Technical report, W3C</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Hillairet</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bertrand</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lafaye</surname>
          </string-name>
          , J.:
          <article-title>Bridging EMF applications and RDF data sources</article-title>
          .
          <source>In: SWESE</source>
          <year>2008</year>
          , 4th Workshop on Semantic Web Enabled Software Engineering, workshop at ISWC 2008,
          <source>the International Semantic Web Conference</source>
          <year>2008</year>
          , Karslruhe, Germany (
          <year>2008</year>
          )
          <volume>26</volume>
          {
          <fpage>40</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <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>On Marrying Ontological and Metamodeling Technical Spaces</article-title>
          . In Crnkovic, I.,
          <string-name>
            <surname>Bertolino</surname>
          </string-name>
          , A., eds.: ESEC/SIGSOFT FSE. (
          <year>2007</year>
          )
          <volume>439</volume>
          {
          <fpage>448</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>WeST</given-names>
            <surname>Web</surname>
          </string-name>
          <article-title>Science</article-title>
          and Technologies: TwoUse Project. Website http://code. google.com/p/twouse/.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Eberhart</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Automatic Generation of Java/SQL Based Inference Engines from RDF Schema and RuleML</article-title>
          . In Horrocks, I.,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.A</given-names>
          </string-name>
          ., eds.:
          <source>International Semantic Web Conference</source>
          . Volume
          <volume>2342</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2002</year>
          )
          <volume>102</volume>
          {
          <fpage>116</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Kalyanpur</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pastor</surname>
            ,
            <given-names>D.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Battle</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Padget</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          :
          <article-title>Automatic Mapping of OWL Ontologies into Java</article-title>
          . In
          <string-name>
            <surname>Maurer</surname>
          </string-name>
          , F.,
          <string-name>
            <surname>Ruhe</surname>
          </string-name>
          , G., eds.: SEKE. (
          <year>2004</year>
          )
          <volume>98</volume>
          {
          <fpage>103</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Knublauch</surname>
          </string-name>
          , H.:
          <article-title>Ontology-Driven Software Development in the Context of the Semantic Web: An Example Scenario with Protege/OWL</article-title>
          . In Frankel, D.S.,
          <string-name>
            <surname>Kendall</surname>
            ,
            <given-names>E.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L</given-names>
          </string-name>
          ., eds.
          <source>: 1st International Workshop on the Model-Driven Semantic Web (MDSW2004)</source>
          . (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Puleston</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cunningham</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rector</surname>
            ,
            <given-names>A.L.</given-names>
          </string-name>
          :
          <article-title>Integrating ObjectOriented and Ontological Representations: A Case Study in Java and OWL</article-title>
          . In Sheth,
          <string-name>
            <given-names>A.P.</given-names>
            ,
            <surname>Staab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Dean</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Paolucci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Maynard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Finin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.W.</given-names>
            ,
            <surname>Thirunarayan</surname>
          </string-name>
          , K., eds.:
          <source>International Semantic Web Conference</source>
          . Volume
          <volume>5318</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2008</year>
          )
          <volume>130</volume>
          {
          <fpage>145</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>OMG: Ontology De nition Metamodel</surname>
          </string-name>
          . Object Modeling Group. (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>