Hello,
I want to load shacl data on neo4j startup.
The following works to load "ordinary" graph data (in plan.cypher) and validation data (in validation.cypher)
I added the following to my neo4j.conf:
dbms.security.procedures.unrestricted=apoc.*
I added the following to my apoc.conf:
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=true
apoc.initializer.neo4j.0=CALL apoc.cypher.runFile("file:///plan.cypher")
apoc.initializer.neo4j.1=CALL apoc.cypher.runFile("file:///validation.cypher")
My plan.cypher contains a CREATE statement where I set up the graph. That works like a charm.
My validation.cypher contains the following:
CALL n10s.graphconfig.init({handleVocabUris:"IGNORE"}) yield param;
CREATE CONSTRAINT n10s_unique_uri IF NOT EXISTS ON (r:Resource) ASSERT r.uri IS UNIQUE;
CALL n10s.validation.shacl.import.inline('
.... turtle file ....','Turtle') YIELD target RETURN target
If my validation.cypher only contains ...
CALL n10s.graphconfig.init({handleVocabUris:"IGNORE"}) yield param;
..., that works just fine.
That leaves me confused and I don't know if that's a bug in neosemantics or apoc or whether this behavior is actually supposed to work.
If I give my files to cypher-shell directly, everything works like a charm. I could provided stripped down versions of my file if that's helpful.