Created
April 7, 2014 19:16
-
-
Save caschwartz/10033581 to your computer and use it in GitHub Desktop.
XQuery - Query to add TYPE attributes for incomplete items
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"; | |
| (: 3/8/12 Query to add TYPE attributes for incomplete items in the kuyper-dl database :) | |
| declare namespace mets = "http://www.loc.gov/METS/"; | |
| declare namespace dc = "http://purl.org/dc/elements/1.1/"; | |
| fn:distinct-values( | |
| for $doc in fn:collection() | |
| let $id := $doc//dc:identifier[1] | |
| let $divs := $doc/mets:mets/mets:structMap//mets:div (: Will work with any div at any level in the hierarchy :) | |
| for $div in $divs | |
| where $div/@TYPE = "non-public-domain" | |
| order by fn:base-uri($doc) | |
| return fn:base-uri($doc)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment