diff --git a/file_checker_exec/pom.xml b/file_checker_exec/pom.xml index c6d3623..9ce0552 100644 --- a/file_checker_exec/pom.xml +++ b/file_checker_exec/pom.xml @@ -4,7 +4,7 @@ 4.0.0 fr.ifremer file_checker_exec - 3.0.2 + 3.0.3 Argo NetCDF file format checker @@ -161,6 +161,58 @@ + + + org.apache.maven.plugins + maven-clean-plugin + 3.4.0 + + + delete-spec-folder + initialize + + clean + + + true + + + + ${project.basedir}/src/main/resources/file_checker_spec + + + + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 3.3.1 + + + copy-external-folder + generate-resources + + copy-resources + + + + ${project.basedir}/src/main/resources/file_checker_spec + + true + + + ${project.basedir}/../file_checker_spec + false + + + + + + org.apache.maven.plugins diff --git a/file_checker_exec/src/main/java/fr/coriolis/checker/validators/ArgoProfileFileValidator.java b/file_checker_exec/src/main/java/fr/coriolis/checker/validators/ArgoProfileFileValidator.java index 5b4cf5d..de957e6 100644 --- a/file_checker_exec/src/main/java/fr/coriolis/checker/validators/ArgoProfileFileValidator.java +++ b/file_checker_exec/src/main/java/fr/coriolis/checker/validators/ArgoProfileFileValidator.java @@ -880,7 +880,7 @@ public boolean validateMetaData(int nProf, ArgoReferenceTable.DACS dac, boolean } else { // need to delete optionnal free text ([free text]) : - s = s.replaceAll("\\s*\\[[^\\]]*\\]\\s*", "").trim(); + s = s.replaceAll("\\s*\\[.*\\]\\s*", "").trim(); tableEntry = ArgoNVSReferenceTable.VERTICAL_SAMPLING_SCHEME_TABLE.getConceptMembersByPrefLabelMap() .get(s); diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R01.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R01.jsonld index d30227b..914d336 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R01.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R01.jsonld @@ -269,7 +269,7 @@ "dce:identifier": "SDN:R01::METAAUX", "pav:version": "1", "skos:notation": "SDN:R01::METAAUX", - "skos:altLabel": "", + "skos:altLabel": "METAAUX", "dc:date": "2024-09-11 11:40:41.0", "owl:versionInfo": "1", "skos:prefLabel": { diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R08.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R08.jsonld index 6bebf73..44578e6 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R08.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R08.jsonld @@ -684,9 +684,14 @@ "dc:date": "2023-10-05 14:39:49.0", "skos:altLabel": "836", "skos:notation": "SDN:R08::836", - "skos:broader": { - "@id": "http://vocab.nerc.ac.uk/collection/R23/current/PROVOR_III/" - }, + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R23/current/PROVOR_III/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R23/current/PROVOR_III_JUMBO/" + } + ], "pav:version": "2", "dce:identifier": "SDN:R08::836", "pav:hasCurrentVersion": { @@ -702,9 +707,14 @@ }, "dce:identifier": "SDN:R08::843", "pav:version": "1", - "skos:broader": { - "@id": "http://vocab.nerc.ac.uk/collection/R23/current/POPS_PROVOR/" - }, + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R23/current/POPS_PROVOR/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R23/current/POPS_NEMO/" + } + ], "skos:notation": "SDN:R08::843", "skos:altLabel": "843", "dc:date": "2020-05-03 20:28:54.0", diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R23.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R23.jsonld index 9ae248b..7d47ce4 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R23.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R23.jsonld @@ -99,6 +99,9 @@ }, "skos:related": { "@id": "http://vocab.nerc.ac.uk/collection/R24/current/OPTIMARE/" + }, + "skos:narrower": { + "@id": "http://vocab.nerc.ac.uk/collection/R08/current/843/" }, "@type": "skos:Concept" }, @@ -111,7 +114,7 @@ "dce:identifier": "SDN:R23::PROVOR_III_JUMBO", "pav:version": "1", "skos:notation": "SDN:R23::PROVOR_III_JUMBO", - "skos:altLabel": "", + "skos:altLabel": "PROVOR_III_JUMBO", "dc:date": "2024-09-11 11:40:41.0", "owl:versionInfo": "1", "skos:prefLabel": { @@ -130,6 +133,12 @@ "skos:definition": { "@language": "en", "@value": "PROVOR float with additional battery pack. PLATFORM_ TYPE_ KEY = 108." + }, + "skos:related": { + "@id": "http://vocab.nerc.ac.uk/collection/R24/current/NKE/" + }, + "skos:narrower": { + "@id": "http://vocab.nerc.ac.uk/collection/R08/current/836/" }, "@type": "skos:Concept" }, diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R25.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R25.jsonld index 1ee94ff..53d7be8 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R25.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R25.jsonld @@ -83,7 +83,7 @@ }, "owl:versionInfo": "1", "dc:date": "2023-11-24 09:35:13.0", - "skos:altLabel": "" + "skos:altLabel": "CTD_TEMP_CNDC" }, { "@id": "http://vocab.nerc.ac.uk/collection/R25/current/FLUOROMETER_CHLA/", @@ -1059,7 +1059,11 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/RAMSES_ACC/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/OCR504_ICSW/" } + ], "skos:definition": { "@language": "en", diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R26.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R26.jsonld index 0f5d539..70efa48 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R26.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R26.jsonld @@ -863,6 +863,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/RBR_PRES/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/RBR_CTD/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/RBR_ARGO/" @@ -1098,6 +1101,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.4/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.5/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41CP_V1.2/" @@ -1164,6 +1170,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE63_OPTODE/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE83_OPTODE/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41CP_V1/" @@ -1272,6 +1281,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SATLANTIC_OCR504_ICSW/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/OCR504_ICSW/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41CP_V1.9/" @@ -1299,6 +1311,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SATLANTIC_OCR504_R10W/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/OCR504_R10W/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/C_ROVER/" diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R27.jsonld b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R27.jsonld index ee675fb..b1a5750 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/R27.jsonld +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/R27.jsonld @@ -95,6 +95,9 @@ "dc:date": "2025-11-18 12:09:41.0", "skos:altLabel": "SBE83_OPTODE", "skos:notation": "SDN:R27::SBE83_OPTODE", + "skos:broader": { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" + }, "pav:version": "2", "dce:identifier": "SDN:R27::SBE83_OPTODE", "pav:hasCurrentVersion": { @@ -124,6 +127,9 @@ "@id": "http://vocab.nerc.ac.uk/collection/R25/current/CTD_TEMP_CNDC/" } ], + "skos:broader": { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/RBR/" + }, "skos:definition": { "@language": "en", "@value": "A system comprising temperature, conductivity and pressure sensors, manufactured by RBR for moored applications. This cell was not optimized for use on profiling floats, and this was used in only one test deployment. The system supports both spot and continuous sampling modes, with sampling speeds configurable to up to 12 Hz. The depth rating for a standard profile is 2000 dbar, with energy consumption of approximately 700 J." @@ -168,6 +174,14 @@ { "@id": "http://vocab.nerc.ac.uk/collection/R25/current/RADIOMETER_UP_RAD412/" } + ], + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SATLANTIC/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" + } ], "skos:definition": { "@language": "en", @@ -216,6 +230,17 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R25/current/RADIOMETER_DOWN_IRR490/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R25/current/RADIOMETER_PAR/" + } + ], + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SATLANTIC/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" } ], "skos:definition": { @@ -2669,6 +2694,57 @@ "skos:broader": { "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" } + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.5/", + "pav:hasVersion": { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.5/1/" + }, + "pav:authoredOn": "2025-04-03 11:54:30.0", + "pav:hasCurrentVersion": { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.5/2/" + }, + "dce:identifier": "SDN:R27::SBE41N_V5.3.5", + "pav:version": "2", + "@type": "skos:Concept", + "skos:related": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R25/current/CTD_PRES/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R25/current/CTD_TEMP/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R25/current/CTD_CNDC/" + } + ], + "skos:definition": { + "@language": "en", + "@value": "A system comprising temperature, conductivity and pressure sensors with pump-controlled, T-C ducted flow, manufactured by Sea-Bir Scientific. The unit is designed for deployment on profiling floats hosting multiple biogeochemical (BGC) sensors. This CTD operates in continuous profiling (CP) mode, thus sampling at 1 Hz during float ascent. Data from all the float's sensors, including the optional bolt-on ones, are integrated in the data stream and transmitted to the float controller when the float reaches the surface. This SBE41N model has firmware version 5.3.5." + }, + "void:inDataset": { + "@id": "http://vocab.nerc.ac.uk/.well-known/void" + }, + "owl:deprecated": "true", + "skos:note": { + "@language": "en", + "@value": "deprecated" + }, + "dc:identifier": "SDN:R27::SBE41N_V5.3.5", + "skos:prefLabel": { + "@language": "en", + "@value": "Sea-Bird Scientific SBE 41N CTD V5.3.5" + }, + "owl:versionInfo": "2", + "dc:date": "2025-04-03 11:54:30.0", + "skos:altLabel": "SBE41N_V5.3.5", + "skos:notation": "SDN:R27::SBE41N_V5.3.5", + "skos:broader": { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" + } }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N/", @@ -6684,6 +6760,9 @@ }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.4/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41N_V5.3.5/" }, { "@id": "http://vocab.nerc.ac.uk/collection/R27/current/SBE41CP_V1.2/" diff --git a/file_checker_exec/src/main/resources/file_checker_spec/NVS/dateOfUpdate.txt b/file_checker_exec/src/main/resources/file_checker_spec/NVS/dateOfUpdate.txt index 4225209..a842c6d 100644 --- a/file_checker_exec/src/main/resources/file_checker_spec/NVS/dateOfUpdate.txt +++ b/file_checker_exec/src/main/resources/file_checker_spec/NVS/dateOfUpdate.txt @@ -1 +1,2 @@ -2026-04-21T09:24:48.256314 \ No newline at end of file +2026-04-21T09:24:48.256314 +manual fixes done on R01, R08, R23, R25, R27 \ No newline at end of file diff --git a/file_checker_exec/src/test/java/fr/coriolis/checker/e2etests/validateVerticalSampingSchemeIT.java b/file_checker_exec/src/test/java/fr/coriolis/checker/e2etests/validateVerticalSampingSchemeIT.java new file mode 100644 index 0000000..2939664 --- /dev/null +++ b/file_checker_exec/src/test/java/fr/coriolis/checker/e2etests/validateVerticalSampingSchemeIT.java @@ -0,0 +1,29 @@ +package fr.coriolis.checker.e2etests; + +import java.io.IOException; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Tag; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +class validateVerticalSampingSchemeIT { + + private final String TEST_DIR_NAME = "TEST_PROFILE_0006"; + + @BeforeAll + public static void init() { + TestsUtils.init(validateVerticalSampingSchemeIT.class); + } + + @Tag(TEST_DIR_NAME) + @ParameterizedTest(name = "{0} from dac {1} should have status {2} at phase {3}") + @CsvSource({ "BR6990526_136_imbricatedBrackets.nc,coriolis" }) + void fileChecker_shouldNotRaiseWarning_WhenImbricatedBracketsInOptText(String fileName, String dac) + throws IOException, InterruptedException { + + TestsUtils.e2eTestWarningAbsence(fileName, dac, TEST_DIR_NAME); + + } + +} diff --git a/file_checker_exec/src/test/netcdf-test-files/TEST_PROFILE_0006/BR6990526_136_imbricatedBrackets.nc b/file_checker_exec/src/test/netcdf-test-files/TEST_PROFILE_0006/BR6990526_136_imbricatedBrackets.nc new file mode 100644 index 0000000..b5ca35e Binary files /dev/null and b/file_checker_exec/src/test/netcdf-test-files/TEST_PROFILE_0006/BR6990526_136_imbricatedBrackets.nc differ diff --git a/file_checker_spec/NVS/R27.jsonld b/file_checker_spec/NVS/R27.jsonld index 006c2b8..b1a5750 100644 --- a/file_checker_spec/NVS/R27.jsonld +++ b/file_checker_spec/NVS/R27.jsonld @@ -175,9 +175,14 @@ "@id": "http://vocab.nerc.ac.uk/collection/R25/current/RADIOMETER_UP_RAD412/" } ], - "skos:broader": { - "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" - }, + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SATLANTIC/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" + } + ], "skos:definition": { "@language": "en", "@value": "Replaces deprecated term 'http://vocab.nerc.ac.uk/collection/R27/current/SATLANTIC_OCR504_R10W'. A cosine-response, multispectral radiometer configured to measure upwelling radiance in water. Number of channels: 4; field of view: 10 deg (half angle, half maximum); bandwidth range: 400 nm to 865 nm (standard), or 305 nm, 325 nm, 340 nm, 380 nm (UV); sampling rate: 7 Hz - 24 Hz; spectral bandwidth: 10 nm or 20 nm. The instrument was originally developed and manufactured at Satlantic, and was rebranded as a Sea-Bird Scientific product following the company's acquisition by Danaher in 2011." @@ -230,9 +235,14 @@ "@id": "http://vocab.nerc.ac.uk/collection/R25/current/RADIOMETER_PAR/" } ], - "skos:broader": { - "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" - }, + "skos:broader": [ + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SATLANTIC/" + }, + { + "@id": "http://vocab.nerc.ac.uk/collection/R26/current/SBE/" + } + ], "skos:definition": { "@language": "en", "@value": "Replaces deprecated term 'http://vocab.nerc.ac.uk/collection/R27/current/SATLANTIC_OCR504_ICSW'. A cosine-response, multispectral radiometer configured to measure downwelling irradiance in water. Number of channels: 4; bandwidth range: 400 nm to 865 nm (standard), or 305 nm, 325 nm, 340 nm, 380 nm (UV); sampling rate: 7 Hz - 24 Hz; spectral bandwidth: 10 nm or 20 nm. The instrument was originally developed and manufactured at Satlantic, and was rebranded as a Sea-Bird Scientific product following the company's acquisition by Danaher in 2011."