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

Closes #2519: Changing the status of dataset DOI from findable to reg… #2525

Merged

Conversation

diasf
Copy link

@diasf diasf commented Jul 23, 2024

Changing the status of dataset DOI from findable to registered when deaccessing it.

  • Data file DOI is unregistered when all versions referencing it, have been un-accessed.
  • Dataset DOI is unregistered when all versions have been un-accessed.

Issue: #2519

@diasf diasf requested a review from madryk July 23, 2024 13:49
@@ -87,18 +87,18 @@ public String reserveIdentifier(String identifier, Map<String, String> metadata,

public void registerIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) throws IOException {
String xmlMetadata = getMetadataFromDvObject(identifier, metadata, dvObject);
DOIDataCiteRegisterCache rc = findByDOI(identifier);
DOIDataCiteRegisterCache rc = Optional.ofNullable(findByDOI(identifier))
.orElseGet(DOIDataCiteRegisterCache::new);
Copy link
Author

@diasf diasf Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files get registered directly on publication (whereas for datasets we reserve the DOI on create). And a cache entry was only been created in the reservation method. As a result DOI for files would never get unregistered because of the missing entry in the cache table.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this DOIDataCiteRegisterCache is even needed (for both datasets and files). Maybe I am missing something in the code.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT it's mainly to keep track of the DOI status. And modifyIdentifier / deleteIdentifier depend on it to perform the correct API calls. Agree, it's not particularly obvious. Maybe we can add a follow-up issue for the rafactoring?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can add a follow-up issue for that.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created: #2553

@@ -121,6 +121,7 @@ public String getMetadataForDeactivateId(String identifier) {
resource.setTitles(Collections.singletonList("This item has been removed from publication"));
resource.setPublisher(":unav");
resource.setPublicationYear("9999");
resource.setCreators(Collections.singletonList(new DataCiteResource.Creator(":unav")));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The creators field is now mandatory.

@@ -87,18 +87,18 @@ public String reserveIdentifier(String identifier, Map<String, String> metadata,

public void registerIdentifier(String identifier, Map<String, String> metadata, DvObject dvObject) throws IOException {
String xmlMetadata = getMetadataFromDvObject(identifier, metadata, dvObject);
DOIDataCiteRegisterCache rc = findByDOI(identifier);
DOIDataCiteRegisterCache rc = Optional.ofNullable(findByDOI(identifier))
.orElseGet(DOIDataCiteRegisterCache::new);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this DOIDataCiteRegisterCache is even needed (for both datasets and files). Maybe I am missing something in the code.

@madryk madryk assigned diasf and unassigned madryk Sep 12, 2024
@diasf diasf requested a review from madryk September 17, 2024 13:08
@diasf diasf assigned madryk and unassigned diasf Sep 17, 2024
@madryk madryk assigned diasf and unassigned madryk Sep 19, 2024
@diasf diasf merged commit 3c65c14 into develop Sep 20, 2024
1 check passed
@diasf diasf deleted the fdias-2519-change-doi-status-to-registered-on-deaccession branch September 20, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants