Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
6ba94a97
Commit
6ba94a97
authored
Feb 15, 2019
by
Mathias Goebel
🎠
Browse files
remove dynamic lookup on Deutsche Biographie, set a static version
parent
8e09bfab
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/index-processor.xqm
View file @
6ba94a97
...
@@ -34,11 +34,6 @@ declare variable $ixp:getNotebook := $ixp:targetStart || $ixp:notebookParam;
...
@@ -34,11 +34,6 @@ declare variable $ixp:getNotebook := $ixp:targetStart || $ixp:notebookParam;
declare variable $ixp:dataPath := '/db/sade-projects/textgrid/data/xml/data/';
declare variable $ixp:dataPath := '/db/sade-projects/textgrid/data/xml/data/';
declare variable $ixp:dataCollection := collection($ixp:dataPath);
declare variable $ixp:dataCollection := collection($ixp:dataPath);
declare variable $ixp:BeaconMap := map:merge((
ixp:beacon-parser(xs:anyURI("http://www.historische-kommission-muenchen-editionen.de/beacon_db_register.txt")),
ixp:beacon-parser(xs:anyURI("http://www.historische-kommission-muenchen-editionen.de/beacon_ndb.txt")),
ixp:beacon-parser(xs:anyURI("http://www.historische-kommission-muenchen-editionen.de/beacon_adb.txt"))
));
(:~
(:~
: Helper function to collect all main nodes from the index files.
: Helper function to collect all main nodes from the index files.
:)
:)
...
@@ -244,6 +239,7 @@ let $str := string($idno)
...
@@ -244,6 +239,7 @@ let $str := string($idno)
let $wikipedia :=
let $wikipedia :=
if($idno/@type = "GND") then ixp:gnd-wikipedia($str) else
if($idno/@type = "GND") then ixp:gnd-wikipedia($str) else
if($idno/@type = "Wikidata") then ixp:wikidata-wikipedia($str) else ()
if($idno/@type = "Wikidata") then ixp:wikidata-wikipedia($str) else ()
let $deutscheBiographie := collection($config:data-root)/id( "gnd"||$str )
return
return
element xhtml:li {
element xhtml:li {
attribute class {"idno"},
attribute class {"idno"},
...
@@ -254,10 +250,10 @@ return
...
@@ -254,10 +250,10 @@ return
<xhtml:i title="Link zu externer Ressource" class="fa fa-external-link"></xhtml:i>
<xhtml:i title="Link zu externer Ressource" class="fa fa-external-link"></xhtml:i>
},
},
(: Deutsche Biografie :)
(: Deutsche Biografie :)
if($idno/parent::tei:person and $
ixp:BeaconMap($str)
)
if($idno/parent::tei:person and $
deutscheBiographie
)
then
then
(", ",
(", ",
let $url :=
$ixp:BeaconMap($str
)
let $url :=
string($deutscheBiographie/@db-url
)
return
return
element xhtml:a {
element xhtml:a {
attribute title {
attribute title {
...
@@ -1485,22 +1481,3 @@ else
...
@@ -1485,22 +1481,3 @@ else
}
}
}
}
};
};
declare function ixp:beacon-parser($url as xs:anyURI)
as map(*) {
let
$persist := false(),
$request-headers := (),
$beacon := httpclient:get($url, $persist, $request-headers)//httpclient:body/node()
=> xmldb:decode() => tokenize("
")
let $target := $beacon[starts-with(., "#TARGET:")] => substring-after(": ")
(: should return something like "http://www.deutsche-biographie.de/pnd{ID}.html#adbcontent"
: where «{ID}» is to be replaced by the GND ID :)
let $replacement := "\{ID\}"
return map:new(
for $i in $beacon[not(starts-with(., "#"))][. != ""]
return
map:entry($i, replace($target, $replacement, $i))
)
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment