Added geom:kernel_type validation rule #807
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a validation rule for geom:kernel_type as a fix for the issue: GEOM LDD schematron rules are not executing as expected <kernel_type> validation #797
🗒️ Summary
Added the geom:kernel_type validation rule to the common dictionary so that it is available for writing to the geom schematron file during LDDTool processing of the Geo Ingest_LDD. The rule is:
sch:pattern
<sch:rule context="geom:SPICE_Kernel_Identification/geom:kernel_type">
<sch:assert test=". = ('CK', 'DBK', 'DSK', 'EK', 'FK', 'IK', 'LSK', 'MK', 'PCK', 'SCLK', 'SPK')">
<title>geom:SPICE_Kernel_Identification/geom:kernel_type/kernel_type</title>
The attribute geom:SPICE_Kernel_Identification/geom:kernel_type must be equal to one of the following values 'CK', 'DBK', 'DSK', 'EK', 'FK', 'IK', 'LSK', 'MK', 'PCK', 'SCLK', 'SPK'.</sch:assert>
</sch:rule>
</sch:pattern>
This issue was caused by a failure to expose attributes in the Common schema that are referenced in Ingest_LDD files. The references are formulated like pds., for example pds:kernel_type, pds:name, pds:comment, etc. The attribute pds:kernel_type is the only attribute that is enumerated.
There are several fixes to the problem, each with its own impact.
Simply add the rule to check the geom:kernel_type. This only solves the problem for kernel_type.
Expose the referenced attributes in the common schema. This was the original intent from V1.0 were it was suggested to expose all common attributes. The DDWG voted not to expose all the attributes but to request them as needed.
The expected result is that the geom schema references the attributes in the common schema using "ref:" instead of defining them locally.
The current impact is a significant set of "cosmetic" differences in the geom schema file, for example:
Add a validation routine to check that all referenced pds: attributes are exposed.
The impact here is that if the common attributes are not exposed then warning messages are written to the log file. Again, over 20 messages would be written.
As a path forward and to minimize surprise, this pull request only implements option 1. The plan is to submit an SCR for DDWG discussion to determine whether option 2 and/or 3 should be considered. It seems reasonable to at least implement option 3.
⚙️ Test Data and/or Report
The test files are attached below. The schema locations will need to be updated for the testing environment. The previous versions of the .xsd and .sch files are provided for diff checking.
Resolves #797 #799
Try3_Option_1.zip