<!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>An Automatic Database Generation and Ontology Mapping from OWL File</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jirapong Panawong</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Taneth Ruangrajitpakorn</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marut Buranarach</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, Faculty of Science and Technology, Thammasat University</institution>
          ,
          <addr-line>Pathum Thani</addr-line>
          ,
          <country country="TH">Thailand</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Faculty of Management Science, Nakhonratchasima Rajabhat University</institution>
          ,
          <addr-line>Nakhonratchasima</addr-line>
          ,
          <country country="TH">Thailand</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Language and Semantic Technology Laboratory, National Electronics and Computer Technology Center</institution>
          ,
          <addr-line>Pathum Thani</addr-line>
          ,
          <country country="TH">Thailand</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>To promote ontology application development, some of the technical processes should be simplified with a supportive tool and an automatic method. This work presents a method to automatically generate a database schema from OWL file to prevent schema conflicts. Moreover, a mapping configuration can be created to associate an ontology and the generated data schema within the process. This method is designed to be compatible with an existing Ontology Application Management (OAM) Framework. With the proposed method, ontology labels are used to name data field name in database generation. The method allows any languages for ontology labels, but English ontology labels are recommended in this work since table names will be understandable. From testing, the produced mapping configuration to map ontology schema to database schema worked equivalently to human in terms of correctness but much faster in time consuming.</p>
      </abstract>
      <kwd-group>
        <kwd>Ontology application</kwd>
        <kwd>Ontological database</kwd>
        <kwd>Instantiation</kwd>
        <kwd>Mapping Support</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>In ontology application development, developers require to excel in several fields of
expertise including knowledge engineering, semantic web technology, programing,
inference engine tool, etc. In order to promote a development of ontology-based
application, simplicity in processes is a must to help developers to reduce expertise
requirements. In general, we can sum up processes as ontology creation, instance
preparation, ontology-instance mapping, and developing application using those data and
ontology. Each of these processes requires a good amount of time and effort to
complete and verify.</p>
      <p>
        Nowadays, several tools to support ontology application development are
available. For ontology creation, an ontology editor such as protégé [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and Hozo [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] are a
great help, and their output as OWL format [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] file can accordingly be used in
applications. Additionally, several inference engines to be used with ontology, such as Jena
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and JESS [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], are public and work smoothly. However, these tools still require
practices in order to utilise them fully. In the recent date, a tool called Ontology
Application Management (OAM) tool [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] was published and open for usage. The tool
was designed to support in ontology application development in several processes for
users who are an expert in a domain but are not excel in programing and technical
concepts in semantic technology. These include 1) user-interface to map ontology and
database schema as instantiation, 2) semantic search platform without background
technical knowledge of related fields such as RDF [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], OWL and URI, and 3)
recommender system platform with a simple user-interface to create rule without knowledge
about inference engine syntax. The tool is a great help to a community of ontology
application development as several applications in many domains were developed
based on OAM tool, for example [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
      <p>Although OAM tool assists in many processes in development, one of the difficult
parts for expert is the ontology-instance mapping. This part though is not a
systemtechnical process; it is necessary and directly effect to overall performance of a
semantic search and recommender application. Moreover, there are many cases that an
ontology of the domain is created before data are gathered. Hence, this work aims to
find a method to generate a database from OWL file and automatically map schema
of the generated database to ontology schema. We expect that this will reduce burden
of users to design a database compatible to their ontology and to map schema of both
sources. To fill in instances, the design of database is exportable to a spreadsheet
format file expected to be familiar and friendly to non-technical users. Lastly, this
work is intentionally designed to fit compatibly with OAM tool.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Background</title>
      <p>
        In this section, Ontology Application Management (OAM) tool is reviewed. The
Ontology Application Management (OAM) framework is an application development
platform aims to simplify creation and adoption of an ontology-based Semantic Web
application [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. This framework is an integrated platform that supports both RDF
data publishing from databases based on domain ontology and processing of the
published data in ontology-based Semantic Web applications, i.e. semantic search and
recommender system applications. Moreover, the framework provides some reusable
and configurable data and application templates customisable for different domain
ontologies using configuration GUIs. The OAM framework introduces intermediate
layers between user application and existing Semantic Web programming and
development environment.
      </p>
      <p>
        OAM framework uses ontology as a central structure for publishing RDF data from
database and as a means to access the published RDF data. The layers introduced by
OAM aim to hide complexity of the underlying Semantic Web data standards and
models. Fig. 1 shows a layered architecture of the OAM framework.
The framework is implemented on top of existing Semantic Web data and application
platforms that are D2RQ [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], Jena’s RDF data storage and Jena’s reasoning engine
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. The OAM framework uses relational database to ontology data mapping,
recommendation and application templates on top of these systems. The user can use the
provided management tools via web browsers (google chrome recommended) in
creating and managing an ontology-based Semantic Web application. For advance usage,
users of OAM can choose to use the Java API function in application development.
      </p>
      <p>
        Moreover, a recent upgrade of OAM included a rule management using
spreadsheet [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. This allows the users to use their own vocabulary and spreadsheet
application in managing recommendation rules. The framework was validated to be
successful tools for supporting by being utilised in several ontology application projects.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Methodology</title>
      <p>
        This work aims to create a database compatible with a given ontology file and
automatically generate a configuration file of mapping for OAM tool. For an overview,
there are three main processes shown in Fig. 2.
Firstly, we read the inputted OWL file [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and parse the annotations of OWL. From
OWL, we capture two kinds of ontological unit: concept and concept relation. For
step-wise, we apply an algorithm shown in Fig. 3.
      </p>
      <p>Algorithm: Parsing of OWL class and property
1
2
3
4
5
6
7
8
9
10
11
while unread class ≠ 0
read and record concepts URI
if class contains property
if property = data_property
record property name and its data_type
if cardinality of property &gt;1</p>
      <p>mark the property for multi-value
if property = object_property
record property name and its class_constraints
if cardinality of property &gt;1</p>
      <p>mark the property for multi-value</p>
      <p>Fig. 3. An algorithm to parse OWL class and property</p>
      <p>In detail of the algorithm, parsing starts from the root class (thing class for protégé
or Any class for Hozo). Next, properties of the class are read and recorded. For
properties, types of property are all the matter in further processes so object-property
(part-of) and data-property (attribute-of) are recorded separately along with their
constraints. Once we run through all properties, we search for sibling classes and
subclasses and keep the iteration until all classes are read.
3.2
Since we aim to be compatible with OAM, MySQL relational database is chosen as
our target format. With the captured classes and their relations, their existence is
considered. For each class, a table is created, and their properties are generated as table
columns. A data property is considered as a field to input data in while an object
property is required to be linked to another table using a foreign key following a class
constraint</p>
      <p>For a multi-value property, an extra table is generated for either data or object
property. Foreign key will be assigned instead of direct value. This multi-value
constraint forms a many-to-many relation of data. A table name and column tags are
generated following a label of an ontology class and relations. The generated database
table and columns along with a label of the ontology class are written into a log file to
be used in a further process. Please be noted that only own properties of a class are
considered since inherited properties from the superclass can be handled by ontology
processing in OAM. Moreover, the naming of tables and table columns can only be
done with an otology with English label. For those ontologies without English label,
number will be generated instead for identification, such as table1 and column4. An
illustration of table generation is shown in Fig. 4.</p>
      <p>Fig. 4. Images showing ontology classes (a) and the generated</p>
      <p>database schema associated with the ontology (b)</p>
      <p>From examples in Fig. 4-a, we can see that the ontology (from Hozo ontology
editor) contains a main class “Publication” with four properties. Let us focus on this
class first. For two data properties (indicated as A/o) of the class, two columns of
table ‘publication’ shown in Fig. 4-b are created for storing the string value for
“pub_id” and “title” relation. These database columns are generated with a data type
‘VARCHAR’ according to ontology data type ‘string’. An object property relation
(marked as P/o) to relation “data_source” is generated to another column field
required for a foreign key to link to another table ‘datasource’ generated in association
with “Data_Source” class from the ontology. Last, a class “Person” in ontology is
generated into another separated table ‘person’ in database shown in Fig. 4-b. This
relation, however, is marked with multi-value (as ‘_mv’ after relation name) since its
cardinality is 1 or greater (shown as ‘1..’ in ontology editor interface in Fig. 4-a). This
requires many-to-many relation; thus, another table is specially created as
‘publication-person’. In this separated table, id of publication instance and id of person
instance are linked.
3.3</p>
      <p>Generating a Mapping Configuration
From the log file kept information about original ontology class and its generated
table, a mapping configuration can be generated. Since a database schema is directly
created from ontology schema, we would not find a case of a conflict of schemas. For
a template of a mapping syntax, we follow OAM mapping configuration. By adding
ontology label and the name of table/table column, we gain an automatic way to
generate a mapping configuration compatible with OAM. Fig. 5 shows a generated
mapping configuration file.</p>
      <p>However, this method can only generate a mapping configuration following
original OWL and the generated table schema. For editing, users are asked to make change
of the mapping via OAM user interface.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Experiments and Discussion</title>
      <p>To approve a potential of the proposed method, we set up two experiments. The first
one is to check an accuracy of an automatically generated mapping configuration by
comparing to a mapping done by human. The second experiment is to examine how
supportive this method give based on time consumption in mapping ontology-data.</p>
      <p>For the first experiment, we asked a user who has experience with OAM to
perform mapping of ontology to the generated database. The given ontology contains 61
classes, 18 object properties and 27 data properties. We then compare a mapping
configuration file from human and our generated mapping configuration file. In
comparison, class mapping and relation mapping are separately counted. The comparison
result is shown in Table I.</p>
      <p>From the result shown in Table I, performance of the proposed method was
reliably good. The only difference of the mapping result was the case of a cardinality of
property is one or more. For the case, human mapped this class constraint to the target
class and all of the subclasses while the generated mapping only gave a mapping to
the target class. However, the outputs of both would give the same result in
applications since ontology processing in OAM can handle the tree spanning based on the
given OWL. Thus, the result though is different, but the both mappings are legit and
acceptable.</p>
      <p>The second experiment was set to compare time used for mapping. Three
ontologies are chosen to represent an effect based on ontology size. Details of the three
ontologies are given in Table II.</p>
      <p>In this experiment, time is counted in minutes used in only mapping process while
a fraction of minutes is considered as a minute. The mapping includes class mapping,
subclass mapping and property mapping. A person to map these ontologies is a user
who has used OAM in his 2 projects and continuously been using OAM for over 11
months. A result of time consumption in mapping between human and the proposed
method are given in Table III.</p>
      <p>From the results in Table III, we can see that time in use for mapping by human
was much higher than the automatic method. However, we notice that the time
consuming in average per class was lower the more he mapped since the most time
consuming period was when he started mapping by looking through and learning of
ontology classes and database. On the other hand, the automatic method skipped the
understanding process and went directly to labels.</p>
      <p>For further validation, those generated mapping configuration files with some data
in the database were tested in OAM semantic search application, and they worked
fine in actual usage. This proves that the generated mapping can help in a
development of an ontology application. For a summary from the experiments, the proposed
method can perform equivalently to human in terms of quality but much greater in
time consuming.</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this work, we propose a method to support ontology application development by
automatically generated database schema and the ontology-data mapping. It was
designed to be compatible with OAM framework to support users who may not excel in
programing and technical implementation. The method requires an OWL file from
ontology editor to generate a database schema along with a mapping configuration
file. The method is though applicable to any language of ontological label, but
English language is recommended for easier modification in further usage. From the
testing, the method can yield a high quality mapping of ontology-data schema with much
less time consuming comparing to human.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>[1] protégé: available online at http://protege.stanford.edu/</mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Hozo</given-names>
            <surname>Ontology</surname>
          </string-name>
          Editor: available online at http://www.hozo.jp
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>OWL Web Ontology Language Overview</surname>
          </string-name>
          : available online at https://www.w3.org/TR/2004/REC-owl-features-
          <volume>20040210</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>[4] Apache jena: available online at https://jena.apache.org</mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <article-title>[5] JESS, the Rule Engine for the JavaTM Platform: available online at www</article-title>
          .jessrules.com/jess/download.shtml
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Buranarach</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruangrajitpakorn</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Anutariya</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wuwongse</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Ontology Design Approaches for Development of an Excise Duty Recommender System</article-title>
          . In: Kawtrakul,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Laurent</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Spyratos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            , and
            <surname>Tanaka</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y</surname>
          </string-name>
          . (eds.) Information Search, Integration, and Personalization. pp.
          <fpage>119</fpage>
          -
          <lpage>127</lpage>
          . Springer International Publishing (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Bruijn</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Welty</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>RIF</surname>
            <given-names>RDF</given-names>
          </string-name>
          and OWL Compatibility: available online at https://www.w3.org/TR/2013/REC-rif
          <string-name>
            <surname>-</surname>
          </string-name>
          rdf-owl-
          <volume>20130205</volume>
          /
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Wongpatikaseree</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ikeda</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Buranarach</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Activity Recognition using ContextAware. Infrastructure Ontology in Smart Home Domain</article-title>
          .
          <source>In The Seventh International Conference on Knowledge, Information and Creativity Support Systems (KICSS2012)</source>
          (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Chariyamakarn</surname>
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boonbrahm</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruangrajitpakorn</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Supnithi</surname>
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>An Ontology-based Supporting System for Integrated Farming towards a Concept of the Sufficiency Economy</article-title>
          .
          <source>The International Joint Conference on Computer Science and Software Engineering (JCSSE2016)</source>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Somsuphaprungyos</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boonbrahm</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruangrajitpakorn</surname>
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>An Ontology-based Framework of Intelligent Services for Smart Campus</article-title>
          .
          <source>In The Tenth International Conference on Knowledge, Information and Creativity Support Systems (KICSS2015)</source>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Buranarach</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thein</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Supnithi</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>A Community-Driven Approach to Development of an Ontology-Based Application Management Framework</article-title>
          . In: Takeda,
          <string-name>
            <given-names>H.</given-names>
            ,
            <surname>Qu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Mizoguchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            , and
            <surname>Kitamura</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y</surname>
          </string-name>
          . (eds.) Semantic Technology. pp.
          <fpage>306</fpage>
          -
          <lpage>312</lpage>
          . Springer Berlin Heidelberg (
          <year>2013</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Bizer</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>D2RQ-Treating Non-RDF Databases as Virtual RDF Graphs</article-title>
          .
          <source>In: Poster at the the 3rd International Semantic Web Conference (ISWC2004)</source>
          (
          <year>2004</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Buranarach</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rattanasawad</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ruangrajitpakorn</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Ontology-based Framework to Support Recommendation Rule Management using Spreadsheet</article-title>
          .
          <source>In The Tenth International Conference on Knowledge, Information and Creativity Support Systems (KICSS2015)</source>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>