Last active
October 5, 2015 20:17
-
-
Save caschwartz/2869559 to your computer and use it in GitHub Desktop.
Query retrieves multi-volume duplicate titles from both local schema metadata and MARCXML
This file contains hidden or 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 retrieves multi-volume duplicate titles for the his directory :) | |
| declare namespace ia = "http://my.server/my.directory"; | |
| declare namespace m = "http://www.loc.gov/MARC21/slim"; | |
| fn:distinct-values | |
| ( | |
| let $docs := xdmp:directory("/ia-xml/h/hi/his/", "infinity") | |
| for $doc in $docs | |
| let $title := $doc/ia:doc/ia:metadata/ia:title | |
| let $volumeInfo := $doc/ia:doc/ia:metadata/ia:marc/m:record/m:datafield[@tag = "300"]/m:subfield[@code = "a"] | |
| where fn:not(fn:matches($volumeInfo, "^1 v.")) and fn:contains($volumeInfo, "v.") or fn:contains($volumeInfo, "vol.") | |
| order by $title ascending | |
| return fn:normalize-space($title) | |
| ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment