From db25a2baa264738abca1a1526a52c639d6c8c1c1 Mon Sep 17 00:00:00 2001 From: bridger Date: Wed, 10 May 2017 14:08:58 -0400 Subject: [PATCH] update filters for crossroads -- more existential checking --- serialize-crossroadsfreedom.xq | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/serialize-crossroadsfreedom.xq b/serialize-crossroadsfreedom.xq index ad9d232..620778f 100644 --- a/serialize-crossroadsfreedom.xq +++ b/serialize-crossroadsfreedom.xq @@ -7,12 +7,15 @@ let $target := '/tmp/repox-data/' let $coll := 'crossroadsfreedom' for $record in db:open($coll)/record - [every $t in metadata/oai_dc:dc/dc:title - satisfies $t[not(normalize-space(.) = '')]] - [every $r in metadata/oai_dc:dc/dc:rights - satisfies $r[not(normalize-space(.) = '')]] - [some $i in metadata/oai_dc:dc/dc:identifier - satisfies $i[starts-with(., 'http://')]]/metadata/oai_dc:dc + [(fn:exists(metadata/oai_dc:dc/dc:title)) and + (every $t in metadata/oai_dc:dc/dc:title + satisfies $t[not(normalize-space(.) = '')])] + [(fn:exists(metadata/oai_dc:dc/dc:rights)) and + (every $r in metadata/oai_dc:dc/dc:rights + satisfies $r[not(normalize-space(.) = '')])] + [(fn:exists(metadata/oai_dc:dc/dc:identifier)) and + (some $i in metadata/oai_dc:dc/dc:identifier + satisfies $i[starts-with(., 'http://')])]/metadata/oai_dc:dc let $file-full := functx:substring-after-last(db:path($record), ':') let $file := if (fn:contains($file-full, '/'))