<!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>PathFinder Demo: Returning Paths in Graph Queries</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vicente Calisto</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Benjamín Farías</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Wim Martens</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Carlos Rojas</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Domagoj Vrgoč</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Instituto Milenio Fundamentos de los Datos (IMFD)</institution>
          ,
          <addr-line>Santiago</addr-line>
          ,
          <country country="CL">Chile</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Pontificia Universidad Católica de Chile</institution>
          ,
          <addr-line>Santiago</addr-line>
          ,
          <country country="CL">Chile</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Bayreuth</institution>
          ,
          <addr-line>Bayreuth</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this demonstration we showcase PathFinder, a unified approach to returning paths in graph database queries. Returning paths is a central feature of regular path queries in the new GQL graph query standard. In the demo we showcase how PathFinder works by establishing two public endpoints, which the attendees will be able to access using their browser to try diferent queries. The first endpoint will host a property graph version of Wikidata to test GQL-style path queries, while the second one contains Wikidata in RDF format and illustrates how SPARQL can be extended to return paths.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;GQL</kwd>
        <kwd>regular path queries</kwd>
        <kwd>SPARQL</kwd>
        <kwd>property paths</kwd>
        <kwd>returning paths</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction and Outline</title>
      <p>n7 : City
name = Rome
country = Italy</p>
      <p>n6 : City
counnamtrye == ANmetshteerrldaanmds
e11 : car
tolls = 73.81€</p>
      <p>n1 : City
counnamtrye == BGaeyrmreaunthy
e1 : train
e2 : train</p>
      <p>n2 : City
Counnamtrye == GNeürrmnbaenryg
e4 : train
e3 : train
duration = 2h</p>
      <p>e9 : flight
e7 : train</p>
      <p>n4 : City
counnamtrye == FGrearnmkafunryt</p>
      <p>n3 : City
counnamtrye == SGteurtmtgaanryt
e6 : train
e5 : train</p>
      <p>n8 : City
Counnamtrye == SCahnilteiago
e8 : flight
code = AF406
duration = 13h</p>
      <p>n5 : City
name = Paris
country = France</p>
      <p>
        The second key component of GQL is the ability to return paths in query answers. Examining
the graph of Figure 1, we can immediately see that returning all the paths conforming to the
query in our example is not feasible. Namely, the loop generated by the edges e1 and e2 allows
us to generate an infinite number of paths. To prohibit infinite query answers, GQL uses path
modes [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], which limit the type of paths we can return. Common modes are simple and trail,
which forbid reusing nodes and edges on paths, respectively. Another option is shortest; for
instance, if we wished to find a shortest way to reach Santiago from Bayreuth by using any
number of train connections or flights, we would write:
      </p>
      <p>MATCH (?x:City WHERE ?x.name='Bayreuth')
-[?p ANY SHORTEST (:train | :flight)+]-&gt;</p>
      <p>(?y: City WHERE ?y.name='Santiago')
In this query the path itself is bound to the variable ?p and has non-deterministic semantics since
there could be multiple shortest paths between the two nodes. For instance, in our example one
answer is traced by the edges e1 → e3 → e5 → e8, another one by e1 → e4 → e7 → e9, etc.
According to GQL, all these answers are valid, and there is no guarantee as to which one will
be returned. Returning all of them can be done using the ALL SHORTEST mode.</p>
      <p>
        Given the novelty of GQL [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] and the fact that queries that return paths are intrinsically
dificult to evaluate [ 13], it is not surprising that their coverage is somewhat lacking in modern
systems. For instance, most engines only support a few path modes out of the 15 that are
possible in GQL [14]. To remedy these issues, we will showcase PathFinder, an add-on for
graph database engines that allows processing path queries at scale and supports all GQL path
modes. PathFinder is based on years of theoretical work on the subject, is implemented on top
of the MillenniumDB graph database engine [15], and supports diferent storage mechanisms,
showcasing its independence of the graph pipeline.
      </p>
      <p>Conference paper. We remark that this demo accompanies our paper PathFinder: Returning
Paths in Graph Queries [16] which will be presented in the ISWC research track. Compared to
the conference version, here we put a strong focus on usability; namely, we develop a graphical
interface for returning paths and host two endpoints where attendees can test path queries. We
also propose an extension of SPARQL where paths can be returned in the query results. Finally,
we remark that an additional author is added compared with the Research Track paper to work
on providing user interfaces and SPARQL support for the demo.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The Demonstration</title>
      <p>The demonstration will consist of the following use cases, all of which are supported through
public query endpoints that will be available during the review process and later on.
A public query endpoint. The main highlight of our demonstration will be a public query
endpoint where the attendees will be able to test GQL path queries using only their Web
browser. In particular, our endpoint will be hosting a property graph version of Wikidata [17]
which we used in our scalability tests. In particular, we use a curated version of the data set
based on the truthy dump of Wikidata [18], which was used in WDBench [19]. The dataset
is publicly available at [20]. During the demonstration we will also have a brief explanation
of the underlying data and will prepare a series of instructive queries for the users to get
acquainted with the language. The Wikidata endpoint is available for the review purposes at
https://mdb.imfd.cl/path_finder/, with a series of illustrative queries included on the endpoint.
PathFinder and SPARQL engines. Since the PathFinder approach can also work as a part
of a SPARQL engine, we first showcase its functionality in the context of evaluating property
paths without returning the path themselves. This approach is already used in MillenniumDB’s
Wikidata SPARQL endpoint at https://wikidata.imfd.cl/, which leverages PathFinder to handle
property path queries, and can be tried there. We remark that in this case the entire Wikidata
dump is from 2023–07–16 and not Wikidata Truthy.</p>
      <p>Returning paths in SPARQL. In addition to checking reachability via property paths, we
would also like to illustrate how PathFinder can be used to return paths in SPARQL queries,
through a syntactic extension of the language. One such proposal can be accessed directly
through the PathFinder console as explained in our online repository [14]. For the demo
presentation we also developed a Web interface for displaying paths that witness SPARQL
property path query answers in a similar fashion as done for our property graph endpoint. To
test this functionality, the attendees can access our (extended) SPARQL endpoint hosting the
Wikidata Truthy dataset at https://mdb.imfd.cl/path_finder/. Figure 2 shows how this extension
of SPARQL syntax and semantics works on our endpoint.</p>
    </sec>
    <sec id="sec-3">
      <title>Acknowledgments</title>
      <p>Calisto, Farías, Rojas and Vrgoč were supported by ANID – Millennium Science Initiative
Program – Code ICN17_002. Vrgoč was also supported by the ANID Fondecyt Regular project
1240346. Martens was supported by ANR project EQUUS ANR-19-CE48-0019; funded by
the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), project number
431183758.
[13] W. Martens, M. Niewerth, T. Popp, C. Rojas, S. Vansummeren, D. Vrgoč, Representing
paths in graph database pattern matching, Proc. VLDB Endow. 16 (2023) 1790–1803.
[14] B. Farías, W. Martens, C. Rojas, D. Vrgoč, PathFinder: A unified approach for handling
paths in graph query languages, 2024. URL: https://github.com/AnonCSR/PathFinder.
[15] D. Vrgoč, C. Rojas, R. Angles, M. Arenas, D. Arroyuelo, C. Buil-Aranda, A. Hogan,
G. Navarro, C. Riveros, J. Romero, Millenniumdb: An open-source graph database system,
Data Intell. 5 (2023) 560–610. URL: https://doi.org/10.1162/dint_a_00229.
[16] B. Farias, W. Martens, C. Rojas, D. Vrgoč, Evaluating regular path queries in GQL and</p>
      <p>SQL/PGQ:, CoRR abs/2306.02194 (2023). URL: https://doi.org/10.48550/arXiv.2306.02194.
[17] D. Vrandecic, M. Krötzsch, Wikidata: a free collaborative knowledgebase, Commun. ACM
57 (2014) 78–85.
[18] T. W. Foundation, Wikidata:database download, 2021. URL: https://www.wikidata.org/
wiki/Wikidata:Database_download.
[19] R. Angles, C. B. Aranda, A. Hogan, C. Rojas, D. Vrgoč, Wdbench: A wikidata graph
query benchmark, in: The Semantic Web - ISWC 2022, 2022. URL: https://doi.org/10.1007/
978-3-031-19433-7_41. doi:10.1007/978-3-031-19433-7\_41.
[20] R. Angles, C. B. Aranda, A. Hogan, C. Rojas, D. Vrgoč, WDBench Dataset Download, 2022.
doi:10.6084/m9.figshare.19599589.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>R.</given-names>
            <surname>Angles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Barceló</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Hogan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. L.</given-names>
            <surname>Reutter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Vrgoč</surname>
          </string-name>
          ,
          <article-title>Foundations of Modern Query Languages for Graph Databases</article-title>
          ,
          <source>ACM Comput. Surv</source>
          .
          <volume>50</volume>
          (
          <year>2017</year>
          ). URL: https://doi.org/10.1145/3104031. doi:
          <volume>10</volume>
          .1145/3104031.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S.</given-names>
            <surname>Sakr</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Bonifati</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Voigt</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Iosup</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Ammar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Angles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. G.</given-names>
            <surname>Aref</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Besta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Boncz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Daudjee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. D.</given-names>
            <surname>Valle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dumbrava</surname>
          </string-name>
          ,
          <string-name>
            <given-names>O.</given-names>
            <surname>Hartig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Haslhofer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Hegeman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Hidders</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Hose</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Iamnitchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Kalavri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Kapp</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Martens</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Özsu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Peukert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Plantikow</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ragab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Ripeanu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Salihoglu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Schulz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Selmer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Sequeda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Shinavier</surname>
          </string-name>
          , G. Szárnyas,
          <string-name>
            <given-names>R.</given-names>
            <surname>Tommasini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Tumeo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Uta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. L.</given-names>
            <surname>Varbanescu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Yakovets</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Yan</surname>
          </string-name>
          ,
          <string-name>
            <surname>E. Yoneki,</surname>
          </string-name>
          <article-title>The future is big graphs: a community view on graph processing systems</article-title>
          ,
          <source>Commun. ACM</source>
          <volume>64</volume>
          (
          <year>2021</year>
          )
          <fpage>62</fpage>
          -
          <lpage>71</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Team</surname>
          </string-name>
          ,
          <string-name>
            <surname>Jena</surname>
            <given-names>TDB</given-names>
          </string-name>
          ,
          <year>2021</year>
          . URL: https://jena.apache.org/documentation/tdb/.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Thompson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Personick</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cutcher</surname>
          </string-name>
          , The Bigdata®
          <article-title>RDF Graph Database, in: Linked Data Management, Chapman</article-title>
          and Hall/CRC,
          <year>2014</year>
          , pp.
          <fpage>193</fpage>
          -
          <lpage>237</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>O.</given-names>
            <surname>Erling</surname>
          </string-name>
          , Virtuoso, a
          <string-name>
            <surname>Hybrid</surname>
            <given-names>RDBMS</given-names>
          </string-name>
          /Graph Column Store,
          <source>IEEE Data Eng. Bull</source>
          .
          <volume>35</volume>
          (
          <year>2012</year>
          )
          <fpage>3</fpage>
          -
          <lpage>8</lpage>
          . URL: http://sites.computer.org/debull/A12mar/vicol.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>I. F.</given-names>
            <surname>Cruz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. T.</given-names>
            <surname>Wood</surname>
          </string-name>
          ,
          <article-title>A graphical query language supporting recursion</article-title>
          ,
          <source>in: SIGMOD</source>
          <year>1987</year>
          ,
          <year>1987</year>
          , pp.
          <fpage>323</fpage>
          -
          <lpage>330</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A. O.</given-names>
            <surname>Mendelzon</surname>
          </string-name>
          , P. T. Wood,
          <article-title>Finding regular simple paths in graph databases</article-title>
          ,
          <source>in: VLDB</source>
          <year>1989</year>
          ,
          <year>1989</year>
          , pp.
          <fpage>185</fpage>
          -
          <lpage>193</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>D.</given-names>
            <surname>Calvanese</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G. D.</given-names>
            <surname>Giacomo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Lenzerini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. Y.</given-names>
            <surname>Vardi</surname>
          </string-name>
          ,
          <article-title>Rewriting of regular expressions and regular path queries</article-title>
          ,
          <source>J. Comput. Syst. Sci</source>
          .
          <volume>64</volume>
          (
          <year>2002</year>
          )
          <fpage>443</fpage>
          -
          <lpage>465</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>M.</given-names>
            <surname>Arenas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Conca</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pérez</surname>
          </string-name>
          ,
          <article-title>Counting beyond a yottabyte, or how SPARQL 1.1 property paths will prevent adoption of the standard</article-title>
          ,
          <source>in: Proceedings of the 21st World Wide Web Conference</source>
          <year>2012</year>
          ,
          <article-title>WWW 2012</article-title>
          , Lyon, France,
          <source>April 16-20</source>
          ,
          <year>2012</year>
          , ACM,
          <year>2012</year>
          , pp.
          <fpage>629</fpage>
          -
          <lpage>638</lpage>
          . URL: https://doi.org/10.1145/2187836.2187922. doi:
          <volume>10</volume>
          .1145/2187836.2187922.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>P. B. Baeza</surname>
          </string-name>
          , Querying graph databases,
          <source>in: PODS</source>
          <year>2013</year>
          ,
          <year>2013</year>
          , pp.
          <fpage>175</fpage>
          -
          <lpage>188</lpage>
          . URL: https: //doi.org/10.1145/2463664.2465216. doi:
          <volume>10</volume>
          .1145/2463664.2465216.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>K.</given-names>
            <surname>Losemann</surname>
          </string-name>
          , W. Martens,
          <article-title>The complexity of regular expressions and property paths in SPARQL</article-title>
          ,
          <source>ACM Trans. Database Syst</source>
          .
          <volume>38</volume>
          (
          <year>2013</year>
          )
          <article-title>24</article-title>
          . URL: https://doi.org/10.1145/2494529. doi:
          <volume>10</volume>
          .1145/2494529.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>A. D</surname>
          </string-name>
          . et. al.,
          <article-title>Graph pattern matching in GQL and SQL/PGQ</article-title>
          , in: SIGMOD '
          <fpage>22</fpage>
          ,
          <year>2022</year>
          . URL: https://doi.org/10.1145/3514221.3526057. doi:
          <volume>10</volume>
          .1145/3514221.3526057.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>