<!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>Visually Exploring SPARQL Endpoints with Murmuration</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Christophe Debruyne</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Declan O'Sullivan</string-name>
          <email>declan.osullivan@tcd.ie</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>ADAPT Centre, Trinity College Dublin</institution>
          ,
          <addr-line>Dublin 2</addr-line>
          ,
          <country country="IE">Ireland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present Murmuration, which is a tool to discover various paths between resourced in a Linked Data dataset serviced by a SPARQL endpoint. Murmuration was developed to run entirely on a client. While this computation is heavy on the client, we provide a reasonably smooth experience by generating a series of queries that cover the different possible paths between two resources. This allows us to use, for each query, a callback to display the results as they come along. This approach also reduces the complexity of queries that the SPARQL endpoint has to process. Future work will look into scalable approaches for distributed computing, as we recognize the need for exploring multiple Linked Data datasets as a whole.</p>
      </abstract>
      <kwd-group>
        <kwd>Linked Data exploration</kwd>
        <kwd>Linked Data visualization</kwd>
        <kwd>relationship discovery</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Exploring Linked Data datasets in a visual manner still remains a challenge. A fairly
recent overview was provided by [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The authors identified and classified tools based
on several characteristics, e.g., ontology (schema) exploration vs. RDF exploration,
their capabilities, and whether they were a web application. In the context of a project,
we needed a tool that allowed one to find arbitrary paths between RDF resources.
      </p>
      <p>
        Our tool, called Murmuration, is inspired by both RelFinder [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and graphVizDB
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. RelFinder iteratively searched for all possible paths between two resources,
showing intermediate results when they are found. RelFinder furthermore allowed one to
provide the nodes from which the tool has to start from and the possibility filter out
certain predicates. The disadvantage of RelFinder is that it relied on now dated
technology (Flash) and required setting up a server for some of the PHP scripts. Similarly,
graphVizDB requires a server as it stores information about the graphs in a bespoke
database. What we appreciate about graphVizDB, however, is that the frontend relies
on Web standards. Unlike RelFinder, however, it allows one to search the graphs as a
whole and does not look for paths between sources in a graph. Ideally, however, we
would have access to a data exploration tool that allows one to:
• look for all paths between resources provided by a user (similar to [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]);
• declare which predicates can be omitted before searching;
• avail of open Web standards for the visualization (similar to [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] and [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]); and
• solely rely on client-side processing (similar to [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]).
      </p>
      <p>The second requirement is interesting when users know, beforehand, which
predicates appear often and do not provide much additional information such as rdf:type
and cidoc:P2_has_type. Such a feature is not present in the aforementioned
tooling; one can filter out predicates when found after a search.</p>
      <p>We thus present Murmuration, a tool that allows one to explore all paths between
two or more resources. Sections 2 and 3 provide details on the design and
implementation, with a focus on the queries that it generates to manage client-side processing. In
Section 4, we conclude the paper.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Design and Implementation</title>
      <p>Murmuration was inspired by RelFinder and graphVizDB, though we wish to develop
a tool that relied on client-side processing. An image is provided in Fig. 1. The tool
consists of a form where one can configure the search, a canvas on which the nodes and
edges are displayed, and a display. Upon clicking on a resource in the visualization, the
tool will try to load an HTML representation of that resource in the display.</p>
      <p>Form</p>
      <p>Visualization</p>
      <p>Display
Fig. 1. Demonstrating Murmuration in the Beyond 2022 Project. An endpoint is chosen in (1).
We can select resources in (2), which looks for URIs or resources with an rdfs:label with
particular string for which we want to find paths. (3) allows us to set the maximum of
intermediate concepts. (4) allows us to exclude predicates appearing in the dataset. Finally, (5) allows
us to toggle nodes and edges in the visualization.
We want to avoid that a user has to wait for all results to appear. Rather than iteratively
finding paths, we chose to generate queries for all possible paths, which is the focus of
this section.</p>
      <p>For each unique pair (non-ordered) of resources (, ) selected in Fig. 1 (2), we
generate &amp;2("#$) − 2) queries. We start with a simple triple pattern looking at
relationships in both directions ( = 1). Then we concatenate these with additional triple
patterns for intermediate concepts, also taking into account the different directions. For
 = 2, we take the patterns that resulted from  = 1 and combined it with the two new
patterns. That resulted in four additional patterns to be considered, totaling at six. This
process is exemplified below.
(d=1) ?x0 ?pred1r ?x1 .
(d=1) ?x1 ?pred1l ?x0 .
(d=2) ?x0 ?pred1r ?x1 . ?x1 ?pred2r ?x2 .
(d=2) ?x0 ?pred1r ?x1 . ?x2 ?pred2l ?x1 .
(d=2) ?x1 ?pred1l ?x0 . ?x1 ?pred2r ?x2 .
(d=2) ?x1 ?pred1l ?x0 . ?x2 ?pred2l ?x1 .
(d=3) ?x0 ?pred1r ?x1 . ?x1 ?pred2r ?x2 . ?x2 ?pred3r ?x3 .
(d=3) ?x0 ?pred1r ?x1 . ?x1 ?pred2r ?x2 . ?x2 ?pred3l ?x3 .
(d=3) ?x0 ?pred1r ?x1 . ?x2 ?pred2l ?x1 . ?x2 ?pred3r ?x3 .
(d=3) ?x0 ?pred1r ?x1 . ?x2 ?pred2l ?x1 . ?x2 ?pred3l ?x3 .
(d=3) ...</p>
      <p>We could have used property paths, but then we would have needed to keep track of
the direction in the application. To avoid comparing URIs in FILTER clauses, we
replace ?x0 by &lt;x&gt; and the largest variable ?xn by &lt;y&gt; in each of the graph patterns.
We do bind the URIs of x and y to these variables in BIND clauses. As we generate
patterns for each unique pair, we cover all the possible graph patterns. This approach
speeds up query evaluation.</p>
      <p>We then introduce a couple of filters: none of the intermediate variables ?xi should
be bound to x or y; none of the intermediate variables ?xi should be bound to the same
resource to avoid cycles; none of the predicates should be bound to URIs appearing in
the predicates to ignore.</p>
      <p>All these patterns and filters were wrapped around a SELECT DISTINCT * and
executed by the client. As for the number of queries generated, given  resources for
which we want to explore the relations between them and  the maximum number of
relations between those resources, the number of SPARQL queries generated is
./ &amp;2{"#$} − 2). The tool uses the variable naming convention to keep track of the
2
nodes and edges to be displayed. The 'l' and the 'r' in the variable names for predicates
is also used to determine the placement of the arrow marker on the edges.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Implementation</title>
      <p>The code has been made available on GitHub with an accessible license.2 The form
relies on various JavaScript libraries (e.g., JQuery), and the visualization relies on
D3.js. The tool uses JavaScript promises and callbacks to populate the visualizations as
results come in. A limitation of our implementation is that indeed one is limited to the
capabilities of one's computer, and visualizations may end up becoming too large or too
cluttered. The latter, however, is a known challenge in visualization.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions</title>
      <p>We presented Murmuration, a tool for visually exploring knowledge graphs in
SPARQL endpoints. It is inspired by the state-of-the-art in Linked Data visualizations,
though we compute the discovery of arbitrary paths between resources on the
clientside. The approach is simple and indeed demanding resources on the client, but it does
not scale for arbitrarily large values for . We believe, however, this tool would come
in handy to quickly explore, in a playful way, data contained in SPARQL endpoints.</p>
      <p>The tool is made available with an accessible license and is currently used in a digital
humanities project. Future work consists of looking into coping with blank nodes and
federated querying, with priority given to the latter. We are also considering comparing
small changes in the approach; e.g., halving the number of generated queries, and
testing whether ?x0 is bound to &lt;x&gt; (or &lt;y&gt;) and ?xn is bound to &lt;y&gt; (or &lt;x&gt;).
Acknowledgements
Beyond 2022 is funded by the Government of Ireland, through the Department of
Culture, Heritage and the Gaeltacht, under the Project Ireland 2040 framework. C.
Debruyne is also partially supported by the ADAPT Centre for Digital Content
Technology under the SFI Research Centres Programme (Grant 13/RC/2106).
2 https://github.com/chrdebru/murmuration
Fig. 2. Different relations have different colors in the graph, which can be hidden using the
panel on the right.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bikakis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liagouris</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krommyda</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Papastefanatos</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sellis</surname>
          </string-name>
          , T.K.:
          <article-title>graphvizdb: A scalable platform for interactive large graph visualization</article-title>
          .
          <source>In: 32nd IEEE International Conference on Data Engineering, ICDE</source>
          <year>2016</year>
          , Helsinki, Finland, May
          <volume>16</volume>
          -20,
          <year>2016</year>
          . pp.
          <fpage>1342</fpage>
          -
          <lpage>1345</lpage>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Bikakis</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sellis</surname>
            ,
            <given-names>T.K.</given-names>
          </string-name>
          :
          <article-title>Exploration and visualization in the web of big linked data: A survey of the state of the art</article-title>
          .
          <source>In: Proceedings of the Workshops of the EDBT/ICDT 2016 Joint Conference, EDBT/ICDT Workshops</source>
          <year>2016</year>
          , Bordeaux, France, March
          <volume>15</volume>
          ,
          <year>2016</year>
          (
          <year>2016</year>
          ), http://ceurws.org/Vol-
          <volume>1558</volume>
          /paper28.pdf
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Heim</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hellmann</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lohmann</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stegemann</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Relfinder: Revealing relationships in RDF knowledge bases</article-title>
          .
          <source>In: Semantic Multimedia, 4th International Conference on Semantic and Digital Media Technologies, SAMT</source>
          <year>2009</year>
          , Graz, Austria, December 2-
          <issue>4</issue>
          ,
          <year>2009</year>
          ,
          <source>Proceedings. Lecture Notes in Computer Science</source>
          , vol.
          <volume>5887</volume>
          , pp.
          <fpage>182</fpage>
          -
          <lpage>187</lpage>
          . Springer (
          <year>2009</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Mouromtsev</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pavlov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Emelyanov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Morozov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Razdyakonov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Galkin</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>The simple web-based tool for visualization and sharing of semantic data and ontologies</article-title>
          .
          <source>In: Proceedings of the ISWC</source>
          <year>2015</year>
          <article-title>Posters &amp; Demonstrations Track co-located with the 14th International Semantic Web Conference (ISWC-</article-title>
          <year>2015</year>
          ), Bethlehem, PA, USA, October
          <volume>11</volume>
          ,
          <year>2015</year>
          (
          <year>2015</year>
          ), http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>1486</volume>
          /paper 77.pdf
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>