kitodo-production icon indicating copy to clipboard operation
kitodo-production copied to clipboard

Validation of search responses (SRU/OAI at least)

Open henning-gerhardt opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

Currently (January 2024) is assumpted that a search response is every time correct in the format of the used search type (OAI or SRU). If this is not the case an error message appear that the search is not returning a positive result. But this is misleading as the response format is complete wrong (f.e. instead of a XML response a HTTP resonse was send) or not in the expected format (f.e. using a SRU 1.1 search request and got a SRU 2.0 response back).

Describe the solution you'd like

After s search specific request was send and a positive answer is returned (f.e. HTTP status code 200) the response should be validated against the used search type (f.e. SRU 2.0). If this request is validated correct all needed additional tasks like extracting number of hits, extracting embedded meta data and more should be startet. If the validation is negative a message should be appear for the user (and maybe in the log) that search was failing because of an incorrect response data format. If a response validation is executed or not should be configurable in the import configuration as it is possible that a used search catalogue can not response to 100% in response format.

For SRU 2.0 and OAI are schema xsd files for validating (the search response) are available. For other versions of SRU they may can be found or adjusted from the SRU 2.0 response format.

For custom import configurations there should maybe a possibility to store a custom xsd file which can be used too. So maybe storing used xsd files for response validation should be general available like the to be used mapping files on import?

henning-gerhardt avatar Jan 12 '24 09:01 henning-gerhardt