What is a good way to load a csv structured like this
I have a csv file structured like this (see below)
The graph we need should look like this;
E1 has two locations Loc1 and Loc2, E2 and E3 have one shared location, Loc3.
Each location has attributes, but they are defined across multiple rows in the incoming csv file. which is the problem..
I need to use APOC, since the labels of the nodes (environments and locations) come from the underlying csv file.
So, how do I combine values (attributeNames) across multiple rows into a single node and have them be the correct types (int, string, timestamp, etc.) with APOC.
See what I am asking?
Then we have to bind nodes together and the destination nodes are defined in the attributes.. think Primary and Foreign keys.. Elements can have an unknown number of destination (foreign) keys.
Can all this be done in a script ? Or do I have to write an engine to figure all this out and do it through Neo4j Transactions?
Example CSV File:
environment,location,attributeName,dataType
E1,Loc1,Loc1PrmKey,primKey
E1,Loc1,Loc2PrmKey,forKey
E1,Loc1,attNameA,int
E1,Loc1,attNameB,string
E1,Loc1,attNameC,timeStamp
E1,Loc2,Loc2PrmKey,primKey
E1,Loc2,Loc3PrimKey,forKey
E1,Loc2,attNameX,string
E1,Loc2,attNameY,string
E2,Loc3,Loc3PrimKey,primKey
E2,Loc3,attNameA,int
E3,Loc3,attNameC,timeStamp