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

MATCH Query Syntax issues #1973

Closed
dianaoa22 opened this issue Jul 10, 2024 · 3 comments
Closed

MATCH Query Syntax issues #1973

dianaoa22 opened this issue Jul 10, 2024 · 3 comments
Labels
question Further information is requested

Comments

@dianaoa22
Copy link

I have the data populated below however I cannot use MATCH query with instance-identifier.

SELECT * FROM cypher('test_graph', $$ MATCH (n) RETURN (n) $$) AS (vertex agtype);
vertex



{"id": 4503599627370506, "label": "SL4SHuniverseC0L0NanotherDASHuniverse", "properties": {"instance-identifier": "/universe:another-universe"}}::vertex
{"id": 5348024557502467, "label": "globularDASHcluster", "properties": {"instance-identifier": "/universe:another-universe/globular-cluster[name='cluster-42
9']"}}::vertex
{"id": 5629499534213124, "label": "galaxy", "properties": {"instance-identifier": "/universe:another-universe/globular-cluster[name='cluster-429']/galaxy[ga
laxy='galaxy-429']"}}::vertex
{"id": 5629499534213125, "label": "galaxy", "properties": {"instance-identifier": "/universe:another-universe/globular-cluster[name='cluster-429']/galaxy[ga
laxy='galaxy-429-b']"}}::vertex
{"id": 5910974510923779, "label": "stuffDASHinDASHgalaxy", "properties": {"instance-identifier": "/universe:another-universe/globular-cluster[name='cluster-
429']/galaxy[galaxy='galaxy-429-b']/stuff-in-galaxy"}}::vertex
{"id": 6192449487634435, "label": "nebula", "properties": {"instance-identifier": "/universe:another-universe/globular-cluster[name='cluster-429']/galaxy[ga
laxy='galaxy-429-b']/stuff-in-galaxy/nebula[name='nebula429']"}}::vertex

SELECT * FROM cypher('test_graph', $$ MATCH (p:SL4SHuniverseC0L0NanotherDASHuniverse {id: '/universe:another-universe'}), (c:globularDASHcluster {id: '/universe:another-universe/globular-cluster[name='cluster-429']'}) CREATE (p)-[:CONTAINS]->(c) $$) AS (result agtype);
ERROR: syntax error at or near "cluster"
LINE 1: .../universe:another-universe/globular-cluster[name='cluster-42...

If I use / to bypass the syntax error (as it allowed to populate this in DB) it doesn't match the data in DB, hence no results are returned.

SELECT * FROM cypher('test_graph', $$ MATCH (p:SL4SHuniverseC0L0NanotherDASHuniverse {id: '/universe:another-universe'}), (c:globularDASHcluster {id: '/universe:another-universe/globular-cluster[name='cluster-429']'}) CREATE (p)-[:CONTAINS]->(c) $$) AS (result agtype);
result

(0 rows)

@dianaoa22 dianaoa22 added the question Further information is requested label Jul 10, 2024
@jrgemignani
Copy link
Contributor

@dianaoa22 I think you need to look over your query and look at the usage of quotes, single and double.

@dianaoa22
Copy link
Author

Thanks it worked.

@jrgemignani
Copy link
Contributor

@dianaoa22 If this is resolved, please consider closing the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants