Summary
-[*1..2]-> fails with “requires at least one relationship type”. In Cypher, omitting the rel type means “any relationship”.
Specifying Kleene star operators in Cypher is a natural expectation among users of graph DBs who may be coming into lance-graph, so it would be good to embrace these users with open arms.
Example
import pyarrow as pa
from lance_graph import GraphConfig, CypherQuery
people = pa.table({"id": [1, 2, 3]})
follows = pa.table({"src": [1, 2], "dst": [2, 3]})
cfg = (
GraphConfig.builder()
.with_node_label("Person", "id")
.with_relationship("FOLLOWS", "src", "dst")
.build()
)
datasets = {"Person": people, "FOLLOWS": follows}
query = "MATCH (a:Person)-[*1..2]->(b:Person) RETURN count(*)"
CypherQuery(query).with_config(cfg).execute(datasets)
Traceback (most recent call last):
File "/Users/prrao/code/graph-benchmark/lance_graph/tt.py", line 15, in <module>
CypherQuery(query).with_config(cfg).execute(datasets)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
ValueError: Invalid graph pattern: Expand requires at least one relationship type
Expected
Count of paths length 1..2, regardless of rel type.
Actual
ValueError: Invalid graph pattern: Expand requires at least one relationship type
Proposal
Explicit types work, e.g., (-[:FOLLOWS*1..2]->), but the any-type form is standard Cypher which users will expect when they come from other systems.
Environment
The following environment was used to test this:
lance-graph 0.4.0
Python 3.13
macOS Tahoe 26.2
Summary
-[*1..2]->fails with “requires at least one relationship type”. In Cypher, omitting the rel type means “any relationship”.Specifying Kleene star operators in Cypher is a natural expectation among users of graph DBs who may be coming into
lance-graph, so it would be good to embrace these users with open arms.Example
Expected
Count of paths length
1..2, regardless of rel type.Actual
ValueError: Invalid graph pattern: Expand requires at least one relationship typeProposal
Explicit types work, e.g.,
(-[:FOLLOWS*1..2]->), but the any-type form is standard Cypher which users will expect when they come from other systems.Environment
The following environment was used to test this: