Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Creating Relationship Between Nodes in Apache AGE Using Cypher #2120

Open
shivamdroidoreo opened this issue Oct 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shivamdroidoreo
Copy link

A clear and concise description of what the bug is:

When executing a CREATE relationship between nodes in Apache AGE using the Cypher query, the operation fails with an error message: ERROR: something failed to execute. The query is intended to create a relationship between two existing nodes, but the error suggests an issue during execution.
How are you accessing AGE (Command line, driver, etc.)?
Command line (e.g., psql)
JDBC
What data setup do we need to do?
We need to create a graph and populate it with Part nodes. For example:

Create the graph and populate it with data:
css
Copy code
SELECT * from cypher('my_graph_name', $$
CREATE (a:Part {part_num: '123'}),
(b:Part {part_num: '345'}),
(c:Part {part_num: '456'}),
(d:Part {part_num: '789'})
$$) as (a agtype);
What is the necessary configuration info needed?
Apache AGE installed
PostgreSQL version [e.g., 13.x]
Installed PostGIS (if applicable)
Graph created in the correct schema (e.g., ag_catalog)
What is the command that caused the error?
This Cypher query fails when trying to create a relationship between two nodes:

css
Copy code
SELECT * from cypher('my_graph_name', $$
MATCH (a:Part {part_num: '123'}), (b:Part {part_num: '345'})
CREATE (a)-[u:used_by { quantity: 1 }]->(b)
$$) as (a agtype);
Error message:

vbnet
Copy code
ERROR: something failed to execute
Expected behavior
The expected behavior is for the Cypher query to successfully create a used_by relationship between the nodes a and b with the property quantity: 1 on the relationship. There should be no error, and the relationship should be visible when querying the graph.
Environment (please complete the following information):
Version: [e.g. Apache AGE 0.4.0]
PostgreSQL Version: [e.g. 13.x]
Operating System: [e.g., Ubuntu 20.04]
Any other relevant environment details
Additional context
Ensure that the graph my_graph_name is correctly set up before running the query.
Double-check for any schema-related issues such as missing labels, incorrect paths, or graph name conflicts in the setup process.
Verify if any PostgreSQL or AGE logs provide more details on the error for further diagnosis.

@shivamdroidoreo shivamdroidoreo added the bug Something isn't working label Oct 4, 2024
@MuhammadTahaNaveed
Copy link
Member

@shivamdroidoreo I am not able to reproduce this issue.

testdb=# SELECT * FROM cypher('issue_2120',$$CREATE (a:Part {part_num: '123'}),
 (b:Part {part_num: '345'}),
 (c:Part {part_num: '456'}),
 (d:Part {part_num: '789'})
 $$) as (a agtype);
 a 
---
(0 rows)

testdb=# SELECT * FROM cypher('issue_2120',$$MATCH (a:Part {part_num: '123'}), (b:Part {part_num: '345'})
 CREATE (a)-[u:used_by { quantity: 1 }]->(b)
 $$) as (a agtype);
 a 
---
(0 rows)

testdb=# SELECT * FROM cypher('issue_2120',$$MATCH p=(a)-[u:used_by { quantity: 1 }]->(b) return p
$$) as (a agtype);
                                                                                                                                                              a                               
                                                                                                                               
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------
 [{"id": 844424930131969, "label": "Part", "properties": {"part_num": "123"}}::vertex, {"id": 1125899906842625, "label": "used_by", "end_id": 844424930131970, "start_id": 844424930131969, "p
roperties": {"quantity": 1}}::edge, {"id": 844424930131970, "label": "Part", "properties": {"part_num": "345"}}::vertex]::path
(1 row)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants