<!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>RDFChain: Chain Centric Storage for Scalable Join Processing of RDF Graphs using MapReduce and HBase</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Pilsik Choi</string-name>
          <email>pilsik.choi@samsung.com</email>
          <email>pschoi@icl.yonsei.ac.kr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jooik Jung</string-name>
          <email>jijung@icl.yonsei.ac.kr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kyong-Ho Lee</string-name>
          <email>khlee@cs.yonsei.ac.kr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, Yonsei University</institution>
          ,
          <addr-line>Seoul</addr-line>
          ,
          <country>Republic of Korea</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Mobile Communication Division</institution>
          ,
          <addr-line>Samsung Electronics</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>As a massive linked open data is available in RDF, the scalable storage and efficient retrieval using MapReduce have been actively studied. Most of previous researches focus on reducing the number of MapReduce jobs for processing join operations in SPARQL queries. However, the cost of shuffle phase still occurs due to their reduce-side joins. In this paper, we propose RDFChain which supports the scalable storage and efficient retrieval of a large volume of RDF data using a combination of MapReduce and HBase which is NoSQL storage system. Since the proposed storage schema of RDFChain reflects all the possible join patterns of queries, it provides a reduced number of storage accesses depending on the join pattern of a query. In addition, the proposed cost-based map-side join of RDFChain reduces the number of map jobs since it processes as many joins as possible in a map job using statistics.</p>
      </abstract>
      <kwd-group>
        <kwd>Map-side join</kwd>
        <kwd>chain centric storage</kwd>
        <kwd>HBase</kwd>
        <kwd>NoSQL</kwd>
        <kwd>RDF</kwd>
        <kwd>SPARQL</kwd>
        <kwd>MapReduce</kwd>
        <kwd>Hadoop</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        As an enormous amount of Linked Data is available, processing a SPARQL query
into a massive RDF dataset becomes a challenging task when scalability and
performance issues are taken into consideration. Progress in many researches into SPARQL
query processing has been made with the use of MapReduce, a distributed parallel
processing framework. In particular, Hadoop1 is the most popular open source version
of MapReduce. Particularly, the conventional MapReduce-based join processing
methods are divided into two approaches: reduce-side join and map-side join [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Map-side join outperforms reduce-side join since the shuffle and reduce phases of
reduce-side join are not required. However, map-side join requires the datasets to be
equally partitioned by join keys. It is not just non-trivial but demanding for the
condition to be met in the case of multi-way joins. Przyjaciel-Zablocki et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] have
proposed the Map-Side Index Nested Loop Join (MAPSIN) using HBase2, which is a
distributed, scalable and column-oriented NoSQL storage. HBase is well suited for
random access due to the sparse multidimensional sorted map, and is also appropriate
for a data model that requires processing row keys such as table scans and lookups.
MAPSIN provides an optimized algorithm for reducing the number of storage access
for star pattern joins, but not for chain pattern joins. Therefore, we propose RDFChain
with the following contributions:
 RDFChain reflects every possible join patterns in its storage schema. Specifically,
the proposed chain centric storage, which reflects relations among the subjects and
objects of RDF triples, reduces the number of storage access.
 RDFChain reduces the number of map jobs in multi-way joins. RDFChain
estimates the cost of join processing using statistics to split a query. The queries
separated include as many triple patterns (TPs) as possible to be processed in a map
job. Thus, RDFChain processes as many joins as possible in a single map job.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Proposed Architecture</title>
      <p>
        RDFChain consists of two components, the data loading component and the query
processing one. RDF triples are converted into an N-triple format which is natively
supported by Hadoop and then loaded using map jobs. At this stage, we employ the
bulk load of HBase instead of directly putting every triple into a table. We also create
all the statistics [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] required by our join execution.
2.1
      </p>
      <sec id="sec-2-1">
        <title>Storage Design</title>
        <p>The proposed method stores RDF triples as follows:
 RDF triples with the terms that co-exist in both the subject and object parts of
triples are located in the Tcom table. A RDF triple with the term as a subject is
considered as a Subject-Predicate-Object (SPO) triple. A RDF triple with the term as an
object correspond to Object-Predicate-Subject (OPS).
 SPO triples which are not located in Tcom are stored in Tspo.
 OPS triples which are not located in Tcom are stored in Tops.</p>
        <p>If a term is used not only as a subject but also as an object in triples, it would be a row
key in Tcom. Tcom has two column-families to represent OPS and SPO schemas. A
predicate comes to a column. The subject and object terms become the values of the
corresponding columns for OPS and for SPO, respectively. A subject may have
several predicates and a predicate may also have several objects. This means that triples
are stored in a triple group by a subject as a row. Although Tcom may be sparse and
have a lot of empty fields, empty fields do not occupy storage in HBase. When
looking into rows in Tcom, some OPS and SPO triple groups share the same row key.</p>
        <sec id="sec-2-1-1">
          <title>2 http://hbase.apache.org.</title>
          <p>
            These triple groups indicate chain pattern relationship. In other words, the target
triples of a chain pattern join must exist in Tcom. RDFChain does not index the
predicates of RDF triples. Having a table with predicates as row keys has serious
scalability problems because the number of predicates in an ontology is usually fixed,
relatively small in RDF datasets [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ].
2.2
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Query Planning</title>
        <p>A join pattern is determined by the relationship of join variables in a query.
SubjectSubject (SS) and Object-Object (OO) relationships are subject to star pattern joins
while Object-Subject (OS or SO) relationships are subject to chain pattern joins. A
query graph is a directed graph derived from a query. A triple pattern is referred to as
a node and each join pattern is referred to as an edge. A logical plan is derived from a
query graph. A logical plan includes a set of triple pattern groups (TPGs) and the join
order of them. RDFChain determines the logical plan with the selection rules
proposed. The selection rules focus on reducing the number of bindings. A chain TPG is
a priority for grouping of TPGs.
2.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Query Execution</title>
        <p>Where a triple pattern has rdf:type as its predicate, we analyze the class hierarchy in
the corresponding ontology tree by utilizing Tcom instead of storing the triples inferred
and then extends the logical plan. The logical plan is transformed into a physical plan
for actual join processing on MapReduce and HBase. Each TPG in a logical plan is
transformed into a map job in a physical plan. RDFChain makes table mappings for
each TPG using an HBase index and accesses tables with an HBase filter based on the
structure of a TPG. The first map job uses HBase tables as the query input. The
intermediate result of each map job is stored in a distributed file system and then
taken as an input of a map job iteration.</p>
        <p>For a star pattern join, RDFChain efficiently retrieves a row through a single
storage access in a map job since its storage has a triple group by subject or object as a
row. For a chain pattern join, RDFChain only scans Tcom since the triple groups
satisfying a chain pattern are located in Tcom. Therefore, Tcom is more efficient for a
chain pattern join due to the reduced number of storage access. In multi-way joins,
only the rows with possibility of satisfying a chain pattern join are passed on as inputs
of map job iterations, thereby reducing the processing time.</p>
        <p>
          Two chain TPGs with disjoint join variables are compatible [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. RDFChain
estimates the cost of processing compatible sets in a map job. The cost of a map-side join
is the sum of all the cost-consuming tasks of a map job. Since we do not need to
consider the shuffle and reduce phases of a reduce-side join, we only take account of the
time to process a join. In a conventional reduce-side join, a map task simply writes
data according to a join key for an actual join in the reduce phase. However, the
proposed map task of RDFChain is relatively heavy to iterate both binding and pattern
matching. So, it may exceed the execution time assigned to the task. This problem can
be resolved by a static method of increasing the timeout or a computing power.
However, for a stationary time duration in a map task environment, we split TPGs based
on a threshold to dynamically solve this problem. We limit the number of TPGs
which can be processed in a map job using statistics such as the number of objects of
frequently used subject-predicate pairs and the number of predicate-object pairs for
every subject. We are able to estimate an intermediate result. The number of bindings
for join variables dominates the number of map jobs. All map jobs run sequentially. If
the cost does not exceed time limit, a single map job is generated.
3
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Experimental Results</title>
      <p>
        We used a Jena SPARQL parser and the Amazon's Elastic MapReduce service. Ten
clusters of large instances were run on Hadoop 0.20.2 and HBase 0.92.0. We
experimented with the LUBM 10K, LUBM 20K and LUBM 30K datasets, which consist of
1.3, 2.7 and 4.1 billion triples respectively, and a subset of benchmark queries, Q1,
Q2, Q3, Q4, Q7 and Q9 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The queries include simple and complex structures and
provide star and chain pattern joins. Q3, Q4, Q7 and Q9 require type inference. We
compared RDFChain with HadoopRDF [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] in terms of reduce-side join and MAPSIN
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for map-side join.
      </p>
      <p>RDFChain showed the best performance in large non-selective queries (Q2 and Q9).
In particular, Q2 and Q9 have a complex structure, a low selectivity due to unbound
objects, and a relationship of a chain pattern join. RDFChain greatly reduced the size
of the intermediate results by limiting RDF triples to actual candidate rows which can
satisfy a chain pattern join. RDFChain also shows smaller number of storage accesses
than MAPSIN. Since Tcom is a common subset of Tspo and Tops, it scales down the scan
space. RDFChain splits TPGs with compatible mappings and process the divided
TPGs in a map task. So, the number of map jobs decreases in turn.</p>
      <sec id="sec-3-1">
        <title>Acknowledgment</title>
        <p>This work was supported by the National Research Foundation of Korea (NRF)
grant funded by the Korea government (MSIP) (No. NRF-2013R1A2A2A01016327).</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Blanas</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ercegovac</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rao</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shekita</surname>
            ,
            <given-names>E.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tian</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>A Comparison of Join Algorithms for Log Processing in Mapreduce</article-title>
          .
          <source>In: Proc. International Conference on Management of data</source>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Przyjaciel-Zablocki</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schätzle</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hornung</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dorner</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lausen</surname>
          </string-name>
          , G.:
          <article-title>Cascading Map-Side Joins over Hbase for Scalable Join Processing</article-title>
          . CoRR, abs/1206.6293 (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Stocker</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seaborne</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bernstein</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kiefer</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reynolds</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>SPARQL basic graph pattern optimization using selectivity estimation</article-title>
          .
          <source>In: WWW</source>
          , pp.
          <fpage>595</fpage>
          -
          <lpage>604</lpage>
          . ACM (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Pérez</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arenas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gutierrez</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Semantics and Complexity of SPARQL</article-title>
          . In: Cruz,
          <string-name>
            <given-names>I.</given-names>
            ,
            <surname>Decker</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Allemang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Preist</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Schwabe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            ,
            <surname>Mika</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Uschold</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Aroyo</surname>
          </string-name>
          ,
          <string-name>
            <surname>L.M. (eds.) ISWC</surname>
          </string-name>
          <year>2006</year>
          .
          <article-title>LNCS</article-title>
          , vol.
          <volume>4273</volume>
          , pp.
          <fpage>30</fpage>
          -
          <lpage>43</lpage>
          . Springer, Heidelberg (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pan</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heflin</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>LUBM: A benchmark for OWL knowledge base systems</article-title>
          .
          <source>Journal of Web Semantics</source>
          <volume>3</volume>
          ,
          <fpage>158</fpage>
          -
          <lpage>182</lpage>
          (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Husain</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGlothlin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Masud</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Khan</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Thuraisingham</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Heuristics-Based Query Processing for Large RDF Graphs Using Cloud Computing</article-title>
          .
          <source>IEEE Transactions on Knowledge and Data Engineering</source>
          , vol.
          <volume>23</volume>
          , no.
          <issue>9</issue>
          , pp.
          <fpage>1312</fpage>
          -
          <lpage>1327</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>