I'm scoping out Neo4j on the possibility that we might eventually deploy graph databases at work. Though I've not had much trouble following the tutorials, somehow I can't seem to make a simple graph with three barebones csv files.
Here's my region data.
My division data looks almost exactly the same.
Here's my relationship data.
The first two .csv files I loaded with:
LOAD CSV WITH HEADERS FROM 'file:///location_dim.csv' AS row
WITH row.REGION_NM AS REGION_NM
CREATE (n {reg: REGION_NM})
return n
and:
LOAD CSV WITH HEADERS FROM 'file:///divs.csv' AS node
WITH node.DIVISION_NM AS DIVISION_NM
CREATE (n {div: DIVISION_NM})
return n
The relationship I loaded in with:
LOAD CSV WITH HEADERS FROM 'file:///reg_div_rel.csv' AS rels
match (from {id: rels.REG}), (to {id: rels.DIV})
create (from)-[:REL {type: rels.`RELATIONSHIP`}]->(to)
return from, to
For the most part this is all taken from tutorials, but isn't working for me. There are two problems.
First, the data load just fine but the nodes aren't labeled.
And second, when I load in the relationships nothing actually happens.
What I want is a graph with region nodes, and region nodes with division nodes hanging off of them where indicated.
Unfortunately I haven't kept a record of every experiment I've tried, but I've altered the syntax in various small ways (not returning anything, using create (from)-[:hasDiv}]->(to) instead of create (from)-[:REL {type: rels.RELATIONSHIP
}]->(to), etc.)
I've also read a non-trivial amount of the documentation and searched the forums for threads.
Any advice?