Find answers from the community

Updated 2 months ago

Unexpected Error Creating A Neo4jPropertyGraphStore

At a glance

A community member is experiencing an unexpected error when creating a Neo4jPropertyGraphStore. The error is related to a CypherTypeError and seems to be caused by an issue in the refresh_schema function. Community members have tried updating the llama-index-graph-stores-neo4j package to the latest version, but the issue persists. One community member has reached out to a Neo4j expert to create a pull request to address the problem, but the fix is still pending. There is no explicitly marked answer in the comments.

Useful resources
Hi everyone,
I'm getting an unexpected error creating a Neo4jPropertyGraphStore.
Code:
global NEO4J_STORE
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
NEO4J_STORE = Neo4jPropertyGraphStore(
url=neo4j_url,
username=neo4j_user,
password=neo4j_password)
Error:
NEO4J_STORE = Neo4jPropertyGraphStore(
File "/usr/local/lib/python3.9/site-packages/llama_index/graph_stores/neo4j/neo4j_property_graph.py", line 169, in init
self.refresh_schema()
File "/usr/local/lib/python3.9/site-packages/llama_index/graph_stores/neo4j/neo4j_property_graph.py", line 270, in refresh_schema
enhanced_info = self.structured_query(enhanced_cypher)[0]["output"]
File "/usr/local/lib/python3.9/site-packages/llama_index/graph_stores/neo4j/neo4j_property_graph.py", line 588, in structured_query
full_result = [d.data() for d in result]
File "/usr/local/lib/python3.9/site-packages/llama_index/graph_stores/neo4j/neo4j_property_graph.py", line 588, in <listcomp>
full_result = [d.data() for d in result]
File "/usr/local/lib/python3.9/site-packages/neo4j/_sync/work/result.py", line 393, in iter
self._connection.fetch_message()
File "/usr/local/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 184, in inner
func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/neo4j/_sync/io/_bolt.py", line 994, in fetch_message
res = self._process_message(tag, fields)
File "/usr/local/lib/python3.9/site-packages/neo4j/_sync/io/_bolt5.py", line 496, in _process_message
response.on_failure(summary_metadata or {})
File "/usr/local/lib/python3.9/site-packages/neo4j/_sync/io/_common.py", line 254, in on_failure
raise self._hydrate_error(metadata)
neo4j.exceptions.CypherTypeError: {code: Neo.ClientError.Statement.TypeError} {message: Expected a string value for substring, but got: 2024-01-01T00:00:00Z; consider converting it to a string with toString().}
L
d
G
12 comments
pip install -U llama-index-graph-stores-neo4j
Nope I do not have the newest verison. I have 0.3.1. I will try it, thanks!
Hi again, @Logan M . I previously resolved this issue, but unfortunately, it's come up again. I've checked for the latest versions of llama-index-graph-stores-neo4j (currently at 0.4.4) and updated llama-index-core to the newest version as well, but the error persists. Any ideas on what might be causing this?
I have no idea on this. I'm not a cypher/neo4j expert at all. I can try asking the neo4j guys and see if they get back to me.

If you are able to make a fix to the code, that might be faster.
Is it possible to use the Neo4jPropertyGraphStore with neo4j db version <=4.5?
Btw, I'm getting a similar error with llama-index-graph-stores-neo4j=0.4.5
@Logan M
Plain Text
CypherTypeError: {code: Neo.ClientError.Statement.TypeError} {message: Invalid input for function 'toString()': Expected a String, Number, Boolean, Temporal or Duration, got: 
StringArray
pretty sure this is already fixed, pip install -U llama-index-graph-stores-neo4j
I just installed the latest version llama-index-graph-stores-neo4j=0.4.5 and compared the code of both files in my local machine and the fix PR you sent.

I think it's a different one
idk man, I'm not a neo4j expert πŸ˜… feel free to make a PR. Whats the full traceback?
will do that if I figure out what the fix is: )
Thanks for trying, I appended the traceback
ah yea, still an issue in the refresh_schema function
Add a reply
Sign up and join the conversation on Discord