<!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>Ontology-driven Translators: The new generation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Francisco-Edgar Castillo-Barrera</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Engineering Faculty, Universidad Autonoma de San Luis Potos</institution>
          ,
          <country country="MX">Mexico</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper we describe a proposal for a new generation of translators. This approach is based on a domain ontology of software components for driving the translation process. We use an example and a prototype to show the feasibility of our approach.</p>
      </abstract>
      <kwd-group>
        <kwd>Domain ontology</kwd>
        <kwd>Translators</kwd>
        <kwd>CORBA-IDL</kwd>
        <kwd>SPARQL</kwd>
        <kwd>Pellet</kwd>
        <kwd>Reasoner</kwd>
        <kwd>Description logic</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>In software ingeniering the research about how the component context can
improve their assembling has been studied so long. We dispose of standard like
CORBA-IDL. We are interenting in explore the use of a domain ontology not
only for guiding the assembling of components but also for enriching the
component descriptions.</p>
      <p>These enriching descriptions needs a di erent kind of translators. These ones
could be based on a domain ontology of software components for driving the
translation. This approach has some advantages like:
{ Semantic associated to the code, ie in software components the entry
le which contains information about declaration of their interfaces and their
methods can be enriched with an ontology.
{ New knowledge. By transforming the translations in an ontology
(description logic) reasoners can be applied automatically and possibly generate new
knowledge (components where possible may be used).</p>
      <p>We consider three kind of translators based on ontologies:
1. Translators that incorporates the source code of the ontology in the
translation process.
2. Translators which maintain a direct communication with the domain
ontology during the translation proces.
3. Translators which before doing the translation using an ontology based on
a domain to verify that the vocabulary used in the code is correct or not.</p>
      <p>For example, an English to Spanish translator. This translator receives text
in English, uses an ontology to verify English language (eg WordNet).</p>
      <p>In this paper we describe the second kind of translators. In our approach, a
populated ontology (properties,instances) is generated from a CORBA-IDL+C
le by using an ontology-based translator.</p>
      <p>The rest of the paper is structured as follows. In Section 2 we present some
related work. In Section 3 we describe our approach an Ontology-based Translator
for CORBA-IDL+C language. Section 4 describes an example and a prototype
to show the feasibility of our approach. Finally, in Section 5 we draw some
concluding remarks.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Related</title>
    </sec>
    <sec id="sec-3">
      <title>Work</title>
      <p>
        An ontology for Syntactic and Semantic English-Korean machine was made by
Il-Sun Song, Su-Kyung Kim and Ho-Jin Choi [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. The authors apply two
translation modules to achieve their goal: Syntactic and Semantic. The rst module
transforms the English structure into Korean structure and the second module
extracts an exact meaning of a word using ontologies. In contrast, our proposal
is based on Programming Languages and we use a domain ontology about
Software Components. A closely related work is a Test Speci cation Code Translator
using ontology and XML/XSLT Technologies presented by Lim Lian Tze, Tang
Enya Kong and Zaharin Yuso [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. They developed and implemented a
framework for translating test speci cation code between platform-speci c languages
and they use a test domain ontology to translate correctly test keywords. We
do not use an ontology to correct word, by contrast, we use a domain ontology
for translating CORBA code in an ontology source code in OWL-DL sintax.
The most closely related work was made by Alessio Lomuscio, Hongyang Qu
and Monika Solanki [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This approach consists(semi-)automatically compile and
verify contract-regulated service compositions.
3
      </p>
    </sec>
    <sec id="sec-4">
      <title>An Ontology-based Translator for CORBA-IDL+C language</title>
      <p>
        Six steps were required to build the Ontology-based Translator which generates
a populated Ontology of Software Componentes in OWL-DL language and using
n3 notation. They consist on:
1. Building an Ontology in the Domain of Software Components
2. De ning the structure of the le in CORBA-IDL++
3. Extending the keywords of CORBA-IDL language
4. Implementing the Lexical Analyzer for a CORBA-IDL++ le
5. Implementing the Syntactic Analyzer
6. Generating the Target Code by Syntax-directed Translator
In this paper, we will describe only the step one. An ontology [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] de nes
the basic terms and relations comprising the vocabulary of a topic area, as well
as the rules for combining terms and relationships used to de ne extensions to
the vocabulary. The Ontology built in this work was in the domain of software
components. Ontology classes and subclasses de nition were written using
notation 3 or n3 [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] which is similar to RDF in its XML syntax, but more easy
to understand. When we de ne a new vocabulary we have to de ne new classes,
it means what type of thing something is, we write a owl:Class. The statements
each consist of a subject, verb and object ending with a period. In n3 we can
write RDF triples in that way. The Ontology built is showed below.
:ComponentType a owl:Class .
:Interface a owl:Class .
:Provider rdfs:subClassOf :Interface .
:Required rdfs:subClassOf :Interface .
:Provider owl:disjointWith :Required .
:Required owl:disjointWith :Provider .
:Method a owl:Class .
:DataType a owl:Class .
:Parameter a owl:Class .
:OperatingSystem a owl:Class .
:ComponentModel a owl:Class .
:Requirements a owl:Class .
      </p>
      <p>:FunctionalRequirements</p>
      <p>rdfs:subClassOf :Requirements .
:NonFunctionalRequirements_QoS</p>
      <p>rdfs:subClassOf :Requirements .
:PreCondition rdfs:subClassOf :Condition .</p>
      <p>:PostCondition rdfs:subClassOf :Condition .</p>
      <p>
        List 1. The main classes of the software component ontology
The mainly concepts used in our logic model are methods, contracts, and
interfaces. Interfaces de ne the methods used in contracts and composition. This
ontology consisted of 20 classes, 28 Object Properties, 36 Data Properties. The
ontology was written using n3 notation, it is used by RDFS and OWL DL logic
model. Some classes are showed in List 1. The Ontology is built by means of
classes and relations among concepts. Each method is speci ed by an
interface, type declarations, a pre-condition, and post-condition [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In addition, there
are two types of interfaces (provided and required). The interface of a method
describes the syntactic speci cation of the method. The typing information
describes the types of input and output or both parameters and internal (local)
variables. All of the above is represented in our ontology (class Type, class
Parameter, etc.). The most important part to consider in our ontology are the
Conditions (Pre, Post and Inv). The Pre-condition describes the condition of
the variables prior to the execution of the method whose behavior is described
by the Post-condition. Invariant are values which has to be hold during the hole
process.
      </p>
      <p>
        Evaluating the ontology created The ontology developed has been evaluated
in an informal and formal way. Regarding the former, the ontology was evaluated
by the developers during the whole ontology life cycle and they used the Pellet
reasoner [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] to check the consistency of the ontology. This group supervised
the releases mainly by asking the de ned competency questions and checking
whether the ontology could answer them. The second evaluation applied to the
ontology is based on the work of Gomez-Perez [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] who establishes ve criteria
(consistency, completeness, conciseness, expandability and sensitiveness).
4
      </p>
    </sec>
    <sec id="sec-5">
      <title>Verifying contracts between ATM components and Bank</title>
      <p>
        We used an Automated Teller Machine (ATM) example. ATM is a machine
at a bank branch or other location which enables customers to perform basic
banking activities. The component model used for describing the ATM system
was made in Chichen Itza Framework using its graphical interface of software
components, and is shown in gure 3: One example in the design phase using
the ATM example [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In this case the input model (semantic IDL le) only
has the information of 2 software components and we can create its instances
and relations among them using the Chichen Itza's menus. We complement the
veri cation process performing queries in SPARQL.
      </p>
      <p>
        A prototype of the framework involves a visual editor. See Fig.4. The tool
makes use of the library Flamingo and the Ribbon component [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] implemented
in Java. The process to verify a matching among components is very easy for
the user.
Pellet [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] is an open-source Java based OWL DL reasoner. In our veri cation
process we use Pellet for checking the consistency of the ontology. Ontology
consistency is de ned as a set of conditions that must hold for every ontology.
Pellet gives an explanation when an inconsistency is detected.
Part of the code generated by the Translator using the ATM and BANK IDL
les is showed below.
      </p>
      <p>:ATM a :ComponentType .
:BANK a :ComponentType .
:IAtmClient a :Interface .
:IAtmClient :hasMethod :deposit .
:IBank a :Interface .
:IBank :hasMethod :withdrawal .
:deposit a :Method .
:withdrawal a :Method .
:amount a :Parameter .
:numclient a :Parameter .
:deposit :hasNumParameters 2 .
:deposit :hasParameter :amount .
:amount :hasIndexOrder 1 .
:deposit :hasPrecond :condition1 .</p>
      <p>:
5</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions</title>
      <p>In this paper we have presented and described an Ontology-based
TranslatorCompiler for generating a populated ontology source code (instances and
properties) based on an Domain Ontology of Software Components.</p>
      <p>A formal veri cation based on a Reasoner (Pellet) can be applied at the
target code generated in an automatic way, without expertise. In addition we
can extract information and knowledge using SPARQL queries. This code can
be classi ed in a certain domain increasing the reuse and compatibility of the
component with others. Besides, the veri cation of the contracts can be done.
The Ontology used was represented in a logic-based language (OWL DL). The
OWL DL ontology proposed is checked with the Pellet reasoner and it has a
nite complexity (it has not problems of decidibility).</p>
      <p>The main contribution of this work is to generate a populated Ontology
of properties and instances from a CORBA-IDL+C le by using an
Ontologybased Translator which can be used for verifying contracts among components
in a formal way. In our example, we have veri ed the matching among software
components using reasoners (formal method based on a Description Logic
Reasoner) for verifying the matching of the software components based on Contracts,
a software components ontology, interfaces (pre-conditions, post-conditions and
invariants), SPARQL queries.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bechhofer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goble</surname>
            ,
            <given-names>C.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Daml+oil is not enough</article-title>
          .
          <source>In: SWWS</source>
          . pp.
          <volume>151</volume>
          {
          <issue>159</issue>
          (
          <year>2001</year>
          ), http://www.informatik.unitrier.de/ ley/db/conf/semweb/swws2001.htmlBechhoferGH01
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Connolly</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hawke</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Semantic web tutorial using n3</article-title>
          .
          <source>In: Twelfth International World Wide Web Conference</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Crnkovic</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Larsson</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Building reliable component-based software systems</article-title>
          .
          <source>Artech House computing library, Norwood</source>
          , MA (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Gruber</surname>
          </string-name>
          , T.:
          <article-title>Toward principles for the design of ontologies used for knowledge sharing</article-title>
          . pp.
          <volume>907</volume>
          {
          <issue>928</issue>
          (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. Java.net: Flamingo. http://java.net/projects/ amingo/ (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. kiu Lau,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <surname>Z.</surname>
          </string-name>
          :
          <article-title>A survey of software component models</article-title>
          .
          <source>Tech. rep., in Software Engineering and Advanced Applications</source>
          .
          <year>2005</year>
          . 31 st EUROMICRO Conference: IEEE Computer Socity (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Lomuscio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qu</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Solanki</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Towards verifying contract regulated service composition</article-title>
          .
          <source>In: Web Services</source>
          ,
          <year>2008</year>
          . ICWS'08. IEEE International Conference on. pp.
          <volume>254</volume>
          {
          <fpage>261</fpage>
          .
          <string-name>
            <surname>IEEE</surname>
          </string-name>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sirin</surname>
          </string-name>
          , E.:
          <article-title>Pellet: An owl dl reasoner</article-title>
          .
          <source>In: In Proceedings of the International Workshop on Description Logics</source>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Seo</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Song</surname>
            ,
            <given-names>I.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kim</surname>
            ,
            <given-names>S.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Choi</surname>
            ,
            <given-names>H.J.</given-names>
          </string-name>
          :
          <article-title>Syntactic and semantic englishkorean machine translation using ontology</article-title>
          .
          <source>In: Proceedings of the 11th international conference on Advanced Communication Technology - Volume 3</source>
          . pp.
          <volume>2129</volume>
          {
          <fpage>2132</fpage>
          . ICACT'09, IEEE Press, Piscataway, NJ, USA (
          <year>2009</year>
          ), http://dl.acm.org/citation.cfm?id=
          <volume>1701655</volume>
          .
          <fpage>1701781</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Staab</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Studer</surname>
            <given-names>R</given-names>
          </string-name>
          .,
          <string-name>
            <given-names>S.H.</given-names>
            ,
            <surname>Sure</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y.</surname>
          </string-name>
          :
          <article-title>Knowledge processes and ontologies</article-title>
          . vol.
          <volume>16</volume>
          , pp.
          <volume>26</volume>
          {
          <issue>34</issue>
          (Jan-Feb
          <year>2001</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Tze</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kong</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yuso</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>A test speci cation code translator using ontology and xml/xslt technologies</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>