Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata Import via Scopus API: improved handling of empty search results #9375

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

saschaszott
Copy link
Contributor

@saschaszott saschaszott commented Feb 28, 2024

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

@tdonohue tdonohue added bug tools: import Related to import of data into the system tools: import-sources Related to "Live Import" Sources feature, allowing import of content via external APIs. port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Feb 28, 2024
@saschaszott
Copy link
Contributor Author

saschaszott commented Feb 28, 2024

In DS-CRIS 7, the test class ScopusImportMetadataSourceServiceIT was extended: it contains a test (scopusImportMetadataGetRecordsEmptyResponseTest) which covers an empty search result. Is it ok to merge the changes in ScopusImportMetadataSourceServiceIT which were added by 4Science in the DS CRIS repo? In this case, the test case scopusImportMetadataGetRecordsEmptyResponseTest has to be adapted in this way: https://github.com/4Science/DSpace/pull/434/files#diff-12daf99ec2c1ccf4239c0b7fa4d21a2b0b81eb37ba36d1bfbbe79396d7658808

@tdonohue
Copy link
Member

@saschaszott : My understanding from the 4Science team (pinging @abollini ) is that they welcome code being ported from DSpace-CRIS back to DSpace. So, I think it's safe to port that test back to DSpace....provided it can be easily ported & works just as well on DSpace.

@saschaszott
Copy link
Contributor Author

@tdonohue , @abollini : I've merged the changes which were applied to ScopusImportMetadataSourceServiceImpl in DSC7 into this PR

@tdonohue tdonohue self-requested a review April 11, 2024 14:53
@tdonohue
Copy link
Member

@saschaszott : Looking at the IT failures in this PR, it appears it may be failing its own tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release tools: import Related to import of data into the system tools: import-sources Related to "Live Import" Sources feature, allowing import of content via external APIs.
Projects
Status: 👀 Under Review
Development

Successfully merging this pull request may close these issues.

None yet

2 participants