iwxxm icon indicating copy to clipboard operation
iwxxm copied to clipboard

Schematron rule(s) expect validPeriod for NON-OPERATIONAL and CANCEL report

Open henrychv opened this issue 2 years ago • 5 comments

Describe the bug Schematron rules like TAF.TAF2 are in 2021-2 version applied not just to translationFailedTAC but also for NON-OPERATIONAL reports, and this fails when isCancelReport="true" as schematron rule expects iwxxm:validPeriod to be present, but in this case there is iwxxm:cancelledReportValidPeriod

To Reproduce Run schematron on iwxxm 2021-2 TAF document which is permissibleUsage="NON-OPERATIONAL", permissibleUsageReason="TEST", isCancelReport="true"

Expected behavior Schematron will not complain.

Screenshots Schematron now fails with error: TAF.TAF-2: A non-operational report or a report that failed translation should have as a minimum appropriately filled elements including iwxxm:issueTime, iwxxm:aerodrome and iwxxm:validPeriod

Additional context We used the TAC below to generate the iwxxm report with set permissibleUsage="NON-OPERATIONAL"

FTXX99 XXXX 131400
TAF LKKV 131400Z 1309/1321 CNL=

I attached example xml file which reproduces the problem. Please ignore the extensive namespaces in xml header which are probably not necessary there.

bug_taf_schematron.txt

henrychv avatar Jul 11 '23 13:07 henrychv

Hello @henrychv,

The permissableUsageReason attribute is used for non-operational test or exercise advisories. There is no requirement that products such as the TAF (or SIGMETs/AIRMETs) need this also.

V/R,

mark

mgoberfield avatar Jul 12 '23 12:07 mgoberfield

Hi Mark, my point was that if we use in our test permissableUsageReason NON-OPERATIONAL for cancel products, the changed schematron rule fails:

<sch:pattern id="TAF.TAF-2">
      <sch:rule context="//iwxxm:TAF">
         <sch:assert test="( if( (string-length(@translationFailedTAC) gt 0) or (@permissibleUsage = 'NON-OPERATIONAL') ) then( exists(iwxxm:issueTime) and exists(iwxxm:aerodrome) and exists(iwxxm:validPeriod) ) else( true() ) )">TAF.TAF-2: A non-operational report or a report that failed translation should have as a minimum appropriately filled elements including iwxxm:issueTime, iwxxm:aerodrome and iwxxm:validPeriod</sch:assert>
      </sch:rule>
   </sch:pattern>

The part or (@permissibleUsage = 'NON-OPERATIONAL') was added recently and breaks this rule for cancel non-operational reports.

Is it possible to have non-operational cancel test reports? If yes, then schematron rule should work with them.

henrychv avatar Jul 13 '23 07:07 henrychv

I think this is a valid observation. The intention of TAF.TAF-2 is that when the message has either translationFailedTAC set or permissibleUsage = "NON_OPERATIONAL" or both, then the message should only need to carry minimal amount of tags, including EITHER validPeriod OR cancelledReportValidPeriod. This would be fixed in 2025-2.

blchoy avatar Jan 22 '25 09:01 blchoy

https://github.com/wmo-im/iwxxm/wiki/TT-AvData-Discussion-2025-Jan-22 notes:

  • Can introduce a fix in the 2025-2 release
  • Mark recommends fixing the previous Schematron rules; the question is how to version the Schematron, which currently has no version identified in the .sch;
  • Schematron has a "version" attribute that can be used: https://www.datypic.com/sc/schematron/a-schemaVersion-2.html
  • Jan recommends splitting the Schematron into a package with versioning;

amilan17 avatar Jan 22 '25 12:01 amilan17