Skip to content

Instantly share code, notes, and snippets.

View EdWarga's full-sized avatar

Ed Warga EdWarga

  • Austin, TX
View GitHub Profile
@EdWarga
EdWarga / gist:23b068f8bf51f8200f14
Created September 2, 2014 20:18
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 })
@EdWarga
EdWarga / gist:7db9fa0c33fe2045bf41
Created September 2, 2014 18:06
Cypher load querries for Law data
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/EdWarga/cc1c28bd4cea6f54ca2d/raw/228561253c6a8c900f151127828bf5f819a6dddd/authors.csv" AS csvLine
CREATE (p:Person { id: toInt(csvLine.authID), name: csvLine.author })
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/EdWarga/afbab50905eb285a764e/raw/387e03f89ccce08361567075a26d2a31998dcc59/articles.csv" AS csvLine
CREATE (a:Article { id: toInt(csvLine.articleID), handle: csvLine.handle, title: csvLine.title, datePublished: csvLine.date, journal: csvLine.journal })
LOAD CSV WITH HEADERS FROM "https://gist.githubusercontent.com/EdWarga/d2f520e20ec9436da525/raw/b9d96ea1a86c39afc548779a71c4d02132079614/lcsh.csv" AS csvLine
CREATE (s:Subject { id: toInt(csvLine.subID), subject: csvLine.lcsh })
xquery version "3.0";
declare namespace xsi="http://www.w3.org/2001/XMLSchema-instance";
declare namespace mods="http://www.loc.gov/mods/v3";
let $doc := fn:doc("/db/Divinity/MODS-JournalArticles-2014-05-21.xml")
let $modsCollection := $doc/mods:modsCollection/mods:mods
let $journal := $modsCollection/mods:relatedItem/mods:titleInfo[fn:not(@type)]/mods:title/text()