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
(: 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"; | |
(: 12/5/13 Query newly imported Benson collection books for volume information :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
<hits>{ | |
for $doc in fn:collection("Benson")[1 to 1000] | |
let $title := fn:normalize-space($doc/ia:doc/ia:metadata/ia:title) |
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/20/14 Query to get a list of URIs from the dcweb database and delete .DS_Store files :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
for $uri in cts:uris() | |
where contains($uri, "._.DS_Store") or contains($uri, ".DS_Store") or matches($uri, "\._") |
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"; | |
(: | |
: This main module queries basic Tanis postcards metadata for IA to create a | |
: CSV file to import into Excel. For Excel import, quotation marks are needed | |
: if value could contain a comma. Needed quotes for Title, Location, and Postcard-type. | |
:) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
declare namespace m = "http://www.loc.gov/mods/v3"; |
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"; | |
(: This query finds properties information :) | |
declare namespace ia = "http://my.namespace/ia"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
for $doc in fn:collection() | |
let $property := fn:QName("", "metadata-editor-reviewed-by") |
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/18/14 Normalize authors for Bollettino della Società di studi valdesi in Theological Commons to the society's currently used form of name :) | |
declare namespace ia = "http://digital.library.ptsem.edu/ia"; | |
for $doc in xdmp:directory("/ia-xml/b/", "infinity") | |
let $name := $doc/ia:doc/ia:metadata/ia:name | |
where fn:contains($name, "Société d'histoire vaudoise") |
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 $directory := "/theocom/" | |
let $uris := cts:uris("","document",cts:directory-query($directory,"infinity"))[70001 to 80000] | |
let $parts := (for $i in $uris let $x := fn:doc($i) return $x) | |
let $manifest := <parts xmlns="xdmp:zip"> | |
{ | |
for $i in $uris |
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"; | |
(: 10/9/14 Query accessions database to correct the location of the xml schema document for validation :) | |
declare namespace arch = "http://www.inmagic.com/webpublisher/query"; | |
for $doc in fn:collection() | |
let $oldAttributeNode := $doc/arch:Record/@xsi:schemaLocation | |
let $schemaLoc := $doc/arch:Record/@xsi:schemaLocation/fn:string() | |
where $schemaLoc |
NewerOlder