Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class SummariesModel {
protected String updateFrequency;

@JsonProperty("dataset_group")
protected String datasetGroup;
protected List<String> datasetGroup;

@JsonProperty("ai:description")
protected String aiDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public enum CQLFields implements CQLFieldsInterface {
dataset_group(
StacSummeries.DatasetGroup.searchField,
StacSummeries.DatasetGroup.displayField,
null,
(literal) -> TermsQuery.of(t ->
t.field(StacSummeries.DatasetGroup.searchField)
.terms(tf -> tf.value(List.of(FieldValue.of(literal.toLowerCase().trim())))))._toQuery(),
null
),
update_frequency(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,32 @@ public void verifyCQLPropertyDatasetGroup() throws IOException {
collections.getBody().getCollections().get(0).getId(),
"UUID matches");
}
/**
* Show that in case of dataset falls in multiple group, it works too
* @throws IOException - Not expected to throw
*/
@Test
public void verifyCQLPropertyMultiDatasetGroup() throws IOException {
super.insertJsonToElasticRecordIndex(
"5c418118-2581-4936-b6fd-d6bedfe74f62.json", // dataset_group null
"7709f541-fc0c-4318-b5b9-9053aa474e0e.json", // dataset_group is IMOS,
"b9bf6b57-54a0-44b3-bd17-30ccfb2b246f.json" // dataset_group aims, imas
);

ResponseEntity<Collections> collections = testRestTemplate.getForEntity(getBasePath() + "/collections?filter=dataset_group='imas'", Collections.class);
assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1, only one record");
assertEquals(
"b9bf6b57-54a0-44b3-bd17-30ccfb2b246f",
collections.getBody().getCollections().get(0).getId(),
"UUID matches");

collections = testRestTemplate.getForEntity(getBasePath() + "/collections?filter=dataset_group='AIMS'", Collections.class);
assertEquals(1, Objects.requireNonNull(collections.getBody()).getCollections().size(), "hit 1, only one record");
assertEquals(
"b9bf6b57-54a0-44b3-bd17-30ccfb2b246f",
collections.getBody().getCollections().get(0).getId(),
"UUID matches");
}
/**
* You can use the score to tune the return result's relevancy, at this moment, only >= make sense other value
* will be ignored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void verifyAddingPropertyWorks() {
assets.put("vessel_satellite_radiance_derived_product.zarr", asset);
var citationString = "{\"suggestedCitation\":\"this is suggested Citation\",\"useLimitations\":[\"this is useLimitations1\",\"this is useLimitations2\"],\"otherConstraints\":[\"this is otherConstraints1\",\"this is otherConstraints2\"]}";
var statement = "This is the statement of this record";
var datasetGroup = "group_test";
var datasetGroup = List.of("group_test");
var aiDescription = "AI-generated description for testing";

StacCollectionModel model = StacCollectionModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.opengis.referencing.operation.TransformException;

import java.io.IOException;
import java.util.Map;
import java.util.Optional;

@Slf4j
Expand Down Expand Up @@ -61,11 +62,11 @@ public void verifyBBoxWorks1() throws CQLException, IOException, FactoryExceptio
.build();
// Expected polygon shape after the no land area intersection with the BBOX
Optional<Geometry> expected = GeometryUtils.readGeometry(
GeometryUtils.convertToGeoJson(
mapper.readValue(GeometryUtils.convertToGeoJson(
new LiteralExpressionImpl(
"POLYGON ((116 -34.84004284124928, 116 -36, 112 -36, 112 -27, 113.78063324619302 -27, 114.01254316500001 -27.31536223799992, 114.14389082100001 -27.687758070999905, 114.09791100400003 -27.862725518999923, 114.16602623800009 -28.10670338299991, 114.53109785200002 -28.52239348799992, 114.60377037900003 -28.838555596999925, 114.84245853000004 -29.108575127999927, 114.97877037900003 -29.479913018999923, 114.94263756600003 -30.031019789999903, 115.06080162900003 -30.52239348799992, 115.72152754000001 -31.772637627999927, 115.75684655000009 -32.18564218499995, 115.67367597700002 -32.273370049999926, 115.73585045700008 -32.33318450299993, 115.71452884200005 -32.537041924999926, 115.76929772200003 -32.60230885199991, 115.65886478000004 -32.62851327899995, 115.71412194100003 -32.78045012799993, 115.63965905000009 -32.656914971999925, 115.70093834700003 -32.51295338299991, 115.60092207100001 -32.66171640399995, 115.66684004000001 -33.28769296699994, 115.69792728000004 -33.1931291649999, 115.71013431100005 -33.27068450299993, 115.36719811300009 -33.63128020599993, 115.19467207100001 -33.64462655999995, 114.98853600400003 -33.52109140399995, 115.01042728000004 -34.24504973799992, 115.11882571700005 -34.36337655999995, 115.29078209700003 -34.301853122999944, 115.61231530000009 -34.44589609199994, 115.91578209700003 -34.70191822699991, 115.97852623800009 -34.83562590899993, 116 -34.84004284124928), (115.49210733500001 -31.99564901299993, 115.44014224400006 -32.021833949999916, 115.55219218900004 -32.00620348499996, 115.49210733500001 -31.99564901299993))"),
CQLCrsType.EPSG4326
)
), Map.class)
);

// Parse the json and get the noland section
Expand Down
74 changes: 15 additions & 59 deletions server/src/test/resources/data_index_schema.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,32 @@
{
"mappings": {
"properties": {
"id": {
"type": "keyword"
},
"stac_version": {
"type": "text"
},
"stac_extensions": {
"type": "text"
},
"type": {
"type": "text"
},
"collection": {
"type": "keyword"
},
"geometry": {
"type": "geo_shape"
},
"bbox": {
"type": "double"
},
"dataset_group": {
"type": "text"
},
"ai:description": {
"type": "text"
},
"properties": {
"features": {
"type": "nested",
"properties": {
"lng": {
"type": "double"
"type": {
"type": "keyword"
},
"lat": {
"type": "double"
"geometry": {
"type": "geo_shape"
},
"depth": {
"type": "double"
},
"count": {
"type": "double"
},
"time": {
"type": "date"
}
}
},
"links": {
"type": "nested",
"properties": {
"link": {
"type": "nested",
"properties": {
"type": "object",
"properties": {
"href": {
"type": "text"
},
"rel": {
"type": "text"
},
"type": {
"type": "text"
"date": {
"type": "date"
},
"title": {
"type": "text"
"count": {
"type": "double"
},
"description": {
"type": "text"
"collection": {
"type": "keyword"
},
"ai:group": {
"type": "text"
"key": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
],
"statement": "Data source: original field data the 3 min ensemble files returned from the ship were processed in the usual way.<BR> Data processing and quality control: according to current CMR Data Centre ADCP data processing manual. For full details, refer to documentation.",
"revision": "2004-04-16T15:44:25",
"dataset_group": "csiro oceans and atmosphere",
"dataset_group": ["csiro oceans and atmosphere"],
"update_frequency": "completed",
"proj:geometry": {
"geometries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"statement": "Original field data. EOV data archive removed from the vessel. Data and paper documentation archived O&A Data Centre. All paper documentation are scanned to 400 dpi PDF. The paper documentation is stored at Hobart with a reference in TRIM system \"in2014_E03\". Data archived to LTO tape and network 1/12/2014. Triaxus log book scanned to pdf and archived to global_docs on the 4 May 2015. Gravity data added to network EOV archive 31/3/2015, new manifest file created manifest_in2014_e03_1.1.txt and EndOfVoyageChecklist.pdf updated. Error in EOV checklist number of folders corrected 17/08/2015. Stored data volume entry correct. Work note entries updated. The archive for the in2014_e03 EOV data will be held temporarily within the CSIRO Oceans and Atmosphere Data Centre in Hobart with a permanent archive to be located at the CSIRO Data Access Portal (DAP).",
"revision": "2022-03-03T03:24:40",
"dataset_group": "csiro oceans and atmosphere",
"dataset_group": ["csiro oceans and atmosphere"],
"proj:geometry": {
"geometries": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"statement": "Statement: The central-west Pacific samples were collected by Dr Gary Williams and preserved in 70% ethanol. Carlos Sanchez, Gary Williams and Katharina Fabricius performed the identification of all samples. Leen van Ofwegen confirmed the identity of Stereonephthya sp. 1 from the GBR.",
"creation": "2009-11-11T00:00:00",
"revision": "2017-11-20T00:00:00",
"dataset_group": "aims",
"dataset_group": ["aims"],
"update_frequency": "completed",
"proj:geometry": {
"geometries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"creation": "2020-07-13T15:13:12",
"revision": "2023-12-08T04:33:13",
"dataset_group": "imos",
"dataset_group": ["imos"],
"dataset_provider": "IMOS",
"proj:geometry": {
"geometries": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"statement": "XBT real-time data contains only RAW data. The data has not been quality controlled.",
"creation": "2019-12-15T05:00:19",
"revision": "2024-06-23T20:35:52",
"dataset_group": "imos",
"dataset_group": ["imos"],
"dataset_provider": "IMOS",
"update_frequency": "real-time",
"proj:geometry": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"summaries": {
"score": 100,
"dataset_provider": null,
"dataset_group": "aodn",
"dataset_group": ["aodn"],
"proj:geometry": {
"coordinates": [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"statement": "This dataset was created using both observed and modelled data. \n\nA full description of the dataset is available from: \"Historical reconstruction of ocean acidification in the Australian region. Lenton et al. 2016, Biogeosciences 13, 1753-1765,http://www.biogeosciences.net/13/1753/2016",
"creation": "2019-01-08T15:59:50",
"revision": "2019-01-08T15:59:50",
"dataset_group": "imos",
"dataset_group": ["imos"],
"dataset_provider": "IMOS",
"proj:geometry": {
"geometries": [
Expand Down
Loading