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
Related
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".
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 :)
I am facing a similar issue on my Mac as given in Error: Could not find or load main class org.neo4j.shell.StartClient.
I initially installed Neo4j using .dmg installer, and it can open Neo4j community edition in browser. But when I click on the Options>Command Prompt, it opens a Terminal window:
xyz$ /Applications/Neo4j \Community\Edition.app/Contents/Resources/app/bin/openNeoTerminal.sh ; exit;
Neo4j Command Prompt
This window is configured with Neo4j on the path.
Available commands:
neo4j-shell
neo4j-import
bash-3.2$ neo4j-shell
Error: Could not find or load main class org.neo4j.shell.StartClient
bash-3.2$
I also downloaded the latest neo4j-2.2.7.tar.gz, unzipped it, created a folder called neo4j under my main directory. I am not sure what is needed further.
Any help will be much appreciated.
Unfortunately this is a bug with the packaging, in Neo4j 2.3.x.
Please use the tgz distribution, in the extracted folder you find bin/neo4j-import.
Please refer to the Neo4j - manual, on how to use it:
http://neo4j.com/docs/stable/import-tool.html
I can't find the neo4j-shell after installing the community edition on Windows. Am I missing something. I wanted to use it to run in a batch of cypher statements.
For Version 2.2.0 in Windows, go to the Neo4j Community Launcher, then click options, click on Command Line tools/ Command Prompt, then type Neo4jShell. You can paste sequences of queries into the shell, very convenient to load a series of CSV imports for instance..
Install the binary from here: http://www.neo4j.org/download/other_versions
Then navigate to the bin folder and run Neo4jShell.bat.
When you install 1.9.4 using the new Windows installer, from where does one launch the Neo4j-Shell (previously found in bin)?
The neo4j-shell isn't currently shipping with the neo4j desktop but you can launch it by running the following command from 'C:\Program Files\Neo4j Community\' (or equivalent location:):
jre\bin\java -classpath bin\neo4j-desktop-1.9.4.jar org.neo4j.shell.StartClient
I'm not sure whether there are plans to include it in the next release, I'll check.
You can uninstall your neo4j windowns instalation version, so you can download an zip file with contains the neo4j binary version for Windows at http://www.neo4j.org/download. Using this version, you can find the bin, conf and lib folder. Besides that, you can find the Neo4jShell.bat. This file is the shell.
I believe the stand alone Neo4j-Shell isn't included in the installer for 1.9.4, but there is the Power tool console in the web interface, and you can also use the shell from the 1.8.3 package. I have no idea if it's supported though, but it seems to work.
For future googlers who end up here, there is a cypher shell at <neo4_dir>\bin\cypher-shell.bat. Neo4j-CE-3.1.0