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

Search Data Packages API returns publication date as year (i.e. YYYY format) #113

Open
clnsmth opened this issue Jun 9, 2023 · 2 comments
Assignees
Labels
wontfix Will not be fixed

Comments

@clnsmth
Copy link

clnsmth commented Jun 9, 2023

A user of the Search Data Packages REST API, via the EDIutils R package, reported an unexpected behavior where the returned pubdate field has values in the format YYYY rather than the expected format YYYY-MM-DD. The returned begindate and enddate fields have values in the format YYYY-MM-DD and this incongruence seems to be the source of confusion. For the original report see: ropensci/EDIutils#45.

The users behavior can be reproduced outside of EDIutils with:

https://pasta.lternet.edu/package/search/eml?q=scope:(knb-lter-fce)&fl=doi,title,packageid,begindate,enddate,pubdate

Now, the Level-1 EML <pubDate> element values of the data packages returned by the users query, lists the date in the format YYYY-MM-DD, so It seems there is a transformation that occurs when processing the EML for delivery through the Search Data Packages REST API.

A quick search of the PASTA+ codebase turns up a potential source of the observed behavior at:

* Returns the publication year based on the publication date in the

Thoughts @servilla @rogerdahl?

Thanks!

@servilla servilla self-assigned this Jun 10, 2023
@servilla
Copy link
Collaborator

Hi @clnsmth,

reported an unexpected behavior

This behavior is completely expected; it's just not what the user wants. The PASTA pubdate has returned the "YYYY" format in the search API since its inception (2015), and yearDate is a valid (and is the default type) format for the EML pubDate field. It is possible to return the full "YYYY-MM-DD", considering that PASTA now overwrites this field with the repository upload date.

so It seems there is a transformation that occurs when processing the EML for delivery through the Search Data Packages REST API

Exactly. This is an expected transformation (above).

A quick search of the PASTA+ codebase turns up a potential source

It is this code:

if (fieldName != null && fieldName.equalsIgnoreCase("pubdate")) {
bestDateFormat = "YYYY";
}

Action: we should discuss as a group the most appropriate "pubDate" to return, realizing that changing this to a full date may affect other users who rely on this field containing a "YYYY" formatted date.

@clnsmth
Copy link
Author

clnsmth commented Jun 12, 2023

Thanks for looking into this @servilla, and for linking to the code that controls the returned date format.

And yes, 100%, I should have more clearly stated that the "expected behavior" is what the user was expecting, rather than imply there was something wrong with the code.

@rogerdahl rogerdahl moved this to ToDos in Consolidated Issues Oct 18, 2023
@servilla servilla added wontfix Will not be fixed EDI and removed under review labels Oct 31, 2023
@servilla servilla removed the EDI label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Will not be fixed
Projects
Status: ToDo
Development

No branches or pull requests

2 participants