This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
for $person in /json/_ | |
let $pm:= $person/names/_/sort_name | |
let $uri:= $person/uri | |
let $source:= $person/names/_/source | |
return | |
<r> | |
<u>{data($uri)}</u> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
exclude-result-prefixes="xs" | |
version="2.0"> | |
<!-- this stylesheet will take the output of an oai feed and select every 80th record --> | |
<xsl:template match="@*|node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, csv, json, urllib, time | |
#to take csv with n columns, and output two columns per row, column 0 and column n | |
with open('toSplit.txt', 'rb') as csvfile: | |
reader = csv.reader(csvfile, delimiter='|', quotechar='"') | |
for row in reader: | |
collection = str(row[0]) | |
#for multiple length csvs, could call len here to define n | |
n = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
declare namespace marc="http://www.loc.gov/MARC21/slim"; | |
(: This xquery will pull all language information from the raw ArchivesSpace MARC output from the OAI feed :) | |
<results> | |
{ | |
for $MarcRecord in /repository/record/metadata/marc:collection/marc:record | |
let $rec := $MarcRecord |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.0"; | |
for $resource in /json/_ | |
(: let $label := $resource/notes/_/label[contains(., 'Summary')] | |
let $type := $resource/notes/_/type[contains(., 'scopecontent')] :) | |
(: let $label := $resource/notes/_/label[contains(., 'Scope')]:) | |
let $type := $resource/notes/_/type[../label[contains(., 'Scope') or contains(., 'Summary')]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ead="urn:isbn:1-931666-22-9" xmlns:xlink="http://www.w3.org/1999/xlink"> | |
<xsl:strip-space elements="ead:*" /> | |
<xsl:output method="text" indent="no" encoding="utf-8" standalone="yes"/> | |
<xsl:variable name="delimiter" select="'|'" /> | |
<xsl:variable name="quote" select="'"'" /> | |
<xsl:variable name="eol" select="' '" /> | |
<xsl:variable name="startlevel" select="1" /> | |
<xsl:variable name="collprefix" select="lower-case(substring-before(ead:ead/ead:archdesc/ead:did/ead:unitid, '.'))" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:ead="urn:isbn:1-931666-22-9" | |
exclude-result-prefixes="xs" | |
version="2.0"> | |
<xsl:output omit-xml-declaration="yes"/> | |
<xsl:template match="ead:ead"> | |
<xsl:for-each select="//ead:c[@level='file']"> | |
<xsl:value-of select="//ead:eadid"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import csv | |
import os | |
#function that takes a series of data formatted date, start time, end time and returns max simultaneous calls | |
def maximumOverlap(calls): | |
times = [] | |
for call in calls: | |
date, startTime, endTime = call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
{ | |
for $Record in /ead | |
where $Record/archdesc/dsc//did/unitdate[not(normalize-space(.))] | |
let $id := $Record/archdesc/did/unitid[@type='clio']/text() | |
let $repo := $Record/archdesc/did/unitid[1]/@repositorycode | |
let $didEmptyTitle := $Record/archdesc/dsc//did/unitdate[not(normalize-space(.))] | |
return |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
exclude-result-prefixes="xs" | |
version="2.0"> | |
<xsl:template match="/"> | |
<xsl:for-each select="c[@level='series']/c[@level='file']"> | |
<xsl:sort select="did/unittitle"/> | |
<xsl:copy-of select="."/> | |
</xsl:for-each> |
OlderNewer