From f6a3e9ed9db64f88bb8f3646f31249e2b10f4a77 Mon Sep 17 00:00:00 2001 From: Viet Nguyen Date: Tue, 30 Apr 2024 00:53:19 +1000 Subject: [PATCH] Fix ardc bug and update tests --- .../ardcvocabs/service/ArdcVocabsService.java | 69 +- .../service/ArdcVocabsServiceTest.java | 48 +- .../aodn/esindexer/utils/VocabUtilsTest.java | 3 +- .../aodn_discovery_parameter_vocabs.json | 331 ++++++++- .../test/resources/canned/sample4_stac.json | 655 +++++++++++------- 5 files changed, 811 insertions(+), 295 deletions(-) diff --git a/ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/service/ArdcVocabsService.java b/ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/service/ArdcVocabsService.java index 600d281d..1e911ac4 100644 --- a/ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/service/ArdcVocabsService.java +++ b/ardcvocabs/src/main/java/au/org/aodn/ardcvocabs/service/ArdcVocabsService.java @@ -103,6 +103,34 @@ protected Map> getLeafNodeOfParameterCategory(S return result; } + protected CategoryVocabModel buildCategoryVocabModel(JsonNode currentNode, JsonNode outerNode) { + if (currentNode instanceof ObjectNode objectNode) { + if (objectNode.has("prefLabel") && objectNode.has("_about")) { + return CategoryVocabModel.builder() + .about(about.apply(currentNode)) + .label(label.apply(currentNode)) + .build(); + } + } else if (currentNode instanceof TextNode textNode) { + if (textNode.asText().contains("parameter_classes")) { + return CategoryVocabModel.builder() + .about(textNode.asText()) + .label(this.findLabelByAbout(outerNode, textNode.asText())) + .build(); + } + } + return null; + } + + protected String findLabelByAbout(JsonNode node, String c) { + for (JsonNode item : node.get("items")) { + if (about.apply(item).contains(c)) { + return label.apply(item); + } + } + return null; + } + public List getParameterCategory(String vocabApiBase) { Map> leaves = getLeafNodeOfParameterCategory(vocabApiBase); List result = new ArrayList<>(); @@ -123,46 +151,25 @@ public List getParameterCategory(String vocabApiBase) { List broader = new ArrayList<>(); List narrower = new ArrayList<>(); + log.debug("Processing label {}", label.apply(j)); + if (j.has("broader")) { for (JsonNode b : j.get("broader")) { - CategoryVocabModel c = null; - if (b instanceof ObjectNode objectNode) { - if (objectNode.has("prefLabel") && objectNode.has("_about")) { - c = CategoryVocabModel - .builder() - .about(about.apply(b)) - .label(label.apply(b)) - .build(); - } - } - if (b instanceof TextNode textNode && textNode.asText().contains("parameter_classes")) { - c = CategoryVocabModel.builder() - .about(textNode.asText()) - .build(); - } - broader.add(c); + broader.add(this.buildCategoryVocabModel(b, node)); } } if (j.has("narrower")) { for (JsonNode b : j.get("narrower")) { - if (b.has("prefLabel") && b.has("_about")) { - CategoryVocabModel c = CategoryVocabModel - .builder() - .about(about.apply(b)) - .label(label.apply(b)) - .build(); - - narrower.add(c); - - // The record comes from ardc have two levels only, so the second level for sure - // is empty, but the third level info comes form another link (aka the leaves) - // and therefore we can attach it to the second level to for the third. - if(leaves.containsKey(about.apply(b))) { - c.setNarrower(leaves.get(about.apply(b))); - } + CategoryVocabModel c = this.buildCategoryVocabModel(b, node); + // The record comes from ardc have two levels only, so the second level for sure + // is empty, but the third level info comes form another link (aka the leaves) + // and therefore we can attach it to the second level to for the third. + if(leaves.containsKey(c.getAbout())) { + c.setNarrower(leaves.get(c.getAbout())); } + narrower.add(c); } } diff --git a/ardcvocabs/src/test/java/au/org/aodn/ardcvocabs/service/ArdcVocabsServiceTest.java b/ardcvocabs/src/test/java/au/org/aodn/ardcvocabs/service/ArdcVocabsServiceTest.java index 1b16f5e4..f71b2864 100644 --- a/ardcvocabs/src/test/java/au/org/aodn/ardcvocabs/service/ArdcVocabsServiceTest.java +++ b/ardcvocabs/src/test/java/au/org/aodn/ardcvocabs/service/ArdcVocabsServiceTest.java @@ -56,26 +56,60 @@ public void verifyGetParameterCategory() throws IOException { List categoryVocabModelList = ardcVocabsService.getParameterCategory(""); assertEquals("Total equals", 33, categoryVocabModelList.size()); - Optional m = categoryVocabModelList + + Optional c = categoryVocabModelList + .stream() + .filter(p -> p.getBroader().isEmpty() && !p.getNarrower().isEmpty() && p.getLabel().equals("Chemical")) + .findFirst(); + + assertTrue("Find target Chemical", c.isPresent()); + assertEquals("Have narrower equals", 5, c.get().getNarrower().size()); + + + Optional b = categoryVocabModelList .stream() - .filter(p -> !p.getNarrower().isEmpty() && p.getLabel().equals("Physical-Atmosphere")) + .filter(p -> p.getBroader().isEmpty() && !p.getNarrower().isEmpty() && p.getLabel().equals("Biological")) .findFirst(); - assertTrue("Find target Physical-Atmosphere", m.isPresent()); - assertEquals("Have narrower equals", 6, m.get().getNarrower().size()); + assertTrue("Find target Biological", b.isPresent()); + assertEquals("Have narrower equals", 5, b.get().getNarrower().size()); + - Optional visibility = m.get().getNarrower() + Optional pa = categoryVocabModelList + .stream() + .filter(p -> p.getBroader().isEmpty() && !p.getNarrower().isEmpty() && p.getLabel().equals("Physical-Atmosphere")) + .findFirst(); + + assertTrue("Find target Physical-Atmosphere", pa.isPresent()); + assertEquals("Have narrower equals", 8, pa.get().getNarrower().size()); + + Optional airTemperature = pa.get().getNarrower() + .stream() + .filter(p -> p.getLabel().equals("Air temperature")) + .findFirst(); + assertTrue("Find target Air temperature", airTemperature.isPresent()); + + Optional visibility = pa.get().getNarrower() .stream() .filter(p -> p.getLabel().equals("Visibility")) .findFirst(); assertTrue("Find target Visibility", visibility.isPresent()); - Optional airSeaLevel = visibility.get().getNarrower() + Optional horizontalVisibilityInTheAtmosphere = visibility.get().getNarrower() .stream() .filter(p -> p.getLabel().equals("Horizontal visibility in the atmosphere")) .findFirst(); - assertTrue("Horizontal visibility in the atmosphere found", airSeaLevel.isPresent()); + assertTrue("Horizontal visibility in the atmosphere found", horizontalVisibilityInTheAtmosphere.isPresent()); + + Optional pw = categoryVocabModelList + .stream() + .filter(p -> p.getBroader().isEmpty() && !p.getNarrower().isEmpty() && p.getLabel().equals("Physical-Water")) + .findFirst(); + + assertTrue("Find target Physical-Water", pw.isPresent()); + assertEquals("Have narrower equals", 14, pw.get().getNarrower().size()); + } } diff --git a/indexer/src/test/java/au/org/aodn/esindexer/utils/VocabUtilsTest.java b/indexer/src/test/java/au/org/aodn/esindexer/utils/VocabUtilsTest.java index 2a153b4d..ee5f94de 100644 --- a/indexer/src/test/java/au/org/aodn/esindexer/utils/VocabUtilsTest.java +++ b/indexer/src/test/java/au/org/aodn/esindexer/utils/VocabUtilsTest.java @@ -47,6 +47,7 @@ void testGetAodnDiscoveryCategories() throws IOException { assertTrue(categories.contains("alkalinity")); assertTrue(categories.contains("temperature")); assertTrue(categories.contains("salinity")); - assertEquals(3, categories.size()); + assertTrue(categories.contains("carbon")); + assertEquals(4, categories.size()); } } diff --git a/indexer/src/test/resources/canned/aodn_discovery_parameter_vocabs.json b/indexer/src/test/resources/canned/aodn_discovery_parameter_vocabs.json index c9d8718d..1d338a2c 100644 --- a/indexer/src/test/resources/canned/aodn_discovery_parameter_vocabs.json +++ b/indexer/src/test/resources/canned/aodn_discovery_parameter_vocabs.json @@ -251,14 +251,28 @@ "label": "Nutrient", "definition": "This category contains vocabulary terms describing nutrient parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/51", - "broader": [], + "broader": [ + { + "label": "Chemical", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/54" + }, + { + "label": "Biological", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/55" + } + ], "narrower": [] }, { "label": "Carbon", "definition": "This category contains vocabulary terms describing carbon parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/52", - "broader": [], + "broader": [ + { + "label": "Chemical", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/54" + } + ], "narrower": [] }, { @@ -363,6 +377,73 @@ } ] }, + { + "label": "Wind", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/6", + "narrower": [ + { + "label": "Wind speed of gust in the atmosphere", + "definition": "Maximum speed of the wind (distance moved per unit time by a parcel of air) parallel to the ground during a gust event (generally regarded as an increase over sustained speed of more than 5m/s lasting less than 20 seconds).", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/395" + }, + { + "label": "Wind to direction in the atmosphere", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/396" + }, + { + "label": "Wind stress on the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/406" + }, + { + "label": "Wind direction (relative to moving platform) in the atmosphere", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/ERWDZZ01" + }, + { + "label": "Wind speed (relative to moving platform) in the atmosphere", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/ERWSZZ01" + }, + { + "label": "Eastward wind velocity in the atmosphere", + "definition": "The component of the wind blowing towards true east. The value could result from any kind of measurement or prediction.", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/ESEWZZXX" + }, + { + "label": "Northward wind velocity in the atmosphere", + "definition": "The component of the wind blowing towards true north. The value could result from any kind of measurement or prediction.", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/ESNSZZXX" + }, + { + "label": "Wind speed in the atmosphere", + "definition": "Sustained speed of the wind (distance moved per unit time by a parcel of air) parallel to the ground at a given place and time", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/ESSAZZ01" + }, + { + "label": "Wind from direction in the atmosphere", + "definition": "Direction relative to true north from which the wind is blowing", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/EWDAZZ01" + } + ] + }, + { + "label": "Air temperature", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/7", + "narrower": [ + { + "label": "Dew point temperature of the atmosphere", + "definition": "The temperature to which air must cool to become saturated with water vapour", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/CDEWZZ01" + }, + { + "label": "Temperature of the atmosphere", + "definition": "The degree of hotness of the atmosphere expressed against a standard scale. Includes both IPTS-68 and ITS-90 scales.", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/CTMPZZ01" + }, + { + "label": "Wet bulb temperature of the atmosphere", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/CWETZZ01" + } + ] + }, { "label": "Humidity", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/8", @@ -477,6 +558,131 @@ "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/656" } ] + }, + { + "label": "Nutrient", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/51", + "narrower": [ + { + "label": "Concentration of nitrate {NO3} per unit volume of the water body", + "definition": "Concentration of nitrate per unit volume of the water column. Nitrate may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/374" + }, + { + "label": "Concentration of nitrate {NO3} per unit mass of the water body", + "definition": "Concentration (moles or mass) of nitrogen as nitrate per unit mass of the water column", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/375" + }, + { + "label": "Concentration of silicate {SiO4} per unit volume of the water body", + "definition": "Concentration of silicate per unit volume of the water column. Silicate may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/376" + }, + { + "label": "Concentration of ammonium {NH4} per unit volume of the water body", + "definition": "Concentration of ammonium per unit volume of the water column. Ammonium may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/377" + }, + { + "label": "Concentration of silicate {SiO4} per unit mass of the water body", + "definition": "Concentration (moles or mass) of silicon as silicate per unit mass of the water column", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/378" + }, + { + "label": "Concentration of phosphate {PO4} per unit volume of the water body", + "definition": "Concentration of phosphate per unit volume of the water column. Phosphate may be expressed in terms of mass or quantity of substance", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/379" + }, + { + "label": "Concentration of phosphate {PO4} per unit mass of the water body", + "definition": "Concentration of phosphate dissolved per unit mass of the water column. Solute may be expressed in terms of mass, volume or quantity of substance", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/380" + }, + { + "label": "Concentration of nitrate and nitrite {NO3 and NO2} per unit mass of the water body", + "definition": "Concentration (moles or mass) of nitrogen as both nitrate and nitrite per unit mass of the water column.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/45" + }, + { + "label": "Concentration of nitrate and nitrite {NO3 and NO2} per unit volume of the water body", + "definition": "Concentration of nitrate and nitrite per unit volume of the water column. May be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/46" + }, + { + "label": "Concentration of total phosphorus per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/47" + }, + { + "label": "Concentration of total phosphorus per unit mass of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/48" + }, + { + "label": "Concentration of nitrite {NO2} per unit mass of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/49" + }, + { + "label": "Concentration of nitrite {NO2} per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/50" + }, + { + "label": "Concentration of phosphate (water soluble reactive) per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/53" + } + ] + }, + { + "label": "Carbon", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/52", + "narrower": [ + { + "label": "Concentration of carbon (total inorganic) per unit mass of the water body", + "definition": "Concentration of dissolved inorganic carbon per unit mass of the water column. Solute may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/1" + }, + { + "label": "Partial pressure of carbon dioxide in the atmosphere", + "definition": "The partial pressure of carbon dioxide in air", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/422" + }, + { + "label": "Partial pressure of carbon dioxide in the water body", + "definition": "The partial pressure of carbon dioxide in air in equilibrium with a water sample", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/425" + }, + { + "label": "Fugacity anomaly (water - air) of carbon dioxide in the water body", + "definition": "The difference in the CO2 fugacity (effective partial pressure allowing for non-ideal gas) between air in equilibrium with seawater and the atmosphere", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/427" + }, + { + "label": "Fugacity of carbon dioxide (at 100% humidity) in the atmosphere", + "definition": "The fugacity (effective partial pressure allowing for non-ideal gas) of carbon dioxide in the atmosphere assuming a humidity of 100 per cent.", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/FCO2WTAT" + }, + { + "label": "Fugacity of carbon dioxide (at 100% humidity) in the water body", + "definition": "Fugacity (partial pressure corrected for non-ideality of gases) of carbon dioxide in air that is in equilibrium with a seawater sample", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/FCO2XXXX" + }, + { + "label": "Mole fraction of carbon dioxide (dry air) in the atmosphere", + "definition": "The proportion as a ratio of quantity of matter of CO2 in a sample of atmosphere expressed on a dry air basis", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/XCO2DRAT" + }, + { + "label": "Mole fraction of carbon dioxide (dry air) in the equilibrated marine sample", + "definition": "The proportion as a ratio of quantity of matter of CO2 in a sample of air equilibrated with seawater expressed on a dry air basis", + "about": "http://vocab.nerc.ac.uk/collection/P01/current/XCO2WBDY" + }, + { + "label": "Saturation state of aragonite in the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/24" + }, + { + "label": "Saturation state of calcite in the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/25" + } + ] } ] }, @@ -817,6 +1023,77 @@ "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/656" } ] + }, + { + "label": "Nutrient", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/51", + "narrower": [ + { + "label": "Concentration of nitrate {NO3} per unit volume of the water body", + "definition": "Concentration of nitrate per unit volume of the water column. Nitrate may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/374" + }, + { + "label": "Concentration of nitrate {NO3} per unit mass of the water body", + "definition": "Concentration (moles or mass) of nitrogen as nitrate per unit mass of the water column", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/375" + }, + { + "label": "Concentration of silicate {SiO4} per unit volume of the water body", + "definition": "Concentration of silicate per unit volume of the water column. Silicate may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/376" + }, + { + "label": "Concentration of ammonium {NH4} per unit volume of the water body", + "definition": "Concentration of ammonium per unit volume of the water column. Ammonium may be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/377" + }, + { + "label": "Concentration of silicate {SiO4} per unit mass of the water body", + "definition": "Concentration (moles or mass) of silicon as silicate per unit mass of the water column", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/378" + }, + { + "label": "Concentration of phosphate {PO4} per unit volume of the water body", + "definition": "Concentration of phosphate per unit volume of the water column. Phosphate may be expressed in terms of mass or quantity of substance", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/379" + }, + { + "label": "Concentration of phosphate {PO4} per unit mass of the water body", + "definition": "Concentration of phosphate dissolved per unit mass of the water column. Solute may be expressed in terms of mass, volume or quantity of substance", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/380" + }, + { + "label": "Concentration of nitrate and nitrite {NO3 and NO2} per unit mass of the water body", + "definition": "Concentration (moles or mass) of nitrogen as both nitrate and nitrite per unit mass of the water column.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/45" + }, + { + "label": "Concentration of nitrate and nitrite {NO3 and NO2} per unit volume of the water body", + "definition": "Concentration of nitrate and nitrite per unit volume of the water column. May be expressed in terms of mass or quantity of substance.", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/46" + }, + { + "label": "Concentration of total phosphorus per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/47" + }, + { + "label": "Concentration of total phosphorus per unit mass of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/48" + }, + { + "label": "Concentration of nitrite {NO2} per unit mass of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/49" + }, + { + "label": "Concentration of nitrite {NO2} per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/50" + }, + { + "label": "Concentration of phosphate (water soluble reactive) per unit volume of the water body", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/53" + } + ] } ] }, @@ -1330,6 +1607,28 @@ "about": "http://vocab.nerc.ac.uk/collection/P01/current/PSLTZZ01" } ] + }, + { + "label": "Sea surface height", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/57", + "narrower": [ + { + "label": "Sea surface height anomaly", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/642" + }, + { + "label": "Sea surface height above geoid", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/643" + }, + { + "label": "Sea surface height above reference datum", + "about": "http://vocab.aodn.org.au/def/discovery_parameter/entity/43" + } + ] + }, + { + "label": "Depth", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/58" } ] }, @@ -1337,28 +1636,48 @@ "label": "Sea surface height", "definition": "This category contains vocabulary terms describing sea surface height parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/57", - "broader": [], + "broader": [ + { + "label": "Physical-Water", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/56" + } + ], "narrower": [] }, { "label": "Depth", "definition": "This category contains vocabulary terms describing depth parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/58", - "broader": [], + "broader": [ + { + "label": "Physical-Water", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/56" + } + ], "narrower": [] }, { "label": "Wind", "definition": "This category contains vocabulary terms describing wind parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/6", - "broader": [], + "broader": [ + { + "label": "Physical-Atmosphere", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/53" + } + ], "narrower": [] }, { "label": "Air temperature", "definition": "This category contains vocabulary terms describing air temperature parameters", "about": "http://vocab.aodn.org.au/def/parameter_classes/category/7", - "broader": [], + "broader": [ + { + "label": "Physical-Atmosphere", + "about": "http://vocab.aodn.org.au/def/parameter_classes/category/53" + } + ], "narrower": [] }, { diff --git a/indexer/src/test/resources/canned/sample4_stac.json b/indexer/src/test/resources/canned/sample4_stac.json index 3adbf5eb..99f97ff2 100644 --- a/indexer/src/test/resources/canned/sample4_stac.json +++ b/indexer/src/test/resources/canned/sample4_stac.json @@ -1,255 +1,410 @@ { - "title" : "Ocean acidification historical reconstruction", - "description" : "This dataset contains the reconstructed time series of monthly mean aragonite, calcite and pH together with distribution of dissolved inorganic carbon (DIC), total alkalinity (ALK), sea surface temperature and salinity in the Australian region at a 1 degree resolution over the period 1870-2013.", - "extent" : { - "bbox" : [ [ 95.5, -44.5, 169.5, -0.5 ], [ 95.5, -44.5, 169.5, -44.5, 169.5, -0.5, 95.5, -0.5, 95.5, -44.5 ] ], - "temporal" : [ [ "1870-07-16T14:10:44Z", "2013-06-16T14:00:00Z" ], [ "1870-07-16T14:10:44Z", "2013-06-16T14:00:00Z" ] ] + "title": "Ocean acidification historical reconstruction", + "description": "This dataset contains the reconstructed time series of monthly mean aragonite, calcite and pH together with distribution of dissolved inorganic carbon (DIC), total alkalinity (ALK), sea surface temperature and salinity in the Australian region at a 1 degree resolution over the period 1870-2013.", + "extent": { + "bbox": [ + [ + 95.5, + -44.5, + 169.5, + -0.5 + ], + [ + 95.5, + -44.5, + 169.5, + -44.5, + 169.5, + -0.5, + 95.5, + -0.5, + 95.5, + -44.5 + ] + ], + "temporal": [ + [ + "1870-07-16T14:10:44Z", + "2013-06-16T14:00:00Z" + ], + [ + "1870-07-16T14:10:44Z", + "2013-06-16T14:00:00Z" + ] + ] }, - "summaries" : { - "score" : 95, - "status" : "completed", - "scope" : { - "code" : "dataset", - "name" : "" - }, - "dataset_group" : "sample", - "dataset_provider" : "IMOS", - "proj:geometry" : { - "coordinates" : [ [ [ [ 95.5, -44.5 ], [ 169.5, -44.5 ], [ 169.5, -0.5 ], [ 95.5, -0.5 ], [ 95.5, -44.5 ] ] ] ], - "type" : "MultiPolygon" - }, - "temporal" : [ { - "start" : "1870-07-16T14:10:44Z", - "end" : "2013-06-16T14:00:00Z" - } ], - "discovery_categories" : [ "alkalinity", "temperature", "salinity" ] + "summaries": { + "score": 95, + "status": "completed", + "scope": { + "code": "dataset", + "name": "" + }, + "dataset_group": "sample", + "dataset_provider": "IMOS", + "proj:geometry": { + "coordinates": [ + [ + [ + [ + 95.5, + -44.5 + ], + [ + 169.5, + -44.5 + ], + [ + 169.5, + -0.5 + ], + [ + 95.5, + -0.5 + ], + [ + 95.5, + -44.5 + ] + ] + ] + ], + "type": "MultiPolygon" + }, + "temporal": [ + { + "start": "1870-07-16T14:10:44Z", + "end": "2013-06-16T14:00:00Z" + } + ], + "discovery_categories": [ + "alkalinity", + "carbon", + "temperature", + "salinity" + ] }, - "contacts" : [ { - "emails" : [ "Andrew.Lenton@csiro.au" ], - "addresses" : [ { - "deliveryPoint" : [ "GPO Box 1538" ], - "country" : "Australia", - "city" : "Hobart", - "postalCode" : "7000", - "administrativeArea" : "Tasmania" - } ], - "roles" : "principalInvestigator", - "organization" : "CSIRO Oceans and Atmosphere - Hobart", - "name" : "Lenton, Andrew", - "phones" : [ ], - "links" : [ ], - "position" : "" - }, { - "emails" : [ "info@aodn.org.au" ], - "addresses" : [ { - "deliveryPoint" : [ "University of Tasmania", "Private Bag 110" ], - "country" : "Australia", - "city" : "Hobart", - "postalCode" : "7001", - "administrativeArea" : "Tasmania" - } ], - "roles" : "pointOfContact", - "organization" : "Integrated Marine Observing System (IMOS)", - "name" : "", - "phones" : [ { - "roles" : "voice", - "value" : "61 3 6226 7488" - }, { - "roles" : "facsimile", - "value" : "61 3 6226 2701" - } ], - "links" : [ { - "href" : "http://imos.org.au/aodn.html", - "title" : "Website of the Australian Ocean Data Network (AODN)", - "type" : "WWW:LINK-1.0-http--link" - } ], - "position" : "Data Officer" - } ], - "languages" : [ { - "code" : "eng", - "name" : "English" - } ], - "links" : [ { - "href" : "http://www.biogeosciences.net/13/1753/2016", - "rel" : "self", - "type" : "text/html", - "title" : "Biogeosciences Journal article" - }, { - "href" : "https://portal.aodn.org.au/search?uuid=7709f541-fc0c-4318-b5b9-9053aa474e0e", - "rel" : "self", - "type" : "text/html", - "title" : "View and download data though the AODN Portal" - }, { - "href" : "http://thredds.aodn.org.au/thredds/dodsC/CSIRO/Climatology/Ocean_Acidification/OA_Reconstruction.nc.html", - "rel" : "self", - "type" : "text/html", - "title" : "NetCDF files via THREDDS catalog" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/SST" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/SSS" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/ALK" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/DIC" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/OMEGA_A" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/OMEGA_C" - }, { - "href" : "http://geoserver-123.aodn.org.au/geoserver/ncwms", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url/pH_T" - }, { - "href" : "https://processes.aodn.org.au/wps", - "rel" : "self", - "type" : "", - "title" : "csiro_oa_reconstruction_url" - }, { - "href" : "https://help.aodn.org.au/web-services/gogoduck-aggregator/", - "rel" : "self", - "type" : "text/html", - "title" : "GoGoDuck help documentation" - } ], - "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 | Ocean Temperature | Sea Surface Temperature" - }, { - "id" : "Oceans | Salinity/density | Salinity" - }, { - "id" : "Oceans | Ocean Chemistry | Carbon Dioxide" - }, { - "id" : "Oceans | Ocean Chemistry | Carbonate" - }, { - "id" : "Oceans | Ocean Chemistry | pH" - } ], - "scheme" : "theme", - "description" : "GCMD", - "title" : "NASA/Global Change Master Directory Earth Science Keywords Version 5.3.8" - }, { - "concepts" : [ { - "id" : "Ocean Biogeochemistry" - }, { - "id" : "pCO2" - } ], - "scheme" : "theme", - "description" : "IMOS", - "title" : "IMOS Keywords Thesaurus" - }, { - "concepts" : [ { - "id" : "Global / Oceans | Pacific Ocean" - }, { - "id" : "Global / Oceans | Southern Ocean" - }, { - "id" : "Global / Oceans | Indian Ocean" - }, { - "id" : "Marine Features (Australia) | Great Australian Bight, SA/WA" - }, { - "id" : "Marine Features (Australia) | Bass Strait, TAS/VIC" - }, { - "id" : "Regional Seas | Coral Sea" - }, { - "id" : "Regional Seas | Tasman Sea" - }, { - "id" : "Regional Seas | Timor Sea" - }, { - "id" : "Regional Seas | Arafura Sea" - }, { - "id" : "Regional Seas | Banda Sea" - }, { - "id" : "Regional Seas | Java Sea" - }, { - "id" : "Regional Seas | Solomon Sea" - } ], - "scheme" : "place", - "description" : "", - "title" : "AODN Geographic Extents Vocabulary" - }, { - "concepts" : [ { - "id" : "Countries | Australia" - }, { - "id" : "Countries | Papua New Guinea" - }, { - "id" : "Countries | Indonesia" - }, { - "id" : "Countries | Timor-Leste" - }, { - "id" : "Countries | New Zealand" - }, { - "id" : "States, Territories (Australia) | Western Australia" - }, { - "id" : "States, Territories (Australia) | Queensland" - }, { - "id" : "States, Territories (Australia) | South Australia" - }, { - "id" : "States, Territories (Australia) | Tasmania" - }, { - "id" : "States, Territories (Australia) | Victoria" - }, { - "id" : "States, Territories (Australia) | New South Wales" - }, { - "id" : "States, Territories (Australia) | Northern Territory" - } ], - "scheme" : "place", - "description" : "", - "title" : "AODN Geographic Extents Vocabulary" - }, { - "concepts" : [ { - "id" : "Temperature of the water body", - "url" : "http://vocab.nerc.ac.uk/collection/P01/current/TEMPPR01" - }, { - "id" : "Practical salinity of the water body", - "url" : "http://vocab.nerc.ac.uk/collection/P01/current/PSLTZZ01" - }, { - "id" : "Concentration of carbon (total inorganic) per unit mass of the water body", - "url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/1" - }, { - "id" : "Total alkalinity per unit mass of the water body", - "url" : "http://vocab.nerc.ac.uk/collection/P01/current/MDMAP014" - }, { - "id" : "Saturation state of aragonite in the water body", - "url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/24" - }, { - "id" : "Saturation state of calcite in the water body", - "url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/25" - }, { - "id" : "pH (total scale) of the water body", - "url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/27" - } ], - "scheme" : "theme", - "description" : "", - "title" : "AODN Discovery Parameter Vocabulary" - } ], - "id" : "7709f541-fc0c-4318-b5b9-9053aa474e0e", - "record_suggest" : { - "title" : "Ocean acidification historical reconstruction" + "contacts": [ + { + "emails": [ + "Andrew.Lenton@csiro.au" + ], + "addresses": [ + { + "deliveryPoint": [ + "GPO Box 1538" + ], + "country": "Australia", + "city": "Hobart", + "postalCode": "7000", + "administrativeArea": "Tasmania" + } + ], + "roles": "principalInvestigator", + "organization": "CSIRO Oceans and Atmosphere - Hobart", + "name": "Lenton, Andrew", + "phones": [], + "links": [], + "position": "" + }, + { + "emails": [ + "info@aodn.org.au" + ], + "addresses": [ + { + "deliveryPoint": [ + "University of Tasmania", + "Private Bag 110" + ], + "country": "Australia", + "city": "Hobart", + "postalCode": "7001", + "administrativeArea": "Tasmania" + } + ], + "roles": "pointOfContact", + "organization": "Integrated Marine Observing System (IMOS)", + "name": "", + "phones": [ + { + "roles": "voice", + "value": "61 3 6226 7488" + }, + { + "roles": "facsimile", + "value": "61 3 6226 2701" + } + ], + "links": [ + { + "href": "http://imos.org.au/aodn.html", + "title": "Website of the Australian Ocean Data Network (AODN)", + "type": "WWW:LINK-1.0-http--link" + } + ], + "position": "Data Officer" + } + ], + "languages": [ + { + "code": "eng", + "name": "English" + } + ], + "links": [ + { + "href": "http://www.biogeosciences.net/13/1753/2016", + "rel": "self", + "type": "text/html", + "title": "Biogeosciences Journal article" + }, + { + "href": "https://portal.aodn.org.au/search?uuid=7709f541-fc0c-4318-b5b9-9053aa474e0e", + "rel": "self", + "type": "text/html", + "title": "View and download data though the AODN Portal" + }, + { + "href": "http://thredds.aodn.org.au/thredds/dodsC/CSIRO/Climatology/Ocean_Acidification/OA_Reconstruction.nc.html", + "rel": "self", + "type": "text/html", + "title": "NetCDF files via THREDDS catalog" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/SST" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/SSS" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/ALK" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/DIC" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/OMEGA_A" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/OMEGA_C" + }, + { + "href": "http://geoserver-123.aodn.org.au/geoserver/ncwms", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url/pH_T" + }, + { + "href": "https://processes.aodn.org.au/wps", + "rel": "self", + "type": "", + "title": "csiro_oa_reconstruction_url" + }, + { + "href": "https://help.aodn.org.au/web-services/gogoduck-aggregator/", + "rel": "self", + "type": "text/html", + "title": "GoGoDuck help documentation" + } + ], + "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 | Ocean Temperature | Sea Surface Temperature" + }, + { + "id": "Oceans | Salinity/density | Salinity" + }, + { + "id": "Oceans | Ocean Chemistry | Carbon Dioxide" + }, + { + "id": "Oceans | Ocean Chemistry | Carbonate" + }, + { + "id": "Oceans | Ocean Chemistry | pH" + } + ], + "scheme": "theme", + "description": "GCMD", + "title": "NASA/Global Change Master Directory Earth Science Keywords Version 5.3.8" + }, + { + "concepts": [ + { + "id": "Ocean Biogeochemistry" + }, + { + "id": "pCO2" + } + ], + "scheme": "theme", + "description": "IMOS", + "title": "IMOS Keywords Thesaurus" + }, + { + "concepts": [ + { + "id": "Global / Oceans | Pacific Ocean" + }, + { + "id": "Global / Oceans | Southern Ocean" + }, + { + "id": "Global / Oceans | Indian Ocean" + }, + { + "id": "Marine Features (Australia) | Great Australian Bight, SA/WA" + }, + { + "id": "Marine Features (Australia) | Bass Strait, TAS/VIC" + }, + { + "id": "Regional Seas | Coral Sea" + }, + { + "id": "Regional Seas | Tasman Sea" + }, + { + "id": "Regional Seas | Timor Sea" + }, + { + "id": "Regional Seas | Arafura Sea" + }, + { + "id": "Regional Seas | Banda Sea" + }, + { + "id": "Regional Seas | Java Sea" + }, + { + "id": "Regional Seas | Solomon Sea" + } + ], + "scheme": "place", + "description": "", + "title": "AODN Geographic Extents Vocabulary" + }, + { + "concepts": [ + { + "id": "Countries | Australia" + }, + { + "id": "Countries | Papua New Guinea" + }, + { + "id": "Countries | Indonesia" + }, + { + "id": "Countries | Timor-Leste" + }, + { + "id": "Countries | New Zealand" + }, + { + "id": "States, Territories (Australia) | Western Australia" + }, + { + "id": "States, Territories (Australia) | Queensland" + }, + { + "id": "States, Territories (Australia) | South Australia" + }, + { + "id": "States, Territories (Australia) | Tasmania" + }, + { + "id": "States, Territories (Australia) | Victoria" + }, + { + "id": "States, Territories (Australia) | New South Wales" + }, + { + "id": "States, Territories (Australia) | Northern Territory" + } + ], + "scheme": "place", + "description": "", + "title": "AODN Geographic Extents Vocabulary" + }, + { + "concepts": [ + { + "id": "Temperature of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/TEMPPR01" + }, + { + "id": "Practical salinity of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/PSLTZZ01" + }, + { + "id": "Concentration of carbon (total inorganic) per unit mass of the water body", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/1" + }, + { + "id": "Total alkalinity per unit mass of the water body", + "url": "http://vocab.nerc.ac.uk/collection/P01/current/MDMAP014" + }, + { + "id": "Saturation state of aragonite in the water body", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/24" + }, + { + "id": "Saturation state of calcite in the water body", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/25" + }, + { + "id": "pH (total scale) of the water body", + "url": "http://vocab.aodn.org.au/def/discovery_parameter/entity/27" + } + ], + "scheme": "theme", + "description": "", + "title": "AODN Discovery Parameter Vocabulary" + } + ], + "id": "7709f541-fc0c-4318-b5b9-9053aa474e0e", + "record_suggest": { + "title": "Ocean acidification historical reconstruction" }, - "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" ] + "stac_version": "1.0.0", + "type": "Collection", + "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" + ] }