From 62fc15f2b3fe1c1a88ad528da1d9ab5281c50265 Mon Sep 17 00:00:00 2001 From: utas-raymondng Date: Mon, 2 Dec 2024 14:23:49 +1100 Subject: [PATCH 1/2] Expand text search to include parameters --- .../core/model/enumeration/CQLFields.java | 6 +- .../server/core/service/ElasticSearch.java | 3 + .../server/core/service/OGCApiService.java | 2 +- .../ogcapi/server/common/RestApiTest.java | 39 +- .../core/service/OGCApiServiceTest.java | 23 +- .../9fdb1eee-bc28-43a9-88c5-972324784837.json | 788 ++++++++++++++++++ .../portal_records_index_schema.json | 9 +- 7 files changed, 842 insertions(+), 28 deletions(-) create mode 100644 server/src/test/resources/databag/9fdb1eee-bc28-43a9-88c5-972324784837.json diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/CQLFields.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/CQLFields.java index a965ed20..1c6386a0 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/CQLFields.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/CQLFields.java @@ -179,9 +179,10 @@ public enum CQLFields implements CQLFieldsInterface { (literal) -> MatchQuery.of(m -> m .fuzziness("AUTO") .field(StacBasicField.Title.searchField) - .prefixLength(2) + .prefixLength(3) // Increase the relevance of matches in title .boost(2.0F) + .operator(Operator.And) // ensure all terms are matched with fuzziness .query(literal))._toQuery(), null ), @@ -191,7 +192,8 @@ public enum CQLFields implements CQLFieldsInterface { (literal) -> MatchQuery.of(m -> m .fuzziness("AUTO") .field(StacBasicField.Description.searchField) - .prefixLength(2) + .prefixLength(3) + .operator(Operator.And) // ensure all terms are matched with fuzziness .query(literal))._toQuery(), null ), diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java index debdbb8c..b1b4b617 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/ElasticSearch.java @@ -254,6 +254,9 @@ public ElasticSearchBase.SearchResult searchByParameters(List keywords, for (String t : keywords) { should.add(CQLFields.fuzzy_title.getPropertyEqualToQuery(t)); should.add(CQLFields.fuzzy_desc.getPropertyEqualToQuery(t)); + should.add(CQLFields.parameter_vocabs.getPropertyEqualToQuery(t)); + should.add(CQLFields.organisation_vocabs.getPropertyEqualToQuery(t)); + should.add(CQLFields.platform_vocabs.getPropertyEqualToQuery(t)); } } diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/OGCApiService.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/OGCApiService.java index 64eafb1a..aad2a437 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/service/OGCApiService.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/service/OGCApiService.java @@ -93,7 +93,7 @@ public ResponseEntity getCollectionList(List keywords, * @param filter - Any existing filter * @return - A combined filter with datetime rewrite. */ - public String processDatetimeParameter(String datetime, String filter) { + public static String processDatetimeParameter(String datetime, String filter) { // TODO: How to handle this? e.g how to know if it is before or after if ?datetime= diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java index 3396a2d8..b494ed69 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/common/RestApiTest.java @@ -59,11 +59,11 @@ public void verifyClusterIsHealthy() throws IOException { super.assertClusterHealthResponse(); } /** - * The search is a fuzzy search based on title and description. So you expect 1 hit only + * The search is a fuzzy search based on title and description and few param field. So you expect 1 hit only * @throws IOException - IO Exception */ @Test - public void verifyApiCollectionsQueryOnText() throws IOException { + public void verifyApiCollectionsQueryOnText1() throws IOException { super.insertJsonToElasticIndex( "516811d7-cd1e-207a-e0440003ba8c79dd.json", "7709f541-fc0c-4318-b5b9-9053aa474e0e.json" @@ -96,6 +96,36 @@ public void verifyApiCollectionsQueryOnText() throws IOException { collections.getBody().getCollections().get(1).getId(), "Correct UUID - 7709f541-fc0c-4318-b5b9-9053aa474e0e"); } + /** + * The search is a fuzzy search based on title and description and few param field. This test add one more text + * which should hit the organization, paramter or vocab field + * 516811d7-cd1e-207a-e0440003ba8c79dd - Have repoduction + * 073fde5a-bff3-1c1f-e053-08114f8c5588 - Nothing match (although the word 'and' will match, but we use AND operator in fuzzy match so it will not count) + * 9fdb1eee-bc28-43a9-88c5-972324784837 - Contains 'precipitation and evaporation' in parameter_vocabs + * + * @throws IOException - IO Exception + */ + @Test + public void verifyApiCollectionsQueryOnText2() throws IOException { + super.insertJsonToElasticIndex( + "516811d7-cd1e-207a-e0440003ba8c79dd.json", + "073fde5a-bff3-1c1f-e053-08114f8c5588.json", + "9fdb1eee-bc28-43a9-88c5-972324784837.json" + ); + + // Call rest api directly and get query result + ResponseEntity collections = testRestTemplate.getForEntity(getBasePath() + "/collections?q=reproduction,precipitation and evaporation", Collections.class); + assertEquals(2, Objects.requireNonNull(collections.getBody()).getCollections().size(), "Only 2 hit"); + assertEquals( + "516811d7-cd1e-207a-e0440003ba8c79dd", + collections.getBody().getCollections().get(0).getId(), + "Correct UUID - 516811d7-cd1e-207a-e0440003ba8c79dd"); + + assertEquals( + "9fdb1eee-bc28-43a9-88c5-972324784837", + collections.getBody().getCollections().get(1).getId(), + "Correct UUID - 9fdb1eee-bc28-43a9-88c5-972324784837"); + } /** * The datetime field after xxx/.. xxx/ etc. It uses CQL internally so no need to test Before After During in CQL */ @@ -466,11 +496,10 @@ public void verifyCQLPropertyScore() throws IOException { assertEquals(error.getStatusCode(), HttpStatus.INTERNAL_SERVER_ERROR); assertEquals(Objects.requireNonNull(error.getBody()).getMessage(), "Or combine with query setting do not make sense", "correct error"); - // Lower score rate make more match + // Lower score but the fuzzy is now with operator AND, therefore it will try to match all words 'dataset' and 'includes' with fuzzy collections = testRestTemplate.getForEntity(getBasePath() + "/collections?q='dataset includes'&filter=score>=1", Collections.class); - assertEquals(2, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 2, with score 1"); + assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1, with score 3"); assertEquals("bf287dfe-9ce4-4969-9c59-51c39ea4d011", Objects.requireNonNull(collections.getBody()).getCollections().get(0).getId(), "bf287dfe-9ce4-4969-9c59-51c39ea4d011"); - assertEquals("7709f541-fc0c-4318-b5b9-9053aa474e0e", Objects.requireNonNull(collections.getBody()).getCollections().get(1).getId(), "7709f541-fc0c-4318-b5b9-9053aa474e0e"); // Increase score will drop one record collections = testRestTemplate.getForEntity(getBasePath() + "/collections?q='dataset includes'&filter=score>=3", Collections.class); diff --git a/server/src/test/java/au/org/aodn/ogcapi/server/core/service/OGCApiServiceTest.java b/server/src/test/java/au/org/aodn/ogcapi/server/core/service/OGCApiServiceTest.java index 8fbd12af..d36c68c3 100644 --- a/server/src/test/java/au/org/aodn/ogcapi/server/core/service/OGCApiServiceTest.java +++ b/server/src/test/java/au/org/aodn/ogcapi/server/core/service/OGCApiServiceTest.java @@ -1,44 +1,33 @@ package au.org.aodn.ogcapi.server.core.service; import org.junit.jupiter.api.Test; - -import java.util.List; - import static org.junit.jupiter.api.Assertions.assertEquals; public class OGCApiServiceTest { - // The class is abstract, so need to implement it before we can test it. - class OGCApiServiceImpl extends OGCApiService { - @Override - public List getConformanceDeclaration() { - return null; - } - }; /** * Verify process function correct, it converts datetime field to CQL filter, here the time isn't important * as parser will handle it and error out if date time format is incorrect. */ @Test public void verifyProcessDatetimeParameter() { - OGCApiServiceImpl impl = new OGCApiServiceImpl(); - String o = impl.processDatetimeParameter("../2021-10-10", ""); + String o = OGCApiService.processDatetimeParameter("../2021-10-10", ""); assertEquals( "temporal before 2021-10-10", o, "Before incorrect1"); - o = impl.processDatetimeParameter("/2021-10-10", ""); + o = OGCApiService.processDatetimeParameter("/2021-10-10", ""); assertEquals( "temporal before 2021-10-10", o, "Before incorrect2"); - o = impl.processDatetimeParameter("2021-10-10/", ""); + o = OGCApiService.processDatetimeParameter("2021-10-10/", ""); assertEquals( "temporal after 2021-10-10", o, "After incorrect1"); - o = impl.processDatetimeParameter("2021-10-10/..", ""); + o = OGCApiService.processDatetimeParameter("2021-10-10/..", ""); assertEquals( "temporal after 2021-10-10", o, "After incorrect1"); - o = impl.processDatetimeParameter("2021-10-10/2022-10-10", ""); + o = OGCApiService.processDatetimeParameter("2021-10-10/2022-10-10", ""); assertEquals( "temporal during 2021-10-10/2022-10-10", o, "During incorrect1"); - o = impl.processDatetimeParameter("/2021-10-10", "geometry is null"); + o = OGCApiService.processDatetimeParameter("/2021-10-10", "geometry is null"); assertEquals( "geometry is null AND temporal before 2021-10-10", o, "Before plus filter incorrect1"); } } diff --git a/server/src/test/resources/databag/9fdb1eee-bc28-43a9-88c5-972324784837.json b/server/src/test/resources/databag/9fdb1eee-bc28-43a9-88c5-972324784837.json new file mode 100644 index 00000000..8176a4ef --- /dev/null +++ b/server/src/test/resources/databag/9fdb1eee-bc28-43a9-88c5-972324784837.json @@ -0,0 +1,788 @@ +{ + "title": "IMOS - Deep Water Moorings - Southern Ocean Flux Station (SOFS) - Surface properties (real-time)", + "description": "This data collection consists of observations at the sea surface made by the Southern Ocean Flux Station (SOFS) mooring, including meteorological parameters, downwelling radiation, and sea water temperature and salinity. Hourly averages of each parameter are delivered in near real-time. SOFS is an observing platform in the Sub-Antarctic Zone, approximately 350 nautical miles south-west of Tasmania. It obtains frequent measurements of the surface and deep ocean properties that control the transfer of heat, moisture, energy and CO2 between the atmosphere and the upper ocean to improve understanding of climate and carbon processes. The mooring was first deployed at (46.7S, 142E) in March 2010.", + "extent": { + "bbox": [ + [ + 141, + -48, + 144, + -46 + ], + [ + 141, + -48, + 144, + -46 + ] + ], + "temporal": [ + [ + "2010-03-16T13:00:00Z", + null + ], + [ + "2010-03-16T13:00:00Z", + null + ] + ] + }, + "summaries": { + "score": 76, + "status": "onGoing", + "credits": [ + "Australia's Integrated Marine Observing System (IMOS) is enabled by the National Collaborative Research Infrastructure Strategy (NCRIS). It is operated by a consortium of institutions as an unincorporated joint venture, with the University of Tasmania as Lead Agent.", + "CSIRO Oceans and Atmosphere", + "Australian Bureau of Meteorology", + "University of Tasmania (UTAS)", + "Marine National Facility", + "Pacific Marine Environmental Laboratory (PMEL), National Oceanic and Atmospheric Administration (NOAA)" + ], + "scope": { + "code": "dataset", + "name": "IMOS Dataset level record" + }, + "creation": "2020-07-15T10:25:48", + "revision": "2024-10-02T00:26:00", + "dataset_provider": "IMOS", + "update_frequency": "real-time", + "proj:geometry": { + "geometries": [ + { + "type": "Polygon", + "coordinates": [ + [ + [ + 141, + -48 + ], + [ + 143, + -48 + ], + [ + 143, + -47 + ], + [ + 144, + -47 + ], + [ + 144, + -46 + ], + [ + 141, + -46 + ], + [ + 141, + -48 + ] + ] + ] + } + ], + "type": "GeometryCollection" + }, + "proj:geometry_noland": { + "geometries": [ + { + "type": "Polygon", + "coordinates": [ + [ + [ + 141, + -46 + ], + [ + 141, + -48 + ], + [ + 143, + -48 + ], + [ + 143, + -47 + ], + [ + 144, + -47 + ], + [ + 144, + -46 + ], + [ + 141, + -46 + ] + ] + ] + } + ], + "type": "GeometryCollection" + }, + "temporal": [ + { + "start": "2010-03-16T13:00:00Z", + "end": null + } + ], + "parameter_vocabs": [ + "salinity", + "air pressure", + "temperature", + "humidity", + "water pressure", + "air temperature", + "precipitation and evaporation", + "air-sea fluxes", + "wind" + ], + "platform_vocabs": [ + "mooring" + ], + "organisation_vocabs": [ + "Southern Ocean Time Series Observatory Sub-Facility, Integrated Marine Observing System (IMOS)" + ] + }, + "contacts": [ + { + "roles": [ + "principalInvestigator", + "about" + ], + "organization": "Australian Bureau of Meteorology", + "name": "Schulz, Eric", + "position": "", + "emails": [], + "addresses": [], + "phones": [ + { + "roles": [ + "voice" + ], + "value": "+61 3 9669 4618" + }, + { + "roles": [ + "facsimile" + ], + "value": "+61 3 9669 4660" + } + ], + "links": [] + }, + { + "roles": [ + "pointOfContact", + "about" + ], + "organization": "Integrated Marine Observing System (IMOS)", + "name": "", + "position": "Data Officer", + "emails": [ + "info@aodn.org.au" + ], + "addresses": [ + { + "delivery_point": [ + "University of Tasmania", + "Private Bag 110" + ], + "city": "Hobart", + "country": "Australia", + "postal_code": "7001", + "administrative_area": "Tasmania" + } + ], + "phones": [ + { + "roles": [ + "voice" + ], + "value": "61 3 6226 7488" + }, + { + "roles": [ + "facsimile" + ], + "value": "61 3 6226 2107" + } + ], + "links": [ + { + "href": "http://imos.org.au/aodn.html", + "type": "WWW:LINK-1.0-http--link", + "title": "Website of the Australian Ocean Data Network (AODN)" + } + ] + }, + { + "roles": [ + "distributor", + "metadata" + ], + "organization": "Integrated Marine Observing System (IMOS)", + "name": "", + "position": "Data Officer", + "emails": [ + "info@aodn.org.au" + ], + "addresses": [ + { + "delivery_point": [ + "University of Tasmania", + "Private Bag 110" + ], + "city": "Hobart", + "country": "Australia", + "postal_code": "7001", + "administrative_area": "Tasmania" + } + ], + "phones": [ + { + "roles": [ + "voice" + ], + "value": "61 3 6226 7488" + }, + { + "roles": [ + "facsimile" + ], + "value": "61 3 6226 2107" + } + ], + "links": [ + { + "href": "http://imos.org.au/aodn.html", + "type": "WWW:LINK-1.0-http--link", + "title": "Website of the Australian Ocean Data Network (AODN)" + } + ] + }, + { + "roles": [ + "resourceProvider", + "citation" + ], + "organization": "Integrated Marine Observing System (IMOS)", + "name": null, + "position": null, + "emails": [ + "imos@imos.org.au" + ], + "addresses": [ + { + "delivery_point": [ + "Private Bag 110" + ], + "city": "Hobart", + "country": "Australia", + "postal_code": "7001", + "administrative_area": "Tasmania" + } + ], + "phones": [ + { + "roles": [ + "voice" + ], + "value": "61 3 6226 7549" + }, + { + "roles": [ + "facsimile" + ], + "value": "61 3 62262107" + } + ], + "links": [ + { + "href": "http://www.imos.org.au/html", + "type": "WWW:LINK-1.0-http--link", + "title": "Website of the Integrated Marine Observing System (IMOS)" + } + ] + } + ], + "languages": [ + { + "code": "eng", + "name": "English" + } + ], + "links": [ + { + "href": "http://imos.org.au/sots.html", + "rel": "related", + "type": "text/html", + "title": "Southern Ocean Time Series page on IMOS website" + }, + { + "href": "http://thredds.aodn.org.au/thredds/catalog/IMOS/DWM/ASFS/SOFS/Surface_properties/Real-time/catalog.html", + "rel": "related", + "type": "text/html", + "title": "NetCDF files via THREDDS catalog" + }, + { + "href": "https://portal.aodn.org.au/search?uuid=9fdb1eee-bc28-43a9-88c5-972324784837", + "rel": "related", + "type": "text/html", + "title": "View and download data though the AODN Portal" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/wms", + "rel": "wms", + "type": "", + "title": "imos:dwm_sofs_surfaceprop_rt_map" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ows", + "rel": "wfs", + "type": "", + "title": "dwm_sofs_surfaceprop_rt_data" + }, + { + "href": "https://help.aodn.org.au/web-services/ogc-wfs/", + "rel": "related", + "type": "text/html", + "title": "OGC WFS help documentation" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ows", + "rel": "related", + "type": "", + "title": "dwm_sofs_surfaceprop_rt_map#url" + }, + { + "href": "https://help.aodn.org.au/web-services/ncurllist-service/", + "rel": "related", + "type": "text/html", + "title": "ncUrlList help documentation" + }, + { + "href": "https://geonetwork-edge.edge.aodn.org.au:443/geonetwork/images/harvesting/IMOS_colour_logo.gif", + "rel": "icon", + "type": "image/png", + "title": "Suggest icon for dataset" + }, + { + "href": "https://catalogue-imos.aodn.org.au:443/geonetwork/srv/api/records/9fdb1eee-bc28-43a9-88c5-972324784837", + "rel": "describedby", + "type": "text/html", + "title": "Full metadata link" + }, + { + "href": "https://licensebuttons.net/l/by/4.0/88x31.png", + "rel": "license", + "type": "image/png" + }, + { + "href": "http://creativecommons.org/licenses/by/4.0/", + "rel": "license", + "type": "text/html" + }, + { + "href": "uuid:a46f1fe3-2a7c-4086-951e-7351192ec98b", + "rel": "parent", + "type": "application/json", + "title": "{\"title\":\"IMOS - Deep Water Moorings - Air Sea Flux Station (ASFS) Sub-Facility, Southern Ocean Flux Station (SOFS) Platform\",\"recordAbstract\":\"SOFS is an observing platform in the Sub-Antarctic Zone, approximately 350 nautical miles southwest of Tasmania. It obtains frequent measurements of the surface and deep ocean properties that control the transfer of heat, moisture, energy and CO2 between the atmosphere and the upper ocean to improve understanding of climate and carbon processes.\n\nThe mooring was first deployed at (46.7S, 142E) in March 2010 and recovered in April 2011. It was re-deployed in November 2011 at (46.8S, 142E) and recovered in July 2012, it was then re-deployed in August 2012 at (-46.7S, 142E) and recovered in January 2013, it was then re-deployed in May 2013 at (-46.8S, 142E) and recovered in October 2013. The mooring was redeployed in March 2015. \n\nThe SOFS is equiped with two identical ASIMET systems and telemetry to provide real time data to marine observers and researchers.\"}" + }, + { + "href": "uuid:80ffbf9d-9547-41aa-8fa1-cf028c58556a", + "rel": "sibling", + "type": "application/json", + "title": "{\"title\":\"IMOS - Deep Water Moorings - Southern Ocean Flux Station (SOFS) - Surface fluxes (real-time)\",\"recordAbstract\":\"This data collection contains heat and mass fluxes at the sea surface computed from observations at the Southern Ocean Flux Station (SOFS) mooring. The observed meteorology, downwelling radiation, and sea water temperature and salinity at the surface are also included. Hourly averages of each parameter are delivered in near real-time. SOFS is an observing platform in the Sub-Antarctic Zone, approximately 350 nautical miles south-west of Tasmania. It obtains frequent measurements of the surface and deep ocean properties that control the transfer of heat, moisture, energy and CO2 between the atmosphere and the upper ocean to improve understanding of climate and carbon processes. The mooring was first deployed at (46.7S, 142E) in March 2010.\"}" + }, + { + "href": "uuid:bbd0c85b-7218-4065-8180-421b1c1d6bbe", + "rel": "sibling", + "type": "application/json", + "title": "{\"title\":\"IMOS - Deep Water Moorings - Southern Ocean Flux Station (SOFS) - Surface properties (delayed mode)\",\"recordAbstract\":\"This data collection consists of observations at the sea surface made by the Southern Ocean Flux Station (SOFS) mooring, including meteorological parameters, downwelling radiation, and sea water temperature and salinity. One-minute averages of each parameter are provided after delayed-mode processing. SOFS is an observing platform in the Sub-Antarctic Zone, approximately 350 nautical miles south-west of Tasmania. It obtains frequent measurements of the surface and deep ocean properties that control the transfer of heat, moisture, energy and CO2 between the atmosphere and the upper ocean to improve understanding of climate and carbon processes. The mooring was first deployed at (46.7S, 142E) in March 2010.\"}" + }, + { + "href": "uuid:b355a5a5-e6ec-45c7-8506-103cf160431a", + "rel": "sibling", + "type": "application/json", + "title": "{\"title\":\"IMOS - Deep Water Moorings - Southern Ocean Flux Station (SOFS) - Surface fluxes (delayed mode)\",\"recordAbstract\":\"This data collection contains heat and mass fluxes at the sea surface computed from observations at the Southern Ocean Flux Station (SOFS) mooring. The observed meteorology, downwelling radiation, and sea water temperature and salinity at the surface are also included. One-minute averages of each parameter are provided after delayed-mode processing. SOFS is an observing platform in the Sub-Antarctic Zone, approximately 350 nautical miles south-west of Tasmania. It obtains frequent measurements of the surface and deep ocean properties that control the transfer of heat, moisture, energy and CO2 between the atmosphere and the upper ocean to improve understanding of climate and carbon processes. The mooring was first deployed at (46.7S, 142E) in March 2010.\"}" + } + ], + "license": "Creative Commons Attribution 4.0 International License", + "providers": [ + { + "name": "Integrated Marine Observing System (IMOS)", + "roles": [ + "distributor" + ], + "url": "http://imos.org.au/aodn.html" + } + ], + "themes": [ + { + "concepts": [ + { + "id": "Oceans | Salinity/density | Conductivity", + "url": null + }, + { + "id": "Oceans | Salinity/density | Salinity", + "url": null + }, + { + "id": "Oceans | Ocean Temperature | Water Temperature", + "url": null + }, + { + "id": "Atmosphere | Atmospheric Winds | Surface Winds", + "url": null + }, + { + "id": "Atmosphere | Atmospheric Pressure | Surface Pressure", + "url": null + }, + { + "id": "Atmosphere | Atmospheric Temperature | Air Temperature", + "url": null + }, + { + "id": "Atmosphere | Atmospheric Water Vapor | Humidity", + "url": null + }, + { + "id": "Atmosphere | Radiation Budget | Shortwave Radiation", + "url": null + }, + { + "id": "Atmosphere | Radiation Budget | Longwave Radiation", + "url": null + }, + { + "id": "Atmosphere | Precipitation | Precipitation Amount", + "url": null + } + ], + "scheme": "theme", + "description": "GCMD", + "title": "NASA/Global Change Master Directory Earth Science Keywords Version 5.3.8" + }, + { + "concepts": [ + { + "id": "Buoys | Moored Buoys", + "url": null + } + ], + "scheme": "", + "description": "MCP", + "title": "Marine Community Profile of ISO19115 v1.4 Collection Methods Vocabulary (Annex C.1.3)" + }, + { + "concepts": [ + { + "id": "Global / Oceans | Southern Ocean", + "url": null + } + ], + "scheme": "place", + "description": "", + "title": "AODN Geographic Extents Vocabulary" + }, + { + "concepts": [ + { + "id": "Countries | Australia", + "url": null + }, + { + "id": "States, Territories (Australia) | Tasmania", + "url": null + } + ], + "scheme": "place", + "description": "", + "title": "AODN Geographic Extents Vocabulary" + }, + { + "concepts": [ + { + "id": "mooring", + "url": "http://vocab.nerc.ac.uk/collection/L06/current/48" + } + ], + "scheme": "theme", + "description": "", + "title": "AODN Platform Vocabulary" + }, + { + "concepts": [ + { + "id": "Eastward wind velocity in the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/ESEWZZXX" + }, + { + "id": "Northward wind velocity in the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/ESNSZZXX" + }, + { + "id": "Temperature of the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/CTMPZZ01" + }, + { + "id": "Relative humidity of the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/CRELZZ01" + }, + { + "id": "Pressure (measured variable) exerted by the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/CAPHZZ01" + }, + { + "id": "Temperature of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/TEMPPR01" + }, + { + "id": "Electrical conductivity of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/CNDCZZ01" + }, + { + "id": "Thickness of precipitation amount (liquid water equivalent) in the atmosphere", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/386" + }, + { + "id": "Wind to direction in the atmosphere", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/396" + }, + { + "id": "Wind speed in the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/ESSAZZ01" + }, + { + "id": "Practical salinity of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/PSLTZZ01" + }, + { + "id": "Downwelling vector irradiance as energy (solar (300-3000nm) wavelengths) in the atmosphere", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/576" + }, + { + "id": "Downwelling vector irradiance as energy (longwave) in the atmosphere", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/LWRDZZ01" + } + ], + "scheme": "theme", + "description": "", + "title": "AODN Discovery Parameter Vocabulary" + }, + { + "concepts": [ + { + "id": "anemometers", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/101" + }, + { + "id": "meteorological packages", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/102" + }, + { + "id": "water temperature sensor", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/134" + }, + { + "id": "salinity sensor", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/350" + }, + { + "id": "precipitation gauges", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/381" + }, + { + "id": "radiometers", + "url": "http://vocab.nerc.ac.uk/collection/L05/current/122" + } + ], + "scheme": "theme", + "description": "", + "title": "AODN Instrument Vocabulary" + }, + { + "concepts": [ + { + "id": "Southern Ocean Time Series Observatory Sub-Facility, Integrated Marine Observing System (IMOS)", + "url": "http://vocab.aodn.org.au/def/organisation/entity/499" + } + ], + "scheme": "discipline", + "description": "", + "title": "AODN Organisation Vocabulary" + } + ], + "id": "9fdb1eee-bc28-43a9-88c5-972324784837", + "search_suggestions": { + "abstract_phrases": [ + "atmosphere", + "flux station sofs mooring", + "antarctic zone", + "flux station", + "sub antarctic", + "upper", + "water temperature", + "delivered", + "salinity hourly averages", + "meteorological parameters downwelling radiation", + "carbon", + "understanding", + "near", + "sofs", + "between", + "energy", + "sea water", + "data collection consists", + "surface", + "station sofs mooring including", + "each parameter", + "made", + "sofs mooring", + "meteorological parameters downwelling", + "frequent measurements", + "time sofs", + "sub antarctic zone approximately", + "each", + "downwelling", + "near real time", + "mooring including meteorological parameters", + "near real time sofs", + "meteorological parameters", + "southern", + "sub", + "south", + "mooring including", + "parameters downwelling radiation", + "collection consists", + "sea", + "mooring including meteorological", + "meteorological", + "zone approximately", + "nautical miles south", + "obtains frequent", + "temperature", + "observing platform", + "including meteorological", + "surface made", + "antarctic", + "measurements", + "southern ocean", + "sea water temperature", + "climate", + "nautical miles", + "near real", + "ocean properties", + "march", + "nautical", + "nautical miles south west", + "south west", + "first", + "mooring", + "downwelling radiation", + "obtains frequent measurements", + "data", + "ocean flux station sofs", + "hourly averages", + "including meteorological parameters", + "including meteorological parameters downwelling", + "sea surface", + "southern ocean flux", + "sub antarctic zone", + "deep ocean properties", + "flux station sofs", + "zone", + "ocean flux station", + "west", + "southern ocean flux station", + "station sofs mooring", + "miles south west", + "sofs mooring including meteorological", + "including", + "tasmania", + "sofs mooring including", + "antarctic zone approximately", + "collection", + "real", + "moisture", + "water", + "sea surface made", + "transfer", + "ocean", + "station sofs", + "improve", + "hourly", + "parameters", + "real time sofs", + "heat", + "ocean flux", + "salinity hourly", + "deep", + "parameters downwelling", + "averages", + "frequent", + "heat moisture", + "deployed", + "heat moisture energy", + "platform", + "miles", + "observations", + "parameter", + "station", + "flux", + "upper ocean", + "carbon processes", + "real time", + "salinity", + "processes", + "control", + "moisture energy", + "deep ocean", + "data collection", + "improve understanding", + "miles south", + "first deployed", + "obtains", + "approximately", + "radiation", + "consists", + "observing", + "time", + "properties" + ], + "parameter_vocabs_sayt": [ + "air pressure", + "air-sea fluxes", + "wind", + "air temperature", + "humidity", + "precipitation and evaporation", + "water pressure", + "temperature", + "salinity" + ], + "platform_vocabs_sayt": [ + "mooring" + ] + }, + "sci:citation": "{\"suggestedCitation\":\"The citation in a list of references is: \"IMOS [year-of-data-download], [Title], [data-access-URL], accessed [date-of-access].\"\",\"useLimitations\":[\"Data, products and services from IMOS are provided \"as is\" without any warranty as to fitness for a particular purpose.\"],\"otherConstraints\":[\"Any users of IMOS data are required to clearly acknowledge the source of the material derived from IMOS in the format: \"Data was sourced from Australia?s Integrated Marine Observing System (IMOS) ? IMOS is enabled by the National Collaborative Research Infrastructure strategy (NCRIS).\" If relevant, also credit other organisations involved in collection of this particular datastream (as listed in 'credit' in the metadata record).\"]}", + "type": "Collection", + "stac_version": "1.0.0", + "stac_extensions": [ + "https://stac-extensions.github.io/scientific/v1.0.0/schema.json", + "https://stac-extensions.github.io/contacts/v0.1.1/schema.json", + "https://stac-extensions.github.io/projection/v1.1.0/schema.json", + "https://stac-extensions.github.io/language/v1.0.0/schema.json", + "https://stac-extensions.github.io/themes/v1.0.0/schema.json", + "https://stac-extensions.github.io/web-map-links/v1.2.0/schema.json" + ] +} diff --git a/server/src/test/resources/portal_records_index_schema.json b/server/src/test/resources/portal_records_index_schema.json index d02bcf46..e85f05d4 100644 --- a/server/src/test/resources/portal_records_index_schema.json +++ b/server/src/test/resources/portal_records_index_schema.json @@ -88,9 +88,6 @@ "organisation_vocabs_sayt": { "type": "search_as_you_type", "analyzer": "custom_analyser" } } }, - "parameter_vocabs": { "type": "keyword" }, - "platform_vocabs": { "type": "keyword" }, - "organisation_vocabs": { "type": "keyword" }, "keywords": { "type": "nested", "properties": { @@ -148,6 +145,9 @@ "dataset_group": { "type": "text" }, "creation" : { "type": "date" }, "revision" : { "type": "date" }, + "proj:geometry_noland": { + "type": "geo_shape" + }, "proj:geometry": { "type": "geo_shape" }, @@ -162,6 +162,9 @@ } } }, + "parameter_vocabs": { "type": "keyword" }, + "platform_vocabs": { "type": "keyword" }, + "organisation_vocabs": { "type": "keyword" }, "statement": { "type": "text" } } }, From 5d70ce3c324ccae1fdbef780d13d41b9c03ab2dc Mon Sep 17 00:00:00 2001 From: utas-raymondng Date: Mon, 2 Dec 2024 14:24:41 +1100 Subject: [PATCH 2/2] Update to use static method --- .../src/main/java/au/org/aodn/ogcapi/server/common/RestApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/common/RestApi.java b/server/src/main/java/au/org/aodn/ogcapi/server/common/RestApi.java index 6d41ff43..89a74a62 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/common/RestApi.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/common/RestApi.java @@ -154,7 +154,7 @@ public ResponseEntity getCollections( // TODO: Support other CRS. if (CQLFilterType.convert(filterLang) == CQLFilterType.CQL && CQLCrsType.convertFromUrl(crs) == CQLCrsType.EPSG4326) { if (datetime != null) { - filter = commonService.processDatetimeParameter(datetime, filter); + filter = OGCApiService.processDatetimeParameter(datetime, filter); } return commonService.getCollectionList( q,