E-ARK-Software / py-rest-ip-validator

Flask wrapping for Information Package validation from eatb
Apache License 2.0
1 stars 2 forks source link

structMap rule for CSIP83, CSIP84, CSIP86 does not fire #4

Open koit opened 4 years ago

koit commented 4 years ago

In the Schematron rules for structMap, the following rule doesn't fire (i.e. none of its assertions are tested):

<rule context="/mets:mets/mets:structMap[@LABEL = 'CSIP']">
  <assert id="CSIP83" role="ERROR" test="@ID">An xml:id identifier for the structural description (structMap) used for internal package references. It must be unique within the package.</assert>
  <assert id="CSIP84" role="ERROR" test="mets:div">The structural map MUST comprises a single division.</assert>
  <assert id="CSIP86" role="ERROR" test="mets:div[@LABEL = /mets:mets/@OBJID]">The package’s top-level structural division div element’s @LABEL attribute value must be identical to the package identifier, i.e. the same value as the mets/@OBJID attribute.</assert>
</rule>

The rules right before and after that one work OK, e.g. when I include the appropriately tweaked version of CSIP86 in the following rule, it works correctly:

<rule context="/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div">
  <assert id="CSIP86a" role="ERROR" test="@LABEL = /mets:mets/@OBJID">The package’s top-level structural division div element’s @LABEL attribute value must be identical to the package identifier, i.e. the same value as the mets/@OBJID attribute.</assert>
  <assert id="CSIP85" role="ERROR" test="@ID">An xml:id identifier must be unique within the package.</assert>
  <assert id="CSIP88" role="ERROR" test="mets:div[@LABEL = 'Metadata']">The package’s top-level structural division div element’s @LABEL attribute value must be identical to the package identifier, i.e. the same value as the mets/@OBJID attribute.</assert>
  <assert id="CSIP93" role="WARN" test="mets:div[@LABEL = 'Documentation']">The documentation referenced in the file section file groups is described in the structural map with one sub division.</assert>
  <assert id="CSIP97" role="WARN" test="mets:div[@LABEL = 'Schemas']">The schemas referenced in the file section file groups are described in the structural map within a single sub-division.</assert>
  <assert id="CSIP101" role="WARN" test="mets:div[@LABEL = 'Representations']">When no representations are present the content referenced in the file section file group with @USE attribute value “Representations” is described in the structural map as a single sub division.</assert>
</rule>

Test environment: Docker image pulled on 2020-05-30, Digest: sha256:174a85e7c65deb3635d22ef3e44c57b3dd3a62c56b9cd6e3e29f0c4d889fb162

carlwilson commented 4 years ago

@koit I'll create a PR and Docker build for you to test for this one.