<!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>Typeful Ontologies with Direct Multilingual Verbalization</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ramona Enache</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Krasimir Angelov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science and Engineering Chalmers University of Technology and University of Gothenburg</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>There is an exciting development in ontology description languages. However the main focus is on the knowledge representation aspect and not so much on two other aspects that are just as important in practice. First, most languages are based on some kind of untyped logic which allows to assert axioms which are not well-formed. In contrast, even the simplest database systems are equipped with some database schemas which rule out incorrect records. In the long run this helps to maintain the information consistent. Another aspect which is of interest in many ontology based systems is to have verbalization of facts and axioms in some controlled language. Although this is not something new, it is usually seen as completely separated component. From an engineering perspective, it is advantageous to use the same language for both ontology description and controlled language development. In our experiment we also realized that in many natural languages the type information i.e. the ontological classes a ect the language generation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Developing large scale ontologies is always an error-prone process. For instance,
a predicate could be applied to arguments of wrong type. Even if its initial usage
was correct, the type of some instance could be changed in the later
development. After that, all places where the instance was used have to be updated.
Since this is a manual process it is very likely that errors will happen. The
programming languages community was dealing with that from the very beginning
of the existence of computer science and developed many di erent type
systems. Unfortunately this problem is largely ignored in the ontology development
community. For instance both KIF [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], OWL [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] and CycL [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] are untyped. We
present an experiment about using a strictly typed language to encode
ontologies. The language of choice is GF [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. As an application we took SUMO [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], the
largest open-source ontology available today.
      </p>
      <p>
        GF is a grammar formalism which makes a distinction between abstract
syntax and concrete syntax. The abstract syntax is a logical system based on Martin
Lof's type theory [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and describes the ontological relations in the domain. The
concrete syntax relates every concept from the abstract syntax to a phrase in
some concrete language. Since the abstract syntax is language independent it is
possible to have several concrete syntaxes associated with one abstract syntax.
      </p>
      <p>We have developed a tool which converts the SUMO axioms from KIF to
abstract syntax in GF (section 3). Since GF is also a framework for developing
grammars, it was natural to develop a natural language interface to SUMO
(section 4). Indeed SUMO already has templates for natural language generation.
They were processed and automatically converted to concrete syntax in GF. The
result is a controlled language which could be used to formulate new axioms in
SUMO or to render existing axioms in a natural language. We use only the
English patterns because they have the largest coverage and the best quality.
However as an experiment, a fraction of the controlled language was ported to
French and Romanian. This revealed that the type system in the ontology is also
important for the natural language generation. The complex morphological
patterns in these languages would make it very di cult to produce uent language
using the original simple patterns in SUMO. Fortunately this is not a problem
in GF.
2</p>
    </sec>
    <sec id="sec-2">
      <title>The type system in SUMO-GF</title>
      <p>Although KIF is an untyped language, in SUMO the types of all predicates and
the class hierarchy are de ned using logical assertions. These assertions are used
to generate the types in the abstract syntax of SUMO-GF. All concepts from
SUMO are mapped to either a type or a function in the abstract syntax. Since
we cannot explain all details of how the types in SUMO are modelled in GF, we
only sketch the design here.</p>
      <p>We de ne the category of all classes to be Class:
This is both a syntactic category and a semantic type. All classes in the ontology
will then be values of type Class. All direct instances of class C will get type
Ind C. When type checking we also need a way to say that some instance is of
some sub-class of C, in this case we assign type El C:</p>
      <p>cat Class;
cat El Class;</p>
      <p>Ind Class;
The relation between this two types is encoded by the coercion:
fun el : (c1; c2 : Class) ! Inherits c1 c2 ! Ind c1 ! El c2;
i.e. something is of class c2 if it is a direct instance of c1, and c1 inherits c2. The
subclass relation is encoded using the category SubClass:</p>
      <p>cat SubClass (c1; c2 : Class);
The re exive - transitive closure of the subclass relation, i.e. the inheritance, is
modeled using the dependent type Inherits:</p>
      <p>cat Inherits (c1; c2 : Class);
The inference rules for the transitive closure itself are represented by two
functions:
fun inhz : (c : Class) ! Inherits c c;
inhs : (c1; c2; c3 : Class) ! SubClass c1 c2 ! Inherits c2 c3 ! Inherits c1 c3;
Finally there is one more type Formula which is the return type for all
predicates.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Mapping SUMO to SUMO-GF</title>
      <p>A total of 17 modules from the SUMO ontology have been processed. Their area
of coverage ranges from the most general facts (Merge - the core SUMO ontology)
to the most speci c domains like \weapons of mass destruction". The over 10
000 objects and almost 7 000 relations have been translated automatically to
GF. For example:
(instance FullyFormed DevelopmentalAttribute)
will become:</p>
      <p>fun FullyFormed : Ind DevelopmentalAttribute:
In SUMO, functions and predicates are represented as instances of a descendent
of Relation. The representation speci es the return type and the type of its
arguments. This information automatically yields the GF representation of the
function/predicate. For example:
(instance address BinaryPredicate)
(domain address 1 Agent)
(domain address 2 Address)
becomes in GF:</p>
      <p>fun address : El Agent ! El Address ! Formula</p>
      <p>In addition to this, SUMO also features axioms which specify the behaviour
of relations and their connection to classes and instances. These axioms often
use quanti cation. For example:
(=&gt; (instance ?P Wading)
(exists (?W) (and (instance ?W BodyOfWater) (located ?P ?W))))
Since GF is a strongly typed language, all variables should be declared with
their corresponding type. We provide a simple type inference algorithm that
searches for the usage of each variable, and assigns it the most general type that
would make the axiom type-check. The corresponding axiom in GF would be:
forall Wading (nP ! (exists BodyOfWater (nW ! located (el P) (el W ))))
The SUMO declarations of objects and relations constitute the SUMO-GF
abstract syntax, while the other axioms are GF trees that are used for testing the
natural language generation and for experiments in reasoning with the ontology.</p>
      <p>During the translation of SUMO to GF, we discovered a number of small
inconsistencies from the original ontologies like mismatches between instances
and classes, usage of unde ned objects and usage of functions used with a wrong
number of arguments. This represents almost 8% of the total number of axioms
from SUMO and was determined automatically during the type checking phase.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Verbalization</title>
      <p>The SUMO distribution provides natural language generation for 10 languages,
via a set of string templates which are assembled together in order to construct
phrases. For a language without sophisticated morphology, such as English, this
turns out to be a satisfactory solution. On the other hand, for languages that
feature gender agreement or case declension for nouns, the templates render naive
constructions, that are not grammatically correct for most non-trivial cases. The
usage of GF guarantees syntactically correct constructions.</p>
      <p>Moreover, due to the design of the type system, variables from quanti ed
formulae are assigned the gender of their corresponding type. This is a common
feature of Romance languages, and would be di cult in an untyped setting.</p>
      <p>
        Our work provides natural language generation for the two biggest
modules Merge and Mid-level-ontology and two domain speci c: Elements - featuring
chemical substances and Mondial - featuring countries and cities of the world. A
total of almost 7 000 objects and 500 relations from SUMO were verbalized in
English. This process is done automatically for objects and semi-automatically
for relations, and uses the GF resource grammar [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] for English. The automatic
process takes advantage of the camel case representation of SUMO concepts.
For example, BodyOfWater will be rendered as \body of water\ and parsed
by GF as a noun phrase. For the two domain speci c ontologies, the
information is extracted from SUMO predicates that assert the connection of an entry
with its name. The procedure used to verbalize functions and predicates is
semiautomatical as it assumes building whole sentences and assumes more interaction
from the user regarding the place and order of the arguments in the phrase.
      </p>
      <p>As a result, our approach renders verbalization of a large number of entries
from the ontology, with a high rate of automation, ensuring syntactical
correctness of the generated phrases. For example :</p>
      <p>For every unique list LIST, every positive integer NUMBER2 and every
positive integer NUMBER1, we have that if the element with number NUMBER1 in
LIST is equal to the element with number NUMBER2 in LIST, then NUMBER1
is equal to NUMBER2.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>Our experience shows that using strongly typed languages in ontologies is
promising from both a knowledge engineering and a linguistic point of view.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Ganesereth</surname>
            ,
            <given-names>M.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fikes</surname>
            ,
            <given-names>R.E.</given-names>
          </string-name>
          :
          <article-title>Knowledge interchange format</article-title>
          .
          <source>Technical Report Logic-92-1</source>
          , Stanford University (
          <year>June 1992</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bechhofer</surname>
          </string-name>
          , S., van
          <string-name>
            <surname>Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>PatelSchneider</surname>
            ,
            <given-names>P.F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stein</surname>
            ,
            <given-names>L.A.</given-names>
          </string-name>
          :
          <article-title>OWL web ontology language reference</article-title>
          (
          <year>February 2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Cycorp:
          <article-title>The syntax of CycL (March</article-title>
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ranta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Grammatical Framework: A Type-Theoretical Grammar Formalism</article-title>
          .
          <source>The Journal of Functional Programming</source>
          <volume>14</volume>
          (
          <issue>2</issue>
          ) (
          <year>2004</year>
          )
          <volume>145</volume>
          {
          <fpage>189</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Niles</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pease</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Towards a standard upper ontology</article-title>
          .
          <source>In: FOIS '01: Proceedings of the international conference on Formal Ontology in Information Systems</source>
          , New York, NY, USA, ACM (
          <year>2001</year>
          ) 2{
          <fpage>9</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Martin-Lo</surname>
            f,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Constructive mathematics and computer programming</article-title>
          . In Cohen, Los, Pfei er, Podewski, eds.: Logic, Methodology and Philosophy of Science VI. North-Holland, Amsterdam (
          <year>1982</year>
          )
          <volume>153</volume>
          {
          <fpage>175</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ranta</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>The GF resource grammar library</article-title>
          .
          <source>Linguistic Issues in Language Technology</source>
          <volume>2</volume>
          (
          <issue>2</issue>
          ) (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>