cancel
Showing results for 
Search instead for 
Did you mean: 

[neosemantics] Load shacl data on startup (using apoc)

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.

1 REPLY 1

TrevorS
Community Team
Community Team

Hello @max_beikirch 
If you are still facing an issue here, can you please create a GitHub ticket and provide as much detail as possible including logs and configs, etc., and share a link to your GitHub ticket in reply to this thread. Or if you have a support contract open a ticket.

If you could resolve the issue, please reply with what you did to solve the problem so others can benefit from your troubleshooting!

TrevorS
Community Specialist
Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.