Commit 519e4d6f authored by mrodzis's avatar mrodzis 🌎
Browse files

Make new draft for persons' index

parent efb7b8b6
......@@ -52,7 +52,21 @@ declare variable $index-info:place-map :=
declare variable $index-info:psn-map :=
map:merge(for $entry in doc("/db/sade-projects/textgrid/data/xml/data/253sx.xml")//*[self::tei:person or self::tei:personGrp]
return
let $same-as := $entry/ancestor::tei:listPerson//tei:person[not(@xml:id)][descendant::tei:ptr[contains(@target, $entry/@xml:id)]]/tei:persName
(: let $works-created-ids := $entry//tei:link[@corresp = "http://purl.org/dc/terms/creator"]/@target/string():)
(: let $works-created :=:)
(: for $id in $works-created-ids:)
(: let $id :=:)
(: if(matches($id, " ")) then:)
(: substring-before($id, " "):)
(: => substring-after(":"):)
(: else:)
(: substring-after($id, ":"):)
(: return:)
(: doc("/db/sade-projects/textgrid/data/xml/data/253t3.xml")//tei:item[@xml:id = $id]/tei:name:)
(: let $works-created := string-join($works-created, "++"):)
return
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:persName[not(@type)], ", "),
......@@ -61,7 +75,8 @@ declare variable $index-info:psn-map :=
"occupation" : string($entry/tei:occupation),
"occs-in-nbs" : "",
"relation-to-fontane" : string($entry/tei:state/tei:desc),
"same-as" : string-join($entry/ancestor::tei:listPerson//tei:person[not(@xml:id)][descendant::tei:ptr[contains(@target, $entry/@xml:id)]]/tei:persName, "+")
"same-as" : string-join($same-as, "+")
(: "creator-of" : string($works-created):)
}
));
......
......@@ -683,7 +683,10 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
fontaneSimple:make-index-infos($node, $index-type),
fontaneSimple:transform($node/node(), $uri)
},
text{" "})
if(not($node//tei:abbr/text()[ends-with(., ":")])) then
text{" "}
else
())
else
()
......@@ -913,6 +916,7 @@ as xs:boolean {
declare function fontaneSimple:make-index-infos($node as element(tei:rs),
$index-type as xs:string) as element()* {
let $bla := util:log-system-out($node)
let $refs := tokenize($node/@ref, " ")
let $no-of-refs := count($refs)
return
......@@ -957,6 +961,12 @@ $index-type as xs:string) as element()* {
let $same-as := index-info:get-info-about($index-type, $ref, "same-as")
return
fontaneSimple:make-term("same-as", $same-as)
else
(),
if(index-info:get-info-about($index-type, $ref, "creator-of")) then
let $creator-of := index-info:get-info-about($index-type, $ref, "creator-of")
return
fontaneSimple:make-term("creator-of", $creator-of)
else
())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment