<!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>Diamond Debugger Demo: Rete-Based Processing of Linked Data</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Daniel P. Miranker</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Rodolfo K. Depena</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hyunjoon Jung</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Juan F. Sequeda</string-name>
          <email>jsequedag@cs.utexas.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlos Reyna</string-name>
          <email>creynam89g@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science University of Texas at Austin</institution>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Diamond is a Rete match based system that evaluates SPARQL queries on Linked Data. The evaluation of SPARQL query predicates is a useful intermediate milestone for a system ultimately intended to support full rule-based inference on Linked Data. A byproduct is the integrated graphical rule debugging environment is a rst of its kind debug environment for SPARQL queries.</p>
      </abstract>
      <kwd-group>
        <kwd>Rete</kwd>
        <kwd>SPARQL</kwd>
        <kwd>Linked Data</kwd>
        <kwd>Semantic Web</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Background</title>
      <p>
        The Linked Data model is an emerging component of the Semantic Web. The
base layer of the Semantic Web is a representation of a directed labeled graph,
expressed using resource description framework (RDF). Each edge of such a
graph is commonly known as a triple. A triple is composed of a subject, a
predicate and an object. The predicate is the edge label. The subject and object are
vertex labels. Each constituent may be a URI. The intention is that labels form
global unique ids and overlay DNS services to identify a particular server that
may provide additional details (semantics) for the URI in the form of additional
triples. The object of a triple may contain a literal. Thus, an RDF graph can
represent complex data, spanning an arbitrary set of Internet servers [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Formal semantics for the Linked Data model are still emerging [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. The
base principles mimic the behavior of hyperlinks in html documents [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. That is,
like a URL, dereferencing a URI instigates a response from a particular server.
However, in lieu of an HTML document that may contain both text and an
embedded set of URL-based hyperlinks, the server simply returns a set of triples.
      </p>
      <p>One can expect that Linked Data crawlers will be intelligent. To date, all
Linked Data speci cations and most related work is limited to RDF. There is no
explicit connection to the schema, ontology and rule layers, (RDFS, OWL, RIF),
of the Semantic Web technology stack. Thus, in Linked Data, any semantic
entailment will necessarily be implemented by inference processes associated with
the processes that initiate and control the Linked Data crawlers. For example,
SPARQL 1.1 allows triples to be updated. SPARQL 1.1 also inlucdes entailment
rules that de ne closure over subclass hierarchies. Unless a system admits to
limiting query and inferance to a potentialy inconsistent cache, it is necessarily
the case that inferance entail freshly collected data.</p>
      <p>Architecturally, the intrinsic, incremental behavior of the Rete Match aligns
well with the web crawling aspects of the Linked Data model. This is true if one
is evaluating rule predicates, or just a single predicate. When a Linked Data URI
is dereferenced it returns a set of triples. The values of the triples may include
additional URIs that have not yet been dereferenced. This operational behavior
is identical to the algorithmic behavior of the Rete match per its original context,
the incremental evaluation of changes to working memory in forward-chaining
rule systems. Since an RDF graph is arbitrarily large and dynamic, even if an
implementation references a local cache of prefetched triples, one can anticipate
that any formal semantics will have to be consistent with an evaluation method
that, operationally, crawls the web of Linked Data and reports results prior to
reaching all reachable vertices. I.e. crawling can paused at any time, and the
system evaluated.</p>
      <p>
        Motivated, in part, by the anticipation intelligent Linked Data agents, we
have rst built a SPARQL query engine based on the Rete match and
architected the integration of a Rete-based system with link-crawling and caching
components [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. In Diamond, there is a Rete network object. Each rule predicate
is compiled as an instance of the Rete network object1.
      </p>
      <p>Serendipitously our implementation of a graphical rule debugger is also a
SPARQL query debugger. Those already familiar with graphical debugging
environments for Rete-based inference engines will already be familiar with the
operation and concomitant rendering of the Rete network and its content. This
is not the case for most developers in the SPARQL community.</p>
      <p>
        We anticipate the development of a SPARQL query debugger will, further,
be welcomed by that community as SPARQL queries can be expansive, even
larger than comparable SQL queries. To support this claim, a query from the
Berlin SPARQL Benchmark Suite is reproduced in Figure 1. This benchmark
is distinguished as it provides semantically equivalent queries in SQL, as shown
in Figure 2. The de nition of a set of Rete operators for SPARQL follows from
long standing connections made between relational algebra and rule predicates,
and results that prove an expressive equivalence between SPARQL, DatalogNeg
without recursion and relational algebra. [
        <xref ref-type="bibr" rid="ref1 ref7">1, 7</xref>
        ]
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>The System</title>
      <p>
        The Diamond architecture is illustrated in Figure 3. The Rete network is created,
dynamically, from a runtime library of Rete netword object de nitions [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The
URI dereferancing object is static. A critical design component is the pair of
1 Optimizations based on sharing Rete network subtrees is anticipated by more
sophisticated compilation techniques and providing for the composition of Rete network
object instances.
PREFIX bsbm-inst: &lt;http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/instances/&gt;
PREFIX bsbm: &lt;http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema&gt;
PREFIX dc: &lt;http://purl.org/dc/elements/1.1/&gt;
SELECT ?label ?comment ?producer ?productFeature
?propertyTextual1 ?propertyTextual2 ?propertyTextual3
?propertyNumeric1 ?propertyNumeric2
?propertyTextual4 ?propertyTextual5 ?propertyNumeric4
WHERE
bsbm-inst:ProductXYZ rdfs:label ?label .
bsbm-inst:ProductXYZ rdfs:comment ?comment .
bsbm-inst:ProductXYZ bsbm:producer ?p .
?p rdfs:label ?producer .
bsbm-inst:ProductXYZ dc:publisher ?p .
bsbm-inst:ProductXYZ bsbm:productFeature ?f .
?f rdfs:label ?productFeature .
bsbm-inst:ProductXYZ bsbm:productPropertyTextual1 ?propertyTextual1 .
bsbm-inst:ProductXYZ bsbm:productPropertyTextual2 ?propertyTextual2 .
bsbm-inst:ProductXYZ bsbm:productPropertyTextual3 ?propertyTextual3 .
bsbm-inst:ProductXYZ bsbm:productPropertyNumeric1 ?propertyNumeric1 .
bsbm-inst:ProductXYZ bsbm:productPropertyNumeric2 ?propertyNumeric2 .
OPTIONAL bsbm-inst:ProductXYZ bsbm:productPropertyTextual4
?propertyTextual4
OPTIONAL bsbm-inst:ProductXYZ bsbm:productPropertyTextual5
?propertyTextual5
OPTIONAL bsbm-inst:ProductXYZ bsbm:productPropertyNumeric4
?propertyNumeric4
SELECT pt.label, pt.comment, pt.producer, productFeature, propertyTex1,
propertyTex2, propertyTex3, propertyNum1, propertyNum2,
propertyTex4, propertyTex5, propertyNum4
FROM product pt, producer pr, productfeatureproduct pfp
WHERE pt.nr=XYZ AND pt.nr=pfp.product AND pt.producer=pr.nr
queues. The queues are intended to enable parallel, asynchronous execution of
query evaluation and URI dereferencing. The queues are actively managed to
avoid redundant dereferencing of URIs or redundant processing of triples by the
Rete network. The queue manager is implemented by accumulating triple in an
embedded copy of the Sesame 2 triplestore.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Demonstration</title>
      <p>For demo purposes we use the benchmark query illustrated in Figure 1. For
pedagogical purposes the screen shots are created by choosing an illustrative subset of
5 triple patterns. Video can be found at http://ribs.csres.utexas.edu/diamond/.
Figure 4 is a screen shot of the debugger when there are triples that satisfy 4 of
the 5 triple patterns. No triples that satisfy the third triple pattern.</p>
      <p>Given the potential for a large number of both triples (data) and triple
patterns (SPARQL clauses) the Rete network is rendered seperately from the data
and the contents of the memory nodes. The contents of a memory node is viewed
by clicking on the node in the Rete network, which opens a new window. Users
may open, resize and move such windows anywhere on the screen. To save space,
the gure shows three memory node windows overlayed on the window of the
Rete network. We show, contents of one alpha-memory, that there is a
repre2 http://www.openrdfo_ rg/
sentation of a successful join in the rst beta-memory. The remainder of the
network is empty.</p>
      <p>Upon a the arrival of a triple that satis es the third triple pattern the query
becomes satis ed. Figure 5 shows the subsequent state of the Rete network. Each
of the beta memories now has content.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Discussion</title>
      <p>
        Although Diamond currently treats a SPARQL query as the predicate of a single
rule, the system is easily extended to process a set of forward-chaining rules.
The overlap of operator level equivalence between SPARQL query predicate
evaluation and rule system evaluation is well established in the literature [
        <xref ref-type="bibr" rid="ref1 ref2 ref8 ref9">1, 2,
8, 9</xref>
        ]. The extensibility of the implementation is a byproduct of object-oriented
design principles. Although we have no immediate plans per the investigation
of parallel evaluation of rule systems, we note that the coordination of Rete
network evaluation with the Linked Data crawlers is by means of asynchronous
queues. Thus, the mechanisms for asynchronous concurrent rule evaluation are
in place as well.
      </p>
      <p>Acknowledgments. This research is supported by an NSF grant IIS-1018554.
Juan F. Sequeda was supported by an NSF Graduate Research Fellowship.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Renzo</given-names>
            <surname>Angles</surname>
          </string-name>
          and Claudio Gutierrez, `
          <article-title>The expressive power of sparql'</article-title>
          , in International Semantic Web Conference, pp.
          <volume>114</volume>
          {
          <fpage>129</fpage>
          , (
          <year>2008</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Francois</given-names>
            <surname>Bry</surname>
          </string-name>
          , Tim Furche, Bruno Marnette, Clemens Ley, Benedikt Linse, and Olga Poppe, `Sparqlog:
          <article-title>Sparql with rules and quanti cation'</article-title>
          ,
          <source>in Semantic Web Information Management</source>
          ,
          <volume>341</volume>
          {
          <fpage>370</fpage>
          , (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Charles</given-names>
            <surname>Forgy</surname>
          </string-name>
          , `
          <article-title>Rete: A fast algorithm for the many patterns/many objects match problem', Artif</article-title>
          . Intell.,
          <volume>19</volume>
          (
          <issue>1</issue>
          ),
          <volume>17</volume>
          {
          <fpage>37</fpage>
          , (
          <year>1982</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Olaf</given-names>
            <surname>Hartig</surname>
          </string-name>
          , `
          <article-title>Sparql for a web of linked data: Semantics and computability'</article-title>
          ,
          <string-name>
            <surname>in</surname>
            <given-names>ESWC</given-names>
          </string-name>
          , pp.
          <volume>8</volume>
          {
          <fpage>23</fpage>
          , (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Olaf</given-names>
            <surname>Hartig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Christian</given-names>
            <surname>Bizer</surname>
          </string-name>
          , and Johann Christoph Freytag, `
          <article-title>Executing sparql queries over the web of linked data'</article-title>
          ,
          <source>in Proceedings of the 8th International Semantic Web Conference</source>
          , pp.
          <volume>293</volume>
          {
          <fpage>309</fpage>
          , (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Tom</given-names>
            <surname>Heath</surname>
          </string-name>
          and
          <string-name>
            <given-names>Christian</given-names>
            <surname>Bizer</surname>
          </string-name>
          ,
          <article-title>Linked Data: Evolving the Web into a Global Data Space, Synthesis Lectures on the Semantic Web</article-title>
          , Morgan &amp; Claypool Pub.,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Daniel P. Miranker,
          <string-name>
            <surname>Rodolfo K. Depena</surname>
            , Hyunjoon Jung,
            <given-names>Juan F.</given-names>
          </string-name>
          <string-name>
            <surname>Sequeda</surname>
          </string-name>
          , and Carlos Reyna, `
          <article-title>Diamond: A sparql query engine, for linked data based on the rete match'</article-title>
          ,
          <source>in Proc. of the Arti cial Intelligence meets the Web of Data Workshop at ECAI12</source>
          , (
          <year>2012</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Axel</given-names>
            <surname>Polleres</surname>
          </string-name>
          , `
          <article-title>From sparql to rules (and back)'</article-title>
          ,
          <source>in Proc. of the 16th int. conf. on World Wide Web, WWW '07</source>
          , pp.
          <volume>787</volume>
          {
          <issue>796</issue>
          , New York, NY, (
          <year>2007</year>
          ). ACM.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>Simon</given-names>
            <surname>Schenk</surname>
          </string-name>
          and
          <article-title>Ste en Staab, `Networked graphs: a declarative mechanism for sparql rules, sparql views and rdf data integration on the web'</article-title>
          ,
          <source>in Proc. of the 17th int. conf. on World Wide Web, WWW '08</source>
          , pp.
          <volume>585</volume>
          {
          <issue>594</issue>
          ,
          <string-name>
            <surname>New</surname>
            <given-names>York</given-names>
          </string-name>
          , (
          <year>2008</year>
          ). ACM.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>