Schematron rule(s) expect validPeriod for NON-OPERATIONAL and CANCEL report
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.
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
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.
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.
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;