NASA-IMPACT / pyQuARC

The pyQuARC tool reads and evaluates metadata records with a focus on the consistency and robustness of the metadata. pyQuARC flags opportunities to improve or add to contextual metadata information in order to help the user connect to relevant data products. pyQuARC also ensures that information common to both the data product and the file-level metadata are consistent and compatible. pyQuARC frees up human evaluators to make more sophisticated assessments such as whether an abstract accurately describes the data and provides the correct contextual information. The base pyQuARC package assesses descriptive metadata used to catalog Earth observation data products and files. As open source software, pyQuARC can be adapted and customized by data providers to allow for quality checks that evolve with their needs, including checking metadata not covered in base package.
Apache License 2.0
20 stars 1 forks source link

DIF10: Dif10 Complex Types do not need to be in schema order #87

Closed andrewdweis closed 2 years ago

andrewdweis commented 3 years ago

Describe the bug Through testing of multiple complex types in the schema, the schema produces errors if the elements in the same hierarchy differ from the exact order in the dif10 schema. This should not be the case - elements in the same complex type can be in any order

To Reproduce Steps to reproduce the behavior: NOTE: The Dif10 Schema Order for Spatial_Coverage is [Spatial_Coverage_Type, Granule_Spatial_Representation, Zone_Identifier, Geometry, Orbit_Parameters, Vertical_Spatial_Info, Spatial_Info]

Change Spatial_Coverage to the following in FAKE file and see error below [Note: Zone_Identifier is at the end rather than after Granule_Spatial_Representation]

Horizontal GEODETIC CARTESIAN -90 90 -180 180 TEST TEST TEST **Expected behavior** The above metadata portion should pass with No Errors **Outputs** Receiving this error: (pyQuARC) aweis@Weis-Impact pyQuARC % python main.py --fake FAKE --format dif10 ******************************** ** Metadata Validation Errors ** ******************************** METADATA: /Users/aweis/Desktop/ARC/pyQuARC/pyQuARC-feature-dif_support/pyQuARC/../tests/fixtures/test_cmr_metadata.dif10 >> Zone_Identifier: Error: This element is not expected. **Additional context** This is an example for one instance - the order for any Metadata Complex Type should not matter. Please reach out for clarification
spa0002 commented 2 years ago

To Reproduce

  <Spatial_Coverage>
    <Spatial_Coverage_Type>Horizontal</Spatial_Coverage_Type>
    <Granule_Spatial_Representation>GEODETIC</Granule_Spatial_Representation>
    <Geometry>
      <Coordinate_System>CARTESIAN</Coordinate_System>
      <Bounding_Rectangle>
        <Southernmost_Latitude>-90</Southernmost_Latitude>
        <Northernmost_Latitude>90</Northernmost_Latitude>
        <Westernmost_Longitude>-180</Westernmost_Longitude>
        <Easternmost_Longitude>180</Easternmost_Longitude>
      </Bounding_Rectangle>
    </Geometry>
    <Spatial_Info>
      <Spatial_Coverage_Type>TEST</Spatial_Coverage_Type>
      <Horizontal_Coordinate_System>
        <Geodetic_Model>
          <Horizontal_DatumName>TEST</Horizontal_DatumName>
        </Geodetic_Model>
      </Horizontal_Coordinate_System>
    </Spatial_Info>
    <Zone_Identifier>TEST</Zone_Identifier>
  </Spatial_Coverage>

The schema has xs:sequence.