E-ARK-Software / eark-validator

E-ARK Python Information Package validation library
Apache License 2.0
5 stars 3 forks source link

Incorrect validation of requirement CSIP21 #83

Open dockmd opened 2 weeks ago

dockmd commented 2 weeks ago

Test case: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP21/testCase.xml contains the definition of 1 packages which should be valid but the validator says they are invalid. Invalid according to the validator, but should be valid: Package: https://github.com/DILCISBoard/eark-ip-test-corpus/tree/integration/corpus/CSIP/CSIP21/valid/IP_18000_CSIP21_2 Output: struct result is: WellFormed {"uid":"85d6fc8b7312461da404aaa53bccf86c","structure":{"status":"WellFormed","messages":[{"rule_id":"CSIPSTR3","severity":"Info","location":"root IP_18000_CSIP21_2","message":"The Information Package MAY be contained in an archive/compressed form, e.g. TAR or ZIP, for storage or transfer. The specific format details should be decided by the interested parties and documented, for example in a submission agreement or statement of access terms."},{"rule_id":"CSIPSTR7","severity":"Warn","location":"root IP_18000_CSIP21_2","message":"If descriptive metadata are available, they SHOULD be included in sub-folder descriptive."},{"rule_id":"CSIPSTR8","severity":"Info","location":"root IP_18000_CSIP21_2","message":"If any other metadata are available, they MAY be included in separate sub-folders, for example an additional folder named other."},{"rule_id":"CSIPSTR13","severity":"Warn","location":"rep1 representation","message":"The representation folder SHOULD include a sub-folder named metadata which MAY include all metadata about the specific representation."}]},"metadata":{"schema_results":{"status":"VALID","messages":[]},"schematron_results":{"status":"INVALID","messages":[{"rule_id":"CSIP21","severity":"Warn","location":"/mets:mets/mets:dmdSecmets:mdRef/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='dmdSec' and namespace-uri()='http://www.loc.gov/METS/']","message":"SHOULD provide a reference to the descriptive metadata file located in the “metadata” section of the IP.."},{"rule_id":"CSIP63","severity":"Error","location":"/mets:mets/mets:fileSec/mets:fileGrp(@csip:CONTENTINFORMATIONTYPE = 'OTHER' and @csip:OTHERCONTENTINFORMATIONTYPE) or (@csip:CONTENTINFORMATIONTYPE != 'OTHER' and not(@csip:CONTENTINFORMATIONTYPE))/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='fileSec' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='fileGrp' and namespace-uri()='http://www.loc.gov/METS/'][1]","message":"When the mets/fileSec/fileGrp/@csip:CONTENTINFORMATIONTYPE attribute has the value \"OTHER\" the mets/fileSec/fileGrp/@csip:OTHERCONTENTINFORMATIONTYPE must state a value for the Content Information Type Specification used."},{"rule_id":"CSIP63","severity":"Error","location":"/mets:mets/mets:fileSec/mets:fileGrp(@csip:CONTENTINFORMATIONTYPE = 'OTHER' and @csip:OTHERCONTENTINFORMATIONTYPE) or (@csip:CONTENTINFORMATIONTYPE != 'OTHER' and not(@csip:CONTENTINFORMATIONTYPE))/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='fileSec' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='fileGrp' and namespace-uri()='http://www.loc.gov/METS/'][2]","message":"When the mets/fileSec/fileGrp/@csip:CONTENTINFORMATIONTYPE attribute has the value \"OTHER\" the mets/fileSec/fileGrp/@csip:OTHERCONTENTINFORMATIONTYPE must state a value for the Content Information Type Specification used."},{"rule_id":"CSIP63","severity":"Error","location":"/mets:mets/mets:fileSec/mets:fileGrp(@csip:CONTENTINFORMATIONTYPE = 'OTHER' and @csip:OTHERCONTENTINFORMATIONTYPE) or (@csip:CONTENTINFORMATIONTYPE != 'OTHER' and not(@csip:CONTENTINFORMATIONTYPE))/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='fileSec' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='fileGrp' and namespace-uri()='http://www.loc.gov/METS/'][3]","message":"When the mets/fileSec/fileGrp/@csip:CONTENTINFORMATIONTYPE attribute has the value \"OTHER\" the mets/fileSec/fileGrp/@csip:OTHERCONTENTINFORMATIONTYPE must state a value for the Content Information Type Specification used."},{"rule_id":"CSIP105","severity":"Warn","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:divmets:div[@LABEL = 'Representations']/mets:div/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']","message":"When a package consists of multiple representations, each described by a representation level METS.xml document, there should be a discrete representation div element for each representation."},{"rule_id":"CSIP91","severity":"Warn","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div/mets:div[@LABEL = 'Metadata']@ADMID/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/'][1]","message":"The admimistrative metadata division should reference all current administrative metadata sections."},{"rule_id":"CSIP92","severity":"Warn","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div/mets:div[@LABEL = 'Metadata']@DMDID/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/'][1]","message":"The descriptive metadata division should reference all current descriptive metadata sections."},{"rule_id":"CSIP96","severity":"Error","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div/mets:div[@LABEL = 'Documentation']mets:fptr/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/'][2]","message":"All file groups containing documentation described in the package are referenced via the relevant file group identifiers. There MUST be one file group reference per fptr element."},{"rule_id":"CSIP104","severity":"Error","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div/mets:div[@LABEL = 'Representations']mets:fptr/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/'][3]","message":"All file groups containing documentation described in the package are referenced via the relevant file group identifiers. There MUST be one file group reference per fptr element."},{"rule_id":"CSIP100","severity":"Error","location":"/mets:mets/mets:structMap[@LABEL = 'CSIP']/mets:div/mets:div[@LABEL = 'Schemas']mets:fptr/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='structMap' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='div' and namespace-uri()='http://www.loc.gov/METS/'][4]","message":"All file groups containing schemas described in the package are referenced via the relevant file group identifiers. There MUST be one file group reference per fptr element."},{"rule_id":"SIP2","severity":"Error","location":"/mets:mets@PROFILE = 'https://earksip.dilcis.eu/profile/E-ARK-SIP.xml'/*[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']","message":"The PROFILE attribute MUST contain the URL of the METS profile, for a SIP: https://earksip.dilcis.eu/profile/E-ARK-SIP.xml."},{"rule_id":"SIP14","severity":"Error","location":"/mets:mets/mets:metsHdr/mets:agent[@ROLE = 'CREATOR']/mets:note@NOTETYPE = 'IDENTIFICATIONCODE'/[local-name()='mets' and namespace-uri()='http://www.loc.gov/METS/']/[local-name()='metsHdr' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='agent' and namespace-uri()='http://www.loc.gov/METS/']/*[local-name()='note' and namespace-uri()='http://www.loc.gov/METS/']","message":"The creator agent element MUST have a NOTETYPE attribute of value IDENTIFICATIONCODE."}]}},"package":{"mets":{"root":{"namespaces":{"xsi":"http://www.w3.org/2001/XMLSchema-instance","":"http://www.loc.gov/METS/","xlink":"http://www.w3.org/1999/xlink","csip":"https://DILCIS.eu/XML/METS/CSIPExtensionMETS"},"objid":"IP_18000_CSIP21_2","label":"","type":"Databases","profile":"http://www.eark-project.com/METS/IP.xml"},"file_entries":[{"path":"metadata/preservation/PREMIS3.xml","type":"file","size":"5417","checksum":{"algorithm":"SHA-256","value":"9994DB02F4BC9188354B5309FCA38275ACA3F12EA6B3E0FD1442DF9E30CFF5C5"},"mimetype":"text/xml","isValid":true,"errors":[]},{"path":"schemas/mets.xsd","type":"file","size":"133920","checksum":{"algorithm":"MD5","value":"4E9961DEC3DE72081E6142B28A437FB8"},"mimetype":"application/xml","isValid":true,"errors":[]},{"path":"schemas/XMLSchema.xsd","type":"file","size":"87677","checksum":{"algorithm":"MD5","value":"94ED1A93CE3147D01BCB2FC1126255ED"},"mimetype":"application/xml","isValid":true,"errors":[]},{"path":"schemas/xlink.xsd","type":"file","size":"8052","checksum":{"algorithm":"MD5","value":"14DAC48802F5F99C51A6B200F9A0B3B4"},"mimetype":"application/xml","isValid":true,"errors":[]},{"path":"schemas/CSIPExtensionMETS.xsd","type":"file","size":"1673","checksum":{"algorithm":"MD5","value":"1A31B3AA3AE1E9B99E7A8B4618F3B485"},"mimetype":"application/xml","isValid":true,"errors":[]},{"path":"documentation\\submission_decision.tif","type":"file","size":"368208","checksum":{"algorithm":"MD5","value":"E1B17DC58F0F3FA160BB90B52450391C"},"mimetype":"tiff","isValid":false,"errors":["CSIP68"]},{"path":"documentation\\Northwind ER diagram.png","type":"file","size":"86453","checksum":{"algorithm":"MD5","value":"E1B17DC58F0F3FA160BB90B52450391C"},"mimetype":"png","isValid":false,"errors":["CSIP71","CSIP68"]},{"path":"representations\rep1\METS.xml","type":"file","size":"13746","checksum":{"algorithm":"MD5","value":"14DAC48802F5F99C51A6B200F9A0B3B4"},"mimetype":"application/xml","isValid":false,"errors":["CSIP71"]}]},"details":{"name":"IP_18000_CSIP21_2","label":"","oaispackagetype":"SIP","othertype":"","contentinformationtype":"SIARD2","checksums":[]},"representations":[]}}