Commit 784bbdd6 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Update memobase xslt to latest.

parent d4c6e433
Pipeline #11949 passed with stages
in 4 minutes and 42 seconds
......@@ -25,6 +25,7 @@ import org.apache.logging.log4j.LogManager
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.api.assertAll
import org.memobase.testing.EmbeddedSftpServer
import java.io.InputStream
import java.util.Properties
......@@ -43,16 +44,24 @@ class TestXsltTransform {
}
@Test
fun `test xslt tranform`() {
fun `test old memobase xslt tranform`() {
val props = Properties()
props.setProperty("xsltFilePath", "${resourcePath}/test_transform/test-transformer.xslt")
props.setProperty("identifierFieldName", "identifierMain")
props.setProperty("recordTag", "record")
val transformer = XMLTransformer(props)
val result = transformer.applyXSLT("", createInputStream("test_transform/test-transformer.xml"))
assertAll("assert old memobase xslt transformation.",
{
assertThat(result.key)
.isEqualTo("ADG-102821")
.isEqualTo("ADG-102683")
},
{
assertThat(result.value.output.toString())
.isEqualTo(readFile("test_transform/output.json"))
}
)
}
}
{"title":"Grabung Castaneda (Siedlung)","SerieTitle":"Grabung Walo Burkart und Karl Keller-Tarnuzzer, Castaneda (Gräberfeld und Siedlung)","creatorPerson":{"name":"[unbekannt]"},"Keywords":"Ausgrabung, Archäologie","Abstract":"Feld 1, östlicher Teil von Westen","Claim":"Dieses Dokument wurde Dank der Unterstützung von Memoriav erhalten.","RecordingLocation":"Castaneda","contributorCorporateBody":{"name":"ADG"},"genre":"Grabungsfotografie / Arbeitsfotografie / Sachfotografie","objectType":"photograph","medium":"[keine Information vorhanden]","imageFormatColorMode":"sw","imageFormatRemarks":"Album-Nr.: A2","identifierOriginal":"102821","identifierCallNumber":"RM_1_33_6","identifierMain":"ADG-102821","location":"Schweiz, Graubünden, Castaneda","rightsHolder":"Archäologischer Dienst Graubünden","accessPhsyical":"onsite","accessDigital":"public"}
\ No newline at end of file
{"title":"Ausgrabung Crestaulta","SerieTitle":"Grabung Walo Burkart und Karl Keller-Tarnuzzer, Lumbrein-Surin (Crestaulta)","creatorPerson":{"name":"Karl Keller-Tarnuzzer"},"Keywords":"Ausgrabung, Archäologie","Abstract":"Herdstelle in Fläche D, 2. Situation (mittlere Schicht)","Context":"Verwandte Dokumente: RM_1_1_7","Claim":"Dieses Dokument wurde Dank der Unterstützung von Memoriav erhalten.","RecordingLocation":"Lumbrein-Surin, Crestaulta","contributorCorporateBody":{"name":"ADG"},"genre":"Grabungsfotografie / Arbeitsfotografie / Sachfotografie","objectType":"photograph","medium":"[keine Information vorhanden]","imageFormatColorMode":"sw","imageFormatRemarks":"Album-Nr.: A4","identifierOriginal":"102683","identifierCallNumber":"RM_1_3_10","identifierMain":"ADG-102683","location":"Schweiz, Graubünden, Lumbrein-Surin, Crestaulta","rightsHolder":"Archäologischer Dienst Graubünden","accessPhsyical":"onsite","accessDigital":"public"}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ xml-data-transform
~ Copyright (C) 2020 Memoriav
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<foxml:digitalObject VERSION="1.1" PID="memobase:ADG-102821"
<foxml:digitalObject VERSION="1.1" PID="memobase:ADG-102683"
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
<foxml:objectProperties>
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Grabung_Castaneda__Siedlung_"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="Ausgrabung_Crestaulta"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="ADG"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2019-11-08T13:12:48.159Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2019-11-08T13:12:48.503Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2019-11-08T13:11:41.422Z"/>
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2019-11-08T13:11:49.329Z"/>
</foxml:objectProperties>
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2019-11-08T13:12:48.159Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2019-11-08T13:11:41.422Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
<foxml:xmlContent>
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
<audit:record ID="AUDREC1">
......@@ -37,7 +19,7 @@
<audit:action>addDatastream</audit:action>
<audit:componentID>TRANSFORMED_METADATA_0</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2019-11-08T13:12:48.284Z</audit:date>
<audit:date>2019-11-08T13:11:42.157Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC2">
......@@ -45,7 +27,7 @@
<audit:action>addDatastream</audit:action>
<audit:componentID>THUMBNAIL_0</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2019-11-08T13:12:48.347Z</audit:date>
<audit:date>2019-11-08T13:11:49.204Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC3">
......@@ -53,7 +35,7 @@
<audit:action>modifyDatastreamByValue</audit:action>
<audit:componentID>DC</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2019-11-08T13:12:48.441Z</audit:date>
<audit:date>2019-11-08T13:11:49.251Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
<audit:record ID="AUDREC4">
......@@ -61,7 +43,7 @@
<audit:action>addDatastream</audit:action>
<audit:componentID>ACCESSCOPY_0</audit:componentID>
<audit:responsibility>fedoraAdmin</audit:responsibility>
<audit:date>2019-11-08T13:12:48.503Z</audit:date>
<audit:date>2019-11-08T13:11:49.329Z</audit:date>
<audit:justification></audit:justification>
</audit:record>
</audit:auditTrail>
......@@ -69,21 +51,21 @@
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2019-11-08T13:12:48.159Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="400">
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" CREATED="2019-11-08T13:11:41.422Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="393">
<foxml:xmlContent>
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Grabung_Castaneda__Siedlung_</dc:title>
<dc:identifier>memobase:ADG-102821</dc:identifier>
<dc:title>Ausgrabung_Crestaulta</dc:title>
<dc:identifier>memobase:ADG-102683</dc:identifier>
</oai_dc:dc>
</foxml:xmlContent>
</foxml:datastreamVersion>
<foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2019-11-08T13:12:48.441Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="607">
<foxml:datastreamVersion ID="DC.1" LABEL="Dublin Core Record for this object" CREATED="2019-11-08T13:11:49.251Z" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/" SIZE="600">
<foxml:xmlContent>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:title>Grabung Castaneda (Siedlung)</dc:title>
<dc:title>Ausgrabung Crestaulta</dc:title>
<dc:type>memobase:MemobaseDocumentModel-1.0</dc:type>
<dc:identifier>memobase:ADG-102821</dc:identifier>
<dc:source>102821</dc:source>
<dc:identifier>memobase:ADG-102683</dc:identifier>
<dc:source>102683</dc:source>
<dc:language>en</dc:language>
<dc:relation>memobase:ADG-68432</dc:relation>
<dc:rights>onsite,public</dc:rights>
......@@ -92,19 +74,19 @@
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="TRANSFORMED_METADATA_0" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
<foxml:datastreamVersion ID="TRANSFORMED_METADATA_0.0" LABEL="Internal Memobase Metadata" CREATED="2019-11-08T13:12:48.284Z" MIMETYPE="text/xml" FORMAT_URI="urn:ebu:metadata-schema:ebuCore_2012" SIZE="3003">
<foxml:datastreamVersion ID="TRANSFORMED_METADATA_0.0" LABEL="Internal Memobase Metadata" CREATED="2019-11-08T13:11:42.157Z" MIMETYPE="text/xml" FORMAT_URI="urn:ebu:metadata-schema:ebuCore_2012" SIZE="3183">
<foxml:xmlContent>
<ebuCoreMain xmlns:ns2="http://purl.org/dc/elements/1.1/" xml:lang="de">
<ebuCoreMain xmlns="urn:ebu:metadata-schema:ebuCore_2012" xmlns:ns2="http://purl.org/dc/elements/1.1/" xml:lang="de">
<coreMetadata>
<title>
<ns2:title>Grabung Castaneda (Siedlung)</ns2:title>
<ns2:title>Ausgrabung Crestaulta</ns2:title>
</title>
<alternativeTitle typeLabel="SerieTitle">
<ns2:title>Grabung Walo Burkart und Karl Keller-Tarnuzzer, Castaneda (Gräberfeld und Siedlung)</ns2:title>
<ns2:title>Grabung Walo Burkart und Karl Keller-Tarnuzzer, Lumbrein-Surin (Crestaulta)</ns2:title>
</alternativeTitle>
<creator>
<contactDetails>
<name>[unbekannt]</name>
<name>Karl Keller-Tarnuzzer</name>
</contactDetails>
<role typeLabel="Author"></role>
</creator>
......@@ -112,13 +94,16 @@
<ns2:subject>Ausgrabung, Archäologie</ns2:subject>
</subject>
<description typeLabel="Abstract">
<ns2:description>Feld 1, östlicher Teil von Westen</ns2:description>
<ns2:description>Herdstelle in Fläche D, 2. Situation (mittlere Schicht)</ns2:description>
</description>
<description typeLabel="Context">
<ns2:description>Verwandte Dokumente: RM_1_1_7</ns2:description>
</description>
<description typeLabel="Claim">
<ns2:description>Dieses Dokument wurde Dank der Unterstützung von Memoriav erhalten.</ns2:description>
</description>
<description typeLabel="RecordingLocation">
<ns2:description>Castaneda</ns2:description>
<ns2:description>Lumbrein-Surin, Crestaulta </ns2:description>
</description>
<contributor>
<organisationDetails>
......@@ -127,7 +112,7 @@
<role typeLabel="ResponsibleInstitution"></role>
</contributor>
<date>
<created startYear="1942"></created>
<created startYear="1937"></created>
</date>
<type>
<genre typeLabel="Grabungsfotografie / Arbeitsfotografie / Sachfotografie"></genre>
......@@ -139,29 +124,29 @@
<medium typeLabel="[keine Information vorhanden]"></medium>
<imageFormat>
<technicalAttributeString typeLabel="ColorMode">sw</technicalAttributeString>
<technicalAttributeString typeLabel="Remarks">Album-Nr.: A2</technicalAttributeString>
<technicalAttributeString typeLabel="Remarks">Album-Nr.: A4</technicalAttributeString>
</imageFormat>
</format>
<identifier typeLabel="Original">
<ns2:identifier>102821</ns2:identifier>
<ns2:identifier>102683</ns2:identifier>
<attributor entityId="Provider"></attributor>
</identifier>
<identifier typeLabel="CallNumber">
<ns2:identifier>RM_1_33_6</ns2:identifier>
<ns2:identifier>RM_1_3_10</ns2:identifier>
</identifier>
<identifier typeLabel="Main">
<ns2:identifier>ADG-102821</ns2:identifier>
<ns2:identifier>ADG-102683</ns2:identifier>
</identifier>
<isMemberOf>
<ns2:relation>ADG-68432</ns2:relation>
</isMemberOf>
<coverage>
<temporal>
<PeriodOfTime period="1929-1945"></PeriodOfTime>
<PeriodOfTime period="1937-1938"></PeriodOfTime>
</temporal>
<spatial>
<location>
<name>Schweiz, Graubünden, Castaneda</name>
<name>Schweiz, Graubünden, Lumbrein-Surin, Crestaulta </name>
</location>
</spatial>
</coverage>
......@@ -184,13 +169,13 @@
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="THUMBNAIL_0" STATE="A" CONTROL_GROUP="M" VERSIONABLE="true">
<foxml:datastreamVersion ID="THUMBNAIL_0.0" LABEL="RM_1_33_6.png" CREATED="2019-11-08T13:12:48.347Z" MIMETYPE="image/png" SIZE="27973">
<foxml:contentLocation TYPE="INTERNAL_ID" REF="memobase:ADG-102821+THUMBNAIL_0+THUMBNAIL_0.0"/>
<foxml:datastreamVersion ID="THUMBNAIL_0.0" LABEL="RM_1_3_10.png" CREATED="2019-11-08T13:11:49.204Z" MIMETYPE="image/png" SIZE="28206">
<foxml:contentLocation TYPE="INTERNAL_ID" REF="memobase:ADG-102683+THUMBNAIL_0+THUMBNAIL_0.0"/>
</foxml:datastreamVersion>
</foxml:datastream>
<foxml:datastream ID="ACCESSCOPY_0" STATE="A" CONTROL_GROUP="M" VERSIONABLE="true">
<foxml:datastreamVersion ID="ACCESSCOPY_0.0" LABEL="RM_1_33_6.jpg" CREATED="2019-11-08T13:12:48.503Z" MIMETYPE="image/jpeg" SIZE="1585055">
<foxml:contentLocation TYPE="INTERNAL_ID" REF="memobase:ADG-102821+ACCESSCOPY_0+ACCESSCOPY_0.0"/>
<foxml:datastreamVersion ID="ACCESSCOPY_0.0" LABEL="RM_1_3_10.jpg" CREATED="2019-11-08T13:11:49.329Z" MIMETYPE="image/jpeg" SIZE="1584333">
<foxml:contentLocation TYPE="INTERNAL_ID" REF="memobase:ADG-102683+ACCESSCOPY_0+ACCESSCOPY_0.0"/>
</foxml:datastreamVersion>
</foxml:datastream>
</foxml:digitalObject>
\ No newline at end of file
......@@ -12,10 +12,12 @@
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:fedora="info:fedora/fedora-system:def/relations-external#"
xmlns:fedora-model="info:fedora/fedora-system:def/model#"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xslt="http://www.w3.org/1999/XSL/Transform">
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:ebu:metadata-schema:ebuCore_2012"
xpath-default-namespace="urn:ebu:metadata-schema:ebuCore_2012">
<xsl:output
indent="no"
indent="yes"
method="xml"
/>
......@@ -24,15 +26,12 @@
</xsl:template>-->
<xsl:template match="/">
<record>
<xsl:template match="coreMetadata">
<xsl:element name="record">
<!--<xsl:apply-templates select="test"/>
<xsl:apply-templates select="title, ns2:title, alternativeTitle, subject, description, format/essenceLocator, format/medium, type/*, references"/>-->
<xsl:apply-templates />
</record>
<!--<xsl:element name="record">
<xsl:apply-templates select="test"/>
<xsl:apply-templates select="title, ns2:title, alternativeTitle, subject, description, format/essenceLocator, format/medium, type/*, references"/>
</xsl:element>-->
</xsl:element>
</xsl:template>
<!-- content of child node is copied to parent node -->
......
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