Neo4j Desktop 1.1.10 how to export cypher file? - neo4j

I have created a graph database within Neo4j Desktop (version 1.1.10) I wish to export that as a Cypher file.
How do I do that? I can't see any command within the app for export a Cypher file.

You can try following the documentation here: Neo4j - Export a (sub)graph to Cypher script and import it again
First, install the apoc procedure library, and add it into the plugins directory.
Second, run Neo4j as an administrator. If not, Neo4j doesn't have permission to write files.
Before starting Neo4j, edit the neo4j.conf file and add this line:
apoc.export.file.enabled=true
Then, start Neo4j, and in the Neo4j browser, execute the following command:
CALL apoc.export.cypher.all("export.cypher",{})
This will store the whole database in the file "export.cypher".

Related

Importing an .xml file into neo4j

I am new to neo4j. Please could you help me how I can import an xml file into Neo4j.
I installed the neo4j community version and added Neosemantics plugin(.jar file) in the appropriate folder. I tried both adding the below lines to neo4j.conf file:
dbms.unmanaged_extension_classes=semantics.extension=/rdf
dbms.unmanaged_extension_classes=n10s.endpoint=/rdf
But still getting an error 'Neo.ClientError.Procedure.ProcedureNotFound' for the following commands I tried in Neo4j browser as a query:
CALL semantics.liteOntoImport('file:///C:/Users/np/neo4j-community-5.2.0/import/ABC.xml','RDF/XML')
CALL semantics.importRDF("https://ABC.xml","RDF/XML")

neo4j console how to specify local path of existing db?

Suppose I have a graph database created with Neo4j Desktop in the path
path/neo4jDatabases/database-abc/installation-3.5.5
In a different path I have the neo4j-community-3.5.5 folder (I am on OSX). I am trying to start the path/neo4jDatabases/database-abc/installation-3.5.5 database with neo4j-community.
I am trying this command:
sudo ./bin/neo4j console -path path/neo4jDatabases/database-abc/installation-3.5.5
but the started database is using the directories of neo4j-community-3.5.5 instead of the ones specified in the path.
How can I start neo4j-community using the path of an existing db (created with Neo4j Desktop)?
The path argument doesn't exist for the command neo4j.
If you want to change the data folder location of your community server, you need to modify the configuration of your community server (the conf/neo4j.conf) by specifying the dbms.directories.data property :
dbms.directories.data=path/neo4jDatabases/database-abc/installation-3.5.5/data
Cheers.

Neo4j Dump: How to specify the database?

Having successfully created and populated a database with 200,000+ nodes, I would like to create a dump as a backup.
The instructions in the documentation are simple:
neo4j-admin dump --database=<database> --to=<destination-path>
But it's not clear what to use for <database>. If I use graph.db (or leave out the option) I get an error. I know the location of the database folder.
If I put the path to the database I get the following error:
unexpected error: 'database' should be a name but you seem to have specified a path
OS: Windows 10
Partial answer:
The database parameter refers to databases that are located in neo4jFolder/data/databases folder, where neo4jFolder is the folder of the unzipped install of Neo4j.
For example: I unzipped the neo4j install zip into E:\Program Files\neo4j-community-3.3.2. My database was elsewhere on the drive. So I copied the database to E:\Program Files\neo4j-community-3.3.2\data\databases\MyDatabase. Then I was able to run neo4j-admin dump --database=MyDatabase --to=backup5.dmp successfully.
I don't know if it's possible to run dump on databases that are not found under /data/databases. I also don't know how to run a dump when Neo4j is installed with the exe installer. My solution is for the zip file installation.

NEO4J 3.1.1 Load CSV

I have been using Neo4j for several months now and am getting pretty exasperated.
It appears that every new version breaks the previous one.
I have multiple Cypher Load scripts that I can no longer run via the command line.
I can run the following from the Browser:
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///person.csv" AS csvLine
MERGE (p:Person {sysurn : csvLine.urn})
ON CREATE SET p.dob = trim(csvLine.dob)
ON CREATE SET p.forename = trim(csvLine.forename)
ON CREATE SET p.surname = trim(csvLine.surname );
Previously in version 3.0.3 (Community Edition) I ran the following:
java -cp "C:\Program Files\Neo4j CE 3.0.3\bin\neo4j-desktop-3.0.3.jar" org.neo4j.shell.StartClient -file "D:/nosql/Load data/load_person.cql"
This no longer works in 3.1.1:
java -cp "C:\Program Files\Neo4j CE 3.1.1\bin\neo4j-desktop-3.1.1.jar" org.neo4j.shell.StartClient -file "D:/nosql/Load data/load_person.cql"
I get a Java Error. The general consensus is to run the full .tar version, so I installed that.
I can now run the Cypher from the browser or using cypher-shell. However this is of no use as there is no way to call an external script, so I have to do this for possibly hundreds of scripts.
Recommendation is to use ne04j-shell (now deprecated!)
I try neo4j-shell. This doesn't accept spaces in the path!
I move the file and try to run the following:
"C:\Program Files\neo4j-community-3.1.1\bin\neo4j-shell" -path "D:/nosql/neoDB/databases/graph.db" -config "neo4j.conf" -file "D:/nosql/Loaddata/load_person.cql"
I get the following error:
ERROR (-v for expanded information):
Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory,
D:\nosql\neoDB\databases\graph.db
I have tried various combinations including adding the host name as prompted:
non-JRMP server at remote endpoint
I try adding the -config param, however this again doesn't allow spaces!
With every new version it seems to get more difficult to actually import data into Neo4j.
My question is, Is it possible in version 3.1.1 to run more than one cypher script at a time without manually running every one?
Is it possible to use neo4j-shell in version 3.1.1?
Try using the APOC procedure apoc.cypher.runFile from within cypher-shell. Here is an example (with a file URL formatted for Windows):
CALL apoc.cypher.runFile("file:d:/nosql/Load data/load_person.cql");
If the space in the path still presents problems, you could rename the "Load data" folder to "LoadData" and modify the above query accordingly.
Well I have managed to find a workaround.
Install neo4j 3.1.1
Create a database
Uninstall Neo4j
Install neo4j 3.0.8
Run my Cypher scripts
e.g. java -cp "C:\Program Files\Neo4j CE
3.0.8\bin\neo4j-desktop-3.0.8.jar" org.neo4j.shell.StartClient -file "D:/nosql/Load data/load_person.cql"
uninstall neo4j
install neo4j 3.1.1
I don't think this is going to cut it in a production environment though :)

Importing data from spreadsheet to Neo4j

I am new to Neo4j.I downloaded the software from www.neo4j.org and I was able to create the Movie graph which came with the download.
Now I am trying to export data from spreadsheet into Neo4j.Here is the procedure I am following
I was stuck at the last step - THEN EXECUTE THE FOLLOWING COMMAND, making sure that Neo4j is NOT running:
cat import.txt | <neo4j directory>/bin/neo4j-shell -config conf/neo4j.properties -path <neo4j directory>/data/graph.db
I am not sure where to find neo4j-shell and conf/neo4j.properties.I don't have these folders in my download.Then I found that I have to download ne04j-community-2.0.1-windows.
I downloaded it and I see neo4j-shell and also conf/neo4j.properties.Now that I have all the things requires to execute the above statement, I am not sure where to execute it.
I am using windows and I am not familiar with scripting.Can you guide me how and where to execute the command so that I can see the nodes and relationships created in Neo4j.
Thankyou!
On the Windows with the installer the shell is not officially installed.
See this blog post for an explanation: http://java.dzone.com/articles/solving-problems-neo4j-shell
C:\Program Files\Neo4j Community>jre\bin\java -cp bin\neo4j-desktop-2.0.0.jar org.neo4j.shell.StartClient
Btw. for other cool examples check out http://blog.bruggen.com

Resources