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

validate reporting target type values as being wrong and suggesting values that are not valid #995

Closed tbarnes4 closed 1 month ago

tbarnes4 commented 2 months ago

Checked for duplicates

Yes - I've already checked

πŸ› Describe the bug

We have a case in the Lucy mission data under peer review where the spacecraft or instrument is listed as the target for DSN data. A LID is provided. But validate says that the type of "Equipment" is unexpected and it should be either "Spacecraft" or "N/A" depending on the situation. I look at the PDS Data Dictionary, and I do not see either of these suggested values as valid, though they may make sense. The valid type values listed in both the current and 1.20.0.0 (which Lucy uses) IM are the same (source):

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, Sky, Star, Star Cluster, Synthetic Sample, Terrestrial Sample, Trans-Neptunian Object

Here are two such examples:

Case 1: Spacecraft as target in

    <Target_Identification>
       <name>Lucy Spacecraft</name>
       <type>Equipment</type>
       <description>The spacecraft and its propulsion system are both the target being measured and the source of SFF data.</description>
       <Internal_Reference>
           <lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.lucy</lid_reference>
           <reference_type>data_to_target</reference_type>
       </Internal_Reference>
   </Target_Identification>

Validate warning:

WARNING [warning.label.context_ref_mismatch] Context reference type mismatch. Value: 'Equipment' Expected one of: '[Spacecraft]'

Case 2: Instrument as target in

   <Target_Identification>
       <name>Lucy RSS</name>
       <type>Equipment</type>
       <Internal_Reference>
           <lid_reference>urn:nasa:pds:context:instrument:lucy.rss</lid_reference>
           <reference_type>data_to_target</reference_type>
       </Internal_Reference>
   </Target_Identification>

Validate warning:

WARNING [warning.label.context_ref_mismatch] Context reference type mismatch. Value: 'Equipment' Expected one of: '[N/A]'

I will note that in the past we had agreed that using "Equipment" though not optimal, was the best option at the time, and at least as I currently see it, currently.

This may be related to some of the context_ref checking that is going on. Though why "N/A" is acceptable instead of "Instrument", I'm not sure.

πŸ•΅οΈ Expected behavior

I expect values as listed in the data dictionary. Perhaps an update is needed?

πŸ“œ To Reproduce

1. 2. 3. ...

πŸ–₯ Environment Info

πŸ“š Version of Software Used

Validate 3.5.2

🩺 Test Data / Additional context

No response

πŸ¦„ Related requirements

πŸ¦„ #xyz

βš™οΈ Engineering Details

No response

πŸŽ‰ Integration & Test

No response

jordanpadams commented 1 month ago

@tbarnes4 without explicit context products that call out these instrument hosts/instruments as targets and their types, there is no way for us to validate these. I would recommend either creating separate target context products for these objects of an observation (targets) vs. observing objects (instrument host, instrument), and relate them (we may need a new reference type to indicate "sameness").

If that is not an option, there is really nothing we can do here because there is know way for us to know that these should be equipment. You can either ignore the warnings, or use the flag to turn the check off.

rchenatjpl commented 1 month ago

I think we previously agreed that any 1 thing would have only 1 context product (i.e. LID). That seems best to me. Richard Chen is a JPL employee and a softball player, but I only get 1 SS#.

This issue has resurfaced because validate now checks and of lid_references. is typically fine except when a telescope shows up as the target (I forgot what bundle is doing this - I think a Radio Science adjacent product), and the xsd has no way to specify Telescope/name. I'm not sure how we want to handle type. I'd be ok dumping that check, but I'm not the requester of that feature.

tbarnes4 commented 1 month ago

@jordanpadams I'm okay ignoring the WARNING. Is the assumption that all LIDs listed in the context area of target context objects? Is it okay to use a non-target LID? I'm just concerned that validate tells the user what the valid should be when that is displays is not a valid one in the standards for targets. Low priority, but perhaps something could be added when a context LID is used that is not of the expected type (spacecraft or instrument instead of expected target in this instance).

We have cases in our PDS3 archive of the target being a spacecraft, the one coming to mind is one spacecraft targeting another.