<!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>Demonstrating the Power of Streaming and Sorting for Non-distributed RDF Processing: RDFpro</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Francesco Corcoglioniti</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessio Palmero Aprosio</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Rospocher</string-name>
          <email>rospocherg@fbk.eu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Fondazione Bruno Kessler - IRST</institution>
          ,
          <addr-line>Via Sommarive 18, Trento, I-38123</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We demonstrate RDFpro (RDF Processor), an extensible, generalpurpose, open source tool for processing large RDF datasets on a commodity machine leveraging streaming and sorting techniques. RDFpro provides out-of-thebox implementations - called processors - of common tasks such as data filtering, rule-based inference, smushing, and statistics extraction, as well as easy ways to add new processors and arbitrarily compose processors in complex pipelines.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        1 Introduction
Processing of RDF data – e.g., Linked Open Data (LOD) – often requires performing
a number of common processing tasks such as triple-level filtering and/or
transformation, inference materialization, owl:sameAs smushing (i.e., replacing URI aliases with
a “canonical” URI), and statistics extraction. Although tools do exist for these tasks,
a Semantic Web practitioner typically faces two challenges. First, tool support is
fragmented, often forcing a user to integrate many heterogeneous tools even for simple
processing workflows. Second, tools coping with LOD dataset sizes in the range of
millions to billions of triples often require distributed infrastructures such as Hadoop
(e.g., WebPIE [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] for forward-chaining inference, voidGen [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for VoID statistics
extraction), which are complex to set up for the user and cannot be used efficiently – if
not at all – on a single machine due to their inherent complexity and overhead.
      </p>
      <p>
        Given these premises we demonstrate RDFpro (RDF Processor) [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ], a tool and Java
library addressing these shortcomings. On the one hand, RDFpro reduces integration
efforts by providing out-of-the-box implementations – called processors – of common
RDF processing tasks, as well as easy ways to add new processors and compose
processors in complex processing pipelines. On the other hand, RDFpro targets local
processing of large datasets without requiring clusters and complex computing infrastructures.
Vertical scalability is achieved with multi-threading and a processing model based on
streaming and sorting, two scalable techniques well-known in the literature [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
Streaming consists in processing one triple at a time, translates to efficient sequential I/O, and
is at the basis of tools such as LODStats [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] for scalable approximate statistics extraction
and Jena RIOT1 for partial RDFS inference. Sorting overcomes many of the limitations
of a pure streaming model, supporting tasks such as duplicate removal, set operations,
and grouping of data that must be processed together (e.g., all the data about an entity).
We describe RDFpro in Section 2 and discuss its use and demonstration in Section 3.
(c)
f
side
      </p>
      <p>RDF ... LOD effects</p>
      <p>(a)
resulting pipeline processor
...</p>
      <p>
        (b)
RDF Processor A processor @P (Figure 1a) is a software component that consumes
RDF quads from an input stream in one or more passes, produces an output stream of
quads, and may have an internal state as well as side effects like writing RDF data.
An RDF quad is a triple with an optional fourth named graph component, which is
unspecified for plain triples and triples in the default graph of the RDF dataset. Streaming
characterizes the way quads are processed: one at a time, with no possibility for the
processor to “go back” in the input stream and recover previously seen quads. Sorting
is offered to processors as a primitive to arbitrarily sort selected data during a pass. This
primitive is realized on top of the native sort Unix utility that support external sorting,
using dictionary encoding techniques to compactly encode frequently used RDF terms
(e.g., TBox ones) in order to reduce the size of sorted data and improve performances.
Sequential and Parallel Composition Composition can be applied recursively to build
pipeline processors starting from a fixed set of basic processors. In a sequential
composition (Figure 1b), two or more processors @Pi are chained so that the output stream
of @Pi becomes the input stream of @Pi+1. In a parallel composition (Figure 1c), the
input stream is sent concurrently to several processors @Pi, whose output streams are
merged into a resulting stream using one of several possible set operators, such as union
with/without duplicates. Composition supports complex processing tasks that cannot be
tackled with a single processor. Moreover, executing a pipeline processor is often faster
than executing the processors it is composed of separately (if separate execution is
possible), as input data is parsed once and I/O costs for intermediate files are eliminated.
Builtin Processors The basic processors included in RDFpro are listed below:
@read Reads RDF file(s), emitting their quads together with the input stream. Files
are read in parallel and, where possible, split in chunks that are parsed concurrently.
@write Writes quads to one RDF file or splits them to multiple files evenly; quads are
also propagated in output. Parallel, chunk-based writing is supported as for @read.
@download Emits data downloaded from a SPARQL endpoint using a query.
@upload Uploads input data to an RDF store using SPARQL INSERT DATA calls.
@tbox Filters the input stream by emitting only quads belonging to TBox axioms.
2 http://rdf4j.org/
@transform Discards or rewrites input quads one at a time, either based on simple
matching criteria or based on an arbitrarily complex JavaScript or Groovy3 script.
@smush Performs smushing, replacing the members of each owl:sameAs
equivalence class with a canonical URI selected based on a ranked namespace list.
@rdfs Computes the RDFS deductive closure of an input stream consisting only of
ABox quads. A fast, hard-coded implementation loads the TBox from a file and
computes its closure first, using the resulting domain, range, sub-class, and
subproperty axioms to perform inference on quads of the input stream one at a time.
@rules Emits the closure of input quads using a customizable set of rules. Rules
heads and bodies are SPARQL graph patterns, with FILTER, BIND, and UNION
constructs allowed in the body. The current implementation is based on Drools.4
@mapreduce Applies a custom map script (JavaScript or Groovy) to label and group
input quads into partitions, each one reduced with a reduce script. A multi-threaded,
non-distributed MapReduce implementation based on the sort primitive is used.
@stats Computes VoID [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] structural statistics for its input, plus additional metadata
and informative labels for TBox terms that can be shown in tools such as Prote´ge´.
@unique Discards duplicate quads in the input stream.
3
      </p>
      <p>Using RDFpro
RDFpro binaries and public domain sources are available on its website.5 RDFpro can be
used in three ways: (i) as a command line tool able to process large datasets; (ii) as a
web tool suited to smaller amounts of data uploaded/downloaded with the browser; and
(iii) as a Java library6 embedded in applications. Users can extend RDFpro via custom
scripts and rulesets, while developers can create new processors by implementing a
simple Java API and focusing on the specific task at hand, as efficient streaming, sorting,
I/O, thread management, scripting, and composition facilities are already provided.</p>
      <p>
        Examples of using RDFpro as a command line and web tool are shown in Figures 2a
and 2b, where a pipeline is executed to compute the RDFS closure of some DBpedia
data (70M triples) and return only rdfs:label triples of entities of type dbo:Company.
The pipeline performs 6 tasks: (i) read data; (ii) compute RDFS closure using DBpedia
TBox; (iii) keep rdf:type and rdfs:label quads; (iv) partition quads by subject, keeping
partitions with object dbo:Company; (v) retain rdfs:label quads; (vi) write results.
Examples of applications using RDFpro as an embedded Java library for RDF I/O, filtering,
smushing, RDFS and rule-based inference are the KnowledgeStore [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] and PIKES [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
(code publicly available); instructions for using the library are provided on the website.
      </p>
      <p>
        A video showing the usage of RDFpro is available on the website, together with a
fully-working installation of the RDFpro web interface, where users can try arbitrary
commands and processing tasks. The demo will mainly focus on using this web
interface on suitable examples, to demonstrate the usability of RDFpro in tasks such as the
ones considered in [
        <xref ref-type="bibr" rid="ref3 ref4">3,4</xref>
        ]. Use of RDFpro as a command line tool on large datasets or as
a library in a sample application will also be demonstrated to interested attendees.
3 Groovy is a scripting language based on Java and its libraries. See http://groovy.codehaus.org/
4 Drools is a rule engine implementing the RETE algorithm. See http://www.drools.org/
5 http://rdfpro.fbk.eu/
6 Available on Maven Central: http://repo1.maven.org/maven2/eu/fbk/rdfpro/.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Urbani</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kotoulas</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maassen</surname>
          </string-name>
          , J.,
          <string-name>
            <surname>Van Harmelen</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bal</surname>
          </string-name>
          , H.:
          <article-title>WebPIE: A web-scale parallel inference engine using MapReduce</article-title>
          .
          <source>J. Web Semant</source>
          <volume>10</volume>
          (
          <year>2012</year>
          )
          <fpage>59</fpage>
          -
          <lpage>75</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. Bo¨hm,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Lorey</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Naumann</surname>
          </string-name>
          ,
          <string-name>
            <surname>F.</surname>
          </string-name>
          :
          <article-title>Creating VoID descriptions for web-scale data</article-title>
          .
          <source>J. Web Semant</source>
          .
          <volume>9</volume>
          (
          <issue>3</issue>
          ) (
          <year>September 2011</year>
          )
          <fpage>339</fpage>
          -
          <lpage>345</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Corcoglioniti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rospocher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Amadori</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mostarda</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>RDFpro: an extensible tool for building stream-oriented RDF processing pipelines</article-title>
          .
          <source>In: Proc of ISWC Developers Workshop 2014</source>
          . Volume 1268 of CEUR Workshop Proceedings., CEUR-WS.org (
          <year>2014</year>
          )
          <fpage>49</fpage>
          -
          <lpage>54</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Corcoglioniti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rospocher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mostarda</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Amadori</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Processing billions of RDF triples on a single machine using streaming and sorting</article-title>
          .
          <source>In: ACM SAC</source>
          . (
          <year>2015</year>
          )
          <fpage>368</fpage>
          -
          <lpage>375</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>O</given-names>
            <surname>'Connell</surname>
          </string-name>
          ,
          <string-name>
            <surname>T.</surname>
          </string-name>
          :
          <article-title>A survey of graph algorithms under extended streaming models of computation</article-title>
          . In: Fundamental Problems in Computing. Springer Netherlands (
          <year>2009</year>
          )
          <fpage>455</fpage>
          -
          <lpage>476</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Auer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Demter</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martin</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehmann</surname>
          </string-name>
          , J.:
          <article-title>LODStats - an extensible framework for highperformance dataset analytics</article-title>
          .
          <source>In: EKAW</source>
          . (
          <year>2012</year>
          )
          <fpage>353</fpage>
          -
          <lpage>362</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Cyganiak</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhao</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hausenblas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alexander</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Describing linked datasets with the VoID vocabulary</article-title>
          .
          <source>W3C note</source>
          ,
          <issue>W3C</issue>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Corcoglioniti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rospocher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cattoni</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Magnini</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Serafini</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>The KnowledgeStore: a Storage Framework for Interlinking Unstructured</article-title>
          and
          <string-name>
            <given-names>Structured</given-names>
            <surname>Knowledge</surname>
          </string-name>
          .
          <source>Int. J. Semantic Web Inf. Syst</source>
          . (to appear)
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Corcoglioniti</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rospocher</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Palmero</given-names>
            <surname>Aprosio</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>Extracting Knowledge from Text with PIKES</article-title>
          .
          <source>In: ISWC 2015 Posters &amp; Demonstrations Track</source>
          . (to appear)
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>