Commit 7700c220 authored by mrodzis's avatar mrodzis 🌿
Browse files

Closes #45

parent 5c921a07
xquery version "3.1"; xquery version "3.1";
(:~ (:~
: @@@ : This module is responsible for retrieving all relevant information from the
: different indicies in order to create a tei:index in the simpler TEI.
: :
: @author Michelle Weidling : @author Michelle Weidling
: @version 0.1 : @version 0.1
: @since TODO : @since v4.0.
:) :)
module namespace index-info="http://fontane-nb.dariah.eu/index-info"; module namespace index-info="http://fontane-nb.dariah.eu/index-info";
...@@ -72,18 +73,29 @@ declare variable $index-info:wrk-map := ...@@ -72,18 +73,29 @@ declare variable $index-info:wrk-map :=
} }
)); ));
(:~
: Gets information about a given term.
:
: @author Michelle Weidling
: @param $index-type the index type ("psn", "eve", ...)
: @param $term the current term, e.g. plc:Lueneburg
: @param $info the specific information to be retrieved, e.g. "regular-name"
: @return the information asked
:)
declare function index-info:get-info-about($index-type as xs:string, declare function index-info:get-info-about($index-type as xs:string,
$term as xs:string, $info as xs:string) as xs:string* { $term as xs:string, $info as xs:string) as xs:string* {
local:get-main-entry($term, $index-type) => map:get($info) local:get-main-entry($term, $index-type) => map:get($info)
}; };
(: auxiliary functions :) (:~
declare function index-info:get-full-maps() { : Selects the right entry on the first level of the map.
$index-info:wrk-map :
}; : @author Michelle Weidling
: @param $ref the current term, e.g. plc:Lueneburg
: @param $index-type the index type ("psn", "eve", ...)
: @return a map with all available information about the given term
:)
declare function local:get-main-entry($ref as xs:string, declare function local:get-main-entry($ref as xs:string,
$index-type as xs:string) as map()* { $index-type as xs:string) as map()* {
let $key := substring-after($ref, ":") let $key := substring-after($ref, ":")
......
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