Commit cd718dbf authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

some more tei:link types rendered

parent 32bfc6b4
......@@ -11,7 +11,7 @@ xquery version "3.1";
module namespace f-indexproc="http://fontane-nb.dariah.eu/indexproc";
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "misc.xqm";
declare namespace gndo="http://d-nb.info/standards/elementset/gnd#";
declare namespace ore="http://www.openarchives.org/ore/terms/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
declare namespace tei="http://www.tei-c.org/ns/1.0";
......@@ -258,10 +258,9 @@ element xhtml:li {
attribute class { "creator" },
"Urheber:",
element xhtml:ul {
for $c in $creators
let $currentId := $c/parent::*/parent::*/@xml:id
let $target := try { ($c/@target => replace("\s|#"||$currentId, "")) }
catch * { "Propably invalid format. Please check!" }
for $creator in $creators
let $currentId := $creator/parent::*/parent::*/@xml:id
let $target := $creator/@target => substring-after(" ")
let $targetId := $target => substring-after(":")
let $targetNode := $f-indexproc:dataCollection/id($target)
let $htmlResource :=
......@@ -280,6 +279,22 @@ element xhtml:li {
}
};
declare function local:has-former-or-current-location($links as element(tei:link)*)
as element(xhtml:li)* {
for $link in $links
let $id := $link/@target => substring-after(":") => substring-before(" ")
return
element xhtml:li {
attribute class { "former-or-current-location" },
element xhtml:a {
attribute href { "?e=" || $id },
<xhtml:i class="fa fa-map-marker" aria-hidden="true"></xhtml:i>,
"&#160;",
$f-indexproc:dataCollection/id($id)/*[1]/string()
}
}
};
(:~
: a list item with a list of links
:)
......@@ -315,12 +330,13 @@ as element(xhtml:li)* {
replace($resolve, "([A-E])0(\d)", "$1$2") || ": ",
element xhtml:ul {
attribute class {"link-list-horizontal"},
let $map := $map($tguri)
let $surface-sequence := $map ! (./@target => substring-after("surface[@n='") => substring-before("']//"))
for $link at $pos in $map
let $this-map := $map($tguri)
let $surface-sequence := $this-map ! (./@target => substring-after("surface[@n='") => substring-before("']//"))
for $link at $pos in $this-map
let $page := $link/@target => substring-after("surface[@n='") => substring-before("']//")
let $count := count( index-of($surface-sequence, $page) )
where $pos = $count[1]
let $index-of := index-of($surface-sequence, $page)
let $count := count( $index-of )
where $pos = $index-of[1]
return
element xhtml:li {
element xhtml:a {
......@@ -438,6 +454,15 @@ for $bibl in $bibls
}
};
declare function local:get-gnd-data($url as xs:string)
as element(rdf:RDF){
httpclient:get(xs:anyURI($url || "/about/rdf"), false(), ())//rdf:RDF
};
(: ################################################### :)
(: ################################################### :)
(: ################################################### :)
(:~
: parser for listEvents/event entities
: @param $eventDoc – the tei:listEvent containing all entries
......@@ -783,6 +808,7 @@ else
let $variant := $place/tei:placeName[@type="variant"]
let $idnos := $place/tei:idno
let $note := $place/tei:note
let $creator := $place/tei:linkGrp/tei:link[@corresp="http://purl.org/dc/terms/creator"]
let $bibl := $place/tei:bibl
let $tookPlaceAt := $place/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P7_took_place_at"]
let $formerCurrentLocation := $place/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P53_has_former_or_current_location"]
......@@ -818,6 +844,9 @@ else
},
(: idno :)
local:idno($idnos),
(: creator :)
if (not(exists($creator))) then () else
local:creator($creator),
(: note :)
local:note($note),
(: bibl :)
......@@ -836,18 +865,7 @@ else
}
},
(: former_or_current_location :)
for $l in $formerCurrentLocation
let $id := $l/@target => substring-after(":") => substring-before(" ")
return
element xhtml:li {
attribute class { "former-or-current-location" },
element xhtml:a {
attribute href { "?e=" || $id },
<xhtml:i class="fa fa-map-marker" aria-hidden="true"></xhtml:i>,
"&#160;",
$f-indexproc:dataCollection/id($id)/*[1]/string()
}
},
local:has-former-or-current-location($formerCurrentLocation),
(: links :)
local:links($links),
local:li-code($place),
......@@ -915,6 +933,8 @@ else
let $note := $work/tei:note
let $bibl := $work/tei:bibl
let $creator := $work/tei:linkGrp/tei:link[@corresp="http://purl.org/dc/terms/creator"]
let $translationOf := $work/tei:linkGrp/tei:link[@corresp="http://purl.org/ontology/bibo/#translationOf"]
let $formerCurrentLocation := $work/tei:linkGrp/tei:link[@corresp="http://erlangen-crm.org/current/P53_has_former_or_current_location"]
let $links := $work/tei:linkGrp/tei:link[@corresp="https://schema.org/mentions"]
return
element xhtml:li {
......@@ -956,10 +976,23 @@ else
(: creator :)
if (not(exists($creator))) then () else
local:creator($creator),
(: translationOf :)
for $link in $translationOf
let $url := $link/@target => substring-after(" ")
return
element xhtml:li {
attribute class {"translationOf"},
"Übersetzung von ",
<a href="{$url}">{
local:get-gnd-data($url)//gndo:preferredNameForTheWork/string(.)
}</a>
},
(: note :)
local:note($note),
(: bibl :)
local:bibl($bibl),
(: former_or_current_location :)
local:has-former-or-current-location($formerCurrentLocation),
(: links :)
local:links($links),
local:li-code($work),
......
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