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 "1.0-ml"; | |
(: 4/18/13 Query to find TEI documents lacking introductions and insert correct introductions based on year of lecture :) | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace localtei = "http://digital.library.ptsem.edu/lectures/tei"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
let $teiDocs := fn:collection() |
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 "1.0-ml"; | |
(: 4/18/13 Query to find TEI documents lacking biographies :) | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace localtei = "http://digital.library.ptsem.edu/lectures/tei"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
let $teiDocs := fn:collection() |
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 "1.0-ml"; | |
(: 4/17/13 Query to find TEI documents lacking biographies and insert correct biographies :) | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace localtei = "http://digital.library.ptsem.edu/lectures/tei"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
let $teiDocs := fn:collection() |
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 "1.0-ml"; | |
(: 3/27/13 Query the filesystem to add finalized PDFs to a MarkLogic database using the <dc:identfier> value for the filenames :) | |
declare namespace tei = "http://www.tei-c.org/ns/1.0"; | |
declare namespace localtei = "http://my.local.tei.customized.schema/tei"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
for $teiDoc in fn:collection() | |
let $newID := $teiDoc/tei:TEI/tei:teiHeader/localtei:metadata/dc:identifier |
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 "1.0-ml"; | |
(: 9/5/12 Query to add documents to the Benson collection :) | |
declare namespace ia = "http://my.local.namespace"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
for $doc in xdmp:directory("/ia-xml/", "infinity") | |
let $marcRecord := $doc/ia:doc/ia:metadata/ia:marc/m:record | |
let $collectionTitles := $marcRecord/m:datafield[@tag = "730"] |
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 "1.0-ml"; | |
(: 11/7/12 This query retrieves and replaces sort titles with punctuation at the beginning of the title :) | |
declare namespace ia = "http://my.namespace.uri"; | |
let $docs := xdmp:directory("/ia-xml/o/", "infinity") | |
let $sortTitles := $docs/ia:doc/ia:metadata/ia:sortTitle | |
for $sortTitle in $sortTitles | |
let $newSortTitle := fn:replace($sortTitle, "^\p{P}+\s*", "") |
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 "1.0-ml"; | |
(: 11/16/12 This query removes the final period from names :) | |
declare namespace ia = "http://my.local.namespace.name"; | |
let $docs := xdmp:directory("/ia-xml/i/", "infinity") | |
let $meta := $docs/ia:doc/ia:metadata | |
for $name in $meta/ia:name | |
let $newNameNode := if (fn:matches($name, "[a-zA-Z]\.\s*$")) then (: keeps final period for names with initials, titles, etc. :) |
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 "1.0-ml"; | |
let $query := 'cts:uris()' | |
let $options := | |
<options xmlns="xdmp:eval"> | |
<database>{ xdmp:database("my.database") }</database> | |
</options> | |
let $theocomURIs := xdmp:eval($query, (), $options) | |
let $dcwebURIs := cts:uris("/theocom/ia-xml/")[70001 to 80000] | |
for $dcwebURI in $dcwebURIs |
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 "1.0-ml"; | |
(: 6/4/12 This query constructs a <volumeInfo> element using part of the IA ID for the <volume> value. :) | |
declare namespace ia = "http://my.server/my.directory"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
let $docs := xdmp:directory("/ia-xml/l/lv/", "infinity") | |
for $doc in $docs |
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 "1.0-ml"; | |
(: 5/31/12 This query adds identifiers to <volumeInfo> elements :) | |
declare namespace ia = "http://my.server/my.directory"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
let $docs := xdmp:directory("/ia-xml/f/", "infinity") | |
let $titles := $docs/ia:doc/ia:metadata/ia:title |