Skip to content

Instantly share code, notes, and snippets.

@EdWarga
Created September 2, 2014 20:18
Show Gist options
  • Save EdWarga/23b068f8bf51f8200f14 to your computer and use it in GitHub Desktop.
Save EdWarga/23b068f8bf51f8200f14 to your computer and use it in GitHub Desktop.
Cyoher - load divinity data
--------------------------------------------
DIVINITY
LOAD NODES:
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Article-node.csv" AS csvLine
CREATE (a:Article { id: csvLine.ArtID, title: csvLine.Title, year: toInt(csvLine.PubYear) })
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Author-node.csv" AS csvLine
CREATE (p:Person { id: csvLine.AutID, name: csvLine.Author })
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Journal-node.csv" AS csvLine
CREATE (j:Journal { id: csvLine.JID, journal: csvLine.Journal, ISSN: csvLine.ISSN })
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Topic-node.csv" AS csvLine
CREATE (t:Topic { id: csvLine.TpcID, topic: csvLine.Topic })
---------------------------------------------------------------------------
LOAD RELATIONSHIPS:
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Author-rel.csv" AS csvLine
MATCH (person:Person {id: csvLine.AutID}),(article:Article { id: csvLine.ArtID})
CREATE person-[:WROTE]->article
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Journal-rel.csv" AS csvLine
MATCH (article:Article { id: csvLine.ArtID}),(journal:Journal { id: csvLine.JID})
CREATE article-[:PUBLISHEDIN]->journal
LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/EdWarga/VUIR-Data-Project/master/Divinity/Topic-rel.csv" AS csvLine
MATCH (article:Article {id: csvLine.ArtID}),(topic:Topic {id: csvLine.TpcID})
CREATE article-[:ISABOUT]->topic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment