<!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>squall2sparql: a Translator from Controlled English to Full SPARQL 1.1</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>IRISA, Universite de Rennes 1 Campus de Beaulieu</institution>
          ,
          <addr-line>35042 Rennes cedex</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper reports on the participation of the system squall2sparql in the QALD-3 question answering challenge for DBpedia. squall2sparql is a translator from SQUALL, a controlled natural language for English, to SPARQL 1.1, a standard expressive query and update language for linked open data. It covers nearly all features of SPARQL 1.1, and is directly applicable to any SPARQL endpoint.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Data (LOD), and covers nearly all features of SPARQL 1.1, for both queries and
updates. The advantage of CNLs is to provide a natural language syntax while
retaining the precision and lack of ambiguity of formal languages like SPARQL [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
The main drawback of CNLs is that users have to learn the language and its
disambiguation rules. The system squall2sparql2 is a Web application that
supports the translation from SQUALL to SPARQL, as well as the direct
querying of SPARQL endpoints, like DBpedia.
      </p>
      <p>The objective of our participation in the QALD-3 question answering task
was to evaluate the capability of SQUALL to express English questions in a
natural and precise way, and the capability of squall2sparql to correctly translate
SQUALL questions into SPARQL. Therefore, the measures of precision and
recall are not enough to evaluate our approach, and the naturalness of SQUALL
questions has also to be assessed.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Approach</title>
      <p>
        Our system squall2sparql, as its name suggests, is a translator from SQUALL
to SPARQL. Given a SQUALL sentence, the system rst translates it into an
intermediate logical representation using a Montague grammar [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. The
intermediate representation is then translated into SPARQL, simply mapping logical
constructs to combinations of SPARQL constructs. The produced query can then
be sent to any SPARQL endpoint, and results returned. We have shown that
SQUALL covers most features of SPARQL 1.1, including aggregations,
expressions, updates, and named graphs. The only missing features are graph-level
updates (e.g., LOAD), federated queries (i.e., SERVICE), and transitive closures of
complex property paths (e.g., (author/^author)+).
      </p>
      <p>We now brie y describe SQUALL as a controlled natural language. Content
words are nouns, verbs, and proper nouns. Nouns (e.g., Person) and intransitive
verbs are interpreted as class URIs or built-in unary predicates. Relation nouns
(e.g., child, birthPlace) and transitive verbs (e.g., matches) are interpreted as
property URIs or built-in binary predicates. Proper nouns (e.g., res:Germany)
are interpreted as entity URIs. Grammatical words are determiners (e.g., a. the,
every, at least 10), auxilliary verbs (e.g., is, has), prede ned verbs (e.g., shares,
relates), imperative verbs (e.g., give me, return), comparative and superlative
adjectives (e.g., higher, later, most), aggregation nouns and adjectives (e.g., number,
average), interrogative determiners and pronouns (e.g., what, which, how many),
coordinations (e.g., and, or, not), and others. Boolean coordinations can be
applied to most types of phrases: noun phrases, verb phrases, relative propositions,
and sentences. Every proposition has a subject, a verb, and also an object if
the verb is transitive. A sentence can be an open question (e.g., starting with
Which or What), a closed question (e.g., starting with Whether or using auxiliary
verbs and inversion), an imperative-style question (e.g., starting with Give me
or Return), or an assertion (for updates).
2 Web forms, examples, and source code can be found from the SQUALL homepage:
http://www.irisa.fr/LIS/softwares/squall.</p>
      <p>
        Complete examples of SQUALL questions are given in the following sections.
More details and examples about the SQUALL language and its translation to
SPARQL can be found in previous papers [
        <xref ref-type="bibr" rid="ref4 ref5">4,5</xref>
        ].
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Resources</title>
      <p>The use of squall2sparql in QALD-3 assumes that English questions are
reformulated in SQUALL, i.e. Controlled English. Its syntax is regular and
sufciently similar to English so that it can be learned without too much e ort.
Many examples are available on the SQUALL's Web page. Its vocabulary (i.e.,
nouns and verbs) is made of URIs because there is so far no lexical treatment in
squall2sparql. This has the obvious drawback that SQUALL queries look less
natural, and that URIs have to be known or discovered manually. However, the
advantage is that squall2sparql is directly applicable to any LOD dataset,
because no linguistic resource is required. If such linguistic resource is available,
like those produced by the lexicon task of the QALD-3 challenge, it could be
combined in SQUALL, using words instead of URIs.</p>
      <p>From the training phase, we already learned some of the DBpedia
vocabulary, and other URIs were found manually with Google searches and DBpedia
browsing. We spent on average a few minutes per question for the
reformulation phase. The automatic translation to SPARQL takes much less time than
SPARQL query evaluation, and is therefore not an issue.</p>
      <p>For illustration purposes, we list below a few original questions along with
their SQUALL reformulation. The full list of SQUALL questions can be found
in the o cial results of the QALD-3 open challenge.</p>
      <p>1 Which German cities have more than 250000 inhabitants?</p>
      <p>Which Town that has country res:Germany has a populationTotal greater
than 250000?
2 Who was the successor of John F. Kennedy?</p>
      <p>Who is the successor of res:John F. Kennedy?
3 Who is the mayor of Berlin?</p>
      <p>Who is the leader of res:Berlin?
4 How many students does the Free University in Amsterdam have?</p>
      <p>What is the numberOfStudents of res:Vrije Universiteit?
5 What is the second highest mountain on Earth?</p>
      <p>Which Mountain has the 2nd highest elevation?
7 When was Alberta admitted as province?</p>
      <p>What is the dbp:admittancedate of res:Alberta?
9 Give me a list of all trumpet players that were bandleaders.</p>
      <p>Give me all Person-s whose instrument is res:Trumpet and whose occupation
is res:Bandleader.
12 Give me all world heritage sites designated within the past ve years.</p>
      <p>Give me all WorldHeritageSite whose dbp:year is between 2008 and 2013.
15 What is the longest river?</p>
      <p>Which River has the highest dbp:length?</p>
    </sec>
    <sec id="sec-4">
      <title>Results</title>
      <p>Out of the 99 questions, we got the right answers for 80 questions (including the
three OUT OF SCOPE questions), and partial answers for 13. Recall is 0.88,
precision is 0.93, and the F-measure is 0.90. Errors come:
{ from heterogeneity in data (12 errors, questions 1, 6, 17, 19, 29, 33, 39, 60,
63, 72, 93, 96),
{ from the user reformulation in SQUALL (2 errors, questions 14, 43),
{ from squall2sparql (2 errors, questions 49, 59),
{ from the gold standard (2 errors, question 16, 75),
{ from the endpoint (1 error, question 92).</p>
      <p>Looking at heterogeneity errors in detail, it appears that most of them could
be solved simply by: either adding generic super-properties in the DBpedia
ontology, or by expanding common words (e.g., location, date) into UNION graph
patterns. For example, in question 39 \Give me all companies in Munich.",
the implicit relation \has location" can be translated in any of the three RDF
properties: dbo:location, dbo:headquarter, dbo:locationCity. This explains
why our reformulation in SQUALL \Give me all Company-es whose location is
res:Munich." has recall 0.6 only (the default pre x was used for DBpedia
ontology, so that location stands for dbo:location). If location, or another
property, was de ned as a super-property of the other properties, the same SQUALL
question would have recall 1. Alternatively, assuming linguistic knowledge, the
word \location" could be mapped to the graph pattern
{ ?x dbo:location ?y }</p>
      <p>UNION { ?x dbo:headquarter ?y }</p>
      <p>UNION { ?x dbo:locationCity ?y }
where ?x and ?y respectively stand for the subject and object of the relation.
Such graph patterns could easily be exploited in the translation from the
intermediate representation to SPARQL without the need to change the SQUALL
language and its parsing.</p>
      <p>Another problem related to heterogeneity is that some expected domain and
range axioms are not veri ed in some cases. For example, in question 19 \Give me
all people that were born in Vienna and died in Berlin.", 2 out of the 6 expected
answers are not instances of the class Person. This is why our reformulation
\Give me all Person-s whose birthPlace is res:Vienna and whose deathPlace
is res:Berlin." missed 2 answers, even though it is arguably equivalent to the
original formulation.</p>
      <p>The errors coming from the user reformulation of questions are due to
misspelling or misunderstanding of URIs. In question 14, \res:Prodigy" was used
instead of \res:The Prodigy". In question 43, the property \dbp:breed" was used
in the wrong direction.</p>
      <p>The errors coming from squall2sparql are due to an incorrect translation
of the special verb \share". For example, Question 49 \Which other weapons did
the designer of the Uzi develop?" was reformulated as \Which Weapon shares
the dbp:designer with res:Uzi?", which returns \Uzi" itself as an answer.
Another possible reformulation is \Which Weapon has the same dbp:designer as
res:Uzi?", but it exhibits the same error.</p>
      <p>The error from the endpoint is because the BIND construct of SPARQL is not
(yet) supported by the QALD-3 endpoint. It is possible to write the SPARQL
query to avoid it, but squall2sparql relies on it to simplify the translation
from SQUALL. Note that the correct answers are returned when using the o cial
DBpedia endpoint.</p>
      <p>Regarding the naturalness of SQUALL sentences, most of them are not much
longer than the original ones, and can be understood without learning SQUALL.
Most di erences fall into three categories:
1. reformulating the question to make it agree with SQUALL's grammar,
2. replacing a word by another (e.g., movie ! Film),
3. making explicit some relations (e.g., \is a chemist" ! \has profession
res:Chemist").
5</p>
    </sec>
    <sec id="sec-5">
      <title>Discussion</title>
      <p>We here discuss a few directions to go in order to improve the usability and
performance of our approach.</p>
      <p>Lexicons. The data independence of SQUALL is valuable as it allows to query
all LOD with neither preparation nor linguistic resources. However, when such
linguistic resources are available [12], it is a shame not to use them, as they
could improve recall, and make SQUALL sentences much more natural at the
lexical level. The useful format of lexicons for squall2sparql would be
mappings from words to graph patterns. Nouns and intransitive verbs would be
mapped to RDF classes or mono-dimensional graph patterns (one free variable),
and relational nouns and transitive verbs would be mapped to RDF properties
or bi-dimensional graph patterns (two free variables). Such lexicons may be
extended to adjectives, adverbs, and prepositions by corresponding extensions of
SQUALL's syntax. A candidate format of lexicons is lemon (lexicon model for
ontologies) [10].</p>
      <p>Multilinguality. This is an aspect of the QALD-3 challenge that we did not
address. A priori, it su ces to de ne a di erent concrete syntax for each
language, keeping unchanged the intermediate representation. However, for some
languages, it may be more di cult than for English whose morphology is less
complex than many other languages.</p>
      <p>
        Guidance. Writing questions in a controlled natural language is easier than in a
formal language like SPARQL. However, it is still error-prone, and may be
frustrating for users. A possible solution that has already been used for CNLs is an
auto-completion mechanism that suggests possible completions for the sentence,
based on the grammar (e.g., Ginseng [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). However, this is mostly useful to avoid
grammatical errors, but not so helpful to nd the right content words. Another
participant of the challenge, Scalewelis, proposes a content-based guided
approach, where users can build in a exible way complex queries without the need
to know the grammar or the content words.
10. McCrae, J., Spohr, D., Cimiano, P.: Linking lexical resources and ontologies on
the semantic web with lemon. In: Extended Semantic Web Conference (ESWC).
pp. 245{259. LNCS 6643, Springer (2011)
11. Perez, J., Arenas, M., Gutierrez, C.: Semantics and complexity of SPARQL. In:
et al, I.F.C. (ed.) Int. Semantic Web Conf. pp. 30{43. LNCS 4273, Springer (2006)
12. Walter, S., Unger, C., Cimiano, P.: A corpus-based approach for the induction of
ontology lexica. In: Int. Conf. Applications of Natural Languages to Information
Systems (NLDB). pp. 102{113. LNCS 7934, Springer (2013)
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bernstein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaufmann</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Kaiser</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Querying the semantic web with Ginseng: A guided input natural language search engine</article-title>
          .
          <source>In: Work. Information Technology and Systems (WITS)</source>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Damljanovic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Agatonovic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cunningham</surname>
          </string-name>
          , H.:
          <article-title>Identi cation of the question focus: Combining syntactic analysis and ontology-based lookup through the user interaction</article-title>
          .
          <source>In: Language Resources and Evaluation Conference (LREC)</source>
          .
          <source>ELRA</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Dowty</surname>
            ,
            <given-names>D.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wall</surname>
            ,
            <given-names>R.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peters</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : Introduction to Montague Semantics. D. Reidel Publishing Company (
          <year>1981</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Ferre</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>SQUALL: a controlled natural language for querying and updating RDF graphs</article-title>
          . In: Kuhn,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Fuchs</surname>
          </string-name>
          , N. (eds.)
          <source>Controlled Natural Languages</source>
          . pp.
          <volume>11</volume>
          {
          <fpage>25</fpage>
          . LNCS 7427, Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Ferre</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>SQUALL: a controlled natural language as expressive as SPARQL 1.1</article-title>
          . In: Metais,
          <string-name>
            <surname>E</surname>
          </string-name>
          . (ed.)
          <source>Int. Conf. Application of Natural Language to Information Systems (NLDB)</source>
          . pp.
          <volume>114</volume>
          {
          <fpage>125</fpage>
          . LNCS 7934, Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Fuchs</surname>
            ,
            <given-names>N.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kaljurand</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schneider</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Attempto Controlled English meets the challenges of knowledge representation, reasoning, interoperability and user interfaces</article-title>
          . In: Sutcli e, G.,
          <string-name>
            <surname>Goebel</surname>
            ,
            <given-names>R</given-names>
          </string-name>
          . (eds.) FLAIRS Conference. pp.
          <volume>664</volume>
          {
          <fpage>669</fpage>
          . AAAI Press (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Hitzler</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , Krotzsch,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Rudolph</surname>
          </string-name>
          ,
          <string-name>
            <surname>S.</surname>
          </string-name>
          :
          <article-title>Foundations of Semantic Web Technologies</article-title>
          . Chapman &amp; Hall/CRC (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Kaufmann</surname>
          </string-name>
          , E.,
          <string-name>
            <surname>Bernstein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Evaluating the usability of natural language query languages and interfaces to semantic web knowledge bases</article-title>
          .
          <source>J. Web Semantics</source>
          <volume>8</volume>
          (
          <issue>4</issue>
          ),
          <volume>377</volume>
          {
          <fpage>393</fpage>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Lopez</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uren</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motta</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pasin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Aqualog: An ontology-driven question answering system for organizational semantic intranets</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>5</volume>
          (
          <issue>2</issue>
          ),
          <volume>72</volume>
          {
          <fpage>105</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>