<!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>A Highly Parallel Engine for RDF</article-title>
      </title-group>
      <contrib-group>
        <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>Yongxin Yu</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 designed a highly parallel engine for RDF, which includes a new RDF storage model with little memory dependence and a Machine Learning algorithm. Based on the above two points, we present a heuristic query decomposition algorithm to split a SPARQL query into subqueries and then process these subqueries parallelly. Experiments show that our engine perform better on SPARQL query execution with maximizing the usage of memory.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>RDF Storage</title>
      <p>In this paper, we propose a novel approach to manage RDF data(named
TriStore). Figure 1 is an example of TriStore used to store RDF data. In order to
save memory usage, instead of storing entire strings or URIs, we use shortened
versions or keys. For each RDF element value, TriStore maintains a mapping
table that maps these keys to their corresponding strings. After encoding, we
convert Figure 1(a) into Figure 1(b). In order to match queries more e ciently,
subject predicate object
rdf:George rdf:hasJob rdf:FullProfes</p>
      <p>sor
rrrdddfffSS:::GttUUaaettnneeoiissttreegdde rrrdddfff::ll:iitvvyeepIIenn rrrdddfffSS:::CttUUaaottnnueeiinsstteetrddy
rdf:FullProfes rdf:type rdf:Professor</p>
      <p>sor
rdf:Professor rdf:workAt rdf:University
rdf:Canada rdf:type rdf:Country
(a)
we use three tables(Figure 1(c), Figure 1(d), Figure 1(e)) to store set of triples
Di in memory, which support the following query operations, where s, p and o
are subject, predicate and object:
1. given p, return set f(s; o)j &lt; s; p; o &gt;2 Dig
2. given s and p, return set foj &lt; s; p; o &gt;2 Dig
3. given o and p, return set fsj &lt; s; p; o &gt;2 Dig</p>
      <p>Where Figure 1(c), Figure 1(d) and Figure 1(e) are used to support query
types 1, 2 and 3 above, respectively. For the rst type of query, only the predicate
p is known, and we want to get all p-related s and o. For TriStore, we rst get
the encoding number m of string p, and then we only need to output all the data
of line m in Figure 1(c) (it can be observed that the line number of the table is
equal to the encoding of the predicate). For example, we perform this SPARQL
query(Select wheref?x rdf : type ?y:g). First nd the digital encoding of the
predicate rdf : type, after nding that the encoding is 2, then directly output
all the data in the second row of Figure 1(c). Therefore, after obtaining the
encoding of string p, corresponding data can be quickly found with O(1) time
complexity.</p>
      <p>Figure 1(d) used to support fast matching of the second type of query, where
s and p are known. What we want to get is o which is related to both s and p.
For TriStore, the encoding m and n of string s and p should be obtained rst.
As we can see from the running examples, line m in Figure 1(d) stores all PIDs
and OIDs associated with the SID m (there are a mapping table that maps PIDs
to OIDs). Hence, we only need to output all the data in the m-th line with the
key n.</p>
    </sec>
    <sec id="sec-3">
      <title>Query Optimization</title>
      <p>
        In order to maximize the e ciency of SPARQL queries in parallel environment,
we split Q into several subqueries with the same cost. We accept the machine
learning based method in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] to estimate the time cost of the SPARQL query.
We use T (Q) to represent the time cost of executing query Q.
      </p>
      <p>Heuristic SPARQL Decomposition Using exhaustive method to decompose
the SPARQL is less e cient. In this section, we present a heuristic query
decomposition algorithm, which can e ciently split query into two subqueries with
equal execution cost. We use degree(denoted as dn) to represent the number of
SELECT ?prof ?stud WHERE {
?prof worksFor CS .</p>
      <p>?stud advisor ?prof.
}
(a) SPARQL
?prof
worksFor</p>
      <p>CS
advisor ?stud
(b) Graph
edges connected to node n in SPARQL graph. For example, in Figure2 (b),
d?prof = 2; dCS = 1; d?stud = 1. It is easy to see that the nodes with higher
degree are usually the center of SPARQL query graph (or regional center). Hence,
we try to split the query from the nodes with higher degree. Note that, the
query Q is decomposed only when the formula: maxfT (q1); T (q2)g &lt; 0:8 T (Q)
is satis ed. 0.8 is the value we obtained through experiments. Since a Q is
decomposed into q1 and q2, an additional join operation must be performed. Next,
we will try to decompose the subqueries q1 and q2 obtained in this round until
the formula cannot be satis ed.</p>
      <p>Joining Order There are three types of Join processing trees commonly used
in databases: left-deep tree, right-deep tree and bushy tree. In order to improve
e ciency as much as possible, and to use the parallel processing power of the
computer. it is essential to use a strategy that can create bushy join trees (rather
than focusing on left-deep or right-deep trees).
4</p>
    </sec>
    <sec id="sec-4">
      <title>Experiments and Evaluation</title>
      <p>In the case of not processing the SPARQL query in parallel, we compare our
engine with RDF3X in query e ciency. As can be seen from Figure 3, our engine
is more e cient than RDF3X even without parallel acceleration. In Figure 4, we
tested our engine in a parallel environment. We have found that our engine can
indeed improve the e ciency of query execution in a parallel environment.
4 0 0
Mmoyre(M)B 23 00 00
1 0 0</p>
      <p>RO Du rF A3 pX p r a o c h 33 05 00 00
2 5 0 0
iTem)sm( 112 500 000 000
5 0 0
0 1
2</p>
      <p>
        Finally, we compare the memory usage of our storage model with
Hexastore [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] on di erent data sets. Hexastore has six tables to quickly respond to
any type of query. Because our method only supports normal SPARQL queries.
For equivalence comparison, we only calculated the memory occupancy of three
tables in Hexastore. Figure 4 shows that our storage model takes up less memory
than Hexatore does.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this paper, we design a highly parallel RDF engine for RDF by our designed
RDF storage model, to take less memory and respond faster to queries in a
highly parallel way.. We believe that our approach is helpful to maximize the
performation of limited computing resources.</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>Hasan</surname>
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gandon</surname>
            <given-names>F.:</given-names>
          </string-name>
          <article-title>A machine learning approach to sparql query performance prediction</article-title>
          .
          <source>In Proc. of WI</source>
          <year>2014</year>
          , pp.
          <volume>266</volume>
          {
          <fpage>273</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Neumann</surname>
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weikum</surname>
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>RDF-3X: A RISC-style engine for RDF</article-title>
          .
          <source>PVLDB</source>
          ,
          <volume>1</volume>
          (
          <issue>1</issue>
          ):
          <volume>647</volume>
          {
          <fpage>659</fpage>
          (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Weiss</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Karras</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bernstein</surname>
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Hexastore: Sextuple indexing for semantic web data management</article-title>
          .
          <source>PVLDB</source>
          ,
          <volume>1</volume>
          (
          <issue>1</issue>
          ):
          <volume>1008</volume>
          {
          <fpage>1019</fpage>
          (
          <year>2008</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Zhang</surname>
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhang</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peng</surname>
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Song</surname>
            <given-names>J.</given-names>
          </string-name>
          , Feng
          <string-name>
            <surname>Z.</surname>
          </string-name>
          , Zou L.:
          <article-title>A scalable sparse matrixbased join for SPARQL query processing</article-title>
          .
          <source>In Proc. of DASFAA</source>
          <year>2019</year>
          , pp.
          <volume>510</volume>
          {
          <fpage>514</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Zou</surname>
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tamer</surname>
            <given-names>O</given-names>
          </string-name>
          
          <string-name>
            <surname>zsu</surname>
            <given-names>M.</given-names>
          </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 graphbased 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>