<!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 Blank Node Matching and RDF/S Comparison Functions</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Christina Lantzaki</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yannis Tzitzikas</string-name>
          <email>tzitzik@ics.forth.gr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dimitris Zeginis⋆</string-name>
          <email>zeginis@ics.forth.gr</email>
          <email>zeginis@uom.gr</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Computer Science, FORTH-ICS, GREECE, and Computer Science Department, University of Crete</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2012</year>
      </pub-date>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Motivation</title>
      <p>
        The ability to compute the differences that exist between two RDF/S Knowledge
Bases (for short KBs) is important for aiding humans to understand the evolution
of knowledge, and for reducing the amount of data that need to be exchanged
and managed over the network in order to build SW synchronization, versioning
and replication services [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref6 ref8">2, 3, 1, 8, 6</xref>
        ].
      </p>
      <p>
        A rather peculiar but quite flexible feature of RDF is that it allows the
representation of blank nodes: a blank node (or anonymous resource or bnode) is
a node in an RDF graph which is not identified by a URI and is not a literal.
Several KBs rely heavily on blank nodes as they are convenient for representing
complex attributes (e.g. an attribute address) without having to name explicitly
the auxiliary node that connects together the values that constitute the complex
value (e.g. the particular street, number and postal code values). Bnodes
are also convenient for resources whose identity is unknown but their attributes
(either literals or associations with other resources) are known. According to [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ],
blank nodes is an inevitable reality, e.g. the data fetched from the “hi5.com”
domain consist of 87.5% of blank nodes.
      </p>
      <p>
        The inability to match bnodes increases the delta size and does not assist in
detecting the changes between subsequent versions of a KB [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
    </sec>
    <sec id="sec-2">
      <title>Approach</title>
      <p>
        Although there are several works on blank node and comparison functions (for
details see [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]), the problem has not been thoroughly studied. To the best of our
knowledge, the only work that attempts to establish a bnode mapping for
reducing the size of deltas also for the case of non equivalent KBs is [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] (ISWC’12).
Finding such a mapping can be considered as a preprocessing step, a task that
is carried out before a differential function is applied.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] we prove that finding the optimal mapping is NP-Hard in the general
case, and polynomial if there are no directly connected bnodes. Subsequently,
we present two main algorithms: (a) the AlgHung algorithm, and (b) the AlgSign
algorithm. AlgHung solves the optimization problem using the Hungarian
algorithm [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], an algorithm for solving the assignment problem. For the cases where
there are directly connected bnodes, a variation of AlgHung is used for producing
an approximate solution. The time complexity of the AlgHung in any case is in
O(n3), where n is the number of bnodes.
      </p>
      <p>
        For making the application of this method feasible also to very large KBs, at
the cost of probably bigger deltas, [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] also proposed a signature-based method,
AlgSign, whose complexity is in O(n log n). For these algorithms, the reported
experimental results over real and synthetic datasets showed significant reductions
of the sizes of the computed deltas.
      </p>
      <p>
        What will be Demonstrated
We will demonstrate a tool called BNodeDelta which supports all algorithms
presented at [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. With this tool, the user (human or other program), specifies
the two KBs to be compared (which can be stored in local files or fetched from
the network using HTTP), then specifies the bnode mapping algorithm to be
used, and then gets back statistics (about the KBs and their delta) and the
delta itself (sets of triples to be added and deleted). Furthermore the tool can
take as input a namespace mapping table (if a namespace nm1 is mapped to a
nm2 then they are considered equal at the comparison phase).
      </p>
      <p>We will demonstrate the system using two real datasets available in the LOD
cloud: the Swedish open cultural heritage dataset1, and the Italian Museums
dataset2, published from LKDI3. We shall also use synthetically generated data.</p>
      <p>Figure 1 (left) shows the command line interface which shows the basic
statistics for the Italian dataset (more statistics can be placed on demand in a file
called ”statistics”). Figure 1 (right) shows an excerpt of the file that contains
the added triples (assuming the user requested the output delta in RDF/XML
format).</p>
      <p>We will give emphasis on the bnode mapping algorithms, specifically we will
show the size of the outcome of the differential function ∆e (where ∆e(K !
K′) = fAdd(t) j t 2 K′ Kg [ fDel(t) j t 2 K K′g) for the cases: AlgHung,
AlgSign, a random bnode mapping algorithm, and no bnode mapping at all.
Time Efficiency (comparative results). In both algorithms (AlgHung and
AlgSign) the required time depends on the number of bnodes of the two KBs and
the average number of triples to which a bnode participates. AlgHung needs 5.4
seconds over datasets of average 3, 650 triples and 525 bnodes, and 9.6 minutes
for datasets of average 49, 900 triples and 6, 390 bnodes, whereas AlgSign needs
only 0.34 seconds and 0.92 seconds respectively. These results show that AlgSign
1 http://thedatahub.org/dataset/swedish-open-cultural-heritage used from
http://kringla.nu/kringla/ for providing information on cultural data of Sweden
2 http://thedatahub.org/dataset/museums-in-italy
3 http://www.linkedopendata.it/</p>
      <p>Demonstrating Blank Node Matching and RDF/S Comparison Functions
can be efficient also in bigger datasets (we will also show that two KBs with
153,600 bnodes can be compared at less than 11 seconds).
Delta Sizes (comparative results). As regards delta size, in the first dataset
without bnode mapping the delta contains 5, 771 triples, whereas with AlgHung
it contains 311 triples, and with AlgSign 419 triples.</p>
      <p>In the second dataset without bnode mapping the delta contains 43, 770
triples, whereas with AlgHung it contains 6 triples, and same for AlgSign.
Delta Visualization. Apart from the benefits in a versioning/synchronization
scenario, the achieved delta size reduction makes the visualization and
exploration of the delta much easier. For this reason, BNodeDelta offers several choices
for formatting the output delta in order to aid further processing or
visualization. One option returns the delta in two separate files, one containing the deleted
triples, the other the added triples, both in RDF/XML format. Each of these
files can be explored and visualized with various RDF/S visualization tools.</p>
      <p>For instance, we loaded to RDF-Gravity4 the RDF/XML file that contains
the added triples of the delta over the synthetic dataset. Figure 2 shows the
derived visualization
Note that if the delta size is small, both added and deleted triples can be
visualized as a single graph. In such cases, BNodeDelta also returns a graph
visualization. For example, Figure 3 shows the graph of delta over the Italian datasets
where the added elements are in green while the deleted are in red.</p>
      <p>The above examples, just show that bnode mapping can reduce the delta to
sizes appropriate for graph-based visualization (something not possible without
bnode mapping).</p>
      <p>Software and datasets are available to download and use from
http://www.ics.forth.gr/isl/BNodeDelta.
4 http://semweb.salzburgresearch.at/apps/rdf-gravity</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>T.</given-names>
            <surname>Berners-Lee</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Connoly</surname>
          </string-name>
          . ”
          <article-title>Delta: An Ontology for the Distribution of Differences Between RDF Graphs”</article-title>
          ,
          <year>2004</year>
          . http://www.w3.org/DesignIssues/Diff.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>J.</given-names>
            <surname>Heflin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hendler</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Luke</surname>
          </string-name>
          . “
          <article-title>Coping with Changing Ontologies in a Distributed Environment”</article-title>
          .
          <source>In AAAI-99 Workshop on Ontology Management</source>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>M.</given-names>
            <surname>Klein</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Fensel</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kiryakov</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Ognyanov</surname>
          </string-name>
          . “
          <article-title>Ontology versioning and change detection on the web”</article-title>
          .
          <source>In Procs of EKAW'02</source>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>A.</given-names>
            <surname>Mallea</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hogan</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Polleres</surname>
          </string-name>
          .
          <article-title>On blank nodes</article-title>
          .
          <source>In Procs of the 10th Intern. Semantic Web Conference (ISWC</source>
          <year>2011</year>
          ). Springer,
          <year>October 2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>J.</given-names>
            <surname>Munkres</surname>
          </string-name>
          .
          <article-title>Algorithms for the assignment and transportation problems</article-title>
          .
          <source>J-SIAM</source>
          ,
          <volume>5</volume>
          (
          <issue>1</issue>
          ),
          <year>1957</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>B.</given-names>
            <surname>Schandl</surname>
          </string-name>
          .
          <article-title>Replication and versioning of partial rdf graphs</article-title>
          .
          <source>ESWC'10</source>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tzitzikas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Lantzaki</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Zeginis</surname>
          </string-name>
          . ”
          <article-title>Blank Node Matching and RDF/S Comparison Functions”</article-title>
          .
          <source>ISWC'12</source>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>D.</given-names>
            <surname>Zeginis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Tzitzikas</surname>
          </string-name>
          , and
          <string-name>
            <given-names>V.</given-names>
            <surname>Christophides</surname>
          </string-name>
          . “
          <article-title>On the Foundations of Computing Deltas Between RDF Models”</article-title>
          .
          <source>In Procs of ISWC-07</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>