Skip to content
Commits on Source (3)
# [1.9.0](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/compare/v1.8.2...v1.9.0) (2024-03-27)
# [1.10.0](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/compare/v1.9.0...v1.10.0) (2024-04-05)
### Features
* using tgsearch for image-lookup ([a734b1d](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/a734b1d0714fa4c2fa3270bfc8945611442d6307))
## [1.8.2](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/compare/v1.8.1...v1.8.2) (2023-12-11)
### Bug Fixes
* check ([ec6c1f3](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/ec6c1f3100a4b32b32fd0bf5be1f22cfde911d16))
* icon for recursive mode ([f613ae3](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/f613ae392003885cfd95e21e31450ecadb4eab50))
* only update when new image ([0abdfae](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/0abdfae5a8367840c89bdd16253039bd0df6c24f))
* port binding ([8aa835c](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/8aa835c677f780d76d4ff23698328f4490a3549b))
* syntax ([deff027](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/deff027e67e79231b78c80946adb40453b6f35d1))
* use tgsearch response for storing image metadata ([ce1815a](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/ce1815a8d9bc67bc875c9bea290211f26f0efa75))
# Changelog
......@@ -23,6 +12,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).
## [2.1.1] - 2024-04-05
### Changed
- image metadata processing performance improved by using tg-search response already present
## [2.1.0] - 2024-03-27
### Added
......@@ -31,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- moving away from tgcrud HEAD requests to tgsearch requests for identifing images during publish process
* using tgsearch for image-lookup ([a734b1d](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/a734b1d0714fa4c2fa3270bfc8945611442d6307))
## [2.0.0] - 2023-12-11
......@@ -56,7 +51,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- icon for recursive mode
## [1.8.2] - 2023-01-12
## [1.8.2](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/compare/v1.8.1...v1.8.2) (2023-12-11)
### Bug Fixes
* check ([ec6c1f3](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/ec6c1f3100a4b32b32fd0bf5be1f22cfde911d16))
* icon for recursive mode ([f613ae3](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/f613ae392003885cfd95e21e31450ecadb4eab50))
* only update when new image ([0abdfae](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/0abdfae5a8367840c89bdd16253039bd0df6c24f))
* port binding ([8aa835c](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/8aa835c677f780d76d4ff23698328f4490a3549b))
* syntax ([deff027](https://gitlab.gwdg.de/SADE/textgrid-connect-standalone/commit/deff027e67e79231b78c80946adb40453b6f35d1))
### Fixed
......
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://expath.org/ns/pkg" name="http://sub.uni-goettingen.de/tg-connect-standalone"
abbrev="tg-connect-standalone"
version="2.1.0"
version="2.1.1"
spec="1.0">
<title>TextGrid Connect</title>
<dependency processor="http://exist-db.org" semver-min="6.0.1" />
......
......@@ -51,15 +51,15 @@ as item()+ {
client:get-latest-aggregated-uris($tguri, $rdfstoreUrl, $sid)
else
$tguri
let $image-uris :=
let $image-map :=
connect:get-image-uris-with-tgsearch(
$descendant-aggregated-uris,
"filter=project.id:" || string($metadataContainer//tgmd:project/@id),
$sid
)
let $store-images := connect:store-images($image-uris, $tgcrud-url, $sid)
let $non-image-uris := connect:get-non-image-uris($descendant-aggregated-uris, $image-uris)
let $store-images := connect:store-images($image-map)
let $non-image-uris := connect:get-non-image-uris($descendant-aggregated-uris, map:keys($image-map))
let $number-of-items-to-publish := count($non-image-uris)
let $log := util:log-system-out("got a total of " || $number-of-items-to-publish || " non-image URIs to publish.")
return
......@@ -140,7 +140,7 @@ declare function connect:get-image-uris-with-tgsearch(
$descendant-aggregated-uris as xs:string+,
$filters as xs:string+,
$sid as xs:string)
as item()* {
as map(*) {
let $tgsearch-url := config:get-value-from-configfile("textgrid.nonpublic") => xs:anyURI()
let $hits :=
client:tgsearch-search(
......@@ -156,7 +156,13 @@ as item()* {
//image[substring-before(@uri, ".") = $descendant-aggregated-uris]
/substring-before(@uri, ".")
return
($intersection, $presentUris[. ne ""])
map:merge(
for $hit in $hits
let $uri := $hit//tgmd:textgridUri/text()
where $uri = $descendant-aggregated-uris
return
map:entry($uri, $hit)
)
};
declare function connect:get-non-image-uris($descendant-aggregated-uris as xs:string+,
......@@ -374,16 +380,14 @@ as xs:string {
(: we do not store images, but reference the published ones in the file images.xml :)
declare function connect:store-images($image-uris as xs:string*,
$tgcrud-url as xs:string,
$sid as xs:string?)
declare function connect:store-images($image-map as map(*))
{
if (count($image-uris) gt 0) then
if (count(map:keys($image-map)) gt 0) then
(
if(doc-available( $config:data-root || "/images.xml" )) then
connect:update-image-xml($image-uris, $tgcrud-url, $sid)
connect:update-image-xml($image-map)
else
connect:create-and-update-image-xml($image-uris, $tgcrud-url, $sid),
connect:create-and-update-image-xml($image-map),
"Images: some metadata stored."
)
else
......@@ -391,25 +395,21 @@ declare function connect:store-images($image-uris as xs:string*,
};
declare function connect:create-and-update-image-xml($image-uris as xs:string*,
$tgcrud-url as xs:string,
$sid as xs:string?)
declare function connect:create-and-update-image-xml($image-map as map(*))
{
xmldb:store($config:data-root, "images.xml", <images/>),
connect:update-image-xml($image-uris, $tgcrud-url, $sid)
connect:update-image-xml($image-map)
};
declare function connect:update-image-xml($image-uris as xs:string*,
$tgcrud-url as xs:string,
$sid as xs:string?)
declare function connect:update-image-xml($image-map as map(*))
{
let $doc := doc($config:data-root || "/images.xml")
let $uris := $doc//image/string(@uri)
let $image-entries :=
for $uri in $image-uris
for $uri in map:keys($image-map)
where not($uri = $uris)
let $metadata := client:get-metadata($uri, $tgcrud-url, $sid)
let $metadata := map:get($image-map, $uri)
return
<image
uri="{string($metadata//tgmd:textgridUri)}"
......