Skip to content

feat(cypher): support *0.. open-range variable-length relationships (#983)#984

Merged
lmeyerov merged 2 commits intomasterfrom
fix/cypher-multi-alias-edge-ref-zerohop
Mar 31, 2026
Merged

feat(cypher): support *0.. open-range variable-length relationships (#983)#984
lmeyerov merged 2 commits intomasterfrom
fix/cypher-multi-alias-edge-ref-zerohop

Conversation

@lmeyerov
Copy link
Copy Markdown
Contributor

Summary

Support *0.., *1.., and other open-max variable-length relationship ranges in direct Cypher queries. Previously these failed with a parser syntax error.

Before

MATCH (m)-[:REPLY_OF*0..]->(p) RETURN p
→ GFQLSyntaxError: Invalid Cypher query syntax

After

result = g.gfql("MATCH (m)-[:REPLY_OF*0..]->(p) RETURN p.id AS postId")
# Works — matches zero or more hops

Changes

  • graphistry/compute/gfql/cypher/parser.py: Add rel_range_open_max grammar rule and transformer for *N.. syntax (unbounded max)
  • graphistry/tests/compute/gfql/cypher/test_parser.py: 4 new parametrized test cases (*0.., *1.., [:R*0..], [:R*2..])

Why

Blocks LDBC SNB Interactive benchmark queries (e.g. IS2 uses REPLY_OF*0..).

Test plan

  • 10/10 variable-length parser tests pass (4 new + 6 existing)
  • 431 lowering tests pass (no regressions)
  • End-to-end execution: *0.. correctly includes seed node (zero hops) plus reachable nodes

🤖 Generated with Claude Code

lmeyerov and others added 2 commits March 30, 2026 16:16
…983)

Add rel_range_open_max grammar rule and transformer for open-range
syntax like *0.., *1.., *2.. where the max bound is unbounded.
Handles min_hops=0 specifically (zero-hop means include the seed
node itself) while keeping the existing rejection of *0 exact syntax.

Adds 4 parametrized parser test cases: *0.., *1.., [:R*0..], [:R*2..].

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmeyerov lmeyerov merged commit 3ce4759 into master Mar 31, 2026
160 of 162 checks passed
@lmeyerov lmeyerov deleted the fix/cypher-multi-alias-edge-ref-zerohop branch March 31, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant