PathFinder: Returning Paths in Graph Queries

Tracking #: 3930-5144

Authors: 
Benjamín Farías
Wim Martens
Carlos Rojas
Domagoj Vrgoč

Responsible editor: 
Marta Sabou

Submission type: 
Full Paper
Abstract: 
Path queries are a central feature of all modern graph query languages and standards, such as SPARQL, Cypher, SQL/PGQ, and GQL. While SPARQL returns \emph{endpoints} of path queries, it is possible in Cypher, SQL/PGQ, and GQL to return \emph{entire paths}. In this paper, we present the first framework for returning paths that match regular path queries under all twenty seven modes supported by the SQL/PGQ and GQL standards. At the core of our approach is the product graph construction combined with a way to compactly represent a potentially exponential number of results that can match a path query. We describe the approach on a conceptual level and provide runtime guarantees for evaluating path queries. We also show how it can be incorporated into the SPARQL query language, thus extending RDF engines with the ability to return witnesses to property path queries (under the GQL semantics). To show the feasibility of our methods in practice, we develop a reference implementation on top of an existing open-source graph processing engine MillenniumDB, and perform a detailed analysis of path querying over several synthetic and real-world datasets. Most notably, we test our implementation over Wikidata using property path queries posted by users, extending them with the ability to return paths. We obtain order-of-magnitude speedups over modern graph database engines and remarkably stable performance, even for theoretically intractable queries.
Full PDF Version: 
Tags: 
Reviewed

Decision/Status: 
Major Revision

Solicited Reviews:
Click to Expand/Collapse
Review #1
By Robert David submitted on 30/Jan/2026
Suggestion:
Minor Revision
Review Comment:

Summary
-------
The paper describes PathFinder, a query system developed to support all paths modes defined in the GQL and SQL/PGQ standards.
The idea is to provide an efficient and scalable approach to be added to existing property graph engines.
Also, the paper discusses how path results can be returned by SPARQL query engines, which is currently not supported by the SPARQL standard.
The path algorithms are described in detail, explaining all the different path modes with examples.
The paper then discusses the implementation, the 3 evaluation scenarios on different data sets and explains the evaluation results.
The conclusion is that PathFinder outperforms other existing implementations and successfully tests for all the supported paths modes.

The authors published the implementation and test data on GitHub.

Originality
-----------
The idea of returning paths in graph queries is not new and there are existing implementations, as mentioned in the paper.
PathFinder's novelty is that it support all paths modes defined in the GQL and SQL/PGQ standard, which makes it valuable for practical purposes.
It also shows reasonable performance for real-world scenarios.
This paper is an extension of a recent conference paper. The additions are sufficient to justify this extended version.
I see a medium originality.

Significance of the results
---------------------------
I think returning paths in graph queries is highly relevant in practice.
Explainability of (graph) query results is increasingly important especially in the context of hybrid AI systems using graphs as a backbone.
Given the factual and semantic information in graphs, explaining results via returned paths makes it possible for users to understand why a result is returned, i.e., understand the context of a result.
I See a high significance.

Quality of writing
------------------
The paper is very well written.
All the query evaluation algorithms for the different path modes are well explained with illustrative examples.
The evaluation is also explained very well. However, I am missing some details about the actual queries used. One can look them up in GitHub, though.
I See a high quality.

Some details for the sections
=============================

2. Graph Databases and Path Queries
-----------------------------------
Definitions and examples are all correct as far as I can see.
The examples illustrate well the different paths semantics.

3. Backbone of PATHFINDER and the WALK Semantics
------------------------------------------------
The algorithms are well explained and illustrated with representative examples.

5. Implementation
-----------------
For MilleniumDB, it is stated that it supports RDF with a fully compliant implementation of SPARQL 1.1 query.
However, the published implementation says otherwise. See https://github.com/MillenniumDB/MillenniumDB/wiki/SPARQL-Implementation-...
This needs to be clarified.

6. Experimental Evaluation
--------------------------
It is highly important that performance is evaluated, because this is a major topic for practical applicability given the potential high complexity of the query task. Testing for 3 different scenarios and data sets further underpins this.
However, it seems not all of the test results are in the GitHub repository (top-k tests).
The results folder doesn't contain any test results.
I therefore suggest to update the published data on GitHub.

Minor issues
------------
Page 6: wold -> would
Page 6: three simple path -> three simple paths

Page 9: ... starts with John, and loops back to him using ... -> ... starts with John, and loops back to him via Joe using ...

Page 10: ... which is blocked in line 15.
There is no line 15. I think it should be line 12.
Page 10: ...the moment they are found (line 8), but ...
I think this should be line 7 instead of line 8.

Page 14: travaerse -> traverse

Page 15: Algorithm 3 work similarly ... -> Algorithm 3 works similarly ...
Page 15: We can the output ... -> We can then output ...

Page 16: ... which contains, for each solution node n a search state ... -> ...which contains, for each solution node n, a search state ...
Page 16: for instance in lines 21 and 27 of Algorithm 3
Should that be 22 instead of 21?
Page 16: line 18 of Algorithm 3
Should that be line 17 instead of 18?

Page 21: reconstrut -> reconstruct

Page 22: sued -> used

Page 23: ... and we do not yes implement ... -> ... and we do not yet implement ...

Page 24: This requires, for instance, that the main while loop of Algorithm 1 be halted as soon as a new solution is detected in line 19...
There is no line 19. I guess it should be line 9.
Page 24: ... solutions can be detected while scanning the neighbours (lines 14–24), ...
There is no line 24, so it should be 14-23 instead.
Page 24: Under 6. Experimental Evaluation, it says 'We start by explaining how PATHFINDER was implemented ...', but it does not describe the implementation, which was done in the previous chapter.

Review #2
Anonymous submitted on 20/Feb/2026
Suggestion:
Major Revision
Review Comment:

This paper presents PathFinder, a framework for evaluating regular path queries (RPQs) and returning matching paths under _all_ path modes defined by the GQL and SQL/PGQ standards. The modes combine four restrictors (like WALK, TRAIL, SIMPLE, ACYCLIC) with six selectors (e.g., ANY, ANY SHORTEST, ALL SHORTEST, ANY k, SHORTEST k, etc.). The idea is to run graph search algorithms on the product of the data graph with a query automaton and use the search structure (a variant of path multiset representations) to compactly encode potentially exponential result sets. Several algorithms are presented for different mode combinations, all supporting pipelined enumeration. The paper also extends SPARQL with a syntax for returning paths. The implementation on top of MillenniumDB is evaluated on a number of real-world and synthetic workloads, showing strong performance against state-of-the-art (where was supported at a time).

Strong Points.

S1) PathFinder is (was?) the first system to support returning paths under all 27 GQL/SQL-PGQ path modes while simultaneously supporting the full class of regular path queries. This is an important contribution to the graph database ecosystem, especially with GQL standardization.

S2) The algorithmic presentation is clean and well-structured. Each algorithm is accompanied by a running example, complexity analysis, and enumeration procedure. The paper is pleasant to read!

S3) The engineering makes sense. The pipelined evaluation is practically important. The SPARQL extension addresses a real limitation (of only returning end-points and not paths). The proposed syntax is clean and the implementation on MillenniumDB shows feasibility.

S4) The experiments are convincing and shows the scalability of the proposed methods (esp. when compared to competitors). Using queries from public SPARQL logs rather than synthetic benchmarks adds real-world credibility.

Points of potential improvement.

W1) The distinction between output-linear enumeration from a precomputed Solutions set and output-linear delay during pipelined execution deserves more explicit treatment. A reader might reasonably expect that pipelined path retrieval for TRAIL queries has the same delay guarantee as for WALK queries, which it doesn't.

W2) Comparison to state-of-the-art is now somewhat outdated (by a few years)... which is a long time given that many vendors are now adopting GQL. Neo4j 4.4.12 is from mid-2023?; Neo4j 2025.x (Cypher 25) now supports some path selectors and some match modes. Kuzu 0.0.6 is very early; the last release was v0.11.3 (Oct 2025, now archived). NebulaGraph 3.5.0 predates Enterprise v5.2, which claims native GQL support. There are a few other systems which claim GQL support, e.g., Spanner Graph, Ultipa. It would be interesting to place this work in relation to the current state of the art.

W3) The public code repository (AnonCSR/PathFinder, last commit October 2023) implements 16 path modes and does not include SHORTEST k, ANY k, or SHORTEST k GROUPS. This appears to correspond to authors' conference paper and does not include any additions in this journal version. It would be good to include the updated code covering all 27 modes. The group mode algorithms are the journal version's main addition, so reproducibility of this new contribution depends on code availability.

Review #3
Anonymous submitted on 30/Mar/2026
Suggestion:
Major Revision
Review Comment:

The paper extends the conference version of PATHFINDER by incorporating additional path semantics aligned with GQL, in particular the notion of GROUPS, and adding to the prior framework the corresponding algorithms. The work is evaluated over a combination of real-world and synthetic datasets, with the aim of demonstrating scalability and applicability.
The topic is relevant and timely, and the work builds upon a solid prior contribution. However, in its current form, I'm not sure that the paper meets the expectations for a journal extension, particularly with respect to the depth of the contribution, the completeness of the presentation, and the experimental validation.

(1) Originality:
The paper presents a technically sound extension of a previously published conference work. The integration of GROUPS into the framework constitutes a meaningful addition, and the overall approach remains original in the broader context of graph query processing.
That said, the degree of novelty with respect to the conference version appears limited. The main ideas and techniques are largely inherited from the earlier work, and the additional contribution, while relevant, does not significantly alter the conceptual core of the approach. As such, the level of originality is acceptable, but somewhat modest for a journal extension.

(2) Significance of the results:
The results presented in the paper are reasonable and consistent with the goals of the work. However, there are two important limitations that affect their overall significance.
First, from a theoretical and algorithmic perspective, the paper does not provide a fully self-contained description of the proposed methods. Several important procedural details within the algorithms are omitted or only partially described. Instead, the authors refer to an external arXiv version for the complete procedures (an arXiv version that is different from the conference one, which itself does not contain all of these details).
This is problematic for a journal extension, which should ideally be self-contained and should not rely on material outside the peer-reviewed manuscript for essential algorithmic details. This makes it difficult to fully assess the correctness and applicability of the approach. Moreover, it's unclear why such details are not included in the paper itself, given the absence of strict space constraints.

Second, the experimental evaluation does not constitute a substantial extension over the conference version. A significant portion of the setup is reused, including two of the three datasets. The only new dataset (Pokec) provides a limited additional perspective, as it explores aspects that seem to already be implicitly covered—often under more demanding conditions—by the synthetic Diamond dataset.
While the paper includes an evaluation of the GROUPS mode, this analysis remains relatively shallow. The experiments primarily show that increasing the number of groups leads to increased runtime, which is expected and does not provide deeper insight into the behaviour or usefulness of this semantics. Furthermore, only very small values of k are considered, and results for Wikidata are omitted (again, not quite sure why but the authors argue its "for brevity").
The lack of comparison with existing systems is understandable given that the proposed GROUPS semantics is not directly supported by current graph query engines. However, this makes it even more important to provide a thorough internal evaluation of this feature. In particular, the paper does not clearly demonstrate in which scenarios GROUPS provides a practical advantage (or if it does at all). For instance, it would be valuable to understand whether GROUPS helps mitigate path explosion by reducing output size, how it compares to returning individual paths (e.g., SHORTEST or TOP-k paths), and what trade-offs it introduces in terms of runtime and result granularity.
More generally, the current evaluation does not explore settings in which GROUPS is expected to be most relevant, such as graphs where multiple paths of different lengths exist between the same pair of nodes. As a result, the experimental section does not sufficiently support the practical relevance of this extension.
Taken together, these issues limit the overall impact and significance of the experiments presented.

(3) Quality of writing:
The quality of writing is uneven across the paper. The parts inherited from the conference version are generally clear and well presented. In contrast, the newly introduced material is noticeably less polished. In particular, the new sections contain typos and some grammatical issues. More importantly, key technical details are sometimes omitted all throughout the manuscript, making certain parts difficult to follow. This places an unnecessary burden on the reader, which is not justified in a journal extension without strict page limits. The paper contains one very useful running example, but also lacks sufficient illustrative examples in places where they would be helpful for understanding non-trivial constructions (e.g., a small example of the product graph).
A recurring concern is that important information is deferred to an external arXiv document rather than being included in the paper itself. This choice is difficult to justify in the context of a journal submission and contributes to the impression that the presentation of the new material is incomplete.
Overall, the manuscript would benefit from a thorough revision to improve clarity, completeness, and consistency.

(4) Data and reproducibility:
The authors provide a link to code, data, and queries, which is a positive aspect. However, the reproducibility of the work is only partially supported due to the concerns raised above.
While the availability of experimental resources is commendable, the lack of a fully self-contained description of the algorithms in the paper itself makes it difficult to independently reproduce or validate the theoretical aspects of the approach. In particular, relying on an external, non-peer-reviewed arXiv version for procedural details raises concerns.
It would be important to ensure that all essential components required to understand and reproduce the work—both theoretical and experimental—are clearly described within the paper and properly documented in the accompanying resources.

Minor comments:
Generally, spelling is uneven. Choose one (neighbor or neighbour, etc), UK or US.

P3
L20 well, technically you do not introduce Pathfinder here, you extend it from your previous work to cover GROUPS.
L42 we describe and extra examples -> and add?
Also, about this Remark: The claim that the manuscript provides additional algorithmic details and examples compared to the conference version is not entirely clear. In my reading, the level of detail remains largely comparable to the conference version, with the main differences being limited to the extensions themselves. Similarly, the examples appear to either be the same ones or follow closely those already presented, with only minor adaptations to account for the new material.
I would have expected a more substantial expansion in terms of both algorithmic detail and illustrative examples. In addition, the discussion on the complexity of the algorithms remains rather limited and could be further developed.

P4
If you’re defining all the basics…. then:
L37 \epsilon not defined
L42 k-fold concatenation not defined.

P5
L1 “greater than”

P7
L33 ‘in practice…’ why? what is the complexity difference? why do you construct the product graph lazily and in the complexity discussions this is still the bound you give, could you explain a bit more what are the practical differences in the lazy approach?

P10
l41 it runtime -> its runtime
l51 The intuition simple -> The intuition IS simple

P11
I’d appreciate a bit more detail on certain discussions, e.g.
L31 why do you require unambiguous here but not in the previous cases?
L32/33 this is easy to enforce for real-world RPQs?
What is the procedure Neighbors doing, here and in Algorithm 1?

P13
L15 why do you “crucially” need this? Or even better, why you don’t need it in the first algorithms but you do need it now? Can you expand on the differences?
L16 Again, a bit more detail on the runtime of the construction of Gx would be helpful.
L18 How much bigger? Please, don’t send the reader to another paper, explain…
L20 you have explained/defined what this is already in P7, and mentioned it already in P10…

P14
L37 are not shortest -> the shortest / by path -> by a path
L41 travaerse -> traverse

P15
L20 pipelinining -> pipelining
L22 k path if more -> paths
L31 Algorithm 3 work -> works
L44 haven’t -> have not
L47 END -> ENS / we can the output -> we can output

P16
L28 q state -> q the state

P17
L44 terminates -> terminating
L 47 to some nodes n -> to some node n

P18
why the need to compute the product graph lazily if all the bounds you are giving are still ~O(|A||G|) ?

P19
Paragraph starting in l41:
Where are you checking that the next node also respects regex? in IsValid? Is it in Neighbors? Please clarify this.
Because for example, in the example you give, when trying to expand Jane there are no outgoing follows or lives edges, so the search from there terminates. Where in your pseudocode’s algorithm is this?

Same question I had about the procedure Neigbors in the other algorithms. You need to clarify in what part of your code you’re “checking” that the regex for the path you are assembling is ok.

P20
L29: the same as -> the same way as

P22
L6 sued -> used
L9 Reachable a set -> Reachable is a set
L10 Groups a dictionary -> Groups is a dictionary (or use colon)

P23
L34-5 we do not yes -> we do not yet