keeps / commons-ip

Commons IP is project that provide a command-line tool and Java Library to validate and manipulate E-ARK Information Packages, so to create or process E-ARK SIP and AIP and also validate them against official specifications.
http://keeps.github.io/commons-ip/
GNU Lesser General Public License v3.0
11 stars 14 forks source link

Questions about validating an E-ARK SIP #269

Closed spacid closed 7 months ago

spacid commented 7 months ago

Hi,

I was looking into using the library to validate E-ARK SIPs. At first glance, the org.roda_project.commons_ip2.validator.EARKSIPValidator seems like a logical choice. However, parsing a SIP also provides a org.roda_project.commons_ip2.model.ValidationReport. It seems that the report spawned by the validator provides more information than when the parsing the SIP.

A Couple of questions:

In general, taking into account that I probably also want access to the validation entries as well as an easy-enough parsable report, what would be the most advised way to validate a SIP?

hmiguim commented 7 months ago

Hi,

How are these related to each other? Is the EARKSIPValidator used to create a ValidationReport when parsing a SIP? By extension, why do both exist?

The ValidationReport stores validation errors when the SIP is being transformed into an AIP. This parse does not perform a full validation against the specification. The EARKSIPValidator produces its own report.

Does parsing a SIP provides the same level of validation than via the dedicated validator class?

No, it performs basic validations.

The ValidationReport only seems to have a String and HTML representation which isn't that practical. What is the use case here?

The ValidationReport stores validation errors when the SIP is being transformed into an AIP, it is used in RODA when transforming the SIP into an AIP.

In general, taking into account that I probably also want access to the validation entries as well as an easy-enough parsable report, what would be the most advised way to validate a SIP?

You should use the org.roda_project.commons_ip2.validator.EARKSIPValidator since it will perform the validation against the CSIP specification.