diff --git a/res/xml/xquery/series.xq b/res/xml/xquery/series.xq index 51c3b6b..481ad0b 100644 --- a/res/xml/xquery/series.xq +++ b/res/xml/xquery/series.xq @@ -1,65 +1,6 @@ xquery version "3.1"; -declare namespace tei = "http://www.tei-c.org/ns/1.0"; - - - -{ - for $book in collection('/db/xml_files/publications') - let $series := $book//tei:seriesStmt/tei:title/text() - let $number := xs:int($book//tei:seriesStmt/tei:idno/text()) - let $maintitle := $book//tei:titleStmt/tei:title[@type = 'main']/node() - let $subtitle := $book//tei:titleStmt/tei:title[@type = 'sub']/node() - let $mainlanguage := xs:string($book//tei:profileDesc/tei:langUsage/tei:language/@ident) - let $coverimage := $book//tei:text/tei:front/tei:figure[@type = 'cover']/tei:graphic/@url - let $date := xs:date($book//tei:publicationStmt/tei:date/@when) - let $abstract := $book//tei:profileDesc/tei:abstract[@n = 'brief']/tei:p - let $authororeditor := $book//tei:fileDesc/tei:titleStmt/(tei:editor[@role = 'volumeeditor'] | tei:author)[1]/name() - order by $series, $number - return - - { concat("/", lower-case($series), "/", $number, "/", $coverimage) } - { $mainlanguage } - - { $series } - { $number } - - - { - let $pehere := $book//tei:fileDesc/tei:titleStmt/(tei:editor[@role = 'volumeeditor'] | tei:author) - for $pp in $pehere - let $localname := xs:string($book/*//tei:respStmt[@xml:id = substring-after($pp/@ref, "#")]/tei:persName/@xml:lang) - let $localid := xs:string($pp/@key) - let $inbookid := xs:string($book/*//tei:respStmt[@xml:id = substring-after($pp/@ref, "#")]/@xml:id) - let $firstname := - $book/*//tei:respStmt[@xml:id = substring-after($pp/@ref, "#")]/tei:persName/tei:forename/node() - let $lastname := - $book/*//tei:respStmt[@xml:id = substring-after($pp/@ref, "#")]/tei:persName/tei:surname/node() - return - { - if ($localname = "zh") then - (concat($lastname, ' ', $firstname)) - else - (concat($firstname, ' ', $lastname)) - } - { $firstname } - { $lastname } - { $inbookid } - - } - - { $maintitle } - { normalize-space($subtitle) } - { $date } - { $abstract } - - -} - -xquery version "3.1"; - - declare namespace tei = "http://www.tei-c.org/ns/1.0";