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

Reserved Keyword Handling: How to update a property which is a keyword. #1988

Closed
dianaoa22 opened this issue Jul 26, 2024 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@dianaoa22
Copy link

Describe the bug
Reserved Keyword Handling- Here below I have a graph test_graph with property match--keyword but I don't seem to have a way to update it.

nspdb=# SELECT *
nspdb-# FROM cypher('test_graph', $$
nspdb$# MATCH (n:Person)
nspdb$# RETURN n LIMIT 5
nspdb$# $$) AS (v agtype);
v

{"id": 3940649673949185, "label": "Person", "properties": {"id": 123, "city": "Lagos", "name": "Daniel", "match": "test", "title": "xyz"}}::vertex
(1 row)

nspdb=# SELECT * FROM cypher('test_graph', $$ MATCH (n:Person { id: 123 }) SET n.match = 'xyz' $$) as (v agtype);
ERROR: syntax error at or near "="
LINE 1: ...h', $$ MATCH (n:Person { id: 123 }) SET n.match = 'xyz' ...
^

How are you accessing AGE (Command line, driver, etc.)?

  • [e.g. JDBC]

What data setup do we need to do?

...
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?

  • [e.g. Installed PostGIS]

What is the command that caused the error?

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:  something failed to execute

Expected behavior
A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • Version: [e.g. 0.4.0]

Additional context
Add any other context about the problem here.

@dianaoa22 dianaoa22 added the bug Something isn't working label Jul 26, 2024
@dianaoa22
Copy link
Author

Tried with backticks too which doesnt seem to help.

@jrgemignani
Copy link
Contributor

@dianaoa22 is this one or 2 issues?

@jrgemignani
Copy link
Contributor

@dianaoa22 As for using keywords within queries, I don't think that you can atm. However, we could look into allowing it.

@dianaoa22
Copy link
Author

@jrgemignani : It is one issue. Yes, I think there should be a way to allow it similar to neo4j https://neo4j.com/docs/cypher-manual/current/syntax/reserved/ where backticks encapsulation allows it.

@jrgemignani
Copy link
Contributor

@dianaoa22 I'm looking into this to see if it is reasonably possible.

@jrgemignani
Copy link
Contributor

@dianaoa22 PR #2005 addresses this and is currently in review.

@dianaoa22
Copy link
Author

@jrgemignani Thanks for making an effort to fix this :)

@dianaoa22
Copy link
Author

@jrgemignani -- When would the Dockerfile be updated with this build which has the fix so that I can verify the same? I see the last update is Build 2004 but the fix is in Build 2005. Please clarify.

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