Skip to content

Commit

Permalink
constrain $docsAuthor to "real" others
Browse files Browse the repository at this point in the history
and exclude places and other entities
  • Loading branch information
peterstadler committed Jun 6, 2024
1 parent 0bebbab commit 8c1f9f3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/wdt.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,16 @@ declare function wdt:backlinks($item as item()*) as map(*) {
},
'filter-by-person' : function($personID as xs:string) as document-node()* {
let $docsAuthor :=
(: currently, can't use core:getOrCreateColl() because of performance loss :)
crud:data-collection('letters')//tei:*[contains(@key, $personID)][ancestor::tei:correspAction][not(ancestor-or-self::tei:note)]/root() |
crud:data-collection('writings')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('news')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('thematicCommentaries')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('documents')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('works')//mei:persName[@codedval = $personID][@role=('cmp', 'lbt', 'lyr', 'aut', 'trl')][ancestor::mei:fileDesc]/root()
if(wdt:personsPlus($personID)?check()) (: see https://github.com/Edirom/WeGA-WebApp/issues/466 :)
then
(: currently, can't use core:getOrCreateColl() because of performance loss :)
crud:data-collection('letters')//tei:*[contains(@key, $personID)][ancestor::tei:correspAction][not(ancestor-or-self::tei:note)]/root() |
crud:data-collection('writings')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('news')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('thematicCommentaries')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('documents')//tei:author[@key = $personID][ancestor::tei:fileDesc]/root() |
crud:data-collection('works')//mei:persName[@codedval = $personID][@role=('cmp', 'lbt', 'lyr', 'aut', 'trl')][ancestor::mei:fileDesc]/root()
else ()
let $docsMentioned :=
crud:data-collection('letters')//tei:*[contains(@key,$personID)][not(ancestor::tei:publicationStmt)]/root() |
crud:data-collection('diaries')//tei:*[contains(@key,$personID)]/root() |
Expand Down

0 comments on commit 8c1f9f3

Please sign in to comment.