Last active
May 19, 2017 15:38
-
-
Save caschwartz/00921ba6d21b1623e6839f431e88ce1b to your computer and use it in GitHub Desktop.
Query McIntire audio recordings to identify duplicates based on recording date
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 | |
where contains($title, "Twentieth Century Reformation Hour") | |
return $rec-date | |
return for $dup in functx:non-distinct-values($rec-dates) | |
order by $dup | |
return string($dup) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment