Commit 0d17b612 authored by mrodzis's avatar mrodzis 🌎
Browse files

Closes #58

parent 67b86a64
......@@ -55,23 +55,35 @@ declare variable $index-info:psn-map :=
return
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:persName[not(@type)], ", "),
"birth" : string($entry/tei:birth),
"death" : string($entry/tei:death),
"occupation" : string($entry/tei:occupation),
"occs-in-nbs" : ""
"regular-name" : string-join($entry/tei:persName[not(@type)], ", "),
"birth" : string($entry/tei:birth),
"death" : string($entry/tei:death),
"occupation" : string($entry/tei:occupation),
"occs-in-nbs" : "",
"relation-to-fontane" : string($entry/tei:state/tei:desc)
}
));
declare variable $index-info:wrk-map :=
map:merge(for $entry in doc("/db/sade-projects/textgrid/data/xml/data/253t3.xml")//tei:item
return
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"occs-in-nbs" : ""
}
));
map:merge(
(for $entry in doc("/db/sade-projects/textgrid/data/xml/data/253t3.xml")//tei:item
return
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"occs-in-nbs" : ""
}
),
for $person in doc("/db/sade-projects/textgrid/data/xml/data/253t3.xml")//tei:person
return
map:entry(string($person/@xml:id),
map {
"regular-name" : string-join($person/tei:persName[not(@type)], ", "),
"occs-in-nbs" : "",
"part-of" : string($person/ancestor::tei:item/tei:name[not(@type)])
}
))
);
(:~
: Gets information about a given term.
......
......@@ -654,6 +654,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
fontaneSimple:copy-element($node, $uri)
case element(tei:rs) return
let $bla := util:log-system-out($node)
let $index-type := substring-before($node/@ref, ":")
return
(: ignore tei:rs elements that are empty after presorting. this
......@@ -927,8 +928,15 @@ $index-type as xs:string) as element()* {
fontaneSimple:make-term("occupation", $occupation))
case "wrk" return
()
(: the index "wrk" not only encompasses works but
also fictional characters that occur in them. part-of
denotes this relationship. :)
if(index-info:get-info-about($index-type, $ref, "part-of")) then
let $part-of := index-info:get-info-about($index-type, $ref, "part-of")
return
fontaneSimple:make-term("part-of", $part-of)
else
()
default return
()
}
......
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