Skip to content

Commit

Permalink
modify serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
CanOfBees committed May 10, 2017
1 parent 9e51b7b commit 47b8fe3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions add-country-qdc-to-db-cmhf-correct.xq
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ for $record in $response//oai:record
let $id := $record/oai:header/oai:identifier/text()
return(
(: db:replace('cmhf', $record, $id, map { 'addcache': true() }) :)
db:add('cmhf-with-db-add', $record, $id, map { 'addcache': true() }),
db:optimize('cmhf-with-db-add', true(), map { 'textindex': true(), 'attrindex': true(), 'tokenindex': true(), 'ftindex': true() })
db:add('country_qdc', $record, $id, map { 'addcache': true() }),
db:optimize('country_qdc', true(), map { 'textindex': true(), 'attrindex': true(), 'tokenindex': true(), 'ftindex': true() })
)
17 changes: 10 additions & 7 deletions serialize-crossroadsfreedom.xq
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import module namespace functx = 'http://www.functx.com';
declare namespace oai_dc = "http://www.openarchives.org/OAI/2.0/oai_dc/";
declare namespace dc = "http://purl.org/dc/elements/1.1/";

let $target := '/tmp/repox-data/'
let $target := '/tmp/'
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 47b8fe3

Please sign in to comment.