Skip to content

Instantly share code, notes, and snippets.

View EdWarga's full-sized avatar

Ed Warga EdWarga

  • Austin, TX
View GitHub Profile
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()
@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 })
@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 })
= The Life You Save May Be Your Own
== Modeling the Graph
//table
//graph
=== OUR DATASET
[source, cypher]
@EdWarga
EdWarga / roosevelt
Last active August 29, 2015 14:07 — forked from stardustnrust/roosevelt
= Roosevelt Family Geneology
== Modeling the Graph
//graph
=== OUR DATASET
[source, cypher]
@EdWarga
EdWarga / gist:513f2fddff7854542524
Created October 17, 2014 19:57
2014-10-17_XQueryGroup
http://try.zorba.io/queries/xquery/gWnUJ4xt9ULEECC8icTYp5zyCDA=
@EdWarga
EdWarga / ReplaceRefid.xq
Last active August 29, 2015 14:19
Replace value of all refids in collection with the normalized value
xquery version "3.0";
declare namespace vra="http://www.vraweb.org/vracore4.htm";
let $records := fn:collection("1941")
for $refid in $records//@refid
return

#Scholarly Communications ##Workshop Series (Fall 2015)

###Sessions: 9/11 18, 25; 10/2, 9, 23, 30; 11/6, 13 , 20; 12/4

###Introduction to GitHub as an Educational Technology ####Friday, September 11, 2015 Ramona Romero

@EdWarga
EdWarga / OAI_ListRecords
Created July 13, 2015 14:07
XQ to harvest OAI-PMH records $verb=ListRecords
xquery version "3.0";
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
declare namespace oai = "http://www.openarchives.org/OAI/2.0/";
declare namespace oai_dc = "http://www.openarchives.org/OAI/2.0/oai_dc/";
declare namespace qdc = "http://purl.org/dc/terms/";
declare function local:resume($base-url as xs:string, $token as xs:string) as document-node()
{
let $doc := fn:doc(($base-url || "?verb=ListRecords&resumptionToken=" || $token))
@EdWarga
EdWarga / Problem_dcCreator
Created July 14, 2015 01:02
OAI to CSV script in progress.
(:test record = "oai:dash.harvard.edu:1/11210576":)
xquery version "3.1";
declare namespace xsi = "http://www.w3.org/2001/XMLSchema-instance";
declare namespace oai = "http://www.openarchives.org/OAI/2.0/";
declare namespace oai_dc = "http://www.openarchives.org/OAI/2.0/oai_dc/";
declare namespace qdc = "http://purl.org/dc/terms/";
declare namespace dc = "http://purl.org/dc/elements/1.1/";