Commit a6c97c7c authored by mrodzis's avatar mrodzis 🐸
Browse files

Merge branch 'feature/#90-short-titles' into 'develop'

Add info about short titles to interformat

Closes #90

See merge request !27
parents 9ae95e90 ae9647d3
...@@ -85,50 +85,54 @@ declare variable $index-info:wrk-map := ...@@ -85,50 +85,54 @@ declare variable $index-info:wrk-map :=
else else
"false" "false"
let $same-as :=
if($periodical) then
$entry/ancestor::tei:list[@type = "periodicals"]//tei:item[not(@xml:id)][descendant::tei:ptr[@target = concat("#", $entry/@xml:id)]]/tei:name
else
()
let $same-as :=
if(count($same-as) gt 1) then
string-join($same-as/string(), ", ")
else if(count($same-as) = 1) then
$same-as/string()
else
()
let $general-map :=
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"periodical" : $is-periodical,
"type" : "work"
}
return return
if($creators and $periodical) then if($creators and $periodical
map:entry(string($entry/@xml:id), or $creators) then
map { let $updated-map := map:put($general-map, "creator-ids", string-join($creator-ids, " "))
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator-ids" : string-join($creator-ids, " "), return
"periodical" : $is-periodical, map:entry(string($entry/@xml:id),
"type" : "work" if($same-as) then
} map:put($updated-map, "same-as", $same-as)
) else
else if($creators) then $updated-map
map:entry(string($entry/@xml:id), )
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator-ids" : string-join($creator-ids, " "),
"periodical" : $is-periodical,
"type" : "work"
}
)
else if($created-by-fontane) then else if($created-by-fontane) then
map:entry(string($entry/@xml:id), map:entry(string($entry/@xml:id),
map { map:put($general-map, "creator", "Fontane")
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator" : "Fontane",
"periodical" : $is-periodical,
"type" : "work"
}
) )
else if($periodical) then else if($periodical) then
map:entry(string($entry/@xml:id), map:entry(string($entry/@xml:id),
map { if($same-as) then
"regular-name" : string-join($entry/tei:name[not(@type)], ", "), map:put($general-map, "same-as", $same-as)
"periodical" : $is-periodical, else
"type" : "work" $general-map
}
) )
else else
map:entry(string($entry/@xml:id), map:entry(string($entry/@xml:id),
map { map:put($general-map, "creator", "Anonym/nicht ermittelt")
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator" : "Anonym/nicht ermittelt",
"periodical" : $is-periodical,
"type" : "work"
}
), ),
(: (fictional) characters mentioned/depicted in works :) (: (fictional) characters mentioned/depicted in works :)
for $person in doc($config:data-root || "/data/253t3.xml")//tei:person for $person in doc($config:data-root || "/data/253t3.xml")//tei:person
......
...@@ -365,7 +365,8 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a ...@@ -365,7 +365,8 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
and $node/following::*[1][self::tei:hi]) then and $node/following::*[1][self::tei:hi]) then
text{"@"} text{"@"}
else else
()) ()
)
(: TODO if $node/@type = "highlighted" then make (: TODO if $node/@type = "highlighted" then make
a hi[@type = "vertical-mark"] in the second stage of creating the a hi[@type = "vertical-mark"] in the second stage of creating the
...@@ -775,7 +776,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a ...@@ -775,7 +776,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
}, },
if(not($node//tei:abbr/text()[ends-with(., ":")] if(not($node//tei:abbr/text()[ends-with(., ":")]
or ($node//text()[last()][ends-with(., "-")] or $node/following-sibling::*[1][self::tei:rs]) or ($node//text()[last()][ends-with(., "-")] or $node/following-sibling::*[1][self::tei:rs])
or $node/following::text()[1][starts-with(., "-") or starts-with(., ".")] or $node/following::text()[1][starts-with(., "-") or starts-with(., ".") or starts-with(., ")")]
or $node/following::text()[1][matches(substring(., 1, 1), "[\w]")] or $node/following::text()[1][matches(substring(., 1, 1), "[\w]")]
or $node/following::*[1][self::tei:handShift]) or $node/following::*[1][self::tei:handShift])
(: or $node/following-sibling::node()[1][starts-with(., "-") or starts-with(., ".")]):) (: or $node/following-sibling::node()[1][starts-with(., "-") or starts-with(., ".")]):)
...@@ -1209,11 +1210,18 @@ as xs:string) as element(tei:term)+ { ...@@ -1209,11 +1210,18 @@ as xs:string) as element(tei:term)+ {
$creator-id $creator-id
let $type := index-info:get-info-about($index-type, $ref, "periodical") let $type := index-info:get-info-about($index-type, $ref, "periodical")
let $same-as := index-info:get-info-about($index-type, $ref, "same-as")
let $no-of-ids := count($creators) let $no-of-ids := count($creators)
return return
( (
fontaneSimple:make-term("periodical", $type), fontaneSimple:make-term("periodical", $type),
if($same-as) then
fontaneSimple:make-term("same-as", $same-as)
else
(),
if($subref-ids) then if($subref-ids) then
for $iii in 1 to $no-of-ids return for $iii in 1 to $no-of-ids return
let $subref := index-info:get-info-about("psn", $creators[$iii], "regular-name") let $subref := index-info:get-info-about("psn", $creators[$iii], "regular-name")
......
Supports Markdown
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