4Science / DSpace

This repository contains the 4Science optimized DSpace & DSpace-CRIS distribution.
https://wiki.lyrasis.org/display/DSPACECRIS/
BSD 3-Clause "New" or "Revised" License
44 stars 63 forks source link

Metadata Import via Scopus: incorrect handling of empty search results #433

Closed saschaszott closed 6 months ago

saschaszott commented 8 months ago

Bug Description

An empty search result which is returned from the Elsevier Scopus REST API looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<search-results xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
                xmlns:prism="http://prismstandard.org/namespaces/basic/2.0/" xmlns:atom="http://www.w3.org/2005/Atom">
    <opensearch:totalResults>0</opensearch:totalResults>
    <opensearch:startIndex>0</opensearch:startIndex>
    <opensearch:itemsPerPage>0</opensearch:itemsPerPage>
    <opensearch:Query role="request" searchTerms="a-query-without-hits" startPage="0"/>
    <link ref="self"
          href="https://api.elsevier.com/content/search/scopus?start=0&amp;count=10&amp;query=a-query-without-hits&amp;httpAccept=application%2Fxml"
          type="application/xml"/>
    <entry>
        <error>Result set was empty</error>
    </entry>
</search-results>

The implementation in ScopusImportMetadataSourceServiceImpl considers this kind of result as a not-empty result.

In consequence, this leads to this unexpected state in the UI

image

jor4science commented 6 months ago

A good idea will be to check the:

0 to handle this 0 result case. Checking this on plain DSpace: https://demo.dspace.org/import-external?entity=Publication&sourceId=scopus&query=a-query-without-hits give the same error. We have to move this ISSUE to the DSpace community
saschaszott commented 6 months ago

There is a PR in https://github.com/DSpace/DSpace/pull/9375 which currently has 3 failing tests. I'll try to fix this asap. I'll close this issue.