age icon indicating copy to clipboard operation
age copied to clipboard

Error Creating Relationship Between Nodes in Apache AGE Using Cypher

Open shivamdroidoreo opened this issue 1 year ago • 1 comments

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 avatar Oct 04 '24 14:10 shivamdroidoreo

@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)

MuhammadTahaNaveed avatar Oct 12 '24 13:10 MuhammadTahaNaveed

This issue is stale because it has been open 60 days with no activity. Remove "Abondoned" label or comment or this will be closed in 14 days.

github-actions[bot] avatar Dec 12 '24 00:12 github-actions[bot]

This issue was closed because it has been stalled for further 14 days with no activity.

github-actions[bot] avatar Dec 27 '24 00:12 github-actions[bot]