@@ -743,11 +743,19 @@ declare function wdt:sources($item as item()*) as map(*) {
743
743
else false ()
744
744
},
745
745
'filter' : function () as document-node ()* {
746
- $item/root ()[mei:manifestation][descendant::mei:titleStmt][not (descendant::mei:annot[@type ='no-ordinary-record' ])]
746
+ $item/root ()[mei:manifestation][descendant::mei:titleStmt][not (descendant::mei:annot[@type ='no-ordinary-record' ])] |
747
+ $item/root ()[descendant::tei:titleStmt/tei:title = 'WeGA, Textquellen, Digitale Edition' ]
747
748
},
748
749
'filter-by-person' : function ($personID as xs:string) as document-node ()* {
749
- if (config:is-person ($personID) or config:is-org ($personID)) then $item/root ()/descendant::mei:persName[@codedval = $personID][@role=('cmp' , 'lbt' , 'lyr' , 'aut' , 'trl' )][ancestor::mei:titleStmt]/root ()
750
- else if (config:is-work ($personID)) then $item/root ()/descendant::mei:identifier[.=$personID][@type = 'WeGA' ]/root () | $item/root ()/descendant::mei:relation[@target=concat ('wega:' , $personID)]/root ()
750
+ if (config:is-person ($personID) or config:is-org ($personID))
751
+ then
752
+ $item/root ()/descendant::mei:persName[@codedval = $personID][@role=('cmp' , 'lbt' , 'lyr' , 'aut' , 'trl' )][ancestor::mei:titleStmt]/root () |
753
+ $item/root ()/descendant::tei:titleStmt/tei:author[@key = $personID]/root ()
754
+ else
755
+ if (config:is-work ($personID))
756
+ then
757
+ $item/root ()/descendant::mei:identifier[.=$personID][@type = 'WeGA' ]/root () | $item/root ()/descendant::mei:relation[@target=concat ('wega:' , $personID)]/root () |
758
+ $item/root ()/descendant::tei:notesStmt/tei:relatedItem[@target=concat ('wega:' , $personID)]/root ()
751
759
else ()
752
760
},
753
761
'filter-by-date' : function ($dateFrom as xs:date?, $dateTo as xs:date?) as document-node ()* {
@@ -757,19 +765,20 @@ declare function wdt:sources($item as item()*) as map(*) {
757
765
$item
758
766
},
759
767
'init-collection' : function () as document-node ()* {
760
- crud:data-collection ('sources' )[descendant::mei:titleStmt][not (descendant::mei:annot[@type ='no-ordinary-record' ])]
768
+ crud:data-collection ('sources' )[descendant::mei:titleStmt][not (descendant::mei:annot[@type ='no-ordinary-record' ])] |
769
+ crud:data-collection ('sources' )[descendant::tei:titleStmt/tei:title = 'WeGA, Textquellen, Digitale Edition' ]
761
770
},
762
771
'init-sortIndex' : function () as item ()* {
763
772
()
764
773
},
765
774
'title' : function ($serialization as xs:string) as item ()? {
766
775
let $source :=
767
776
typeswitch ($item)
768
- case xs:string return crud:doc ($item)/mei:manifestation
769
- case xs:untypedAtomic return crud:doc ($item)/mei:manifestation
770
- case document-node () return $item/mei:manifestation
771
- default return $item/root ()/mei:manifestation
772
- let $title-element := ($source/mei:titleStmt/mei:title[not (@type )])[1 ]
777
+ case xs:string return crud:doc ($item)/*
778
+ case xs:untypedAtomic return crud:doc ($item)/*
779
+ case document-node () return $item/*
780
+ default return $item/root ()/*
781
+ let $title-element := ($source/mei:titleStmt/mei:title[not (@type )], $source//tei:titleStmt/tei:title[@level= 'a' ] )[1 ]
773
782
return
774
783
switch ($serialization)
775
784
case 'txt' return str:normalize-space (replace (string-join (str:txtFromTEI ($title-element, config:guess-language (())), '' ), '\s*\n+\s*(\S+)' , '. $1' ))
0 commit comments