From 5dfc73d013b4a686938744950e5744d64a944924 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 8199b18e220d..e9ee7d2c89e6 100644 --- a/dspace/config/crosswalks/oai/xoai.xml +++ b/dspace/config/crosswalks/oai/xoai.xml @@ -121,7 +121,6 @@ - This context exports items following the openaire data archive rules. From 8e1b1d3175d10fa740f92212eb800c9b80f723e9 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 045bdb5bfa38..66b526c5291f 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 6c892758ade5..317f4654c5ec 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 65bae3166fdac0910517739d312f1d96d060775b 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 4b8cfb036684..8b75d9f645f1 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 @@ -353,20 +353,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 @@ -1119,13 +1136,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")))); } @@ -1909,6 +1926,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 46a658653584..560e41d165de 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1112,7 +1112,11 @@ broadening of AJP, and HBS has no single successor). --> - + + - - - - - - - + + + + + + + + From 95b503b16833a0dea525ebf24f039328692ba5be 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 8b75d9f645f1..f8efcf65c715 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 @@ -386,6 +386,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 560e41d165de..fad122ff330a 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -190,6 +190,12 @@ else ())"/> + + - - - + - + @@ -1135,8 +1136,8 @@ - - + + diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 317f4654c5ec..d8991f11feae 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 fefebc57075f87cfa393298f802a38661b14609c 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 f8efcf65c715..73ee6e88b467 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 @@ -1750,14 +1750,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 fad122ff330a..c025084a4502 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1815,15 +1815,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 3400d39d52564e9f53355ae18bc4fe713e225443 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 73ee6e88b467..c48fc102e688 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 @@ -1762,7 +1762,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 c025084a4502..521a2a23c0bb 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -1816,8 +1816,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 6758bec8c4aa36519ac1cc1cca0892ec7c6343eb 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 521a2a23c0bb..c47af1cfb5a1 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/ccmm.xsl @@ -159,8 +159,8 @@ abkaframharaasmaze