How to create a local DB ?

27 views
Skip to first unread message

Keld Sørensen

unread,
Oct 18, 2017, 7:48:58 PM10/18/17
to Neo4j

I just downloaded the "Community free version" and want to create a local DB for showing my family tree , but ...

1) how do I create the DB-file
2) where do I import commands in a TXT-file - command for creating PERSONS and RELATIONS - I have the commands:
                     
                      BEGIN
                      create n={id:'1', name:'Amada Emory', type:'Female'};
                      ... ect
                      match (from {id:1}), (to {id:11}) create from-[:MOTHER_OF]->to;
                      ... ect
                      COMMIT

3) How to insure that AUTO-INDEXING is enabled



Michael Hunger

unread,
Oct 19, 2017, 4:16:06 PM10/19/17
to ne...@googlegroups.com
I think you found a very old example. Use Neo4j Desktop 0.5.0 instead from this page: https://neo4j.com/download/other-releases/

It's easiest to use LOAD CSV to load data from a CSV file. Put them in the import directory of your database.

LOAD CSV WITH HEADERS FROM "file://people.csv" AS row
CREATE (p:Person {name:row.name, gender: row.gender, id: row.id});


LOAD CSV WITH HEADERS FROM "file://relationships.csv" AS row
MATCH (p1:Person {id: row.from})
MATCH (p2:Person {id: row.to})
CREATE (p1)-[:RELATED {type: row.type}]->(p2);



create constraint on (p:Person) assert p.id is unique;
create index on :Person(name);

Michael

--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages