I have created a python environment neo4j where all the required modules are installed. So before running any python file you need to activate this environment
# To activate the environment
source neo4j/bin/activate
# To deactivate the environment
deactivate
It contain some example of cypher queries
It contain cypher queries for loading the database
<!-- copy and paste queries and then run to execute them -->
It contain a class which handle all the loading part of database using neo4j module It provide following features:
- It connect to Neo4j Database
- We can run time change database folder
- Load Database
- Delete Whole Database
- Count the number of nodes
- Can generate statements for any type of data, we just need to provide data with header
It uses load_database.py file for doing many things. It just like an application.
# <database folder> = Path to database in which all the .csv file exists
python main.py <database folder>
They also uses load_database.py file for loading database but in distributed way. Like just upload particular number of elements from a particular numbers
# For following files only
# load_nodes.py
# load_fields.py
# load_taxonomy_terms.py
# load_field_collection_items.py
# <filename> = any above file
# <database folder> = Path to database in which all the .csv file exists
# <start with> = integer which tell from where to start the loading
# <max count> = Which tell how many items/rows/nodes/etc are to be loaded
python <filename> <Database Folder> <start with> <max count>
If you want to import data from csv file then do following changes in neo4j.config file dbms.security.allow_csv_import_from_file_urls=true => UNCOMMENT IT dbms.directories.import=import => COMMENT IT
Installing APOC
- create a folder <NEO4J_HOME>/plugins
- Download .jar file with the same version as your neo4j in <NEO4J_HOME>/plugins folder
- change the following in the file
Backup your database backup: Copy <NEO4J_HOME>/data/databases/graph.db folder restore: replace <NEO4J_HOME>/data/databases/graph.db with your back *.db folder