Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-22-2021 04:45 AM
I have a cypher script that is automatically run when a docker container starts. I'd like to run n10s.graphconfig.init() when the container was run for the first time. However, after that it gives an error. It's not causing any issue but I'd like to check if the error message could be avoided by running the init() call only if the graph is empty.
The error message says:
n10s.graphconfig.init`: Caused by: n10s.graphconfig.GraphConfigProcedures$GraphConfigException: The graph is non-empty
05-22-2021 09:28 AM
match (n) return count(n)?
05-23-2021 10:22 AM
Yep, that would do.
To be more precise, the procedure will refuse to run if there is at least a node labeled as :Resource
or in other words, if there is some RDF data imported in the DB. Because if that is the case, some config was applied for that import and changing it without cleaning the DB would mess things up.
Here's where this happens.
@dazhi.jiao Is it expected to start a container with a pre-populated DB?
You can do two things, like @david.rosenblum mentioned you could check if there are any nodes, you can restrict it to (n:Resource)
if you prefer. Or you can check if there is already a graph config in the DB. You can get it with n10s.graphconfig.show()
Hope this helps.
JB.
All the sessions of the conference are now available online