<!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>Efficient processing of large RDF streams using memory management algorithms</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vaibhav Khadilkar</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Murat Kantarcioglu</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Latifur Khan</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bhavani Thuraisingham</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>As more RDF streaming applications are being developed, there is a growing need for an efficient mechanism for storing and performing inference over these streams. In this poster, we present a tool that stores these streams in a unified model by combining memory and disk based mechanisms. We explore various memory management algorithms and disk-persistence strategies to optimize query performance. Our unified model produces an optimized query execution and inference performance for RDF streams that benefit from the advantages of using both, memory and disk.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        1 http://jena.sourceforge.net/contrib/contributions.html,http://cs.utdallas.edu/semanticweb
2 http://lucene.apache.org/java/docs/index.html
If the triple is an ABox triple we also store or update for every subject of each
incoming triple, it’s degree, a timestamp of when it was last accessed and a
pointer to the triples belonging to it, in a memory buffer. The TBox triples
are first read into memory without maintaining any statistics for them in the
buffer. This helps to distinguish TBox triples from ABox triples. Since no
statistics are maintained these TBox triples are never written to disk. When the
writeThreshold is reached the buffer management subsystem returns a sorted
buffer based on the selected memory management algorithm such as FIFO,
LIFO, LRU, MRU and RANDOM. We also adapted social network
centrality measures such as degree centrality (DC ) and clustering coefficient (CC )
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] into memory management algorithms. The writeThreshold is defined as,
writeT hreshold = initT hreshold totalM em. The equation takes initThreshold
as a number of triples and the memory size (specified in gigabytes) given to the
current run from the user. Triples from the in-memory graph are moved to the
Lucene graph using the pointer of every subject node (from the sorted buffer) and
the selected persistence strategy. This process of moving triples continues as long
as x% of the writeThreshold is not reached (x is also user configurable). Finally,
when the dbThreshold is reached we move all triples to Jena’s RDB graph. From
this point onwards all incoming triples are directly stored in the RDB graph.
We use a combination of in-memory, Lucene and RDB graphs for non-inference
models and a combination of in-memory and Lucene graphs for inference models.
For query execution, the input query is submitted to the graph that is currently
being used. A non-inference query is run on either the in-memory and Lucene
graphs or the RDB graph and a complete result is returned to the user. For an
inference query, Pellet infers additional triples by reasoning over the result from
the in-memory and Lucene graphs, using the TBox triples that are always in
memory. The resulting triples are then returned to the user.
3
      </p>
    </sec>
    <sec id="sec-2">
      <title>Experimental Results</title>
      <p>
        We performed benchmark experiments to compare the performance of the unified
model to both, the Jena database backends and a purely Lucene triple store. We
used the Sp2Bench [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] benchmark to check non-inference query execution and the
LUBM [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] benchmark to test inference. Although we have tested all queries of
both benchmarks on our system, in this section we show results only for Q5b and
Q8 from Sp2Bench and for Q4 and Q6 from LUBM as they are representative of
the overall trend. The graphs below show only query time and they do not include
loading times. We have also performed scalability tests with varying graph sizes,
but in this poster we only show graph sizes of 50168 triples for Sp2Bench and
1 university ( 103000 triples) for LUBM. We use these small sizes since we
only want to determine the best algorithm and Lucene persistence strategy in
this paper. Further, we set writeT hreshold = (3=4) no. of triples in the graph,
totalM em = 1 and x = no. of triples in mem=90. We chose these values for the
parameters so that we always have a good balance of triples between memory
and Lucene giving us a good indication of the overall performance of various
queries of both benchmarks.
      </p>
      <p>30000
25000
) 20000
s
(m15000
e
iTm10000
5000</p>
      <p>LRU+DegC
MRU+DegC
FIFO
LIFO
DegC
IndCC
Random
Lucene
RDB
SDB
20000
15000
)
s
(m10000
e
m
i
T 5000</p>
      <p>LRU
MRU
FIFO
LIFO
DegC
IndCC
Random
Lucene
RDB
SDB
0</p>
      <p>0
Q5b</p>
      <p>Q8</p>
      <p>Q4</p>
      <p>Q6
Query</p>
      <p>Query
(a) Algorithms - Sp2Bench
(b) Algorithms - LUBM
We have used the degree and timestamp values to implement the memory
management algorithms. For example, if we use LRU, we sort the buffer in the
increasing order of timestamp values while for degree centrality we sort the buffer
in increasing order of DC values. The reader should note that the DC and CC
values are recomputed for every node each time the buffer is sorted. We then
move triples to the Lucene graph for every node starting from the top of the
buffer until x% of the triples are moved. We have also combined LRU and MRU
with both DC and CC by first using the timestamp to sort the buffer and if there
is a tie we use DC or CC to break the tie. Figure 2 shows a comparison of all
memory management algorithms that we have tested for Sp2Bench and LUBM.
5000
5000</p>
      <p>C-S
C-S-Eff
Mem
Lucene
RDB
SDB
For Sp2Bench, we see that DC gives us the best result because it keeps nodes
that are relevant to the Sp2Bench queries in memory. In comparison, for LUBM,
we see that MRU performs the best. This is due to the fact that MRU leaves
the least recently used nodes in memory that are used by the Pellet reasoner for
inference and query execution.</p>
      <p>25000 25000
(a) Persistence strategies - Sp2Bench
(b) Persistence strategies - LUBM</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Dave</given-names>
            <surname>Beckett</surname>
          </string-name>
          .
          <article-title>Scalability and Storage: Survey of Free Software/Open Source RDF storage systems</article-title>
          . http://www.w3.org/2001/sw/Europe/reports/rdf_scalable_ storage_report/,
          <year>July 2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. AllegroGraph RDFStore. http://www.franz.com/agraph/allegrograph/,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Hong-Tai Chou</surname>
            and
            <given-names>David J. DeWitt.</given-names>
          </string-name>
          <article-title>An Evaluation of Buffer Management Strategies for Relational Database Systems</article-title>
          . In VLDB, pages
          <fpage>127</fpage>
          -
          <lpage>141</lpage>
          ,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>M. O.</given-names>
            <surname>Jackson</surname>
          </string-name>
          .
          <source>Social and Economic Networks</source>
          . Princeton University Press,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Michael</given-names>
            <surname>Schmidt</surname>
          </string-name>
          , Thomas Hornung, Georg Lausen, and Christoph Pinkel.
          <article-title>SP2Bench: A SPARQL Performance Benchmark</article-title>
          .
          <source>In ICDE</source>
          , pages
          <fpage>222</fpage>
          -
          <lpage>233</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Yuanbo</given-names>
            <surname>Guo</surname>
          </string-name>
          , Zhengxiang Pan, and
          <string-name>
            <given-names>Jeff</given-names>
            <surname>Heflin</surname>
          </string-name>
          .
          <article-title>LUBM: A benchmark for OWL knowledge base systems</article-title>
          .
          <source>J. Web Sem</source>
          .,
          <volume>3</volume>
          (
          <issue>2</issue>
          -3):
          <fpage>158</fpage>
          -
          <lpage>182</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>