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

As a user, I want to receive a WARNING message when the `Observing_System_Component.name` does not match the value in the context product #857

Closed mace-space closed 4 months ago

mace-space commented 5 months ago

Checked for duplicates

Yes

Motivation

... so that I can ensure consistency between the context product values and the values in the labels

Additional Details

When I ran validate on a bundle, it passed labels (e.g.) containing the following mistake:

...
 <Observing_System>
      <name>Hubble Space Telescope FOS</name>
      <Observing_System_Component>
        <name>Hubble Space Telescope</name>
        <type>Host</type>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.hst</lid_reference>
          <reference_type>is_instrument_host</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
      <Observing_System_Component>
        <name>Wide Field Camera 3</name>
        <type>Instrument</type>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument:hst.fos</lid_reference>
          <reference_type>is_instrument</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
    </Observing_System>
    ...

This should be:

 ...
    <Observing_System>
      <Observing_System_Component>
        <name>Hubble Space Telescope</name>
        <type>Host</type>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.hst</lid_reference>
          <reference_type>is_instrument_host</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
      <Observing_System_Component>
        <name>HST Faint Object Spectrograph</name>
        <type>Instrument</type>
        <Internal_Reference>
          <lid_reference>urn:nasa:pds:context:instrument:hst.fos</lid_reference>
          <reference_type>is_instrument</reference_type>
        </Internal_Reference>
      </Observing_System_Component>
    </Observing_System>
    ...

(Aside: I also didn't want the <Observing_System>.<name> element, line 2 of 1st snippet)

🕵️ Expected behavior

I expected the product label's <Observing_System_Component>.<name> to contain the <Instrument>.<name> of the corresponding context product.

📜 To Reproduce

$ validate /path/to/uranus_occ_u137_hst_fos/ -R pds4.bundle -v 2 -r validate.log

🖥 Environment Info

📚 Version of Software Used

Validate v3.4.1

⚙️ Engineering Details

We should also include a new flag to disable this check (--disable-context-name-check) in the event you wanted this value to be different for some reason.

jordanpadams commented 5 months ago

@mace-space if you run validate with the --verbose 0 flag, you will see this flagged.

we previous threw WARNINGs when this occurred in the past, but the SWG noted that this is not required by the SR so we should not raise an issue from validate. happy to bring this back up with the SWG and/or with the DDWG.

I agree that we should raise some issue here since the information is no longer consistent across the system.

tloubrieu-jpl commented 5 months ago

For Software Working Group, 03/20/2024:

Mia is asking about the status of validate issue with the incorrect context product name not being caught (#857). Jordan says that the discrepancy is already caught by validate but only reported as an INFO message. Jordan is asking if the group thinks the message should be turned into WARNING. Rob says that we should not overflow to log with WARNING messages, a flag should enable to disable this warning. Another option the group agreed on, is to allow the name in the product to match any aliases name available in the context product. Matt is suggesting that we create an SCR to add a recommendation on the information model usage. All these suggestions are agreed by the group and ENG will move forward with that decision.

al-niessner commented 5 months ago

@jordanpadams can we keep this out of #832 since it is not table related please. If you want me to do this before I finish #832 I can do it. It is just everything else in 832 is table related and looks like one liners - or 100 lines in Java.

al-niessner commented 5 months ago

For all lurking, case sensitive check?

jordanpadams commented 5 months ago

@al-niessner let's make it case insensitive...