Skip to content

Cypher: nodes(), relationships(), length() on variable-length path patterns (e.g. [*1..3]) not implementedΒ #4353

Closed

Description

@lvca

Context

Reported by a user migrating from Neo4j in the blog post Moving a Graph RAG system from Neo4j to ArcadeDB (May 2026, against ArcadeDB 26.4.1-SNAPSHOT). The author concluded that variable-length path queries were unreliable and recommended using fixed-hop patterns instead.

Problem

nodes(path), relationships(path), and length(path) are not supported when path is bound from a variable-length pattern such as [*1..3] or [*2].

This is acknowledged in the test suite: three tests in OpenCypherAdvancedFunctionTest.java are marked @Disabled with the reason "Requires path matching with variable length relationships to be fully implemented":

  • nodesFunction()
  • relationshipsFunction()
  • lengthFunctionOnPath()

(all using [*2] patterns).

Reproduction

MATCH p = (a:Worker)-[*1..3]->(b:Worker)
RETURN nodes(p), relationships(p), length(p)

Expected: list of nodes/relationships/length per matching path.
Actual: errors or missing rows (per the disabled tests).

Why it matters

Variable-length traversal is a primary reason users adopt a graph database. Without these accessors, downstream queries that depend on path inspection (e.g. RAG over multi-hop relationships) need to be rewritten as fixed-hop joins, which is exactly what the blog author resorted to.

Suggested fix

Plumb the variable-length traversal result through to a Path object that supports nodes/relationships/length, and re-enable the disabled tests. Several recent fixes already touched this area (#4006, #3999, #4190, #4111, #3997) β€” this issue tracks the remaining accessor coverage.

Activity

  1. added this to the 26.6.1 milestone on May 26, 2026
  2. self-assigned this
    on May 26, 2026
  3. added theissue type on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions