Created
December 10, 2014 16:31
-
-
Save caschwartz/7355018722763e369327 to your computer and use it in GitHub Desktop.
Query to create zip files for the MODS documents in the dcweb database
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 | |
let $file := fn:substring-after($i,$directory) | |
let $part := <part>{$file}</part> | |
return $part | |
} | |
</parts> | |
let $pkg := xdmp:zip-create($manifest, ($parts)) | |
return xdmp:save("C:\temp\Summon\theocom8.zip", $pkg, | |
<options xmlns="xdmp:save"> | |
<encoding>utf8</encoding> | |
</options>) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Used this query to create batches of 10,000 MODS records for ProQuest Summon deliverables.