Skip to content

Instantly share code, notes, and snippets.

View EdWarga's full-sized avatar

Ed Warga EdWarga

  • Austin, TX
View GitHub Profile
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"
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
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 dc = "http://purl.org/dc/elements/1.1/";
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 8 columns, instead of 4. in line 4.
recordIdentifier,creator,date,title,subject,publisher,language,type
oai:DiscoverArchive.Vanderbilt.edu:1803/5594,"Thomas, Randall S., 1955-; Palmiter, Alan R.; Cotter, James F.",2012,Dodd-Frank's Say on Pay: Will It Lead to a Greater Role for Shareholders in Corporate Governance?,Dodd-Frank; corporate governance; executive compensation,Cornell Law Review; http://www.lawschool.cornell.edu/research/cornell-law-review/,en_US,Article
oai:DiscoverArchive.Vanderbilt.edu:1803/5596,"Bressman, Lisa Schultz",2009,Chevron's Mistake,Canons of construction; Statutory interpretation; Judicial Review; Delegation; Administrative law,Duke Law Journal,en_US,Article
oai:DiscoverArchive.Vanderbilt.edu:1803/5597,"Gervais, Daniel J., 1963-",2005,"Intellectual Property, Trade & Development: The State of Play",intellectual property rights; international trade; economic development; TRIPS agreement,Fordham Law Review,en_US,Article
oai:DiscoverArchive.Vanderbilt.edu:1803/5599,"Maroney, Terry A.",2011,Adolescent Brain Science After Gra
xquery version "3.1";
fetch:text("
http://www.worldcat.org/webservices/catalog/search/opensearch?q=[SEARCH TERMS];wskey=[KEY]")
TEI
teiHeader
fileDesc
titleStmt
title
author
respStmt
resp
name
sponsor
<terms>
<term>
<path>date</path>
<facet>date</facet>
</term>
</terms>
xquery version "3.1";
(: Produces facets dynamically by applying a config file ('facets.xml')
to a book list ('books.csv') :)
declare function local:build-facet ($books as element()*, $path as xs:string, $name as xs:string) as element(facet)?
{
let $facets :=
for $book in $books
group by $facet :=
@EdWarga
EdWarga / CFRegisterToCSV.xq
Created December 11, 2015 17:48
Convert CFRegister Data to CSV
xquery version "3.1";
declare namespace xpf = "http://www.w3.org/2005/xpath-functions";
(: Connects to the Comédie Française registers, converts JSON data to XML, and (optionally) persists documents to BaseX database :)
(:Based on https://gist.github.com/CliffordAnderson/d8ee47849964f75030e9:)
declare function local:convert-play($map as element()) as element()
{
element play {
attribute id {$map/xpf:number[@key="id"]/text()},
name
"A'Hearn, Michael F."
"ADANI, FLAVIA"
"Aach, John"
"Aad, G."
"Aaltonen, Titta"
"Aaron, Daniel"
"Aarts, Henk"
"Abad, G. G."
"Abadie, Alberto"