Commit 41002924 authored by mrodzis's avatar mrodzis 💪
Browse files

Merge branch '233-manifest-metadata' into 'develop'

fix: provide editor info in Actor Object

Closes #233

See merge request !220
parents ef4e0d27 2d51e407
Pipeline #332253 passed with stages
in 6 minutes and 54 seconds
......@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [7.9.2] - 20221109
### Fixed
- moved editor info for manifests from Metadata Object to Actor Object
## [7.9.1] - 20221026
### Changed
......
project.name=https://ahikar-test.sub.uni-goettingen.de/
project.version=7.9.0
project.version=7.9.1
project.title=Ahiqar
project.abbrev=ahikar-test
project.processorversion=6.0.1
......
......@@ -36,7 +36,8 @@ as map() {
"support": tapi-mani:make-support-object($server),
"license": tapi-mani:get-license-info($tei-xml),
"annotationCollection": $server || "/api/annotations/ahikar/" || $collection-type || "/" || $manifest-uri || "/annotationCollection.json",
"sequence": array{ tapi-mani:make-sequences($collection-type, $manifest-uri, $server) }
"sequence": array{ tapi-mani:make-sequences($collection-type, $manifest-uri, $server) },
"actor": array{ tapi-mani:make-editors($tei-xml) }
}
};
......@@ -49,7 +50,6 @@ as xs:string {
declare function tapi-mani:make-metadata-objects($tei-xml as document-node(), $server as xs:string)
as map()+ {
tapi-mani:make-editors($tei-xml),
tapi-mani:make-creation-date($tei-xml),
tapi-mani:make-origin($tei-xml),
tapi-mani:make-current-location($tei-xml),
......@@ -81,12 +81,13 @@ as xs:string+ {
};
declare function tapi-mani:make-editors($tei-xml as document-node())
as map() {
as map()* {
let $editors := $tei-xml//tei:titleStmt//tei:editor
return
for $editor in $editors return
map {
"key": if (count($editors) gt 1) then "Editors" else "Editor",
"value": if (exists($editors)) then string-join($editors, ", ") else "none"
"@context": "https://gitlab.gwdg.de/subugoe/emo/text-api/-/raw/main/jsonld/actor.jsonld",
"role": "editor",
"name": $editor/string()
}
};
......@@ -192,7 +193,6 @@ as map(*)+ {
declare function tapi-mani:make-metadata-objects-for-Salhani($tei-xml as document-node(), $server as xs:string)
as map()+ {
tapi-mani:make-editors($tei-xml),
map {
"key": "Title of the edited chapter",
"value": $tei-xml//tei:biblStruct//tei:title[@level = "a"]/string()
......
......@@ -163,7 +163,7 @@ function tmt:get-manifest-title($manifest-uri as xs:string) {
};
declare
%test:assertXPath("map:get($result, 'value') = 'Simon Birol, Aly Elrefaei'")
%test:assertXPath("map:get($result[1], 'name') = 'Simon Birol'")
function tmt:make-editors-present() {
let $tei-xml := commons:get-tei-xml-for-manifest("sample_edition")
return
......@@ -171,7 +171,7 @@ function tmt:make-editors-present() {
};
declare
%test:assertXPath("map:get($result, 'value') = 'none'")
%test:assertEmpty
function tmt:make-editors-not-present() {
let $tei-xml := commons:get-tei-xml-for-manifest("test-manifest1")
return
......@@ -292,10 +292,9 @@ as item()+ {
};
declare
%test:assertXPath("count($result) gt 3")
%test:assertXPath("map:get($result[1], 'value') = 'Simon Birol, Aly Elrefaei'")
%test:assertXPath("map:get($result[2], 'value') = 'Tale of Haiqar the wise, vizir of Sennachrieb the king and of his sister''s son Nadan'")
%test:assertXPath("map:get($result[3], 'value') = 'Salhani, Anton. Ṭarāʾif fukāhāt fī arbaʿ ḥikājāt (Contes Arabes). Beirut 1890, 1–20. Published by al-Maṭbaʿa al-kāṯūlīkīja li-l-āAbā al-jasūʿījīn.'")
%test:assertXPath("count($result) = 3")
%test:assertXPath("map:get($result[1], 'value') = 'Tale of Haiqar the wise, vizir of Sennachrieb the king and of his sister''s son Nadan'")
%test:assertXPath("map:get($result[2], 'value') = 'Salhani, Anton. Ṭarāʾif fukāhāt fī arbaʿ ḥikājāt (Contes Arabes). Beirut 1890, 1–20. Published by al-Maṭbaʿa al-kāṯūlīkīja li-l-āAbā al-jasūʿījīn.'")
function tmt:make-metadata-objects-for-Salhani() {
let $tei-xml := doc("/db/data/textgrid/data/salhani_header_sample_teixml.xml")
return
......
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