FalkorDB / FalkorDB

A super fast Graph Database uses GraphBLAS under the hood for its sparse adjacency matrix graph representation. Our goal is to provide the best Knowledge Graph for LLM (GraphRAG).
https://www.falkordb.com/
Other
723 stars 31 forks source link

FalkorDB violates the relation uniqueness requirements of Cypher standard #740

Closed Aurora-yzj closed 4 months ago

Aurora-yzj commented 4 months ago

FalkorDB seems to violate the uniqueness requirements when matching relations, as specified in the openCypher standard, chapter "Pattern-Uniqueness"(https://s3.amazonaws.com/artifacts.opencypher.org/openCypher9.pdf): image

For example, suppose we build a database using the following queries:

CREATE (n0{id : 2});
CREATE (n0{id : 5});
MATCH (n0 {id : 5}), (n1 {id : 2}) MERGE(n0)-[r :T1 {id : 24}]->(n1);

And then run the Cypher query:

MATCH (n0)-[r0]-(n1)-[r1]-(n2) WHERE true RETURN n0.id, r0.id, n1.id, r1.id, n2.id

There should be no result, as such a pattern does not exist if we do not count repetitive relations (assigning relation 24 to both r0 and r1), and other Cypher-based databases indeed follow this rule, for example Memgraph and neo4j:

image-1

However, FalkorDB violates this property and give the result: image-2

Such inconsistency with the standard could cause trouble when programming with FalkorDB. Fix would be very appreciated. Thank you!

dorukkarinca commented 4 months ago

694 ?

Aurora-yzj commented 4 months ago

694 ?

Thank you! I'll add edge tracking manually.