diff --git a/src/main/java/org/fao/geonet/schema/dcatap/DCATAPSchemaPlugin.java b/src/main/java/org/fao/geonet/schema/dcatap/DCATAPSchemaPlugin.java index 79e8899d..e14db7fe 100644 --- a/src/main/java/org/fao/geonet/schema/dcatap/DCATAPSchemaPlugin.java +++ b/src/main/java/org/fao/geonet/schema/dcatap/DCATAPSchemaPlugin.java @@ -143,24 +143,24 @@ private Set getAssociatedVirtualCatalog(Element metadata) { /** * For next records, resolve dcat:next elements */ - private Set getAssociatedNext(Element metadata) { - Set results = getAssociatedResourcesByXpath(metadata, "*//dcat:next/@rdf:resource"); + private Set getAssociatedPrevious(Element metadata) { + Set results = getAssociatedResourcesByXpath(metadata, "*//dcat:prev/@rdf:resource"); return results.stream() - .peek(ar -> ar.setAssociationType("nextResource")) + .peek(ar -> ar.setAssociationType("revisionOf")) .collect(Collectors.toSet()); } /** * For previous records, find datasets that point to the current one with a dcat:next */ - private Set getAssociatedPrevious(Element metadata) { + private Set getAssociatedNext(Element metadata) { try { String currentUuid = getCurrentUuid(metadata); if (currentUuid == null) { return Collections.emptySet(); } var searchManager = ApplicationContextHolder.get().getBean(EsSearchManager.class); - var response = searchManager.query(String.format("+nextUUIDInSeries:\"%s\"", currentUuid), null, + var response = searchManager.query(String.format("+previousUUIDInSeries:\"%s\"", currentUuid), null, Sets.newHashSet("uuid", "resourceTitleObject.default"), 0, 100); if (response.hits().hits().isEmpty()) { @@ -175,7 +175,7 @@ private Set getAssociatedPrevious(Element metadata) { AssociatedResource ar = new AssociatedResource( (String) associatedRecord.get("uuid"), "", - "previousResource", + "nextResource", null, ((Map) associatedRecord.get("resourceTitleObject")).get("default") ); @@ -183,7 +183,7 @@ private Set getAssociatedPrevious(Element metadata) { } return res; } catch (Exception e) { - Log.error(Log.JEEVES, "GET associated previous resources error: " + e.getMessage(), e); + Log.error(Log.JEEVES, "GET associated next resources error: " + e.getMessage(), e); } return Collections.emptySet(); } diff --git a/src/main/plugin/dcat-ap/config/associated-panel/default.json b/src/main/plugin/dcat-ap/config/associated-panel/default.json index 09561535..95aee08f 100644 --- a/src/main/plugin/dcat-ap/config/associated-panel/default.json +++ b/src/main/plugin/dcat-ap/config/associated-panel/default.json @@ -37,6 +37,12 @@ "isTemplate": "n" }, "searchParamsPerType": { + "revisionOf-*": { + "type": [ + "dataset", + "service" + ] + }, "nextResource-*": { "type": [ "dataset", diff --git a/src/main/plugin/dcat-ap/index-fields/index.xsl b/src/main/plugin/dcat-ap/index-fields/index.xsl index 57ba9045..366d66a9 100644 --- a/src/main/plugin/dcat-ap/index-fields/index.xsl +++ b/src/main/plugin/dcat-ap/index-fields/index.xsl @@ -307,6 +307,11 @@ + + + + + diff --git a/src/main/plugin/dcat-ap/loc/dut/codelists.xml b/src/main/plugin/dcat-ap/loc/dut/codelists.xml index 732312c5..216e34a7 100644 --- a/src/main/plugin/dcat-ap/loc/dut/codelists.xml +++ b/src/main/plugin/dcat-ap/loc/dut/codelists.xml @@ -25,10 +25,15 @@ - + + + revisionOf + + Vorherige Resource in series diff --git a/src/main/plugin/dcat-ap/loc/eng/codelists.xml b/src/main/plugin/dcat-ap/loc/eng/codelists.xml index 4ab5ee05..d0882e95 100644 --- a/src/main/plugin/dcat-ap/loc/eng/codelists.xml +++ b/src/main/plugin/dcat-ap/loc/eng/codelists.xml @@ -25,10 +25,15 @@ - + + + revisionOf + + Previous resource in series diff --git a/src/main/plugin/dcat-ap/loc/fre/codelists.xml b/src/main/plugin/dcat-ap/loc/fre/codelists.xml index 9a9f8129..19bd1925 100644 --- a/src/main/plugin/dcat-ap/loc/fre/codelists.xml +++ b/src/main/plugin/dcat-ap/loc/fre/codelists.xml @@ -25,10 +25,15 @@ - + + + revisionOf + + Ressource précédente dans la série diff --git a/src/main/plugin/dcat-ap/loc/ger/codelists.xml b/src/main/plugin/dcat-ap/loc/ger/codelists.xml index bed6045e..94b305ce 100644 --- a/src/main/plugin/dcat-ap/loc/ger/codelists.xml +++ b/src/main/plugin/dcat-ap/loc/ger/codelists.xml @@ -25,10 +25,15 @@ - + + + revisionOf + + Vorherige Ressource in series diff --git a/src/main/plugin/dcat-ap/process/sibling-add.xsl b/src/main/plugin/dcat-ap/process/sibling-add.xsl index b2badcad..85f055e8 100644 --- a/src/main/plugin/dcat-ap/process/sibling-add.xsl +++ b/src/main/plugin/dcat-ap/process/sibling-add.xsl @@ -81,7 +81,7 @@ - + @@ -102,10 +102,11 @@ + - + - + diff --git a/src/main/plugin/dcat-ap/process/sibling-remove.xsl b/src/main/plugin/dcat-ap/process/sibling-remove.xsl index 7d649203..ec2eafe2 100644 --- a/src/main/plugin/dcat-ap/process/sibling-remove.xsl +++ b/src/main/plugin/dcat-ap/process/sibling-remove.xsl @@ -20,6 +20,7 @@ dcat:CatalogRecord[starts-with(@rdf:about, 'http') and @rdf:about = $uuidref]"/> +