muhammadshoaib commented on pull request #87:
URL: https://github.com/apache/incubator-age/pull/87#issuecomment-872477922
## General Comments:
What is difference between execCypher and queryCipher
Could you please check on the following queries if the driver in question
works according to cipher's requirements
```
MATCH (a:Person) RETURN a.name, a.age, a.country
MATCH (a:Person) RETURN a;
```
Also, path model is relationship/edge model as it does not consider the
multiple hop paths. Considering following query the driver's behaviors is
unknown
```
MATCH p=(a)-[:know]-(b)-[:knows]-(c) RETURN a, b, c, p
```
## Subsequent errors:
I also have observed that if one query fails because of Cypher error all
consequences queries start giving following exceptions. A new session solves
this problems but this doesn't seems a normally behaviors to me.
Following is my test case for this.
```
>>> ag.queryCypher("MATCH (n:Person)")
Traceback (most recent call last):
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 90, in execSql
psycopg2.errors.SyntaxError: syntax error at end of input
LINE 1: ... from cypher('my_test_graph', $$ MATCH (n:Person) $$) as (v ...
^
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 107, in queryCypher
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 100, in execCypher
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 94, in execSql
age.exceptions.SqlExcutionError: ("SELECT * from cypher('my_test_graph', $$
MATCH (n:Person) $$) as (v agtype);", SyntaxError("syntax error at end of
input\nLINE 1: ... from cypher('my_test_graph', $$ MATCH (n:Person) $$) as (v
...\n ^\n"))
```
From here all subsequent queries starts failing unless I quit the python
session and restart a new session
```
>>> ag.execCypher("MATCH (n:Person) RETURN n")
Traceback (most recent call last):
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 90, in execSql
psycopg2.errors.UndefinedFunction: function cypher(unknown, unknown) does
not exist
LINE 1: SELECT * from cypher('my_test_graph', $$ MATCH (n:Person) RE...
^
HINT: No function matches the given name and argument types. You might need
to add explicit type casts.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 100, in execCypher
File
"/usr/local/lib/python3.8/dist-packages/incubator_age-0.0.2-py3.8.egg/age/age.py",
line 94, in execSql
age.exceptions.SqlExcutionError: ("SELECT * from cypher('my_test_graph', $$
MATCH (n:Person) RETURN n $$) as (v agtype);", UndefinedFunction("function
cypher(unknown, unknown) does not exist\nLINE 1: SELECT * from
cypher('my_test_graph', $$ MATCH (n:Person) RE...\n
^\nHINT: No function matches the given name and argument types. You might need
to add explicit type casts.\n"))
```
## Record Traversing Errors
The following code prints nothing
```
import age
print("Loading age")
DSN = "host=127.0.0.1 port=5432 dbname=age user=age"
TEST_GRAPH_NAME = "my_test_graph"
ag = age.connect(dsn=DSN, graph=TEST_GRAPH_NAME)
ag.execCypher("CREATE (n:Person {name: 'Joe'})")
ag.execCypher("CREATE (n:Person {name: 'Smith'})")
ag.queryCypher("MATCH (n:Person) RETURN n")
for vertex in ag.rows():
print(vertex)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]