From 1d35611ff9c2587f108fb6a0f83a60e5b54ee949 Mon Sep 17 00:00:00 2001 From: gbif-jenkins Date: Mon, 18 Dec 2023 13:34:48 +0100 Subject: [PATCH 1/4] [maven-release-plugin] prepare for next development iteration (cherry picked from commit ae30c6eb0f912900d6a35760911e77b92dd828d1) --- pom.xml | 2 +- registry-cli/pom.xml | 2 +- registry-directory/pom.xml | 2 +- registry-doi/pom.xml | 2 +- registry-domain/pom.xml | 2 +- registry-events/pom.xml | 2 +- registry-examples/pom.xml | 4 ++-- registry-identity/pom.xml | 2 +- registry-integration-tests/pom.xml | 2 +- registry-mail/pom.xml | 2 +- registry-messaging/pom.xml | 2 +- registry-oaipmh/pom.xml | 2 +- registry-persistence/pom.xml | 2 +- registry-pipelines/pom.xml | 2 +- registry-search/pom.xml | 2 +- registry-security/pom.xml | 2 +- registry-service/pom.xml | 2 +- registry-surety/pom.xml | 2 +- registry-ws-client/pom.xml | 2 +- registry-ws/pom.xml | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 0909642ab..b228bafad 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.gbif.registry registry-parent - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT GBIF Registry Parent GBIF Registry project diff --git a/registry-cli/pom.xml b/registry-cli/pom.xml index 4a37bcd32..c3350950f 100644 --- a/registry-cli/pom.xml +++ b/registry-cli/pom.xml @@ -4,7 +4,7 @@ org.gbif.registry registry-parent - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT registry-cli diff --git a/registry-directory/pom.xml b/registry-directory/pom.xml index 4756e44b4..07adbd956 100644 --- a/registry-directory/pom.xml +++ b/registry-directory/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-doi/pom.xml b/registry-doi/pom.xml index 0879856ef..27567ae10 100644 --- a/registry-doi/pom.xml +++ b/registry-doi/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-domain/pom.xml b/registry-domain/pom.xml index ac87789fc..471c67a4d 100644 --- a/registry-domain/pom.xml +++ b/registry-domain/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-events/pom.xml b/registry-events/pom.xml index 118cb783b..102288a92 100644 --- a/registry-events/pom.xml +++ b/registry-events/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-examples/pom.xml b/registry-examples/pom.xml index 9b5e798dc..813814717 100644 --- a/registry-examples/pom.xml +++ b/registry-examples/pom.xml @@ -3,12 +3,12 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 registry-examples - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT jar diff --git a/registry-identity/pom.xml b/registry-identity/pom.xml index b35102522..8e0bd41c6 100644 --- a/registry-identity/pom.xml +++ b/registry-identity/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-integration-tests/pom.xml b/registry-integration-tests/pom.xml index d73cc69b5..c6297e09a 100644 --- a/registry-integration-tests/pom.xml +++ b/registry-integration-tests/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-mail/pom.xml b/registry-mail/pom.xml index 99b96de42..78716c43c 100644 --- a/registry-mail/pom.xml +++ b/registry-mail/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-messaging/pom.xml b/registry-messaging/pom.xml index aa330c4ab..afee1493b 100644 --- a/registry-messaging/pom.xml +++ b/registry-messaging/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-oaipmh/pom.xml b/registry-oaipmh/pom.xml index 8a75aea04..149b1d7e7 100644 --- a/registry-oaipmh/pom.xml +++ b/registry-oaipmh/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-persistence/pom.xml b/registry-persistence/pom.xml index 509d0d2e1..c7d688334 100644 --- a/registry-persistence/pom.xml +++ b/registry-persistence/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-pipelines/pom.xml b/registry-pipelines/pom.xml index f2b41f70e..fc6b8ecef 100644 --- a/registry-pipelines/pom.xml +++ b/registry-pipelines/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-search/pom.xml b/registry-search/pom.xml index eebd99413..3b200b992 100644 --- a/registry-search/pom.xml +++ b/registry-search/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-security/pom.xml b/registry-security/pom.xml index c9a2576ae..a03e74316 100644 --- a/registry-security/pom.xml +++ b/registry-security/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-service/pom.xml b/registry-service/pom.xml index e15c3635d..02464ffe6 100644 --- a/registry-service/pom.xml +++ b/registry-service/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-surety/pom.xml b/registry-surety/pom.xml index 54c0b7ba4..cb91afe23 100644 --- a/registry-surety/pom.xml +++ b/registry-surety/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-ws-client/pom.xml b/registry-ws-client/pom.xml index c89c35944..e0b4045b1 100644 --- a/registry-ws-client/pom.xml +++ b/registry-ws-client/pom.xml @@ -3,7 +3,7 @@ registry-parent org.gbif.registry - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT 4.0.0 diff --git a/registry-ws/pom.xml b/registry-ws/pom.xml index c0728a1f1..be407cb3f 100644 --- a/registry-ws/pom.xml +++ b/registry-ws/pom.xml @@ -4,7 +4,7 @@ org.gbif.registry registry-parent - 3.95.13-SNAPSHOT + 3.95.14-SNAPSHOT registry-ws GBIF Registry Webservices From 613f27fd7eb510a517f1b54f045d99c962fc78b1 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Wed, 27 Dec 2023 13:36:42 +0100 Subject: [PATCH 2/4] #537 fixed dataset search parameters documentation --- .../ws/resources/DatasetResource.java | 113 +++++++++++------- 1 file changed, 68 insertions(+), 45 deletions(-) diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java index 707317e9f..978cf2d6f 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java @@ -45,13 +45,7 @@ import org.gbif.api.service.registry.DatasetSearchService; import org.gbif.api.service.registry.DatasetService; import org.gbif.api.util.iterables.Iterables; -import org.gbif.api.vocabulary.Continent; -import org.gbif.api.vocabulary.Country; -import org.gbif.api.vocabulary.DatasetSubtype; -import org.gbif.api.vocabulary.DatasetType; -import org.gbif.api.vocabulary.IdentifierType; -import org.gbif.api.vocabulary.License; -import org.gbif.api.vocabulary.MetadataType; +import org.gbif.api.vocabulary.*; import org.gbif.common.messaging.api.MessagePublisher; import org.gbif.common.messaging.api.messages.Platform; import org.gbif.common.messaging.api.messages.StartCrawlMessage; @@ -237,13 +231,6 @@ public DatasetResource( @Retention(RetentionPolicy.RUNTIME) @Parameters( value = { - @Parameter( - name = "country", - description = - "The 2-letter country code (as per ISO-3166-1) of the country publishing the dataset.", - schema = @Schema(implementation = Country.class), - in = ParameterIn.QUERY, - explode = Explode.FALSE), @Parameter( name = "type", description = "The primary type of the dataset.", @@ -256,24 +243,6 @@ public DatasetResource( schema = @Schema(implementation = DatasetSubtype.class), in = ParameterIn.QUERY, explode = Explode.TRUE), - @Parameter( - name = "license", - description = "The dataset's licence.", - schema = @Schema(implementation = License.class), - in = ParameterIn.QUERY, - explode = Explode.TRUE), - @Parameter( - name = "identifier", - description = "An identifier such as a DOI or UUID.", - schema = @Schema(implementation = String.class), - in = ParameterIn.QUERY), - @Parameter( - name = "keyword", - description = - "Filters datasets by a case insensitive plain text keyword. The search is done on the merged " - + "collection of tags, the dataset keywordCollections and temporalCoverages.", - schema = @Schema(implementation = String.class), - in = ParameterIn.QUERY), @Parameter( name = "publishingOrg", description = "Filters datasets by their publishing organization UUID key", @@ -285,9 +254,11 @@ public DatasetResource( schema = @Schema(implementation = UUID.class), in = ParameterIn.QUERY), @Parameter( - name = "endorsingNodeKey", - description = "Node key that endorsed this dataset's publisher", - schema = @Schema(implementation = UUID.class), + name = "keyword", + description = + "Filters datasets by a case insensitive plain text keyword. The search is done on the merged " + + "collection of tags, the dataset keywordCollections and temporalCoverages.", + schema = @Schema(implementation = String.class), in = ParameterIn.QUERY), @Parameter( name = "decade", @@ -305,17 +276,16 @@ public DatasetResource( in = ParameterIn.QUERY, explode = Explode.FALSE), @Parameter( - name = "projectId", + name = "hostingCountry", description = - "Filter or facet based on the project ID of a given dataset. A dataset can have a project id if " - + "it is the result of a project. multiple datasets can have the same project id.", - schema = @Schema(implementation = String.class), + "Filters datasets by their hosting organization's country given as a ISO 639-1 (2 letter) country code", + schema = @Schema(implementation = Country.class), in = ParameterIn.QUERY, - example = "AA003-AA003311F"), + explode = Explode.FALSE), @Parameter( - name = "hostingCountry", + name = "country", description = - "Filters datasets by their hosting organization's country given as a ISO 639-1 (2 letter) country code", + "The 2-letter country code (as per ISO-3166-1) of the country publishing the dataset.", schema = @Schema(implementation = Country.class), in = ParameterIn.QUERY, explode = Explode.FALSE), @@ -326,11 +296,64 @@ public DatasetResource( in = ParameterIn.QUERY, deprecated = true, explode = Explode.FALSE), + @Parameter( + name = "license", + description = "The dataset's licence.", + schema = @Schema(implementation = License.class), + in = ParameterIn.QUERY, + explode = Explode.TRUE), + @Parameter( + name = "projectId", + description = + "Filter or facet based on the project ID of a given dataset. A dataset can have a project id if " + + "it is the result of a project. multiple datasets can have the same project id.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "AA003-AA003311F"), + @Parameter( + name = "taxonKey", + description = "A taxon key from the GBIF backbone.", + schema = @Schema(implementation = Integer.class), + in = ParameterIn.QUERY), + @Parameter( + name = "recordCount", + description = + "Number of records of the dataset. Accepts ranges and a '*' can be used as a wildcard.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "100,*"), + @Parameter( + name = "modifiedDate", + description = + "Date when the dataset was modified the last time. Accepts ranges and a '*' can be used as a wildcard.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY, + example = "2022-05-01,*"), + @Parameter( + name = "doi", + description = "A DOI identifier.", + schema = @Schema(implementation = String.class), + in = ParameterIn.QUERY), @Parameter( name = "networkKey", description = "Network associated to a dataset", schema = @Schema(implementation = UUID.class), in = ParameterIn.QUERY), + @Parameter( + name = "endorsingNodeKey", + description = "Node key that endorsed this dataset's publisher", + schema = @Schema(implementation = UUID.class), + in = ParameterIn.QUERY), + @Parameter( + name = "installationKey", + description = "Key of the installation that hosts the dataset.", + schema = @Schema(implementation = UUID.class), + in = ParameterIn.QUERY), + @Parameter( + name = "endpointType", + description = "Type of the endpoint of the dataset.", + schema = @Schema(implementation = EndpointType.class), + in = ParameterIn.QUERY), @Parameter(name = "request", hidden = true), @Parameter(name = "searchRequest", hidden = true), @Parameter(name = "suggestRequest", hidden = true) @@ -340,9 +363,9 @@ public DatasetResource( @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) @Parameter( - name = "metadataKey", - description = "Key for the *metadata document* (not a dataset UUID).", - in = ParameterIn.PATH) + name = "metadataKey", + description = "Key for the *metadata document* (not a dataset UUID).", + in = ParameterIn.PATH) @interface MetadataDocumentKeyParameter {} @Operation( From 9d48ca2b45b3748db8bf213ee1a70fdc5f73d4f2 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Thu, 28 Dec 2023 11:43:42 +0100 Subject: [PATCH 3/4] #537 fixed dataset search parameters documentation --- .../indexing/DatasetJsonConverter.java | 26 ------------------- .../main/resources/dataset-es-mapping.json | 2 -- .../ws/resources/DatasetResource.java | 7 ----- 3 files changed, 35 deletions(-) diff --git a/registry-search/src/main/java/org/gbif/registry/search/dataset/indexing/DatasetJsonConverter.java b/registry-search/src/main/java/org/gbif/registry/search/dataset/indexing/DatasetJsonConverter.java index d4bb8df40..e85a99acf 100644 --- a/registry-search/src/main/java/org/gbif/registry/search/dataset/indexing/DatasetJsonConverter.java +++ b/registry-search/src/main/java/org/gbif/registry/search/dataset/indexing/DatasetJsonConverter.java @@ -88,11 +88,6 @@ public class DatasetJsonConverter { private static final int MAX_FACET_LIMIT = 1200000; - // Collections - private static final String PROCESSING_NAMESPACE = "processing.gbif.org"; - private static final String INSTITUTION_TAG_NAME = "institutionCode"; - private static final String COLLECTION_TAG_NAME = "collectionCode"; - // Gridded datasets private static final String GRIDDED_DATASET_NAMESPACE = "griddedDataSet.jwaller.gbif.org"; private static final String GRIDDED_DATASET_NAME = "griddedDataset"; @@ -405,27 +400,6 @@ private void addTaxonKeys(Dataset dataset, ObjectNode datasetObjectNode) { } private void addMachineTags(Dataset dataset, ObjectNode datasetObjectNode) { - datasetObjectNode - .putArray("institutionKey") - .addAll( - dataset.getMachineTags().stream() - .filter( - mt -> - PROCESSING_NAMESPACE.equals(mt.getNamespace()) - && INSTITUTION_TAG_NAME.equals(mt.getName())) - .map(v -> new TextNode(v.getValue().split(":")[0])) - .collect(Collectors.toList())); - datasetObjectNode - .putArray("collectionKey") - .addAll( - dataset.getMachineTags().stream() - .filter( - mt -> - PROCESSING_NAMESPACE.equals(mt.getNamespace()) - && COLLECTION_TAG_NAME.equals(mt.getName())) - .map(v -> new TextNode(v.getValue().split(":")[0])) - .collect(Collectors.toList())); - // Gridded dataset dataset.getMachineTags().stream() .filter( diff --git a/registry-search/src/main/resources/dataset-es-mapping.json b/registry-search/src/main/resources/dataset-es-mapping.json index f8b9b584a..4c949b7d3 100644 --- a/registry-search/src/main/resources/dataset-es-mapping.json +++ b/registry-search/src/main/resources/dataset-es-mapping.json @@ -136,8 +136,6 @@ "programmeAcronym": {"type": "keyword", "copy_to": "all"}, "keyword": {"type": "keyword", "copy_to": "all"}, "doi": {"type": "keyword", "copy_to": "all"}, - "institutionKey": {"type": "keyword"}, - "collectionKey": {"type": "keyword"}, "installationKey": {"type": "keyword"}, "publishingOrganizationKey": {"type": "keyword"}, "publishingOrganizationTitle": {"type": "text", "copy_to": "all"}, diff --git a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java index 978cf2d6f..b048cb67a 100644 --- a/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java +++ b/registry-ws/src/main/java/org/gbif/registry/ws/resources/DatasetResource.java @@ -282,13 +282,6 @@ public DatasetResource( schema = @Schema(implementation = Country.class), in = ParameterIn.QUERY, explode = Explode.FALSE), - @Parameter( - name = "country", - description = - "The 2-letter country code (as per ISO-3166-1) of the country publishing the dataset.", - schema = @Schema(implementation = Country.class), - in = ParameterIn.QUERY, - explode = Explode.FALSE), @Parameter( name = "continent", description = "Not implemented.", From a4b31f72fc3db51f13afcce4f2e51c3a976f8b85 Mon Sep 17 00:00:00 2001 From: Marcos Lopez Gonzalez Date: Fri, 29 Dec 2023 10:55:43 +0100 Subject: [PATCH 4/4] #513 added DB constraint to check that the duplicate dataset key is different than the dataset key --- .../129-duplicate-dataset-key-constraint.xml | 13 +++++++++++++ .../src/main/resources/liquibase/master.xml | 1 + 2 files changed, 14 insertions(+) create mode 100644 registry-persistence/src/main/resources/liquibase/129-duplicate-dataset-key-constraint.xml diff --git a/registry-persistence/src/main/resources/liquibase/129-duplicate-dataset-key-constraint.xml b/registry-persistence/src/main/resources/liquibase/129-duplicate-dataset-key-constraint.xml new file mode 100644 index 000000000..3a92ddbf1 --- /dev/null +++ b/registry-persistence/src/main/resources/liquibase/129-duplicate-dataset-key-constraint.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/registry-persistence/src/main/resources/liquibase/master.xml b/registry-persistence/src/main/resources/liquibase/master.xml index 8d0525516..31602dae9 100644 --- a/registry-persistence/src/main/resources/liquibase/master.xml +++ b/registry-persistence/src/main/resources/liquibase/master.xml @@ -134,4 +134,5 @@ +