//One way to "clean the slate" in Neo4j before importing (run both lines):
match (a)-[r]->() delete a,r
match (a) delete a
//Script to Import Data Set: test.csv (simple road network)
//For Windows use something like the following
//[NOTE: replace any spaces in your path with %20, "percent twenty" ]
LOAD CSV WITH HEADERS FROM "file:///C:/coursera/data/test.csv" AS line
MERGE (n:MyNode {Name:line.Source})
MERGE (m:MyNode {Name:line.Target})
MERGE (n) -[:TO {dist:line.distance}]-> (m)
//For mac OSX use something like the following
//[NOTE: replace any spaces in your path with %20, "percent twenty" ]
LOAD CSV WITH HEADERS FROM "file:///coursera/data/test.csv" AS line
MERGE (n:MyNode {Name:line.Source})
MERGE (m:MyNode {Name:line.Target})
MERGE (n) -[:TO {dist:line.distance}]-> (m)
//Script to import global terrorist data
LOAD CSV WITH HEADERS FROM "file:///Users/jsale/sdsc/coursera/data/terrorist_data_subset.csv" AS row
MERGE (c:Country {Name:row.Country})
MERGE (a:Actor {Name: row.ActorName, Aliases: row.Aliases, Type: row.ActorType})
MERGE (o:Organization {Name: row.AffiliationTo})
MERGE (a)-[:AFFILIATED_TO {Start: row.AffiliationStartDate, End: row.AffiliationEndDate}]->(o)
MERGE(c)<-[:IS_FROM]-(a);