Skip to content

Instantly share code, notes, and snippets.

@caschwartz
Last active May 19, 2017 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caschwartz/00921ba6d21b1623e6839f431e88ce1b to your computer and use it in GitHub Desktop.
Save caschwartz/00921ba6d21b1623e6839f431e88ce1b to your computer and use it in GitHub Desktop.
Query McIntire audio recordings to identify duplicates based on recording date
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