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

Publication date potentially corrected from the consolidation service seems to be lost in a limbo #760

Closed
lfoppiano opened this issue May 26, 2021 · 1 comment · Fixed by #761
Labels
bug From Hemiptera and especially its suborder Heteroptera

Comments

@lfoppiano
Copy link
Collaborator

Related to #759.
I tried to solve the problem by enabling the consolidation, however, the correct publication date was not retrieved correctly.

The BiblioItem object from the consolidation service had:

  • publicationDate = null
  • normalisedPublicationDate with the correct value

(I wonder if this is the correct behaviour)

however, in the BiblioItem, after the correct(...) method is invoked, the normalisedPublication date is overridden with the first raw publication date:

// normalization of dates
                if (resHeader != null) {
                    if (resHeader.getPublicationDate() != null) {
                        List<Date> dates = parsers.getDateParser().processing(resHeader.getPublicationDate());
                        // most basic heuristic, we take the first date - to be
                        // revised...
                        if (dates != null) {
                            if (dates.size() > 0) {
                                resHeader.setNormalizedPublicationDate(dates.get(0));
                            }
                        }
                    }

This will inevitably lose the good normalised date from the consolidation service. I'm not sure what is the correct behaviour, I supply this issue mostly for information as I assume there many different use cases 😉

@lfoppiano lfoppiano changed the title Consolidation Publication date potentially corrected from the consolidation service seems to be lost in a limbo May 26, 2021
@kermitt2
Copy link
Owner

Good catch Luca !!
It's a bug yes, we should not normalize the publication date if (resHeader.getNormalizedPublicationDate() != null) already.

(I wonder if this is the correct behaviour)

yes it's the correct behavior, crossref record has only a normalized publication date (no "raw" publication date).

@kermitt2 kermitt2 added the bug From Hemiptera and especially its suborder Heteroptera label May 26, 2021
@lfoppiano lfoppiano linked a pull request May 27, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug From Hemiptera and especially its suborder Heteroptera
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants