<!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>Multi-Query Optimization in RDF Q/A System</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jie Jiao</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Shujun Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xiaowang Zhang⋆</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Zhiyong Feng</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>College of Intelligence and Computing, Tianjin University</institution>
          ,
          <addr-line>Tianjin 300350</addr-line>
          ,
          <country>China Tianjin</country>
          <institution>Key Laboratory of Cognitive Computing and Application</institution>
          ,
          <addr-line>Tianjin</addr-line>
          ,
          <country country="CN">China</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper, we present an optimization to answer a question with multiple queries by detecting all common subqueries of that question. Moreover, we apply mutual information in reducing ambiguity of queries of a question to improve the quality of common subqueries. Finally, to improve the accuracy of SPARQL query generated, we evaluate the semantic importance of each word in a question via TF-IDF during the generating queries process. Experiments show that our proposal ourperforms those single query execution.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>Overview of Our Approach</title>
      <p>Mutual Information Disambiguation Consider a question \Which movies
are directed by Paul Anderson? ". When we do phrase linking to the word \Paul
Anderson", we may see that the RDF dataset contains a large number of entities
about the word \Paul Anderson".</p>
      <p>⟨Paul Anderson⟩ and ⟨Paul W S Anderson⟩ may be directors, but ⟨Paul S
Anderson⟩ is a teacher. According to the semantics of question, we can actually
know that although there are three \Paul Anderson" in RDF dataset,
Movierelated ⟨Paul Anderson⟩ and ⟨Paul W. S. Anderson⟩ are what we really need.
Hence, we can delete ⟨Paul S Anderson⟩.</p>
      <p>The above example illustrates the intuition of our approach, we can deal with
ambiguity by counting the number of predicates between entities in advance.
However, there are too many entities in RDF graph. In this paper, we point out
that collecting two types of lightweight information in RDF graphs:
1. Count the number of relationships between di erent types of entities.
2. Count the number of relationships between speci c entities and di erent
types of entities.</p>
      <p>Word Core Measurement In the challenge of Question Understanding, we
try to use the SPARQL Q to accurately express the semantics of the question
N. In fact, the di erent words in N are di erent in the importance of generating
Q. However, there is currently no way to measure the importance of each word
in N for generating Q. Question Understanding stage can be expressed by the
formula:f (N ) → Q.</p>
      <p>The natural language question N is composed of the word wi, and the
SPARQL is composed of triple pattern pj , hence, we can convert the f (N ) → Q
into f (w1; w2; · · · ; wn) → (p1; p2; · · · ; pm), and then by vectorizing wi and pj we
can get the following formula:
we de ned a loss function as follows.</p>
      <p>f (w−→1; w−→2; · · · ; w−→n) → (−→p1; −→p2; · · · ; p−→m)</p>
      <p>L =</p>
      <p>
        m
∑(∑ −→pj −
j=1
n
∑ w−→i)
i=1
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
We choose transH[4] to vectorize triple patterns in SPARQL queries. By formula
2, we make the overall ⟨Ni; Qj ⟩ in the dataset as equal as possible.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Multi-Query Optimization</title>
      <p>We can divide all phrases in N into two categories:</p>
      <p>
        (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) \The United States" in Figure 1 (c) only corresponds to the entity
⟨United States⟩ in Figure 1(d). We use symbol wo to represent this type of
phrases.
Dependency tree
      </p>
      <p>Which actors
born
were
in
in</p>
      <p>Transformers</p>
      <p>The United States
(a)</p>
      <p>Super Semantic</p>
      <p>Query Graph</p>
      <p>Which movies
Nodes</p>
      <p>SPARQL Query Graph</p>
      <p>
        (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) The phrase \Transformers" in Figure 1 (c) corresponds to multiple entities
⟨Transformers (
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1,2,3</xref>
        )⟩ in Figure 1(d). We use symbol wm to represent these
ambiguous phrases.
      </p>
      <p>From Figure 1, we can see that subquery {?actors ⟨birthPlace⟩ ⟨United States⟩}
is a common subquery among all SPARQL queries. Hence, we can conclude that
the SPARQL queries generated by phrases without ambiguity in a question are
unique and common.</p>
      <p>Besides, due to the large amount of data in RDF Graph, it is very likely
that a phrase in N corresponds to many entities. In this case, too many
SPARQL queries are generated. Hence, we present a scoring mechanism for words in
question. Pay more attention to phrases that have important implications.</p>
      <p>We introduce TF-IDF to measure the semantic importance of di erent words
in a question:</p>
      <p>Score(wi) = T F ( |wi| ) · IDF (
|w|</p>
      <p>
        |N | )
|N (wi)|
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
|wi| indicates the number of occurrences of the word wi, |w| denotes the total
number of words. |N | denotes the number of questions in the corpus, |N (wi)|
denotes the number of questions that contain the word wi.
      </p>
      <p>If the importance of a word wi is not high, but wi corresponds to a lot of
items in RDF graph. We can ignore wi. In this way, we can slightly reduce the
accuracy, but in return for a great increase in e ciency.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Experiments and Evaluation</title>
      <p>From the data shown in Table 1, we can see that the accuracy of Our Approach is
slightly higher than the original work gAnswer[2] because of the better selection
of words wi in natural language question N .</p>
      <p>As can be seen from Figure 2, the e ciency of processing multiple
SPARQL queries can be improved by nding common structures between SPARQL
queries. Because it avoids redundant execution of common subquery. On this
basis, our method can further improve the execution e ciency of multiple
SPARQL queries. Because our method can determine the common subquery in
the Question Understanding phase. That is, all phrases in the question that</p>
      <p>Processed Right
100 70
100 68
100 40
100 52
100 36
do not contain ambiguity will generate a common subquery after the question
understanding stage.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this paper, we addressed the issue of multiple query optimization in RDF
Q/A system. We introduce machine learning algorithm to select the useful part
of question for SPARQL query generation. At the same time, we give a
speci c application of multiple SPARQL queries optimization. We hope that our
work can inspire other RDF system designers to apply machine learning more
in system design.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work is supported by the National Key Research and Development Program
of China (2017YFC0908401) and the National Natural Science Foundation of
China (61972455,61672377). Xiaowang Zhang is supported by the Peiyang Young
Scholars in Tianjin University (2019XRX-0032).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bidoit</surname>
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Herschel</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tzompanaki</surname>
            <given-names>A</given-names>
          </string-name>
          .:
          <article-title>E cient computation of polynomial explanations of why-not questions</article-title>
          .
          <source>In Proc. of CIKM</source>
          <year>2015</year>
          , pp.
          <volume>713</volume>
          {
          <fpage>722</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Hu</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zou</surname>
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yu</surname>
            <given-names>J.X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Answering natural language questions by subgraph matching over knowledge graphs (extended abstract)</article-title>
          .
          <source>In Proc. of ICDE</source>
          <year>2018</year>
          , pp.
          <year>1815</year>
          {
          <year>1816</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Ren</surname>
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            <given-names>J</given-names>
          </string-name>
          .
          <article-title>: Multi-query optimization for subgraph isomorphism search</article-title>
          .
          <source>PVLDB</source>
          ,
          <volume>10</volume>
          (
          <issue>3</issue>
          ):
          <volume>121</volume>
          {
          <fpage>132</fpage>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Wang</surname>
            <given-names>Z.</given-names>
          </string-name>
          , Zhang J.,
          <string-name>
            <surname>Feng</surname>
            <given-names>J.</given-names>
          </string-name>
          , Chen Z.:
          <article-title>Knowledge graph embedding by translating on hyperplanes</article-title>
          .
          <source>In Proc. of AAAI</source>
          <year>2014</year>
          , pp.
          <volume>1112</volume>
          {
          <fpage>1119</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Zou</surname>
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>O</given-names>
            <surname>zsu M.T.</surname>
          </string-name>
          ,
          <string-name>
            <surname>Chen</surname>
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shen</surname>
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huang</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            <given-names>D</given-names>
          </string-name>
          .
          <article-title>: gStore: A graph-based SPARQL query engine</article-title>
          .
          <source>VLDB J</source>
          .,
          <volume>23</volume>
          (
          <issue>4</issue>
          ):
          <volume>565</volume>
          {
          <fpage>590</fpage>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>