Skip to content

Commit

Permalink
update filters for crossroads -- more existential checking
Browse files Browse the repository at this point in the history
  • Loading branch information
CanOfBees committed May 10, 2017
1 parent 9e51b7b commit db25a2b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions serialize-crossroadsfreedom.xq
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/'))
Expand Down

0 comments on commit db25a2b

Please sign in to comment.