From f8b79867aaa5aead2df0b77c911bf0e727bb8c65 Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:11:24 +0300 Subject: [PATCH 1/9] Add tests to LIDO-EDM transformation --- .../Base/Utils/XslTransformationTest.php | 128 ++ .../transformations/europeana-license.xsl | 47 + .../transformations/lido2edm.xsl | 1145 +++++++++++++++++ .../transformations/lido2edm_3D.properties | 30 + .../transformations/lido2edm_image.properties | 30 + .../transformations/lido2edm_text.properties | 30 + .../transformations/lido2edm_video.properties | 30 + .../transformations/url-encode.xsl | 48 + .../transformations/validate-lang.xsl | 40 + .../transformations/validate-text-lang.xsl | 52 + .../transformations/wikidata-worktype.xsl | 272 ++++ .../Base/utils/XslTransformation/lido_3D.xml | 261 ++++ .../utils/XslTransformation/lido_3D_edm.xml | 69 + .../utils/XslTransformation/lido_image.xml | 222 ++++ .../XslTransformation/lido_image_edm.xml | 47 + .../utils/XslTransformation/lido_text.xml | 208 +++ .../utils/XslTransformation/lido_text_edm.xml | 48 + .../utils/XslTransformation/lido_video.xml | 256 ++++ .../XslTransformation/lido_video_edm.xml | 61 + 19 files changed, 3024 insertions(+) create mode 100644 tests/RecordManagerTest/Base/Utils/XslTransformationTest.php create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_3D.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_image.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_text.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_video.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml diff --git a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php new file mode 100644 index 000000000..021fdefcc --- /dev/null +++ b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php @@ -0,0 +1,128 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/NatLibFi/RecordManager + */ + +namespace RecordManagerTest\Base\Utils; + +use RecordManager\Base\Utils\XslTransformation; +use RecordManagerTest\Base\Feature\FixtureTrait; + +/** + * XmlTransformation tests + * + * @category DataManagement + * @package RecordManager + * @author Minna Rönkä + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/NatLibFi/RecordManager + */ +class XslTransformationTest extends \PHPUnit\Framework\TestCase +{ + use FixtureTrait; + + /** + * Test LIDO-EDM transformation with image + * + * @return void + */ + public function testLido2EdmTransformationWithImage() + { + $xslTransformation = $this->getXslTransformation("lido2edm_image.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_image.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_image_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with video + * + * @return void + */ + public function testLido2EdmTransformationWithVideo() + { + $xslTransformation = $this->getXslTransformation("lido2edm_video.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_video.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_video_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with text + * + * @return void + */ + public function testLido2EdmTransformationWithText() + { + $xslTransformation = $this->getXslTransformation("lido2edm_text.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_text.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_text_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with 3D + * + * @return void + */ + public function testLido2EdmTransformationWith3D() + { + $xslTransformation = $this->getXslTransformation("lido2edm_3D.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_3D.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_3D_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Create XmlTransformation + * + * @param string $config Transformation config file name + * + * @return XslTransformation + */ + protected function getXslTransformation(string $config) + { + return new XslTransformation( + $this->getConfigDir(), + $config + ); + } + + /** + * Get config directory + * + * @return string + */ + protected function getConfigDir() + { + return $this->getFixtureDir() . 'config/xsltransformationtest/transformations'; + } +} diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl new file mode 100644 index 000000000..4918e2a1b --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl @@ -0,0 +1,47 @@ + + + + + + + + + + + + http://creativecommons.org/licenses/ + + + + / + + / + + + + + http://creativecommons.org/publicdomain/mark/1.0/ + + + + + http://creativecommons.org/publicdomain/zero/1.0/ + + + + + http://rightsstatements.org/vocab/InC/1.0/ + + + + + http://rightsstatements.org/vocab/CNE/1.0/ + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl new file mode 100644 index 000000000..84a70e338 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -0,0 +1,1145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3D + + + VIDEO + + + SOUND + + + IMAGE + + + TEXT + + + IMAGE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties new file mode 100644 index 000000000..fb22eb251 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "objectWebResource" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl new file mode 100644 index 000000000..589ebaed9 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl new file mode 100644 index 000000000..09bc60449 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl new file mode 100644 index 000000000..a373121ef --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl new file mode 100644 index 000000000..a50a5adc4 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml new file mode 100644 index 000000000..1c15e765b --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml @@ -0,0 +1,261 @@ + + + + testimuseo-K1554 + + + + + malli + + + + + Fotogrammetrinen malli + + + 100 valokuva + + + 12345 + + + fin + + + + + + + Kissa nurmikolla -3D-malli + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + fotogrammetria + + + negatiivi + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + https://kissarepo/images/download?id=k1554_2&size=large + + + https://kissarepo/images/download?id=k1554_2&size=original + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_3 + Avaa Sketchfabissa + + https://kissarepo/images/download?id=k1554_3&size=original&format=glb + + koko + size + verteksit + vertices + 60000 + + + koko + size + polygonit + polygons + 21069 + + + + https://sketchfab.com/3d-models/k1554_3 + + + 3D Mesh + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + Testimuseo + + + Testimuseo / Karvinen, Osku + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml new file mode 100644 index 000000000..96b9e5637 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml @@ -0,0 +1,69 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + fotogrammetria + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla -3D-malli + + Fotogrammetrinen malli + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + 3D + + + + + + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + 21069 + + 60000 + + + + Test Museum + + + + + + + National Library of Finland + + + + + Sketchfab + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_image.xml b/tests/fixtures/Base/utils/XslTransformation/lido_image.xml new file mode 100644 index 000000000..679156d10 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_image.xml @@ -0,0 +1,222 @@ + + + + testimuseo-K1554 + + + + + valokuva + + + + + valokuvanegatiivi + + + 100 valokuva + + + 12345 + + + fin + + + + + + + Kissa nurmikolla + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + salakuvaus + + + negatiivi + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + https://kissarepo/images/download?id=k1554_2&size=large + + + https://kissarepo/images/download?id=k1554_2&size=original + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml new file mode 100644 index 000000000..6b435d820 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml @@ -0,0 +1,47 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + salakuvaus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla + + valokuvanegatiivi + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + IMAGE + + + + + + + + + + Test Museum + + + + + National Library of Finland + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_text.xml b/tests/fixtures/Base/utils/XslTransformation/lido_text.xml new file mode 100644 index 000000000..12e9e4348 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_text.xml @@ -0,0 +1,208 @@ + + + + testimuseo-K1554 + + + + + valokuva + + + + + kaunokirjoitus + + + 100 valokuva + + + 12345 + + + + + + + Kissa nurmikolla -kuvan tarina + The story of the image: Cat On Grass + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla: kuvauskertomus + black and white cat sleeping on grass: photography report + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kirjoittaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + kaunokirjoitus + + + pergamentti + + + pergamentti + parchment + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.pdf + + https://kissarepo/images/download?id=k1554_2&size=original&format=pdf + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml new file mode 100644 index 000000000..e1dc7e85f --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml @@ -0,0 +1,48 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla: kuvauskertomus + black and white cat sleeping on grass: photography report + Photographing was done while the cat was sleeping because the cat refused to co-operate + kaunokirjoitus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla -kuvan tarina + The story of the image: Cat On Grass + + kaunokirjoitus + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + pergamentti + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + TEXT + + + + + + + + + + Test Museum + + + + + National Library of Finland + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml new file mode 100644 index 000000000..732fc400c --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml @@ -0,0 +1,256 @@ + + + + testimuseo-K1554 + + + + + + + + + + + + + fin + + + + + + + + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + + + pituus + 6 + cm + + + leveys + 6 + cm + + + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + Kissakuja 1 + + + + 60.187796179482426 24.983517601821166 + + + + + Helsinki + + + + Suomi + + + + + + + salakuvaus + + + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + aiheen aika 2000-luku + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + Katso teos Testimuseon kokoelmasivustolla + + https://www.kansallisgalleria.fi/fi/object/594898 + https://www.kansallisgalleria.fi/en/object/594898 + + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + 924453 + HK19931028_2211.tif + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + Karvinen, Osku + + + + + https://kissarepo/images/download?id=k1554_1&size=original&format=mp4 + + + https://www.youtube.com/watch?v=k1554_1 + + + + InC + In copyright + + + + Testimuseo + + + Testimuseo / Karvinen, Osku + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml new file mode 100644 index 000000000..bebe8724f --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml @@ -0,0 +1,61 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + salakuvaus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Ei otsikkoa + + valmistusaika 2009 + pituus: 6 cm + leveys: 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + negative + kuvauspaikka Kissakuja 1, Helsinki + + aiheen paikka Kissakujan nurmikko + aiheen aika 2000-luku + VIDEO + + + + Karvinen, Osku + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + Test Museum + + + + + + National Library of Finland + + + + Kissakuja 1 + 60.187796179482426 + 24.983517601821166 + + From ced31dfcf8f94486db12d009cba7c1fd9929ad7d Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:13:57 +0300 Subject: [PATCH 2/9] fix errors --- .../Base/Utils/XslTransformationTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php index 021fdefcc..b2abf0141 100644 --- a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php +++ b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php @@ -52,7 +52,7 @@ class XslTransformationTest extends \PHPUnit\Framework\TestCase */ public function testLido2EdmTransformationWithImage() { - $xslTransformation = $this->getXslTransformation("lido2edm_image.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_image.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_image.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_image_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -66,7 +66,7 @@ public function testLido2EdmTransformationWithImage() */ public function testLido2EdmTransformationWithVideo() { - $xslTransformation = $this->getXslTransformation("lido2edm_video.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_video.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_video.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_video_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -80,7 +80,7 @@ public function testLido2EdmTransformationWithVideo() */ public function testLido2EdmTransformationWithText() { - $xslTransformation = $this->getXslTransformation("lido2edm_text.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_text.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_text.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_text_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -94,7 +94,7 @@ public function testLido2EdmTransformationWithText() */ public function testLido2EdmTransformationWith3D() { - $xslTransformation = $this->getXslTransformation("lido2edm_3D.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_3D.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_3D.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_3D_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -105,7 +105,7 @@ public function testLido2EdmTransformationWith3D() * Create XmlTransformation * * @param string $config Transformation config file name - * + * * @return XslTransformation */ protected function getXslTransformation(string $config) From 3eac4cd0efb16d93fa6e931541f6f3333034091b Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:45:29 +0300 Subject: [PATCH 3/9] Small edits --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 3 +-- .../transformations/lido2edm_3D.properties | 2 +- tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 84a70e338..3edfdbde8 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -23,7 +23,7 @@ - + @@ -744,7 +744,6 @@ - diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties index a1f330da1..b11b04005 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties @@ -27,4 +27,4 @@ data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" ; URL to the preferred Finna view -sourceURL = "http://testmuseum.finna.fi" +sourceURL = "Sketchfab" diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml index 96b9e5637..c141cee8b 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml @@ -53,7 +53,7 @@ Test Museum - + From 09e358d17362afa0a2c9f10f49ff9fa611ec9d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:03 +0300 Subject: [PATCH 4/9] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 3edfdbde8..42323c379 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -386,7 +386,7 @@ - + From e67cf19e9dee68301fc279aed885c1aeb2231e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:13 +0300 Subject: [PATCH 5/9] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 42323c379..64ec8ad55 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -143,7 +143,7 @@ - + From f3245480f543ed3c627bca0983cdd1e2c2163f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:22 +0300 Subject: [PATCH 6/9] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 64ec8ad55..bcf0a3fd3 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -250,7 +250,7 @@ - + From f39bcff2adcc9170ea10d824b00b57c0a8d6f441 Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 17 Jun 2026 14:45:37 +0300 Subject: [PATCH 7/9] Refactoring and more tests --- .../Base/Utils/XslTransformationTest.php | 14 + .../transformations/europeana-license.xsl | 35 +- .../transformations/lido2edm.xsl | 934 +++++++++--------- .../transformations/lido2edm_3D.properties | 4 +- .../transformations/lido2edm_image.properties | 4 +- .../lido2edm_incomplete.properties | 32 + .../transformations/lido2edm_text.properties | 4 +- .../transformations/lido2edm_video.properties | 4 +- .../transformations/validate-lang.xsl | 22 +- .../transformations/validate-text-lang.xsl | 23 - .../Base/utils/XslTransformation/lido_3D.xml | 11 +- .../utils/XslTransformation/lido_3D_edm.xml | 1 + .../XslTransformation/lido_image_edm.xml | 2 +- .../XslTransformation/lido_incomplete.xml | 222 +++++ .../XslTransformation/lido_incomplete_edm.xml | 24 + .../utils/XslTransformation/lido_text_edm.xml | 2 +- .../utils/XslTransformation/lido_video.xml | 112 +-- .../XslTransformation/lido_video_edm.xml | 8 +- 18 files changed, 837 insertions(+), 621 deletions(-) create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_incomplete.properties create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_incomplete.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_incomplete_edm.xml diff --git a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php index b2abf0141..e6add978b 100644 --- a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php +++ b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php @@ -101,6 +101,20 @@ public function testLido2EdmTransformationWith3D() $this->assertSame($expectedEdm, $transformedEdm); } + /** + * Test LIDO-EDM transformation with incomplete data + * + * @return void + */ + public function testLido2EdmTransformationWithIncompleteData() + { + $xslTransformation = $this->getXslTransformation('lido2edm_incomplete.properties'); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_incomplete.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_incomplete_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + /** * Create XmlTransformation * diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl index 4918e2a1b..c1e79fff3 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl @@ -8,39 +8,40 @@ - - http://creativecommons.org/licenses/ - - - - / - - / + + + + + + + + - - http://creativecommons.org/publicdomain/mark/1.0/ + + - - http://creativecommons.org/publicdomain/zero/1.0/ + + - - http://rightsstatements.org/vocab/InC/1.0/ + + - - - http://rightsstatements.org/vocab/CNE/1.0/ + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index bcf0a3fd3..c6581535a 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -20,7 +20,8 @@ - + + @@ -32,46 +33,46 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -85,13 +86,13 @@ - + - + @@ -114,8 +115,8 @@ - - + + @@ -123,7 +124,7 @@ - + @@ -135,7 +136,7 @@ - + @@ -147,7 +148,7 @@ - + @@ -159,60 +160,51 @@ - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + - + - + - + + - - - - - - - - - + @@ -227,14 +219,14 @@ - + - + @@ -244,7 +236,7 @@ - + @@ -255,7 +247,7 @@ - + @@ -265,9 +257,9 @@ - + - + @@ -280,7 +272,7 @@ - + @@ -290,8 +282,8 @@ - - + + @@ -304,39 +296,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -349,8 +345,8 @@ - - + + @@ -364,7 +360,7 @@ - + @@ -374,8 +370,8 @@ - - + + @@ -389,7 +385,7 @@ - + @@ -402,7 +398,7 @@ - + @@ -412,7 +408,7 @@ - + @@ -424,8 +420,8 @@ - - + + @@ -438,7 +434,7 @@ - + @@ -476,39 +472,46 @@ - + + + + + + + + - - + + - + - + - + - + - + - + - + @@ -518,16 +521,16 @@ - - - - - - - - + + + + + + + + - + @@ -538,23 +541,24 @@ - + + - + - + - + - + - + @@ -573,281 +577,225 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + + - + - + + - + - - - - - - - - + + - + - + + - + + + + + + + + + - + + - + - - - - - - - - + + - + - + + - + + + + + + + + + - + + - + - - - - - - - - + + - + - + + - + + + + + + + + + - + + - + - - - - - - - - + + - + - + + - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - + - - - - - - - - - - - - - - + + + + - + @@ -865,36 +813,46 @@ - - - - + + + + + + - - - - - + + + + + + + + + + + - - + + + + - - + + - - + + - + - + @@ -924,161 +882,148 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1088,11 +1033,12 @@ - + + - + @@ -1121,19 +1067,21 @@ - + + + - + - + - + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties index b11b04005..6619d76a9 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties @@ -26,5 +26,7 @@ provider = "National Library of Finland" data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" +; Link to be used as external view of the object +externalView = "Sketchfab" ; URL to the preferred Finna view -sourceURL = "Sketchfab" +sourceURL = "https://finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties index a1f330da1..1315a871a 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties @@ -26,5 +26,7 @@ provider = "National Library of Finland" data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" +; Link to be used as external view of the object +externalView = "sourceURL" ; URL to the preferred Finna view -sourceURL = "http://testmuseum.finna.fi" +sourceURL = "https://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_incomplete.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_incomplete.properties new file mode 100644 index 000000000..74edf2509 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_incomplete.properties @@ -0,0 +1,32 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; Link to be used as external view of the object +externalView = "sourceURL" +; URL to the preferred Finna view +sourceURL = "https://finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties index a1f330da1..1315a871a 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties @@ -26,5 +26,7 @@ provider = "National Library of Finland" data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" +; Link to be used as external view of the object +externalView = "sourceURL" ; URL to the preferred Finna view -sourceURL = "http://testmuseum.finna.fi" +sourceURL = "https://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties index fb22eb251..cb09527b0 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties @@ -26,5 +26,7 @@ provider = "National Library of Finland" data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" +; Link to be used as external view of the object +externalView = "objectWebResource" ; URL to the preferred Finna view -sourceURL = "objectWebResource" +sourceURL = "https://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl index 09bc60449..58fa6a281 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl @@ -7,26 +7,12 @@ - - - - - - - - - + + - - - - - - - - - + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl index a373121ef..2faefaa71 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl @@ -4,31 +4,8 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml index 1c15e765b..00e04642c 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml @@ -11,10 +11,10 @@ - Fotogrammetrinen malli + Fotogrammetrinen malli - 100 valokuva + 100 valokuva 12345 @@ -22,12 +22,15 @@ fin + + Swedish + - Kissa nurmikolla -3D-malli + Kissa nurmikolla -3D-malli @@ -42,7 +45,7 @@ - mustavalkoinen kissa nukkuu nurmikolla + mustavalkoinen kissa nukkuu nurmikolla black and white cat sleeping on grass diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml index c141cee8b..8dd76ee77 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml @@ -8,6 +8,7 @@ fotogrammetria K1554 fin + swe kissat diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml index 6b435d820..2c6465030 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml @@ -37,7 +37,7 @@ Test Museum - + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_incomplete.xml b/tests/fixtures/Base/utils/XslTransformation/lido_incomplete.xml new file mode 100644 index 000000000..2a2facd0b --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_incomplete.xml @@ -0,0 +1,222 @@ + + + + testimuseo-K1554 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + valmistus + Creation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yleinen suomalainen asiasanasto + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Kokoelma + + + + + + + + K1554 + + item + + + + + + + + + + + + + + + + + + + + + + https://kissarepo/images/download?id=k1554_1&size=large + + + + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + + + + + + + + + + https://kissarepo/images/download?id=k1554_2&size=original + + + + + + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_incomplete_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_incomplete_edm.xml new file mode 100644 index 000000000..5ca590f91 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_incomplete_edm.xml @@ -0,0 +1,24 @@ + + + + Ei otsikkoa + + IMAGE + + + + + + + + + + Test Museum + + + + + National Library of Finland + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml index e1dc7e85f..bd323ce59 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml @@ -38,7 +38,7 @@ Test Museum - + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml index 732fc400c..c7b913479 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_video.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml @@ -14,21 +14,21 @@ - fin + fin - + Kissa nurmikolla -video - Testimuseo + Testimuseo K1554 @@ -36,22 +36,22 @@ - mustavalkoinen kissa nukkuu nurmikolla - black and white cat sleeping on grass + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass - pituus - 6 + pituus + 6 cm leveys 6 - cm + cm @@ -61,60 +61,60 @@ - valmistus - Creation + Creation + valmistus - Karvinen, Osku + Karvinen, Osku - kuvaaja + kuvaaja - valmistusaika 2009 + valmistusaika 2009 - kuvauspaikka Kissakuja 1, Helsinki + kuvauspaikka Kissakuja 1, Helsinki - Kissakuja 1 + Kissakuja 1 - 60.187796179482426 24.983517601821166 + 60.187796179482426 24.983517601821166 - Helsinki + Helsinki - Suomi + Suomi - salakuvaus + salakuvaus - negatiivi - negative + negatiivi + negative - Photographing was done while the cat was sleeping because the cat refused to co-operate + Photographing was done while the cat was sleeping because the cat refused to co-operate @@ -124,7 +124,7 @@ näyttely - Kissat kautta aikojen - Helsinki Cat Exhibition + Kissat kautta aikojen - Helsinki Cat Exhibition @@ -135,19 +135,19 @@ Yleinen suomalainen asiasanasto - kissat + kissat - http://www.yso.fi/onto/yso/p16142 - nurmikot + http://www.yso.fi/onto/yso/p16142 + nurmikot - http://iconclass.org/48C5 - maalaustaide, piirrostaide ja taidegrafiikka + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka @@ -156,15 +156,15 @@ - Hänen Majesteettinsa Kissa Kissanen + Hänen Majesteettinsa Kissa Kissanen - aiheen paikka Kissakujan nurmikko + aiheen paikka Kissakujan nurmikko - aiheen aika 2000-luku + aiheen aika 2000-luku @@ -172,19 +172,19 @@ - Kissakuvakokoelma - Cat image collection + Kissakuvakokoelma + Cat image collection - Kokoelma + Kokoelma - Katso teos Testimuseon kokoelmasivustolla + Katso teos Testimuseon kokoelmasivustolla - https://www.kansallisgalleria.fi/fi/object/594898 - https://www.kansallisgalleria.fi/en/object/594898 + https://www.kansallisgalleria.fi/fi/object/594898 + https://www.kansallisgalleria.fi/en/object/594898 @@ -193,61 +193,61 @@ - K1554 + K1554 - item + item - Testimuseo + Testimuseo - CC0 - julkinen + CC0 + julkinen - 924453 - HK19931028_2211.tif + 924453 + HK19931028_2211.tif - https://kissarepo/images/download?id=k1554_1&size=thumb + https://kissarepo/images/download?id=k1554_1&size=thumb - https://kissarepo/images/download?id=k1554_1&size=large + https://kissarepo/images/download?id=k1554_1&size=large - https://kissarepo/images/download?id=k1554_1&size=master + https://kissarepo/images/download?id=k1554_1&size=master - CC BY 4.0 - Tiedostoa voi käyttää vapaasti myös kaupallisesti. + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. - Karvinen, Osku + Karvinen, Osku - https://kissarepo/images/download?id=k1554_1&size=original&format=mp4 + https://kissarepo/images/download?id=k1554_1&size=original&format=mp4 - https://www.youtube.com/watch?v=k1554_1 + https://www.youtube.com/watch?v=k1554_1 - InC - In copyright + InC + In copyright - Testimuseo + Testimuseo - Testimuseo / Karvinen, Osku + Testimuseo / Karvinen, Osku diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml index bebe8724f..6512d3139 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml @@ -12,7 +12,7 @@ Hänen Majesteettinsa Kissa Kissanen - Ei otsikkoa + Kissa nurmikolla -video valmistusaika 2009 pituus: 6 cm @@ -29,18 +29,18 @@ VIDEO - Karvinen, Osku + - Testimuseo / Karvinen, Osku Testimuseo + - Testimuseo / Karvinen, Osku Testimuseo + From d4f3d1f343334ccc790a9e4d2b9ffa3cd4d182ac Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 17 Jun 2026 14:54:37 +0300 Subject: [PATCH 8/9] edit comment --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index c6581535a..da856da8d 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -24,7 +24,7 @@ - + From 140d0e105ec7bfde8c3f62c586a574724219a6d3 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Thu, 18 Jun 2026 11:12:38 +0300 Subject: [PATCH 9/9] Replace Finna-specific language with more generic terms. --- .../transformations/lido2edm.xsl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index da856da8d..7b944ff05 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -815,14 +815,14 @@ - + - + - + @@ -830,12 +830,12 @@ - + - + @@ -846,13 +846,13 @@ - + - - + +