NASA-PDS / validate

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

Validate does not appear to validate against the latest versions of context products #949

Open mace-space opened 2 weeks ago

mace-space commented 2 weeks ago

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

Validate v3.5.1 flags warning.label.context_ref_mismatchs for labels that appear to use correct instrument names.

For example, validate outputs:

     WARNING  [warning.label.context_ref_mismatch]   line 160: Context reference name mismatch. Value: 'Radio Science Subsystem for Cassini Orbiter' Expected one of: '[RADIO SCIENCE SUBSYSTEM]'
     WARNING  [warning.label.context_ref_mismatch]   line 184: Context reference name mismatch. Value: 'DSS-43 70-m Radio Telescope' Expected one of: '[N/A]'

for a label containing:

…
             <Observing_System_Component>
                 <name>Radio Science Subsystem for Cassini Orbiter</name>
                 <type>Instrument</type>
                 <Internal_Reference>
                     <lid_reference>urn:nasa:pds:context:instrument:rss.co</lidvid_reference>
                     <reference_type>is_instrument</reference_type>
                 </Internal_Reference>
             </Observing_System_Component>
…
            <Observing_System_Component>
                 <name>DSS-43 70-m Radio Telescope</name>
                 <type>Telescope</type>
                 <Internal_Reference>
                     <lid_reference>urn:nasa:pds:context:telescope:canberra.dss43_70m</lid_reference>
                     <reference_type>is_telescope</reference_type>
                 </Internal_Reference>
            </Observing_System_Component>
…

i.e. labels that use information from the context products to fill in the attributes above: https://pds.nasa.gov/data/pds4/context-pds4/instrument/co.rss_2.0.xml https://pds.nasa.gov/data/pds4/context-pds4/telescope/canberra.dss43_70m_1.0.xml

🕵️ Expected behavior

I expected Validate to insist on text from the context product attributes to match Observing_System_Components.

However, it appears to validate against what's registered with pds.nasa.gov's Data Search. For example, by searching for identifier:urn:nasa:pds:context:instrument:rss.co in the Keyword Search for Cassini RSS, the webpage shows “NAME” = “RADIO SCIENCE SYSTEM.”

Searching for the DSS-43 LID gives 0 results (hence why Validate reports Expected one of: '[N/A]').

When a context product is updated and its name changes, this is not updated in the registered context product at https://pds.nasa.gov/datasearch/keyword-search/. Validate is insisting on the original name of the instrument rather than the updated name.

📜 To Reproduce

% validate --label-extension lblx --target template-tau_filled_20240625rgf_mjtm.lblx --report-file ./validate_logs/template-tau_filled_20240625rgf_mjtm.log​

Outputs:

PDS Validate Tool Report

Configuration:
   Version     3.5.1
   Date        2024-06-26T20:30:45Z

Parameters:
   Targets                      [file:/Users/webmaster/Dropbox%20(SETI%20Institute)/Shared-pdart-rss/cassini_saturn/templates/template-tau_filled_20240625rgf_mjtm.lblx]
   Severity Level               WARNING
   Recurse Directories          true
   File Filters Used            [*.lblx, *.LBLX]
   Data Content Validation      on
   Product Level Validation     on
   Max Errors                   100000
   Registered Contexts File     /usr/local/validate-3.5.1/resources/registered_context_products.json

Product Level Validation Results

  PASS: file:/Users/webmaster/Dropbox%20(SETI%20Institute)/Shared-pdart-rss/cassini_saturn/templates/template-tau_filled_20240625rgf_mjtm.lblx
      WARNING  [warning.label.context_ref_mismatch]   line 160: Context reference name mismatch. Value: 'Radio Science Subsystem for Cassini Orbiter' Expected one of: '[RADIO SCIENCE SUBSYSTEM]'
      WARNING  [warning.label.context_ref_mismatch]   line 184: Context reference name mismatch. Value: 'DSS-43 70-m Radio Telescope' Expected one of: '[N/A]'
        1 product validation(s) completed

Summary:

  1 product(s)
  0 error(s)
  2 warning(s)

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

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

  Message Types:
    2            warning.label.context_ref_mismatch

End of Report

🖥 Environment Info

📚 Version of Software Used

3.5.1

🩺 Test Data / Additional context

No response

🦄 Related requirements

No response

⚙️ Engineering Details

No response

🎉 Integration & Test

No response

jordanpadams commented 2 weeks ago

@mace-space for https://pds.nasa.gov/data/pds4/context-pds4/instrument/co.rss_2.0.xml, it appears your Observing_System_Component values are using the title value from the context product, as opposed to the name, which is what our tool uses to validate:

<title>Radio Science Subsystem for Cassini Orbiter</title>
<Instrument>
  <name>Radio Science Subsystem</name>

For https://pds.nasa.gov/data/pds4/context-pds4/telescope/canberra.dss43_70m_1.0.xml, not sure why that has not been registered.

@rchenatjpl any ideas here why that telescope is not available in the keyword search?

rchenatjpl commented 2 weeks ago

None of the telescopes show up in search. I'm not sure what part is configured that way. Does anyone want me to investigate and change that?

mace-space commented 2 weeks ago

@jordanpadams Thanks. I thought the Validate warning meant it was insisting on all uppercase "RADIO SCIENCE SUBSYSTEM," but I see now that Validate passes both "Radio Science Subystem" and "RADIO SCIENCE SUBSYSTEM".

Are you saying that Validate uses <Instrument>.<name> to check, and so because context products like canberra.dss_70m don't have such an attribute they cannot validate currently?

matthewtiscareno commented 2 weeks ago

Also, doesn't the appearance of "RADIO SCIENCE SUBSYSTEM" in the warning indicate that it is looking at v1.0 of the context product (where that is the Instrument.name) rather than v2.0 (where it is "Radio Science Subsystem")?