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.1";
declare namespace oai = "http://www.openarchives.org/OAI/2.0/";
(: Retrieves metadata records for an entire OAI-PMH collection :)
(: Adds records to BaseX database:)
declare function local:request($base-url as xs:string, $verb as xs:string, $set-spec as xs:string) as document-node()*
{
let $request := $base-url || $verb
name
"A'Hearn, Michael F."
"ADANI, FLAVIA"
"Aach, John"
"Aad, G."
"Aaltonen, Titta"
"Aaron, Daniel"
"Aarts, Henk"
"Abad, G. G."
"Abadie, Alberto"
recordIdentifier, creatorID
oai:dash.harvard.edu:1/2031670,"Shieber, Stuart"
oai:dash.harvard.edu:1/2019322,"Shieber, Stuart"
oai:dash.harvard.edu:1/2031713,"Marks, Joe"
oai:dash.harvard.edu:1/2031713,"Shieber, Stuart"
oai:dash.harvard.edu:1/2031713,"Johari, Ramesh"
oai:dash.harvard.edu:1/2031713,"Partovi, Ali"
oai:dash.harvard.edu:1/2026618,"Shieber, Stuart"
oai:dash.harvard.edu:1/2027194,"Hobbs, Jerry"
oai:dash.harvard.edu:1/2027194,"Shieber, Stuart"
@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/";
@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))

#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 / 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
@EdWarga
EdWarga / gist:513f2fddff7854542524
Created October 17, 2014 19:57
2014-10-17_XQueryGroup
http://try.zorba.io/queries/xquery/gWnUJ4xt9ULEECC8icTYp5zyCDA=
@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]
= The Life You Save May Be Your Own
== Modeling the Graph
//table
//graph
=== OUR DATASET
[source, cypher]