Skip to content

Cypher parser rejects shortestPath((a)-[:REL*]-(b)) official shortest-path syntax #997

Description

@lmeyerov

Summary

Direct Cypher execution currently rejects official shortest-path syntax of the form:

path = shortestPath((person1)-[:KNOWS*]-(person2))

This is now a measured benchmark blocker from pyg-bench for LDBC SNB Interactive interactive-complex-13 / Q13.

Repro Shape

MATCH
    (person1:Person {id: $person1Id}),
    (person2:Person {id: $person2Id}),
    path = shortestPath((person1)-[:KNOWS*]-(person2))
RETURN
    CASE path IS NULL
        WHEN true THEN -1
        ELSE length(path)
    END AS shortestPathLength

Actual

Compiler/parser rejects the query before execution with an Invalid Cypher query syntax error.

Expected

The official shortest-path syntax should parse and lower, even if execution support is still staged behind a later runtime issue.

Benchmark Impact

  • blocks direct Cypher coverage for SNB Interactive interactive-complex-13
  • this is distinct from the old #983 zero-hop open-range issue: the official text here uses [:KNOWS*], not *0..
  • on the same staged fixture, a local BFS workaround returns the correct shortest-path length 2, so this is a parser/front-end blocker rather than missing test data

Activity

  1. lmeyerov commented on Mar 31, 2026

    @lmeyerov
    ContributorAuthor

    Measured another benchmark manifestation of this lane on March 31, 2026: LDBC SNB Interactive interactive-complex-1 (named-shortest-friends).

    Official query shape includes:

    • MATCH path = shortestPath((p)-[:KNOWS*1..3]-(friend))
    • WITH min(length(path)) AS distance, friend
    • follow-on city / university / company collection

    Current measured behavior in pyg-bench against pinned master 7095102df and the staged official fixture:

    • GFQL: partial via bounded-shortest-path + profile-history join workaround, expected rows matched
    • direct Cypher: parser_gap with GFQLSyntaxError: [invalid-cypher-syntax] Invalid Cypher query syntax

    The query is now classified under #997 because the failure is triggered by the official shortestPath(...) form before later row-carrying stages execute.

  2. lmeyerov commented on Apr 1, 2026

    @lmeyerov
    ContributorAuthor

    Fixed in v0.53.15 via PR #1009.

    shortestPath() and allShortestPaths() now parse and raise a clear "not yet supported" validation error instead of a generic syntax error. Execution support tracked in #1010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions