step by step instructions on loading a csv into neo4j - neo4j

I am using Neo4j Community edition 2.0.1 and have run into an issue which I cannot seem to resolve. I am trying to load a CSV file but am unable, keeps giving me the message of "type help to see valid commands". I used the same DB file that it says in the database location in the popup to connect, and created an import folder within that folder, and put the csv file there, but it will still not connect. The command I put is the following:
LOAD CSV WITH HEADERS FROM "file:///C:/test.csv" AS line
MERGE (n:MyNode {Name:line.Source})
MERGE (m:MyNode {Name:line.Target})
MERGE (n) -[:TO {dist:line.distance}]-> (m)
But, the error I get is:
Type :help for a list of available commands
Anyone have an idea of what I am doing wrong?

I believe LOAD CSV was only introduced in version 2.1 (you can see where it was added in the 2.1 changelogs), so you won't be able to use this.
Neo4j 2.0.1 was released in 2014, you should seriously consider using/upgrading to a more recent version if possible.

Related

How to load yelp dump file in neo4j desktop?

I'm using Neo4j Desktop Version 1.4.3. I've created a new project named "Yelp Project", then uploaded the yelp dump file in it, but I'm not getting the option "Create new DBMS from dump". So I selected Add --> Local DBMS and created a database. But when I open Neo4j Browser, there are no nodes and relationships. I'm not able to figure out how to get this done, can someone help refer image
The feature that you are looking for is not yet available for Neo4j desktop Windows version. See below community thread discussion then scroll at the bottom.
https://community.neo4j.com/t/missing-create-new-dbms-from-dump-yelp-dataset/29393

Neo4j "Sandbox" Error while I import CSV file

I have referred to "how to import csv data in neo4j DB". However, all of them refer the standalone DB.
I created a Blank Sandbox on neo4j browser (not standalone) and trying to import from the local Windows machine with the guidelines given in Neo4j documentation as below.
LOAD CSV WITH HEADERS FROM 'file:C:/San/MyGraphData_CSV.csv' as row
RETURN row.columName;
I get Error " Neo.DatabaseError.General.UnknownError: URI is not hierarchical
".
The solutions earlier recommended to replace C:/ with C:/// and other, seems to refer the Standby Neo4j. But i am using online Sandbox and importing.
Please help me resolve as this is POC and I need to evaluate more features and go for the concrete neo4j installation
Regards
San
File URIs should begin with "file:///".
The 3 slashes do not go after the Windows drive letter.

neo4j-APOC plugin stopped working

Plugin APOC was working for me for a long time which means I have it copied at right place and I have edited config file correctly. But today I needed to create same graph on different data set so I stopped neo4j service, removed database directy, restarted it, changed password then copied plugins directory in neo4j directory(as I'm not using shell) and again restarted neo4j serivice. Then tried to execute the same query again and got error messgae.
There is no procedure with the name apoc.create.relationship registered for this database instance. and the query I'm using is as following
CALL apoc.create.relationship(n, network.connection, {}, m) yield rel
I have made following change based on a stackoverflow post,
uncommented following line
#dbms.directories.plugins=plugins
and added plugin directory path, restarted service even restarted system but still not working. I have done this(removing neo4j directory...) in past multiple times but this has never happened to me. Even I have tried replacing old apoc.jar with newly downloaded one before. I have neo4j3.3.0 with apoc3.3.0.1jar with windows10. Can anybody tell me what have I done wrong this time? Thanks in advance.
EDIT 1: when I uncomment above line in config file my other plugins also stop working but after commenting it other plugins like graph algorithms are working but not APOC
Since you are using APOC procedures and graph algorithms, I think you have configured your config file this way:
dbms.security.procedures.unrestricted=algo.*
dbms.security.procedures.unrestricted=apoc.*
If it is the case, change these lines to:
dbms.security.procedures.unrestricted=algo.*,apoc.*
I really don't know what the problem was, I uninstalled it with logs and config files, downloaded latest version which didn't pose any headaches of editing config file for csv files and for plugins and it worked.
If someone is reading this question and has done everything correctly. Set the correct permissions on the plugins directory, uncommented the whitelisted and unrestricted sections of the /etc/neo4j.conf, checked if the version of the Apoc jar you're loading is the same version as neo4j, etc. and can't make it work.
Try to restart your PC, that was what did it for me, for some weird reason.

Start with existing graph db

I was just watching the Belgium Beer demo and I would like to replicate the same process to start structr with an existing neo4j graph.
Unfortunately if do the following steps:
Extract the downloaded structr folder.
Create a folder structr/db and copy the content of my graph.db.
Start structr with appropriate version of this command:
java -cp lib/*;structr-ui-1.1-SNAPSHOT-201505231136.f596a.jar org.structr.Server
I get the following error:
SEVERE: Vital service NodeService failed to start: Error starting
org.neo4j.kern el.EmbeddedGraphDatabase,
c:\Users\DataToValue\Documents\structr.\db. Aborting
Any idea how I could start a structr project with an existing graph db?
Not entirely sure what your goal is, but... you cannot simply use a product with an existing database, just because it uses a database brand which matches what you're already using (in this case, Neo4j). Structr (or any product, for that matter), will have its own data schema, its own product-specific metadata, etc. There's really no way to simply swap out a product's database and swap in your own (unless it was essentially a backup/instance from that product's database content).
With upcoming structr 2.1 version it it possible to specify an external/ existing neo4j DB instance as described here: https://stackoverflow.com/a/43583403/1821792

Trying to use periodic commit, Neo4j 2.1.2 refuses to run cypher queries

I am working with large node and relationship files of several gigabytes each, so not using periodic commit isn't really an option. I've tested LOAD CSV and it works fine with smaller files on Neo4j 2.1.2, however, when I try to run something like this:
USING PERIODIC COMMIT
LOAD CSV FROM 'file://localhost/C:/dev/project.csv' AS line
CREATE (:Provider { Code: toInt(line[0]) })
The shell refuses to execute, instead displaying a red-background message "Type :help for a list of available commands." This confuses me because normally when I do something wrong, the shell doesn't hesitate to throw a syntax error message below.
OS: Windows 7
Please use CTRL+R or CTRL+F5 to clear your browser cache. The client-side validation of the Neo4j browser-based shell is cached from a previous version of Neo4j.

Resources