This file contains 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
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
(: | |
for each person, show stage directions involving that | |
person | |
:) | |
<people-plus-stage-directions> | |
{ | |
for $person in //tei:person | |
(: using a map isn't required here, I don't think :) |
This file contains 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
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
(: for each actor, give a list of the scenes that they appear in :) | |
for $actor in //tei:div2[@type="scene"]//tei:sp/tei:speaker/tei:w | |
let $scene := concat($actor/ancestor::tei:div1/tei:head/normalize-space(.), ', ', $actor/ancestor::tei:div2/tei:head/normalize-space(.)) | |
group by $actor |
This file contains 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
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
(: give a scene list and for each actor, give a list of the scenes that they appear in :) | |
(: should do an intersect, union, except with the speaking role result set :) | |
<results> | |
{ | |
for $stage-direction in //tei:div2[@type="scene"]//tei:stage[@who] | |
let $actor-list := $stage-direction/@who | |
let $scenes := concat($stage-direction[. = tokenize(., '#| #')]/ancestor::tei:div1/tei:head/normalize-space(.), ', ', $stage-direction[. = tokenize(., '#| #')]/ancestor::tei:div2/tei:head/normalize-space(.)) | |
This file contains 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
(: | |
combine... | |
1 to 3 | |
"TEST" | |
"ING" | |
= | |
1, 2, 3 testing |
This file contains 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
declare namespace tei="http://www.tei-c.org/ns/1.0"; | |
<results> | |
{ | |
for $actor-list in //tei:stage/@who, | |
$actor in $actor-list/tokenize(., ' ') | |
group by $actor | |
order by $actor | |
return | |
<actor> { |
This file contains 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 mdc = "http://mdc"; | |
declare function mdc:add-check-digit-to-partial-barcode ($partial-barcode as xs:string) as xs:string { | |
(: the next two variables compute the Codabar barcode sum for 14-digit library barcodes according to the Luhn algorithm:) | |
let $barcode-sum := | |
(: add up the even sequence :) | |
sum(string-to-codepoints($partial-barcode)[position() mod 2 eq 0] ! xs:integer(codepoints-to-string(.))) | |
+ | |
(: add up the odd sequence :) |
This file contains 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 ead="urn:isbn:1-931666-22-9"; | |
declare namespace xlink = "http://www.w3.org/1999/xlink"; | |
<results> | |
{ | |
for $ead in ead:ead | |
let $doc := base-uri($ead) | |
return |
This file contains 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
<!-- i've been using this to sort top/circulating containers in EAD, but i need a way to do this in the ASpace staff/public interface, as well... | |
the gist is that boxes like 1, 2, 2a, 2b, 3, 4, should be able to be sorted in order, regardless of where they occur in a finding aid... and it should also use what ASpace calls container2 and container3 values for sorting if multiple components are displayed | |
... so component Y would sort before component X if component Y was box 12a, folder 22 and component X was box 12a, folder 29 | |
--> | |
<xsl:function name="mdc:container-to-number" as="xs:decimal"> | |
<xsl:param name="current-container" as="node()*"/> | |
<xsl:variable name="primary-container-number" select="replace($current-container, '\D', '')"/> | |
<xsl:variable name="primary-container-modify"> | |
<xsl:choose> | |
<xsl:when test="matches($current-container, '\D')"> |
This file contains 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
AppConfig[:record_inheritance] = { | |
:archival_object => { | |
:composite_identifiers => { | |
:include_level => true, | |
:identifier_delimiter => " ", | |
}, | |
:inherited_fields => [ | |
{ | |
:property => "title", | |
:inherit_directly => true |
This file contains 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
SELECT | |
r.id AS 'resource database id', | |
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(r.identifier, ',', '.'),'"',''),']',''),'[',''),'.null','') AS 'collection call number', | |
r.title, | |
r.publish, | |
r.repo_id, | |
r.ead_id, | |
r.finding_aid_author, | |
GROUP_CONCAT(DISTINCT extent.number, ' ', ev.value | |
SEPARATOR '; ') AS 'Extent', |
OlderNewer