E-ARK-Software / rest-ip-validator

REST web services and client for E-ARK Information Package validation
Apache License 2.0
1 stars 0 forks source link

metsHdr/agent causes error "Main METS.xml file is not valid" #3

Open koit opened 5 years ago

koit commented 5 years ago

If metsHdr/agent is present, the validator gives an error:

ERROR: Main METS.xml file is not valid.

This happens with a valid minimal IP that has folders metadata, representations, representations/rep1 and representations/rep1/data and the following METS.xml in the root folder:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/METS/" xmlns:csip="DILCIS" OBJID="ID0001" TYPE="SIP:X" csip:CONTENTTYPESPECIFICATION="MIXED" PROFILE="http://www.eark-project.com/METS/IP.xml">
  <metsHdr CREATEDATE="2018-10-12T14:20:00" csip:OAISPACKAGETYPE="SIP">
    <agent ROLE="CREATOR" TYPE="OTHER" OTHERTYPE="SOFTWARE">
      <name>E-ARK Corpus Team</name>
      <note csip:NOTETYPE="SOFTWARE VERSION">1.0</note>
    </agent>
  </metsHdr>
  <structMap TYPE="physical" LABEL="Common Specification structural map">
    <div ID="ID7063" LABEL="ID0001">
      <div LABEL="metadata" />
      <div LABEL="representations">
        <div LABEL="rep1">
          <div LABEL="data"/>
        </div>
      </div>
    </div>
  </structMap>
</mets>

Full IP as a zip file: valid_minimal_IP.zip

The error disappears when metsHdr/agent is removed:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<mets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/METS/" xmlns:csip="DILCIS" OBJID="ID0001" TYPE="SIP:X" csip:CONTENTTYPESPECIFICATION="MIXED" PROFILE="http://www.eark-project.com/METS/IP.xml">
  <metsHdr CREATEDATE="2018-10-12T14:20:00" csip:OAISPACKAGETYPE="SIP">
  </metsHdr>
  <structMap TYPE="physical" LABEL="Common Specification structural map">
    <div ID="ID7063" LABEL="ID0001">
      <div LABEL="metadata" />
      <div LABEL="representations">
        <div LABEL="rep1">
          <div LABEL="data"/>
        </div>
      </div>
    </div>
  </structMap>
</mets>

Full IP as a zip file: agent_removed.zip

karinbredenberg commented 5 years ago

Looking at the XML, I'm missing SchemaLocations in the mets-element. You need to have that for getting the extra attributes for the agent. For the note to be able to have the extra attribute, make sure you are using version 1.12 of METS.

hsilva-keep commented 5 years ago

In addition to what @karinbredenberg said, one needs to keep in mind that commons-ip library being used by the rest-ip-validator is still an old version which does not support these new attributes (based on METS version 1.11 and common specification version 0.17). I'm working on the library during the next weeks in order to turn it common specification version 2 compliant (will use METS version 1.12).