graph-data-science-client: streamNodeProperty() doesn't work with gds.run_cypher() as I guess
graphdatascience 1.3
I tried a query like this:
query = f'''
call gds.graph.streamNodeProperty(
'xxx',
'xxxx',
['xxxxx']
)
yield nodeId as id, propertyValue as degree
return id, degree limit 100
...
result = gds.run_cypher(query)
=> KeyError: ‘graph_name’
I figured out to make it work like this:
query = f'''
...
'''
params = {
'graph_name': 'xxx',
'properties': 'xxxx',
'entities'" ['xxxxx'],
'config': ''
}
result = gds.run_cypher(query, params)
=> No error, but it returned all rows(not limited to 100) as nodeId and propertyValue(not renamed as id and degree)
Other cypher queries works with gds.run_cypher(query) as expected.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (14 by maintainers)
It’s a quick PoC project to demonstrate Neo4j and GDSL capabilities. It has no specific requirement to meet. The graph was buit with 2.4M news. It has News nodes and the Word or Entity(multi token) nodes generated from the news. It is projected of 77M nodes and 800M relationships. Some codes can be made as a batch process but some cases need a real time responce. Any case the faster the better. I have to finish this demo at the end of this month or so.
Yes, run_cypher works with no keyError after arrow disabled. The slice of 10 records is just to check the code. My purpose is to get all the vectors and then calculated them with numpy or scikit to find the most similar nodes. I tried Filtered KNN(alpha) but terminated in the middle of running since it took so long time with the big data. So I have to wait the next release. Thanks. Dongho.
The original query is the code in my first post. Its error message was like this(Beware typo since I am typing it): Traceback (most recent call last): File “/usr/local/lib/python3.8/code.py”, line 90 in runcode exec(code, self.locals) File “”, line 10, in <module> File “/app1/pycharm-code/venv/lib/python3.8/site-packages/graphdatascience/graph_data_science.py”, line 134, in run_cypher return self._query_runner.run_query(query, params) File “/app1/pycharm-code/venv/lib/python3.8/site-packages/graphdatascience/query_runner/arrow_query_runner.py”, line 57, in run_query graph_name = params[“graph_name”] KeyError: ‘graph_name’
Yes, there is no ‘graph_name’ in my code. But it appeared in its error message above.