johnsonfoo / fyp-java-spring-data-neo4j

Spring Boot Application using Spring Data Neo4j for querying data stored in Neo4j
2 stars 0 forks source link

Add Neo4j cypher scripts for importing Datalog data #91

Closed johnsonfoo closed 2 years ago

johnsonfoo commented 2 years ago

Before importing any data, make sure to run

CREATE CONSTRAINT unique_fqn_name IF NOT EXISTS FOR (f:FQN) REQUIRE f.name IS UNIQUE

Afterwards, run the following command in the Neo4j Browser Console for each Datalog file

CALL apoc.cypher.runFile("file:///scripts/<datalog_file_1>.cypher");
CALL apoc.cypher.runFile("file:///scripts/<datalog_file_2>.cypher");
...

Note: Use of apoc.cypher.runFiles([files or urls]); is not recommended as it is asynchronous and will timeout easily (requiring multiple runs of the command to achieve same result as running individually)