NASA-PDS / pds4-information-model

The software tools and data necessary for generating the Information Model including PDS4 ontology, data, and information model.
https://nasa-pds.github.io/pds4-information-model/
Other
9 stars 6 forks source link

As a user, I want validate to report the value found on a valid-list failure #760

Open rgdeen opened 3 weeks ago

rgdeen commented 3 weeks ago

Checked for duplicates

Yes - I've already checked

🧑‍🔬 User Persona(s)

data engineer

💪 Motivation

When we have an attribute with a valid list, and the value is not in the list, we get an error message such as the following:

  FAIL: file:/project/m20/rgd/rav1ciun_overflow/boilerplate/bundle/data/qedr/vgr1/VGR_1223-MAMQTV-055580-DATA-055580.021.xml
      ERROR  [error.label.schematron]   line 86, 13: The attribute pds:type must be equal to one of the following values 'Asteroid', 'Astrophysical', 'Calibration', 'Calibration Field', 'Calibrator', 'Centaur', 'Comet', 'Dust', 'Dwarf Planet', 'Equipment', 'Exoplanet System', 'Galaxy', 'Globular Cluster', 'Laboratory Analog', 'Lunar Sample', 'Magnetic Field', 'Meteorite', 'Meteoroid', 'Meteoroid Stream', 'Nebula', 'Open Cluster', 'Planet', 'Planetary Nebula', 'Planetary System', 'Plasma Cloud', 'Plasma Stream', 'Ring', 'Sample', 'Satellite', 'Star', 'Star Cluster', 'Synthetic Sample', 'Terrestrial Sample', 'Trans-Neptunian Object'.
        14777 product validation(s) completed

It would be very helpful if it also reported what value it actually found (in this case, "Sun"). That way I could easily scan the validate output to find all the bad values and fix them at once, instead of having to go to each product individually to look up what's in the label. I'd wanted this feature several times in the past...

📖 Additional Details

validate version 2.1.4

Acceptance Criteria

Given When I perform Then I expect

⚙️ Engineering Details

No response

jordanpadams commented 3 weeks ago

@rsjoyner @jshughes can you help update this schematron rule? will this require an SCR?

jordanpadams commented 3 weeks ago

@rgdeen this is a schematron rule that validate doesn't have any real control over, so this is something we can try to support in schematron in the future. Unfortunately, we cannot retrofit this into past IM releases.

jordanpadams commented 3 weeks ago

@rgdeen that being said, that line number should also help in tracking down where this is in the label.

rgdeen commented 3 weeks ago

Ah. So the error is coming out of the schematron engine, not validate per se. Okay. This is not a big deal, just thought it would be an easy improvement... if not, don't worry about it. I guess we could pass a request along to the schematron folks but up to you if it's worth the trouble. Note that it was a general comment, not related to that specific attribute (it's just an example) so no need to update the schematron rule just for that item. (I'm not sure if you could, anyway). I use the line number a lot.