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 to know the actual value for a failed schematron validation #427

Open jordanpadams opened 2 years ago

jordanpadams commented 2 years ago

πŸ’ͺ Motivation

...so that I can know what the bad value was in the label.

πŸ“– Additional Details

Per B. Deen:

When we get an error like this:

  {
    "severity": "ERROR",
    "type": "error.label.schematron",
    "line": 560,
    "column": 51,
    "message": "The attribute geom:Coordinate_Space_Indexed/geom:coordinate_space_frame_type must be nulled or equal to one of the following values 'APXS_Frame', 'APXS_Frame', 'ARM_CUSTOM_TCP_FRAME', 'ARM_DOCKING_POST_FRAME', 'ARM_DRILL_FRAME', 'ARM_DRT_FRAME', 'ARM_FCS_FRAME', 'ARM_FRAME', 'ARM_GDRT_FRAME', 'ARM_MAHLI_FRAME', 'ARM_PIXL_FRAME', 'ARM_PORTION_FRAME', 'ARM_SCOOP_TCP_FRAME', 'ARM_SCOOP_TIP_FRAME', 'ARM_SHERLOC_FRAME', 'ARM_TURRET_FRAME', 'ARM_WATSON_FRAME', 'Arm_Custom_TCP_Frame', 'Arm_DRT_Frame', 'Arm_Docking_Post_Frame', 'Arm_Drill_Frame', 'Arm_FCS_Frame', 'Arm_Frame', 'Arm_GDRT_Frame', 'Arm_MAHLI_Frame', 'Arm_PIXL_Frame', 'Arm_Portion_Frame', 'Arm_SHERLOC_Frame', 'Arm_Scoop_TCP_Frame', 'Arm_Scoop_TIP_Frame', 'Arm_Turret_Frame', 'Arm_WATSON_Frame', 'CINT_FRAME', 'CINT_Frame', 'DRILL_BIT_TIP', 'HELI_G_FRAME', 'HELI_M_FRAME', 'HELI_S1_FRAME', 'HELI_S2_FRAME', 'Heli_G_Frame', 'Heli_M_Frame', 'Heli_S1_Frame', 'Heli_S2_Frame', 'LANDER_FRAME', 'LOCAL_LEVEL_FRAME', 'Lander_Frame', 'Local_Level_Frame', 'MB_Frame', 'MCMF_FRAME', 'MCMF_Frame', 'MCZ_CAL_PRIMARY', 'MEDA_RDS', 'MI_Frame', 'Mast_Frame', 'ORBITAL', 'Orbital', 'PIXL_BASE_FRAME', 'PIXL_Base_Frame', 'PIXL_SENSOR_FRAME', 'PIXL_Sensor_Frame', 'PIXL_TOOL', 'PIXL_Tool', 'ROVER_FRAME', 'ROVER_MECH_FRAME', 'ROVER_NAV_FRAME', 'RSM_FRAME', 'RSM_Frame', 'RSM_HEAD_FRAME', 'RSM_Head_Frame', 'Rat_Frame', 'Rover_Frame', 'Rover_Mech_Frame', 'Rover_Nav_Frame', 'SITE_FRAME', 'SUN', 'Site_Frame', 'TOOL_FRAME', 'TURRET_FRAME', 'Tool_Frame', 'Turret_Frame', 'WHEEL_LF', 'WHEEL_LM', 'WHEEL_LR', 'WHEEL_RF', 'WHEEL_RM', 'WHEEL_RR', 'Wheel_LF', 'Wheel_LM', 'Wheel_LR', 'Wheel_RF', 'Wheel_RM', 'Wheel_RR'."
  }

can we get it to also print out what the offending value is?

βš–οΈ Acceptance Criteria

Given When I perform Then I expect

βš™οΈ Engineering Details

Basically, instead of an error message like this:

  {
    "severity": "ERROR",
    "type": "error.label.schematron",
    "line": 560,
    "column": 51,
    "message": "The attribute pds.attribute must be nulled or equal to one of the following values 'foo', 'bar', 'baz'."
  }

they would like an error message like this:

  {
    "severity": "ERROR",
    "type": "error.label.schematron",
    "line": 560,
    "column": 51,
    "message": "The attribute pds.attribute must be nulled or equal to one of the following values 'foo', 'bar', 'baz'. Current value: 'this_isnt_right'"
  }

where the actual, failing value is included in the error message. I imagine this should be a comprehensive change in how schematron rules work, so not sure it is worth the effort or if it would require DDWG approval?

jordanpadams commented 2 years ago

@jshughes @rsjoyner not sure how easier or hard this would be and/or if it would require DDWG approval since it will change pretty much every schematron rule error message.