<!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>Parallel sort-merge-join reasoning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Julien Subercaze</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Christophe Gravier</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Laboratoire Hubert Curien, UMR CNRS 5516 Universite Jean</institution>
          <addr-line>Monnet 25 rue docteur Remy Annino F-42000, Saint-Etienne</addr-line>
          ,
          <country country="FR">France</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present an in-memory, cross-platform, parallel reasoner for RDFS and RDFSPlus . Inferray uses carefully optimized hash-based join and sorting algorithms to perform parallel materialization. Designed to take advantage of the architecture of modern CPUs, Inferray exhibits a very good uses of cache and memory bandwidth. It o ers state-of-theart performance on RDFS materialization, outperforms its counterparts on RDFSPlus and can be connected with Jena. Reasons to see the poster: i) Presentation of the system, how to use it; ii) Discussion about implementation, source code walkthrough.</p>
      </abstract>
      <kwd-group>
        <kwd>in-memory reasoner</kwd>
        <kwd>RDFSPlus</kwd>
        <kwd>Jena</kwd>
        <kwd>performance</kwd>
        <kwd>opensource</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        Research in reasoner design and implementation roots to the advent of the
Semantic Web technologies [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and the list of related systems and publications is
too long to t here. We hereby focus on recent comparable systems and refer the
reader to the recent survey of Kaoudi [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ].
      </p>
      <p>
        Forward-chaining reasoning can be performed either by iterative rules
application, as done in Inferray, or by using the RETE algorithm [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The RETE
algorithm, used by Jena and GraphDB(formely known as OWLIM for the
reasoner module), due to its graph-based data structures, incurs lots of random
memory access, thus hindering global performance [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. The iterative rules
application does not specify particular underlying datastructures, leaving room for
various designs. RDFox [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] uses an almost lock-free data structure to e ciently
parallelize hash-based joins and reports a good parallelization results. OWLIM
reasoners family uses a custom rule entailment process with a xed-point
inference mechanism.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>System description</title>
      <sec id="sec-3-1">
        <title>Transitivity</title>
      </sec>
      <sec id="sec-3-2">
        <title>Closure</title>
      </sec>
      <sec id="sec-3-3">
        <title>Vertical</title>
      </sec>
      <sec id="sec-3-4">
        <title>Partitioning</title>
      </sec>
      <sec id="sec-3-5">
        <title>Parallel</title>
      </sec>
      <sec id="sec-3-6">
        <title>Sortmerge-joins</title>
      </sec>
      <sec id="sec-3-7">
        <title>Post</title>
      </sec>
      <sec id="sec-3-8">
        <title>Processing</title>
        <p>RDF file</p>
        <p>Import</p>
        <p>
          Inferray imports data either from les on the hard drive or to interact with
the widely used Jena. After importation, the inference process is separated into
di erent steps, depicted in Figure 1, the highlights are presented as follows:
Transitivy Closure To perform e cient transitivity closure, Inferray performs
this task prior to the iterative rules application. This innovative approach,
relies on a temporary data layout (before vertical partitioning) that allows
the use of the state-of-the-art algorithm from Nuutila[
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] to perform the
transitivity closure. When the ontology contains a su cient number of
transitivity relations, the use of the temporary data layout and the data translation
cost to the vertical partitioning layout are compensated by the e ciency of
Nuutila's algorithm.
        </p>
        <p>
          Dictionary Encoding &amp; Vertical Partitioning Inferray uses a tricky
dictionary encoding to compact the range of the IDs, while allowing an e cient
data layout. Instead of starting numeration at 0 and increasing the value
with incoming RDF resources, Inferray uses a dense numbering scheme that
allows both vertical partitioning and the use of e cient sorting algorithms.
The s p o triples are then splitted to be vertical partioned, using the
standard partition on the predicate p [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], that o ers a best selectivity for rules
application. Triples are stored in arrays, whose indexes correspond to p, as
continuous pairs of o s. Each array is sorted by s and possibly by o to
e ciently perform sort-merge-joins.
        </p>
        <p>Sorting algorithms E ciently sorting is the cornerstone of high-performance
sort-merge-join algorithms. Based on the dense numbering scheme, Inferray
uses an adaptative sorting approach including a new counting sort algorithm
for sorting pairs of integers. When outside the application domain of the
counting sort, a custom MSD-Radix algorithm for sorting pairs kicks in.
Our sorting experiments report througputs from 20 to 70 millions pairs per
second, results that are at least on par with state-of-the-art algorithms.
Parallel sort-merge-joins Using array based layout, sort-merge-joins are
performed e ciently due to a maximization of memory cache usage. In the rst
step, joins are perform on parallel, on a per-rule basis. Results of the joins
is the materialisation of inferred triples, that may contains duplicates
already present in the main triple store. The inferred triples are sorted and
then merged in linear time into the main store, again in parallel manner.
This e cient handling of duplicates largely contribute to the e ciency of
Inferray.</p>
        <p>Post processing The post-processing step handles corner cases such as rules
having only one condition, this is for instance common in RDFS reasoning.
100000
10000
1000
100
10
1</p>
        <p>Inferray OWLIM RDFox
LUBM 1M LUBM 5M LUBM 10M LUBM 25M LUBM 50M LUBM 75M LUBM 100M Wikipedia Yago Taxo Wordnet</p>
        <p>Fig. 2. RDFSPlus Inference time in milliseconds, log scale.</p>
        <p>
          Performance
Experiments were conducted on a Intel Xeon E3 1246v3 processor with 8MB of
L3 cache. Our system is equipped with 32GB of main memory; a 256Go PCI
Express SSD. The system runs a 64-bit Linux 3.13.0 kernel with Oracle's JDK
7u67. We compared Inferray against RDFox and OWLIM-SE. To perform our
experiments, we developed a dedicated benchmark suite [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] called USE-RB, that
allows to report various performance metrics (cache pressure, memory usage) in
addition to standard execution time. We report in Figure 2 the results obtained
on RDFSPlus inference on various datasets: di erent size of the LUBM dataset
as well as real-world ontologies. The results highlight the excellent performance
of Inferray on RDFSPlus on both types of dataset.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>In this paper, we presented Inferray, a high-performance reasoner based on
parallel sort-merge-join. We believe that the presented system is of the utmost
practical interest for the community. Its performance enable large scale processing of
ontologies and its compatibility with the widely used Jena ensures its adoption
by the end users.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>D. J.</given-names>
            <surname>Abadi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Marcus</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. R.</given-names>
            <surname>Madden</surname>
          </string-name>
          , and
          <string-name>
            <given-names>K.</given-names>
            <surname>Hollenbach</surname>
          </string-name>
          .
          <article-title>Scalable semantic web data management using vertical partitioning</article-title>
          .
          <source>In PVLDB</source>
          , pages
          <volume>411</volume>
          {
          <fpage>422</fpage>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>D.</given-names>
            <surname>Allemang</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Hendler</surname>
          </string-name>
          .
          <article-title>Semantic Web for the working ontologist: e ective modeling in RDFS and OWL</article-title>
          . Elsevier,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>J. J.</given-names>
            <surname>Carroll</surname>
          </string-name>
          , I. Dickinson,
          <string-name>
            <given-names>C.</given-names>
            <surname>Dollin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Reynolds</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Seaborne</surname>
          </string-name>
          , and
          <string-name>
            <given-names>K.</given-names>
            <surname>Wilkinson</surname>
          </string-name>
          .
          <article-title>Jena: implementing the semantic web recommendations</article-title>
          .
          <source>In WWW</source>
          , pages
          <volume>74</volume>
          {
          <fpage>83</fpage>
          . ACM,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>O.</given-names>
            <surname>Erling</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Mikhailov. RDF</surname>
          </string-name>
          <article-title>Support in the Virtuoso DBMS</article-title>
          .
          <source>In Networked Knowledge-Networked Media</source>
          , pages
          <fpage>7</fpage>
          <lpage>{</lpage>
          24. Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>C. L.</given-names>
            <surname>Forgy</surname>
          </string-name>
          .
          <article-title>Rete: A fast algorithm for the many pattern/many object pattern match problem</article-title>
          .
          <source>Arti cial intelligence</source>
          , pages
          <volume>17</volume>
          {
          <fpage>37</fpage>
          ,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Gravier</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Subercaze</surname>
          </string-name>
          .
          <article-title>USE-RB: benchmarking how reasoners work in harmony with modern hardware. In submitted to ISWC 2016 poster &amp; demo track</article-title>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Z.</given-names>
            <surname>Kaoudi</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Manolescu.</surname>
          </string-name>
          <article-title>RDF in the clouds: a survey</article-title>
          .
          <source>VLDB J</source>
          .,
          <volume>24</volume>
          (
          <issue>1</issue>
          ):
          <volume>67</volume>
          {
          <fpage>91</fpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>B.</given-names>
            <surname>Motik</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Nenov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Piro</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Horrocks</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Olteanu</surname>
          </string-name>
          .
          <article-title>Parallel materialisation of datalog programs in centralised, main-memory RDF systems</article-title>
          .
          <source>In Proc. AAAI</source>
          , pages
          <volume>129</volume>
          {
          <fpage>137</fpage>
          ,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>E.</given-names>
            <surname>Nuutila</surname>
          </string-name>
          .
          <article-title>E cient transitive closure computation in large digraphs</article-title>
          .
          <source>PhD thesis</source>
          , Helsinki University,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>J. Subercaze</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Gravier</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Chevalier</surname>
            , and
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Laforest</surname>
          </string-name>
          .
          <article-title>Inferray: fast in-memory RDF inference</article-title>
          .
          <source>PVLDB</source>
          ,
          <volume>9</volume>
          (
          <issue>6</issue>
          ):
          <volume>468</volume>
          {
          <fpage>479</fpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>J. Urbani</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Van Harmelen</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Schlobach</surname>
            , and
            <given-names>H.</given-names>
          </string-name>
          <string-name>
            <surname>Bal</surname>
          </string-name>
          . QueryPIE:
          <article-title>Backward reasoning for OWL Horst over very large knowledge bases</article-title>
          .
          <source>The Semantic Web{ ISWC</source>
          <year>2011</year>
          , pages
          <fpage>730</fpage>
          {
          <fpage>745</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>