<!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>Quelo: a NL-based intelligent query interface</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Enrico Franconi</string-name>
          <email>franconi@inf.unibz.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Paolo Guagliardo</string-name>
          <email>paolo.guagliardo@stud-inf.unibz.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Trevisan</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>KRDB Research Centre, Free University of Bozen-Bolzano</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        A controlled natural language (CNL) is a language engineered to look and feel
like natural language and to be more suitable, for a speci c purpose, than
natural language itself. CNLs have been designed to improve communication between
humans, like PoliceSpeak [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], to improve performance of machine translation, like
ScaniaSwedish [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], and to edit and query knowledge bases, like Attempto [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] (e.g. as
used in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). In this article we address CNLs of the latter kind.
      </p>
      <p>
        According to a survey [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] on natural language interfaces to (query) databases
(NLIDBs), one of the problems that speci cally a ect NLIDBs is the so-called
\linguistic vs conceptual failure": when the system fails to answer a query, the user does
not know whether it failed because the query could not be interpreted or because
its interpretation was not supported by the schema of the database. A similar
problem a ects CNL-based interfaces as well: in this case, the system informs the user
whether the query could be interpreted correctly, because the language is de ned
precisely, but|still|the user cannot tell whether the query retrieved no results
because its interpretation was not consistent with the schema or simply because there
was no data matching the requested features.
      </p>
      <p>The described problem arises only when the user does not know the schema. In
this situation, even if users are pro cient with SQL or other formal query languages,
they cannot query the database without knowledge of the schema. When the schema
is largely unknown, users lack the vocabulary necessary to formulate queries in the
rst place. We must point out that CNL interfaces provide some help in such a
situation, through so-called predictive editors. Thanks to a formal, unambiguous
grammar and to a closed vocabulary, such an editor displays all syntactically legal
completions of the user input at every single keystroke. This feature lets the user
have a glance at the vocabulary of the language, which give a hint about the content
of the database.</p>
      <p>Nevertheless, even when the user knows the vocabulary supported, the user needs
to know how the terms they can be combined meaningfully, and what constraints
hold on the data, in order to formulate queries that the system can answer. For
example, predictive editors that rely only on syntactical information do not stop
users from composing a meaningless query like \Which songs are performed by two
songs? ", but also a query like \Which albums have two artists? ", that is reasonable
even if it fails when the schema associates artists with songs but not with albums.
If that is the case, even if the latter query is syntactically correct, no data will ever
match it. In this article we introduce the Quelo system, which addresses this very
problem, by supporting the user in the task of formulating a precise query { which
best captures their information needs { even when the user ignores completely the
vocabulary and the constraints of the underlying information system holding the
data.</p>
      <p>
        Our idea develops a technique presented in earlier systems. \Conceptual
authoring" [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] allows the user to compose a query by assembling snippets of text associated
with semantic elements that are determined by the semantic context. NLMenu [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
uses semantic grammars to display the possible semantic extensions of a query in
a menu. Both systems use a dedicated conceptual schema to guide the user during
the composition of the query in the same way a predictive editor uses a syntactic
grammar. These schemas are domain-dependent: when system engineers con gure
the system to query a new knowledge base, they must craft one such schema
specifically for it. CNLs cannot take advantage of these techniques immediately, because
these techniques were not designed as stand-alone reusable components.
      </p>
      <p>
        We developed a novel system, named Quelo and formally described in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], that
exploits Description Logic (DL) ontology schemas to capitalise the service provided
by semantic grammars, that is, ltering out semantically inappropriate query
extensions and suggesting the appropriate ones given the context of the query and the
background knowledge represented by the ontology schema. The purpose of Quelo is
similar to purpose of the prediction subsystem of a syntax-based predictive editor,
but Quelo works on the semantic level, and therefore it is not syntax-aware, and it
is language independent. The improvement over the conceptual authoring systems
developed so far consists in the use of a DL reasoner to enforce semantically
consistency in the user's queries. Consider for example the following ontology schema,
two queries and two query fragments. We present them in English using an informal
paraphrase, but they would be best written using a rst order logic syntax, or, even
better, using DL syntax.
(A) \there are only men and women": for each X, if X is a person then (X is a
man or X is a woman);
\men don't love anyone": there is no X such that a man loves X;
\men don't hate each other ": for each X, if X is a man, no men hate X;
\women hate only men": for each X, if a woman hates X, X is a man.
(B) I am looking for a person X who hates a person Y who hates a man.
(C) X is a woman.
(D) X loves a person.
(E) I am looking for a married woman.
      </p>
      <p>Given the schema A, our tool can avoid suggesting C and D as an extension of query
B, because according to the constraints in A, X will always be a man in B. But
Quelo goes even further: it drives the user in composing informative queries|that
is to say|it tries to limit the insertion of redundant elements. A case in point: when
Quelo retrieves the possible substitutions for \married" in query E, it will lter out
\person", even if \person" is semantically compatible with \woman". The reason for
this exclusion is that a \woman" is a \person" already, therefore \person woman"
would not be more informative than \woman".</p>
    </sec>
    <sec id="sec-2">
      <title>Query Representation and Reasoning</title>
      <p>In a nutshell, Quelo works on a tree-shaped, conjunctive, description logics formula.
It uses a DL reasoner to calculate which extensions would make the formula
unsatis able with respect to a OWL DL ontology, in order to lter them out. In addition,
it lters out some of the extensions that, if added, would produce an equivalent
formula.</p>
      <p>The system has a few, simple requirements. First, our \semantic grammar" is an
OWL DL ontology schema. Such a schema is standard technology used to represent
a formal conceptualisation of a knowledge domain, that is, a conceptual schema. If
an OWL DL ontology Modelling the target knowledge base already exists, our tool
needs no information besides the schema to provide its services. Second, the system
requires a reasoner for OWL DL. Many such reasoners are developed commercially
and available o -the-shelf under various licensing agreements.</p>
      <p>The input query is a directed tree, where each edge is labelled with exactly one
binary predicate and each node is labelled with one or more unary predicates. Such
a tree encodes a rst-order logic query in which the root node represents a free
variable; each other node represents a distinct, existentially quanti ed variable; the
label R of an edge directed from node x to node y represents a formula R(x; y);
each label C of a node x represents a formula C(x). The overall formula encoded by
the tree is the conjunction of all the formulae represented by edge and node labels
and therefore it is a conjunctive query: no negations, no disjunctions, no universal
quanti cations may appear. Moreover, it is tree-shaped: no variables may appear
twice as the second argument of a binary predicate. For instance, the query \I'm
looking for a woman who loves a married man" corresponds to the following formula:
9y Woman(x) ^ loves(x; y) ^ Married(y) ^ Man(y) :</p>
      <p>
        The above restrictions on the shape of the query allow Quelo to deliver its services
fast enough to provide them on-line, that is, at the same time the user types the
query. Given such a query in input, the services o ered by Quelo [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] consist in:
{ retrieve additional labels that can be added to a given node: these are unary
predicates that are not disjoint from the labels of the given node and are not
equivalent to, more general than or more speci c than any of them;
{ retrieve the labels that can be associated with a newly created edge attached
to a given node: these are binary predicates that, if added to the query, do not
make it unsatis able;
{ retrieve the labels that can be used to replace a given selected portion of the
tree: these are unary predicates that are equivalent to, more general than or
more speci c than the formula represented by the selection and, if used in its
stead, do not make the query unsatis able.
      </p>
      <p>Each set of unary predicates included in the result is arranged in a hierarchy
according to the constraints of the target ontology.</p>
    </sec>
    <sec id="sec-3">
      <title>Natural Language Interface</title>
      <p>
        In order to evaluate and showcase the system, we implemented a web-based
natural language interface (NLI) [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], following the conceptual authoring paradigm [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
and using a custom-built natural language generation (NLG) module for English.
Conceptual authoring is a technique to compose a textual document enriched with
a precise, unambiguous speci cation of its meaning. In our NLI the document is a
query: a textual representation (in English) of the user's informative need, enriched
with a speci cation of its meaning | a labeled, directed tree query model.
      </p>
      <p>To compose a query in the NLI, the user starts from an initial, system-de ned
sentence ("I am looking for something."). At its margins (and, later on in the process,
within it) there are gaps where the user can insert snippets of text chosen among
those proposed by the system. Some parts of the sentence, determined by the system,
can be deleted, or replaced with other similar snippets. The insertion, deletion and
substitution of system-determined snippets are the only operations allowed. Through
a sequence of such operations, the user edits the text. At the same time, hidden to the
user, the system maintains a directed tree corresponding to the meaning of the query.
Each operation on the text a ects the tree by inserting, deleting or substituting a
label, a node or a portion of the tree. Each part of the text is connected with a
speci c element of the tree, and each snippet that is inserted or removed carries in
or out an element of the tree. In this way, the system builds the meaning of the text
by observing the operations performed. In particular, the system does not take into
consideration the text as a whole resulting from these operations in order to produce
the tree. In this way, the system avoids the disadvantages associated with natural
language understanding.</p>
      <p>The snippets inserted and removed cannot be simple canned text, otherwise
the result of their composition would hardly resemble English. For this reason, our
interface uses NLG. Each of our snippets consists in a so-called NLG \template",
that is, a portion of a parse tree conforming to a simple English grammar with feature
structures. Each such snippet has three layers: a surface textual representation, which
is displayed to the user when it is suggested by the system, a portion of parse tree,
which is used to produce the text as whole after the insertion of the snippet in the
query, and a portion of a labeled directed tree, which represents the contribution of
the snippet to the meaning of the query.</p>
      <p>So far, the system we described follows closely the conceptual authoring archetype:
the query is presented to the user in a generated natural language tightly connected
with the underlying semantics. The ontology schema can thus be e ectively exploited
by the users in order to formulate a natural language query that best captures their
information need, without any ambiguity. Our improvement on the basic conceptual
authoring system is that the snippets available for addition and for replacement are
ltered by Quelo. As explained in the second section Quelo operates by means of
appropriate automated reasoning techniques over the ontology schema which describes
the domain of the data in the information system. For each snippet, Quelo checks
whether the portion of labeled directed tree of the snippet is a valid extension of the
current query, e ectively restricting the user's choice to only those snippets which
are relevant and meaningful in a given context.</p>
      <p>The most powerful and innovative feature of the conceptual authoring interface
of our system lies in the fact that users need not to be aware of the underlying
organisation of the data, nor they need knowledge of the vocabulary, and still they tool
will guide them into composing a query that is sound with respect to the underlying
information system. Moreover, such knowledge can be gradually acquired by using
the tool itself, gaining con dence with the vocabulary and with the constraints of
the ontology. Users may also decide to just explore the knowledge without actually
querying the information system, with the aim of discovering general information
about the modelled domain.</p>
      <p>
        To work properly, our NLI requires a map from elements of the ontology schema
to such \templates". To ease the adoption of the system, we devised a rule-based
technique to extract linguistic information from the ontologies themselves in order
to generate the NLG templates automatically. In order to achieve this result, we
harvested and analysed more than 12000 unique schema relations, and we carefully
selected the grammatical features supported by the generated natural language in
order to keep the templates simple to build while being exible enough to satisfy
the most common expression needs of existing ontologies. While limited to English,
the technique is e ective to the point that the NLG interface can be used with most
ontologies virtually without the need of human intervention. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]
      </p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>
        We developed a natural language interface for Quelo, but Quelo was not speci cally
designed for it. In fact, we are currently developing other interfaces as well. We
believe it could also be used within CNL-based predictive editors to limit the set
of suggestions. Intuitively, when the query composed so far can be unambiguously
transformed into a well-formed formula, it could be fed to Quelo in order to lter
out suggestions associated with semantic extensions that are syntactically correct
but not semantically appropriate. A complete description of this work together with
an extensive set of references can be found in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>I.</given-names>
            <surname>Androutsopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.D.</given-names>
            <surname>Ritchie</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Thanisch</surname>
          </string-name>
          .
          <article-title>Natural language interfaces to databases - an introduction</article-title>
          .
          <source>Natural Language Engineering</source>
          ,
          <volume>1</volume>
          (
          <issue>01</issue>
          ):
          <volume>29</volume>
          {
          <fpage>81</fpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Abraham</given-names>
            <surname>Bernstein</surname>
          </string-name>
          , Esther Kaufmann, Anne Gohring, and Christoph Kiefer.
          <article-title>Querying ontologies: A controlled english interface for end-users</article-title>
          .
          <source>In Proceedings of ISWC 2005: The 4th International Semantic Web Conference</source>
          , pages
          <volume>112</volume>
          {
          <fpage>126</fpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Enrico</given-names>
            <surname>Franconi</surname>
          </string-name>
          , Paolo Guagliardo, and
          <string-name>
            <given-names>Marco</given-names>
            <surname>Trevisan</surname>
          </string-name>
          .
          <article-title>An intelligent query interface based on ontology navigation</article-title>
          .
          <source>In Proceedings of the Workshop on Visual Interfaces to the Social and Semantic Web (VISSW</source>
          <year>2010</year>
          ),
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Norbert</surname>
            <given-names>E.</given-names>
          </string-name>
          <string-name>
            <surname>Fuchs</surname>
            , Uta Schwertel, and
            <given-names>Rolf</given-names>
          </string-name>
          <string-name>
            <surname>Schwitter</surname>
          </string-name>
          .
          <article-title>Attempto controlled english - not just another logic speci cation language</article-title>
          . In Pierre Flener, editor,
          <source>Logic-Based Program Synthesis and Transformation, number 1559 in Lecture Notes in Computer Science</source>
          , Manchester,
          <string-name>
            <surname>UK</surname>
          </string-name>
          ,
          <year>June 1999</year>
          . Eighth International Workshop LOPSTR'98, Springer.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Paolo</given-names>
            <surname>Guagliardo</surname>
          </string-name>
          .
          <article-title>Theoretical foundations of an ontology-based visual tool for query formulation support</article-title>
          .
          <source>Master's thesis</source>
          , Free University of Bozen-Bolzano (
          <article-title>Italy)</article-title>
          and Vienna University of Technology (Austria),
          <year>October 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Catalina</given-names>
            <surname>Hallett</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Donia</given-names>
            <surname>Scott</surname>
          </string-name>
          , and Richard Power.
          <article-title>Composing questions through conceptual authoring</article-title>
          .
          <source>Computational Linguistics</source>
          ,
          <volume>33</volume>
          (
          <issue>1</issue>
          ):
          <volume>105</volume>
          {
          <fpage>133</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Laura</surname>
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Perez</surname>
          </string-name>
          .
          <article-title>Intelligent query interface: adding natural language support</article-title>
          .
          <source>Technical Report KRDB09-7</source>
          , KRDB Research Centre, Faculty of Computer Science, Free University of Bozen-Bolzano, Italy,
          <year>April 2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Jonathan</given-names>
            <surname>Pool</surname>
          </string-name>
          .
          <article-title>Can controlled languages scale to the web?</article-title>
          <source>In Proceedings of CLAW 2006: The 5th International Workshop on Controlled Language Applications</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Harry</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Tennant</surname>
          </string-name>
          ,
          <string-name>
            <surname>Kenneth M. Ross</surname>
          </string-name>
          , Richard M. Saenz, Craig W. Thompson, and
          <string-name>
            <surname>James</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Miller</surname>
          </string-name>
          .
          <article-title>Menu-based natural language understanding</article-title>
          .
          <source>In Proceedings of the 21st annual meeting on Association for Computational Linguistics</source>
          , pages
          <volume>151</volume>
          {
          <fpage>158</fpage>
          ,
          <string-name>
            <surname>Morristown</surname>
          </string-name>
          , NJ, USA,
          <year>1983</year>
          .
          <article-title>Association for Computational Linguistics</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>Marco</given-names>
            <surname>Trevisan</surname>
          </string-name>
          .
          <article-title>A portable menu-guided natural language interface to knowledge bases for Querytool</article-title>
          .
          <source>Master's thesis</source>
          , Free University of Bozen-Bolzano (Italy) and University of Groningen (Netherlands),
          <year>January 2010</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>