From 17ddd73472b58b79f0bc87c6d2ec4d9492e79659 Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:07:52 +0100 Subject: [PATCH 1/7] CCMM: do not offer ccmm-xml in the openaire_data OAI context OpenAIRE does not use CCMM; the national metadata directory (NMA) harvests the default context /oai/request, which keeps the format. Review of ufal/clarin-dspace#1438. --- dspace/config/crosswalks/oai/xoai.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/dspace/config/crosswalks/oai/xoai.xml b/dspace/config/crosswalks/oai/xoai.xml index 033905d32d75..882881cf46af 100644 --- a/dspace/config/crosswalks/oai/xoai.xml +++ b/dspace/config/crosswalks/oai/xoai.xml @@ -103,7 +103,6 @@ - This context exports items following the openaire data archive rules. From fd6ee84674aba022edd8d7a818d529daaae3c92d Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:07:52 +0100 Subject: [PATCH 2/7] Move the CLARIN dspace.version.prefix to clarin-dspace.cfg CLARIN-specific values live in clarin-dspace.cfg (e.g. dspace.name), which overrides dspace.cfg, so the effective value does not change. dspace.cfg keeps the documentation, now with the actual fallback of RootConverter. Review of ufal/clarin-dspace#1438. --- dspace/config/clarin-dspace.cfg | 2 ++ dspace/config/dspace.cfg | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dspace/config/clarin-dspace.cfg b/dspace/config/clarin-dspace.cfg index f6230a670b03..8e489ff6fa9c 100644 --- a/dspace/config/clarin-dspace.cfg +++ b/dspace/config/clarin-dspace.cfg @@ -7,6 +7,8 @@ #------------------------------------------------------------------# dspace.shortname = DSpace dspace.name = CLARIN DSpace +# Prefix of the version string at the REST root (UI ), see dspace.cfg +dspace.version.prefix = CLARIN-DSpace #------------------------------------------------------------------# #---------------------------UPLOAD FILE----------------------------# diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index e78ba5a041f4..38bf5076a8ac 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -43,10 +43,10 @@ dspace.name = DSpace at My University dspace.shortname = DSpace # Prefix for the version string exposed at the REST root (/server/api), rendered by the UI as -# the HTML value. Falls back to "DSpace" when unset or blank. -# This branch is the UFAL/CLARIN base, so it ships the CLARIN identity by default. -# Non-CLARIN deployments must set this to "DSpace". -dspace.version.prefix = CLARIN-DSpace +# the HTML value. Falls back to "CLARIN-DSpace" when unset or blank. +# The CLARIN value is set in clarin-dspace.cfg. Non-CLARIN deployments set this to "DSpace" +# in local.cfg. +#dspace.version.prefix = DSpace # Assetstore configurations have moved to config/modules/assetstore.cfg # and config/spring/api/bitstore.xml. From a43cf7ff2d38f84f813289820ba207cc68517552 Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:12:05 +0100 Subject: [PATCH 3/7] CCMM: primary_language only for an item with exactly one language dc.language.iso has no order of importance: multilingual items list their languages alphabetically, so the first code was an arbitrary primary language (e.g. Ancient Greek for Universal Dependencies). With several languages all of them are now other_language; no language is dropped. primary_language is optional (0..1) in CCMM 1.1.0 and 2.0.0. Review of ufal/clarin-dspace#1438. --- .../xoai/tests/stylesheets/CcmmXslTest.java | 46 +++++++++++++------ .../crosswalks/oai/metadataFormats/ccmm.xsl | 21 +++++---- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java index 9846726f36d8..5873b226a758 100644 --- a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java +++ b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java @@ -354,20 +354,37 @@ public void ccmmAnItemWithNoFilesIsMetadataOnlyNotRestricted() throws Exception public void ccmmContainsPrimaryLanguage() throws Exception { // CCMM: "Use IRI identifier from the register // http://publications.europa.eu/resource/authority/language" - String result = apply("ccmm.xsl").to(resource(MAIN)); + String result = ccmmOf(once(fixture(MAIN), ENG_CODE, "")); assertThat(result, is(ccmm().withXPath( - "//ccmm:dataset/ccmm:primary_language/ccmm:iri", - equalTo("http://publications.europa.eu/resource/authority/language/CES")))); + "//ccmm:dataset/ccmm:primary_language/ccmm:iri", equalTo(LANGUAGE + "CES")))); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:other_language)", equalTo("0")))); + } + + @Test + public void ccmmSeveralLanguagesHaveNoPrimaryLanguage() throws Exception { + // dc.language.iso has no order of importance, so with several languages none is the primary one + String result = apply("ccmm.xsl").to(resource(MAIN)); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:primary_language)", equalTo("0")))); } @Test public void ccmmOtherLanguageKeepsItsRegisterIri() throws Exception { - // document order is preserved and duplicates removed without reordering, so the second - // distinct code is the first other_language + // with several languages every one is an other_language, in document order String result = apply("ccmm.xsl").to(resource(MAIN)); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:other_language)", equalTo("2")))); assertThat(result, is(ccmm().withXPath( - "//ccmm:dataset/ccmm:other_language/ccmm:iri", - equalTo("http://publications.europa.eu/resource/authority/language/ENG")))); + "(//ccmm:dataset/ccmm:other_language/ccmm:iri)[1]", equalTo(LANGUAGE + "CES")))); + assertThat(result, is(ccmm().withXPath( + "(//ccmm:dataset/ccmm:other_language/ccmm:iri)[2]", equalTo(LANGUAGE + "ENG")))); + } + + @Test + public void ccmmTheSameLanguageTwiceIsOnePrimaryLanguage() throws Exception { + // "cs" and "ces" are one language once mapped to ISO 639-3 + String result = ccmmOf(once(fixture(MAIN), ENG_CODE, "cs")); + assertThat(result, is(ccmm().withXPath( + "//ccmm:dataset/ccmm:primary_language/ccmm:iri", equalTo(LANGUAGE + "CES")))); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:other_language)", equalTo("0")))); } @Test @@ -1120,13 +1137,13 @@ public void ccmmMandatoryLicenceIsNeverAnEmptyElement() throws Exception { public void ccmmLanguageCarriesTheRegisterIriAndNoInventedLabel() throws Exception { // the scope note asks for the register's label "and/or" its code; DSpace's own string is // not the register's, so only the IRI is published - String result = apply("ccmm.xsl").to(resource(MAIN)); - assertThat(result, is(ccmm().withXPath( - "//ccmm:primary_language/ccmm:iri", - equalTo("http://publications.europa.eu/resource/authority/language/CES")))); - assertThat(result, is(ccmm().withXPath( + String single = ccmmOf(once(fixture(MAIN), ENG_CODE, "")); + assertThat(single, is(ccmm().withXPath("//ccmm:primary_language/ccmm:iri", equalTo(LANGUAGE + "CES")))); + assertThat(single, is(ccmm().withXPath( "count(//ccmm:primary_language/ccmm:label)", equalTo("0")))); - assertThat(result, is(ccmm().withXPath( + String several = apply("ccmm.xsl").to(resource(MAIN)); + assertThat(several, is(ccmm().withXPath("count(//ccmm:other_language/ccmm:iri)", equalTo("2")))); + assertThat(several, is(ccmm().withXPath( "count(//ccmm:other_language/ccmm:label)", equalTo("0")))); } @@ -1910,6 +1927,9 @@ private static String relationTypeOf(String iri) { private static final String SOURCE_URI = "https://example.org/czech-nlp-dataset"; /** dc.relation.replaces of MAIN */ private static final String REPLACED = "http://hdl.handle.net/123456789/1-1111"; + /** the second of MAIN's two dc.language.iso codes */ + private static final String ENG_CODE = "eng"; + private static final String LANGUAGE = "http://publications.europa.eu/resource/authority/language/"; /** A fixture as text, to edit with {@link #once} or {@link #add} and transform with {@link #ccmmOf}. */ private String fixture(String name) throws Exception { diff --git a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl index 2be6551d4a14..143858b61472 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1113,7 +1113,11 @@ broadening of AJP, and HBS has no single successor). --> - + + - - - - - - - + + + + + + + + From 062d03566f73374f61347bc33809c04cd86d0a5d Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:23:32 +0100 Subject: [PATCH 4/7] CCMM: a language value without a code also means several languages An item with ces and a free-text value (e.g. "English; Czech") has no primary language either; CES stays as other_language. dspace.cfg no longer suggests setting dspace.version.prefix there, clarin-dspace.cfg overrides it. --- .../xoai/tests/stylesheets/CcmmXslTest.java | 17 +++++++++++++++++ .../crosswalks/oai/metadataFormats/ccmm.xsl | 19 ++++++++++--------- dspace/config/dspace.cfg | 5 ++--- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java index 5873b226a758..78b088853a80 100644 --- a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java +++ b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java @@ -387,6 +387,23 @@ public void ccmmTheSameLanguageTwiceIsOnePrimaryLanguage() throws Exception { assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:other_language)", equalTo("0")))); } + @Test + public void ccmmAValueWithoutACodeStillMeansSeveralLanguages() throws Exception { + // free text maps to no register code, but it can be another language, so CES is not primary + String result = ccmmOf(once(fixture(MAIN), ENG_CODE, "English; Czech")); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:primary_language)", equalTo("0")))); + assertThat(result, is(ccmm().withXPath("count(//ccmm:dataset/ccmm:other_language)", equalTo("1")))); + assertThat(result, is(ccmm().withXPath( + "//ccmm:dataset/ccmm:other_language/ccmm:iri", equalTo(LANGUAGE + "CES")))); + } + + @Test + public void ccmmNoLanguageIsNeitherPrimaryNorOther() throws Exception { + String result = ccmmOf(once(once(fixture(MAIN), "ces", ""), ENG_CODE, "")); + assertThat(result, is(ccmm().withXPath( + "count(//ccmm:dataset/ccmm:primary_language | //ccmm:dataset/ccmm:other_language)", equalTo("0")))); + } + @Test public void ccmmAcceptsIso6391AndRegionSubtags() throws Exception { // stock DSpace stores "en_US"; the register keys on the uppercased 639-3 code diff --git a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl index 143858b61472..6f761f1febd5 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -191,6 +191,12 @@ else ())"/> + + - - - + - + @@ -1136,8 +1137,8 @@ - - + + diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 38bf5076a8ac..fd451d8650bd 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -44,9 +44,8 @@ dspace.shortname = DSpace # Prefix for the version string exposed at the REST root (/server/api), rendered by the UI as # the HTML value. Falls back to "CLARIN-DSpace" when unset or blank. -# The CLARIN value is set in clarin-dspace.cfg. Non-CLARIN deployments set this to "DSpace" -# in local.cfg. -#dspace.version.prefix = DSpace +# Set in clarin-dspace.cfg, which overrides this file; non-CLARIN deployments set +# dspace.version.prefix = DSpace in local.cfg. # Assetstore configurations have moved to config/modules/assetstore.cfg # and config/spring/api/bitstore.xml. From d1e601b5212b536bbdf61ccd714b8df13c535dc5 Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:33:13 +0100 Subject: [PATCH 5/7] CCMM: only the first of several relations to one resource carries its iri CCMM identifies a related resource by its iri and gives it one relation type (SHACL sh:maxCount 1 on ccmm:hasType). Two stated relations to one Handle (11858/00-097C-0000-0001-487A-4: isbasedon + requires PDT 2.0, 11858/00-097C-0000-0006-DB11-8: isbasedon + replaces) became one RDF resource with two types and failed SHACL in CCMM 1.1.0 and 2.0.0. The further relation keeps identifier and resource_url, so both relations are still published. --- .../xoai/tests/stylesheets/CcmmXslTest.java | 15 +++++++++++++-- .../crosswalks/oai/metadataFormats/ccmm.xsl | 8 +++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java index 78b088853a80..16f8c6dcc00f 100644 --- a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java +++ b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java @@ -1751,14 +1751,25 @@ public void ccmmTwoStatedRelationsToOneResourceAreBothPublished() throws Excepti // choosing one would be correcting the record String result = ccmmOf(add(fixture(MAIN), "dc", field("relation.isbasedon", "none", REPLACED))); assertThat(result, is(ccmm().withXPath( - "count(//ccmm:related_resource[ccmm:iri='" + REPLACED + "'])", equalTo("2")))); + "count(//ccmm:related_resource[ccmm:resource_url='" + REPLACED + "'])", equalTo("2")))); for (String type : new String[] {"Obsoletes", "IsDerivedFrom"}) { assertThat(type, result, is(ccmm().withXPath( - "count(//ccmm:related_resource[ccmm:iri='" + REPLACED + "']" + "count(//ccmm:related_resource[ccmm:resource_url='" + REPLACED + "']" + + "[ccmm:identifier/ccmm:value='123456789/1-1111']" + "[ccmm:resource_relation_type/ccmm:iri='" + RELATION + type + "'])", equalTo("1")))); } } + @Test + public void ccmmOnlyTheFirstOfTwoRelationsToOneResourceCarriesItsIri() throws Exception { + // CCMM identifies a related resource by its iri and allows it one relation type (SHACL + // sh:maxCount 1 on ccmm:hasType), so a second relation to the same resource has no iri + String result = ccmmOf(add(fixture(MAIN), "dc", field("relation.isbasedon", "none", REPLACED))); + assertThat(result, is(ccmm().withXPath( + "count(//ccmm:related_resource[ccmm:iri='" + REPLACED + "'])", equalTo("1")))); + assertThat(result, is(ccmm().withXPath(relationTypeOf(REPLACED), equalTo(RELATION + "IsDerivedFrom")))); + } + @Test public void ccmmDemoUriThatIsAFeaturedServiceIsOnlyADistribution() throws Exception { // CCMM: distributions of the dataset SHALL NOT be modeled as related resource diff --git a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl index 6f761f1febd5..fac847bf6c37 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1816,15 +1816,21 @@ distributions (a featured service also given as the demo, a web service also given as the source) is not repeated as a related resource: CCMM says distributions SHALL NOT be modeled as related resources. + CCMM identifies a related resource by its iri and gives it one relation type (SHACL + sh:maxCount 1 on ccmm:hasType), so only the first relation to an IRI carries it; a + further one keeps the identifier and resource_url. --> + - + + + From e3c6a4df1da9a8f295567a27728f964525b2acc3 Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:41:55 +0100 Subject: [PATCH 6/7] CCMM: clarify which relation keeps the iri --- .../java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java | 3 ++- dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java index 16f8c6dcc00f..3c753c78b092 100644 --- a/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java +++ b/dspace-oai/src/test/java/org/dspace/xoai/tests/stylesheets/CcmmXslTest.java @@ -1763,7 +1763,8 @@ public void ccmmTwoStatedRelationsToOneResourceAreBothPublished() throws Excepti @Test public void ccmmOnlyTheFirstOfTwoRelationsToOneResourceCarriesItsIri() throws Exception { // CCMM identifies a related resource by its iri and allows it one relation type (SHACL - // sh:maxCount 1 on ccmm:hasType), so a second relation to the same resource has no iri + // sh:maxCount 1 on ccmm:hasType), so a second relation to the same resource has no iri. + // add() puts isbasedon before MAIN's own dc.relation element, so it is the first one. String result = ccmmOf(add(fixture(MAIN), "dc", field("relation.isbasedon", "none", REPLACED))); assertThat(result, is(ccmm().withXPath( "count(//ccmm:related_resource[ccmm:iri='" + REPLACED + "'])", equalTo("1")))); diff --git a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl index fac847bf6c37..89547ecbd24f 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1817,8 +1817,8 @@ the source) is not repeated as a related resource: CCMM says distributions SHALL NOT be modeled as related resources. CCMM identifies a related resource by its iri and gives it one relation type (SHACL - sh:maxCount 1 on ccmm:hasType), so only the first relation to an IRI carries it; a - further one keeps the identifier and resource_url. + sh:maxCount 1 on ccmm:hasType), so only the first relation to an IRI, in the record's + order, carries it; a further one is still identified by its resource_url. --> From 0bfe487a6419aa5e16270a8a4bc69768a6b2eea5 Mon Sep 17 00:00:00 2001 From: Mario Lukac Date: Mon, 23 Nov 2026 10:59:06 +0100 Subject: [PATCH 7/7] CCMM: drop the stale note that the first language code is primary --- dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl index 89547ecbd24f..51f6abfe1693 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -160,8 +160,8 @@ abkaframharaasmaze