Skip to content

Cypher undirected MATCH can bind the seed node as the peer alias on incoming edges #994

Description

@lmeyerov

Summary

Direct Cypher execution can bind the seed node as the peer alias for an undirected relationship pattern when the stored edge is incoming.

This showed up while rerunning the LDBC SNB Interactive interactive-short-3 shape on current master / v0.53.10 (7095102df492feed0ce7a83240ee406c779c5f81). The query no longer hard-fails, but it returns semantically wrong rows.

Minimal repro

import pandas as pd
import graphistry

nodes = pd.DataFrame([
    {"id": 1, "label__Person": True, "firstName": "Alice", "lastName": "Seed"},
    {"id": 2, "label__Person": True, "firstName": "Bob", "lastName": "Friend"},
])

edges = pd.DataFrame([
    {"s": 2, "d": 1, "type": "KNOWS", "creationDate": 10},
])

g = graphistry.nodes(nodes, "id").edges(edges, "s", "d")

q = """
MATCH (n:Person {id: $personId })-[r:KNOWS]-(friend)
RETURN
    friend.id AS personId,
    friend.firstName AS firstName,
    friend.lastName AS lastName,
    r.creationDate AS friendshipCreationDate
ORDER BY friendshipCreationDate DESC, toInteger(personId) ASC
"""

res = g.gfql(q, params={"personId": 1}, engine="pandas")
print(res._nodes[["personId", "firstName", "lastName", "friendshipCreationDate"]].to_dict(orient="records"))

Actual

[{"personId": 1, "firstName": "Alice", "lastName": "Seed", "friendshipCreationDate": 10}]

Expected

[{"personId": 2, "firstName": "Bob", "lastName": "Friend", "friendshipCreationDate": 10}]

Benchmark impact

This blocks direct-Cypher correctness for LDBC SNB Interactive interactive-short-3 / IS3 on pyg-bench. GFQL still has a workaround path, but the direct Cypher path is now a semantic mismatch rather than an unsupported query.

Activity

  1. added a commit that references this issue on Apr 1, 2026
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