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/14/13 Query to locate the titleInfo elements that are commented out :) | |
declare namespace mods = "http://www.loc.gov/mods/v3"; | |
for $doc in xdmp:directory("/MODS/", "infinity") | |
let $comments := $doc/mods:modsCollection/mods:mods//comment() | |
for $comment in $comments |
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"; | |
(: 8/27/13 Query all headers in EAD documents and create a new text nodes with the colons removed using MarkLogic imperative function :) | |
declare namespace ead = "urn:isbn:1-931666-22-9"; | |
let $docs := xdmp:directory("/EAD/") | |
let $headers := $docs/ead:ead//ead:head | |
for $header in $headers | |
where fn:ends-with($header, ":") |
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"; | |
(: 8/6/13 Query to retrieve all exact duplicates title-date values (using one of Priscilla Walmsley's functx XQuery functions :) | |
declare namespace ia = "http://my.local.namespace"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
declare namespace functx = "http://www.functx.com"; | |
declare function functx:non-distinct-values | |
( $seq as xs:anyAtomicType* ) as xs:anyAtomicType* { |
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"; | |
(: 8/21/13 Query to list unique PTS collection names (taken from MARC 730 fields) :) | |
declare namespace ia = "http://my.local.namespace"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
(: Finds unique collection names other than Benson and Torrance :) | |
let $collNames := fn:distinct-values(for $doc in fn:collection()[1 to 10000] | |
let $marc := $doc/ia:doc/ia:metadata/ia:marc/m:record |
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/29/11 Query theocom documents for edition for works by John Calvin :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
for $doc in xdmp:directory("/ia-xml/8/", "infinity") | |
let $marc := $doc/ia:doc/ia:metadata/ia:marc/m:record |
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/19/12 Query theocom documents for edition statements and create <edition> elements :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
for $doc in xdmp:directory("/ia-xml/l/ly/", "infinity") | |
let $marc := $doc/ia:doc/ia:metadata/ia:marc/m:record |
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"; | |
(: 7/11/12 This query adds the @integer attribute to the <number> element :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
let $docs := xdmp:directory("/ia-xml/d/", "infinity") |
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"; | |
(: 8/6/12 Query to locate EAD documents that have a <controlaccess> element with subject headings. :) | |
declare namespace ead = "urn:isbn:1-931666-22-9"; | |
for $doc in xdmp:directory("/EAD/") | |
let $controlAccess := $doc/ead:ead/ead:archdesc/ead:controlaccess[2] (: Second controlaccess element contains subjects :) | |
let $title := $doc/ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt/ead:titleproper | |
return $controlAccess |
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/7/13 Query to add <dc:type> element to TEI documents in lectures database :) | |
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/"; | |
for $teiDoc in xdmp:directory("/TEI/", "infinity") | |
let $id := $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"; | |
(: 5/1/13 This query find and corrects problem names in the theocom database :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
for $doc in xdmp:directory("/ia-xml/h/hi/his/", "infinity") | |
let $name := $doc/ia:doc/ia:metadata/ia:name | |
let $newNameNode := <name xmlns="http://digital.library.ptsem.edu/ia">Goodspeed, Edgar J. (Edgar Johnson), 1871–1962</name> |