Mayil-AI-Sandbox / kuzudb_jan15

MIT License
0 stars 0 forks source link

Unresolved relationship tables giving avoidable binding errors (hashtag2812) #18

Open vikramsubramanian opened 4 months ago

vikramsubramanian commented 4 months ago

I have a database with an RDFGraph TurtleTest, a regular node table Student, and a regular rel table st_r from student to TurtleTest_r resource node table. I get the following error:

kuzu> match (a)-[e]->(b:TurtleTest_l) return *;
Error: Binder exception: Relationship pattern e contains both property graph relationship label st_to_r and RDFGraph label TurtleTest. Mixing two tables in the same relationship pattern is not supported.
kuzu> call show_tables() return *;

I should not be getting this because the destination of e is TurtleTest_l, so e can only bind to TurtleTest_lt. So there is no real mixing of relationship tables from RDFGraph and regular property graph. We should not disable all multilabel queries because a database has an rdfgraph and a regular relationship table. We should only disable it when a relationship pattern resolves to mix these two types of relationship tables.

Here is a more basic example that we re disabling unlabeled or multilabel queries completely: I have a database with an RDFGraph TestTurtle, a regular node table student, and a regular rel table st_to_st from student to student.

kuzu> create rel table st_to_st (from student to student);
-----------------------------------------
| result                                |
-----------------------------------------
| Rel table: st_to_st has been created. |
-----------------------------------------
 match (a)-[e]->(b:TurtleTest_l) return *;
Error: Binder exception: Relationship pattern e contains both property graph relationship label st_to_st and RDFGraph label TurtleTest. Mixing two tables in the same relationship pattern is not supported.

So as long as there is a regular relationship in the database we give this error even though there is no relationship table between an RDFGraph's node table and a regular node table. )

mayil-ai[bot] commented 4 months ago

Summary: The issue involves avoidable binding errors with unresolved relationship tables, causing a mix of RDFGraph and regular property graph relationship tables.

Possible Solution

Based on the provided information and code snippets, the issue seems to be related to the handling of relationship patterns in queries, particularly when involving RDFGraphs and property graphs. The error message indicates that the system does not support mixing two tables in the same relationship pattern, which is happening in the command match (a)-[e]->(b:TurtleTest_l) return *;.

To resolve the issue, consider the following steps:

Remember to follow the project's coding standards and guidelines for contributing to the codebase when making changes.

Code snippets to check