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/26/12 Query to replace ORDER attribute numbers for third-level divs in structMap :) | |
declare namespace mets = "http://www.loc.gov/METS/"; | |
declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
let $divsNumTwo := let $doc := fn:doc("/new-divs/Kuyper365-370.xml") |
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"; | |
(: 5/23/12 This query retrieves all duplicate titles (with multiple volumes) from MARCXML records in database :) | |
declare namespace ia = "http://my.server/my.directory"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
fn:distinct-values( |
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/2/12 Use MarkLogic function cts:uris to query 730 fields for local collection headings in embedded MARCXML :) | |
declare namespace ia = "http://my.server/my.directory"; | |
declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
let $values := fn:distinct-values(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"; | |
(: 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"; | |
(: 3/8/12 Query to add TYPE attributes for incomplete items in METS documents :) | |
declare namespace mets = "http://www.loc.gov/METS/"; | |
let $doc := fn:doc("/METS/Kuyper128.xml") | |
let $seriesNum := "128" (: Series number for incomplete items :) | |
let $divs := $doc/mets:mets/mets:structMap//mets:div (: Will work with any div at any level in the hierarchy :) |
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"; | |
(: Query language elements in MODS documents and XML version of Library of Congress MARC Code List for Languages :) | |
declare namespace mods = "http://www.loc.gov/mods/v3"; | |
declare namespace cd = "info:lc/xmlns/codelist-v1"; | |
let $docs := xdmp:directory("/mods/", "infinity") | |
for $doc in fn:subsequence($docs, 1, 4)//mods:mods/mods:language | |
let $text := fn:doc("/marc-languages.xml")/cd:codelist/cd:languages/cd:language[cd:code = $doc/mods:languageTerm]/cd:name |
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/8/11 Query Endnote xml and split into separate files :) | |
declare namespace functx = "http://www.functx.com"; | |
declare function functx:pad-integer-to-length | |
( $integerToPad as xs:anyAtomicType? , | |
$length as xs:integer ) as xs:string { | |
if ($length < string-length(string($integerToPad))) |
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
(: 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" |
OlderNewer