Skip to content

Commit

Permalink
Fix cardinality error for metrics:update-sitelinks
Browse files Browse the repository at this point in the history
  • Loading branch information
cmil committed Apr 19, 2024
1 parent cde34e3 commit 60bc474
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/metrics.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ declare function metrics:update-sitelinks(
$id as xs:string,
$collection as xs:string
) {
if ($id) then
if ($id ne "") then
let $log := util:log-system-out('querying sitelinks for ' || $collection)
let $sitelinks := <sitelinks id="{$id}" updated="{current-dateTime()}">{
for $uri in wd:get-sitelinks($id)
Expand All @@ -48,7 +48,9 @@ declare function metrics:update-sitelinks($url as xs:string) {
let $p := dutil:filepaths($url)
let $doc:= dutil:get-doc($p?corpusname, $p?playname)
let $id := dutil:get-play-wikidata-id($doc/tei:TEI)
return metrics:update-sitelinks($id, $p?collections?play)
return if ($id) then
metrics:update-sitelinks($id, $p?collections?play)
else ()
};

(:~
Expand Down

0 comments on commit 60bc474

Please sign in to comment.