NASA-PDS / validate

Validates PDS4 product labels, data and PDS3 Volumes
https://nasa-pds.github.io/validate/
Apache License 2.0
16 stars 11 forks source link

Data with illegitimate units PASS validation when it should fail #515

Open jpl-jengelke opened 2 years ago

jpl-jengelke commented 2 years ago

πŸ› Describe the bug identified during I&T

A WARNING is issued instead of ERROR when Validate is run against a test file with units represented incorrectly:

    <DD_Value_Domain>
      <enumeration_flag>false</enumeration_flag>
      <value_data_type>ASCII_Real</value_data_type>
      <unit_of_measure_type>thisshouldnotpassbutdoes</unit_of_measure_type>
    </DD_Value_Domain>

πŸ₯Ό Related Test Case(s)

IM.8

πŸ” : Related issues

pds4-information-model#443


βž• Additional Details

πŸ“œ To Reproduce

Steps to reproduce the behavior: Execute the following:

  1. validate -t badtype.xml
  2. validate -t shouldpass.xml

πŸ•΅οΈ Expected behavior

The former file should fail. The latter file should pass. This passes if both conditions are met.

πŸ“š Version of Software Used

pds4-information-model-ontology version 14.0.1 (I) Validate 2.2.0

🩺 Test Data / Additional context

Validate output:

PDS Validate Tool Report

Configuration:
   Version                       2.2.0
   Date                          2022-05-09T15:22:33Z

Parameters:
   Targets                       [file:/System/Volumes/Data/sourcecode/source/pds/test-validations/12-1/pds4-im/443/testdata/badtype.xml]
   Severity Level                WARNING
   Recurse Directories           true
   File Filters Used             [*.xml, *.XML]
   Data Content Validation       on
   Product Level Validation      on
   Max Errors                    100000
   Registered Contexts File      /sourcecode/source/pds/validate-latest/resources/registered_context_products.json

Product Level Validation Results

  PASS: file:/System/Volumes/Data/sourcecode/source/pds/test-validations/12-1/pds4-im/443/testdata/badtype.xml
      WARNING  [warning.label.schematron]   line 30, 29: The attribute pds:DD_Value_Domain/pds:unit_of_measure_type must be equal to one of the following values 'Units_of_Acceleration', 'Units_of_Amount_Of_Substance', 'Units_of_Angle', 'Units_of_Angular_Velocity', 'Units_of_Area', 'Units_of_Current', 'Units_of_Energy', 'Units_of_Force', 'Units_of_Frame_Rate', 'Units_of_Frequency', 'Units_of_Gmass', 'Units_of_Length', 'Units_of_Map_Scale', 'Units_of_Mass', 'Units_of_Misc', 'Units_of_None', 'Units_of_Optical_Path_Length', 'Units_of_Pixel_Resolution_Angular', 'Units_of_Pixel_Resolution_Linear', 'Units_of_Pixel_Resolution_Map', 'Units_of_Pixel_Scale_Angular', 'Units_of_Pixel_Scale_Linear', 'Units_of_Pixel_Scale_Map', 'Units_of_Power', 'Units_of_Pressure', 'Units_of_Radiance', 'Units_of_Rates', 'Units_of_Solid_Angle', 'Units_of_Spectral_Irradiance', 'Units_of_Spectral_Radiance', 'Units_of_Storage', 'Units_of_Temperature', 'Units_of_Time', 'Units_of_Velocity', 'Units_of_Voltage', 'Units_of_Volume', 'Units_of_Wavenumber'.
        1 product validation(s) completed

Summary:

  0 error(s)
  1 warning(s)

  Product Validation Summary:
    1          product(s) passed
    0          product(s) failed
    0          product(s) skipped

  Referential Integrity Check Summary:
    0          check(s) passed
    0          check(s) failed
    0          check(s) skipped

  Message Types:
    1            warning.label.schematron

End of Report
Completed execution in 4643 ms

🏞Screenshots

πŸ–₯ System Info


πŸ¦„ Related requirements

βš™οΈ Engineering Details

We should probably change schematron failures to ERRORS, not WARNINGs.

jordanpadams commented 2 years ago

@jpl-jengelke can you send over the exact output from Validate? this helps-ish, but the output you are seeing would be great

jpl-jengelke commented 2 years ago

can you send over the exact output from Validate?

@jordanpadams Updated in description.

al-niessner commented 1 year ago

@jordanpadams

Are we simply saying change the warning to error as:

WARNING  [warning.label.schematron]   line 30, 29: The attribute pds:DD_Value_Domain/pds:unit_of_measure_type must be equal to one of the following values 'Units_of_Acceleration', 'Units_of_Amount_Of_Substance', 'Units_of_Angle', 'Units_of_Angular_Velocity', 'Units_of_Area', 'Units_of_Current', 'Units_of_Energy', 'Units_of_Force', 'Units_of_Frame_Rate', 'Units_of_Frequency', 'Units_of_Gmass', 'Units_of_Length', 'Units_of_Map_Scale', 'Units_of_Mass', 'Units_of_Misc', 'Units_of_None', 'Units_of_Optical_Path_Length', 'Units_of_Pixel_Resolution_Angular', 'Units_of_Pixel_Resolution_Linear', 'Units_of_Pixel_Resolution_Map', 'Units_of_Pixel_Scale_Angular', 'Units_of_Pixel_Scale_Linear', 'Units_of_Pixel_Scale_Map', 'Units_of_Power', 'Units_of_Pressure', 'Units_of_Radiance', 'Units_of_Rates', 'Units_of_Solid_Angle', 'Units_of_Spectral_Irradiance', 'Units_of_Spectral_Radiance', 'Units_of_Storage', 'Units_of_Temperature', 'Units_of_Time', 'Units_of_Velocity', 'Units_of_Voltage', 'Units_of_Volume', 'Units_of_Wavenumber'.

to

ERROR  [error.label.schematron]   line 30, 29: The attribute pds:DD_Value_Domain/pds:unit_of_measure_type must be equal to one of the following values 'Units_of_Acceleration', 'Units_of_Amount_Of_Substance', 'Units_of_Angle', 'Units_of_Angular_Velocity', 'Units_of_Area', 'Units_of_Current', 'Units_of_Energy', 'Units_of_Force', 'Units_of_Frame_Rate', 'Units_of_Frequency', 'Units_of_Gmass', 'Units_of_Length', 'Units_of_Map_Scale', 'Units_of_Mass', 'Units_of_Misc', 'Units_of_None', 'Units_of_Optical_Path_Length', 'Units_of_Pixel_Resolution_Angular', 'Units_of_Pixel_Resolution_Linear', 'Units_of_Pixel_Resolution_Map', 'Units_of_Pixel_Scale_Angular', 'Units_of_Pixel_Scale_Linear', 'Units_of_Pixel_Scale_Map', 'Units_of_Power', 'Units_of_Pressure', 'Units_of_Radiance', 'Units_of_Rates', 'Units_of_Solid_Angle', 'Units_of_Spectral_Irradiance', 'Units_of_Spectral_Radiance', 'Units_of_Storage', 'Units_of_Temperature', 'Units_of_Time', 'Units_of_Velocity', 'Units_of_Voltage', 'Units_of_Volume', 'Units_of_Wavenumber'.