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"; | |
(: 8/29/18 Query used to add three attributes: type, integer, and id to new <relatedNumber> element :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
for $doc in collection("pts-journals") | |
let $vol-info := $doc/ia:doc/ia:metadata/ia:relatedItem/ia:volumeInfo | |
let $volume := $vol-info/ia:volume |
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"; (: Delete/change XQuery version declaration if not a MarkLogic user :) | |
import module namespace functx = "http://www.functx.com" at "/MarkLogic/functx/functx-1.0-nodoc-2007-01.xqy"; | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
let $rec-dates := | |
for $doc in collection("media-available") | |
let $title := $doc/ia:doc/ia:metadata/ia:title | |
let $rec-date := $doc/ia:doc/ia:metadata/ia:recordingDate |
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
(: 11/23/11 Cliff's Code - Sequential Article ID's :) | |
xquery version "1.0-ml"; | |
declare namespace mets = "http://www.loc.gov/METS/"; | |
for $doc in xdmp:directory("/METS/") | |
let $dmdSecs := | |
for $dmdSec in $doc/mets:mets/mets:dmdSec | |
where $dmdSec//*:type = "Article" |
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"; | |
(: 2/23/11 Use MarkLogic function cts:uris to find irregular call numbers in the 090 field of MARCXML :) | |
declare namespace ia = "http://my.server/my.directory"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
let $uris := cts:uris((), "ascending") | |
for $uri in $uris[fn:position() = (50001 to fn:last())] |
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"; | |
(: 12/1/11 Adds "sort" element to dmdSec of METS documents for issue numbers :) | |
declare namespace sort = "http://my.server/my.directory"; | |
declare namespace mets = "http://www.loc.gov/METS/"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
for $journal in xdmp:directory("/METS/")/mets:mets/mets:dmdSec[2]/mets:mdWrap/mets:xmlData | |
let $title := $journal/dc:format |
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"; | |
(: 12/1/11 Adds "sort" elements to dmdSec of METS documents for volume and issue numbers :) | |
declare namespace sort = "http://my.local.namespace/sort"; | |
declare namespace mets = "http://www.loc.gov/METS/"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
for $journal in xdmp:directory("/METS/")/mets:mets/mets:dmdSec[2]/mets:mdWrap/mets:xmlData | |
let $title := $journal/dc:format |
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/13/11 Working on browse book title list for Digital Library of AK :) | |
declare namespace METS = "http://www.loc.gov/METS/"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
declare namespace html = "http://www.w3.org/1999/xhtml"; | |
let $collection := fn:collection() | |
let $first-section := $collection/METS:mets/METS:dmdSec[1] |
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
(: Check for copy numbers in the items record :) | |
declare function mpm:get-copy-info($seq as xs:integer) | |
as node()* | |
{ | |
let $records := xdmp:directory(concat("/Monographs/", $seq, "/"), "infinity") | |
let $items := $records/holdings/institution/holding/item (: May be more than one item record :) | |
for $item in $items | |
let $copy-info := $item/itemData[@name = "copy"] | |
return $copy-info | |
}; |
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"; | |
(: 1/6/14 Using Priscilla Walmsley's function, this query puts the root node and all descendant elements in the MARCXML namespace :) | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
declare namespace functx = "http://www.functx.com"; | |
declare function functx:change-element-ns-deep | |
( $nodes as node()* , | |
$newns as xs:string , |
NewerOlder