I posted my first question here and I should've posted in newbie section: Basics: Relationships of nodes where relationship info is the goal
I have a database copy log file and want to see where data went from original db to copies (...of copies of copies). First problem is importing the data, db IDs are fixed but names can change, so nodes are identified by ID but I want to display the name. Second problem is to show only most recent relationship: what data was last copied to that database since prior data was overwritten, and the relationship should show who copied the data on what date. Also I noticed neo4j doesn't like names to start with numbers, but names are arbitrary, and I also noticed a node can have multiple labels (maybe useful since an ID can have a different name later).
I'm pretty sure I'm on the wrong path:
- LOAD CSV WITH HEADERS FROM 'file:///desktop-csv-import/copy.csv' AS row
MERGE (s:SourceID {source_db_id: row.source_db_id})
RETURN count(s);
Added 24648 labels, created 24648 nodes, set 24648 properties, started streaming 1 records after 2467427 ms and completed after 2467427 ms.
Count 312324 - LOAD CSV WITH HEADERS FROM 'file:///desktop-csv-import/copy.csv' AS row
MERGE (t:TargetID {target_db_id: row.target_db_id})
RETURN count(t);
Count 312324
Added 38744 labels, created 38744 nodes, set 38744 properties, started streaming 1 records after 4096611 ms and completed after 4096611 ms. - LOAD CSV WITH HEADERS FROM 'file:///desktop-csv-import/copy.csv' AS row
MATCH (s:SourceID {source_db_id: row.source_db_id})
MATCH (t:TargetID {target_db_id: row.target_db_id})
MERGE (s)-[r:Copied_To]->(t)
RETURN count(*);
Count 312324
Created 59218 relationships, started streaming 1 records after 12145906 ms and completed after 12145936 ms. - create index on :TargetID (target_instance_id)
(Too late, and I should've started with a shortened file after that last 3.3hr job)
Can someone show me the proper steps to graphically show the data below? Sample csv below, real csv has 312,000 rows and a few more columns.
copy.csv
source_name,source_id,target_name,target_id,user_name,date,sys_created_on
Hollywood,52a99701310c785,Hollywooddev,904f897bf9619ac,Charlie,11/6/19 10:41,11/6/19 10:25
Dallas,51e7b2f5d3ee434,Dallasdev,16639cc0dfdc527,Eve,9/9/19 9:24,9/9/19 9:05
Indiana,75ff897bf9619ab,Indianauat,bf6d5b0cf96199e,Rupert,8/22/19 16:17,8/22/19 15:58
Indiana,75ff897bf9619ab,Indianadev,b2efba8bf961931,Rupert,8/15/19 16:30,8/15/19 16:11
Gilroy,51e7b2f5d3ee445,Gilroydev,51e7b2f5d3ee47d,Alice,7/22/19 2:00,7/22/19 1:34
20Dallas,51e7b2f5d3ee434,20Dallastest,a75a9cc5d3ee474,Eve,7/9/19 13:53,7/9/19 13:34
Clevelanddev,99959efe8da152e,Clevelandgroupllcdemo1,2e3f70fbf961974,Bob,7/1/19 10:22,7/1/19 10:20
Clevelanddev,99959efe8da152e,Clevelandgroupllcdemo3,264f70fbf9619e4,Bob,5/30/19 8:40,5/30/19 8:37
Clevelanddev,99959efe8da152e,Clevelandgroupllcdemo3,264f70fbf9619e4,Bob,5/24/19 8:30,5/24/19 8:23
20Dallas,51e7b2f5d3ee434,20Dallastest,a75a9cc5d3ee474,Eve,5/21/19 7:19,5/21/19 7:03
Clevelanddev,99959efe8da152e,Clevelandgroupllcdemo3,264f70fbf9619e4,Bob,5/6/19 11:30,5/6/19 11:28
Indiana,75ff897bf9619ab,Indianadev,b2efba8bf961931,Rupert,4/30/19 19:42,4/30/19 19:22
Barrington,f035d00cf96192a,Barringtondev,36ad5b0cf961906,Sybil,3/12/19 0:11,3/11/19 23:52
Indiana,75ff897bf9619ab,Indianauat,bf6d5b0cf96199e,Rupert,3/11/19 17:59,3/11/19 17:42
Indiana,75ff897bf9619ab,Indianadev,b2efba8bf961931,Kilo,3/4/19 14:08,3/4/19 13:55
Indiana,75ff897bf9619ab,Indianadev,b2efba8bf961931,Kilo,3/3/19 17:09,3/3/19 16:50
Barrington,f035d00cf96192a,Barringtondev,36ad5b0cf961906,Sybil,3/2/19 19:10,3/2/19 19:08
Indiana,75ff897bf9619ab,Indianauat,bf6d5b0cf96199e,Kilo,2/27/19 13:56,2/27/19 13:37
Indiana,75ff897bf9619ab,Indianauat,bf6d5b0cf96199e,Kilo,2/26/19 19:30,2/26/19 19:11