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

Fractional dates are not returned via the API #1361

Open
richardhallett opened this issue Oct 27, 2021 · 1 comment · May be fixed by datacite/bolognese#148
Open

Fractional dates are not returned via the API #1361

richardhallett opened this issue Oct 27, 2021 · 1 comment · May be fixed by datacite/bolognese#148
Assignees
Labels

Comments

@richardhallett
Copy link
Contributor

Metadata can include dates that are in the format which contain a fraction of a second, this however then causes the REST API not to return this value.
The date is still available in the raw XML.

  1. Recreate with dates field
2020-11-06T21:37:33.12Z 2017-01-26 2016-09-07
  1. Attempt to retrieve doi via https://api.stage.datacite.org/dois/
  2. Notice the Accepted date is not appearing at all.
@richardhallett richardhallett self-assigned this Aug 26, 2022
@richardhallett
Copy link
Contributor Author

Looks like this is in bolognese not lupo and how we handle date parsing in general.
I've created a branch with a rspec test that causes the issue:
https://github.com/datacite/bolognese/tree/fractional_date_bug_1361

Run the specific test
bundle exec rspec ./spec/readers/datacite_reader_spec.rb:1656

The bug or arguably just how it's implemented is down to our use of a EDTF library for date parsing
https://github.com/datacite/bolognese/blob/6cb2ae3d76eca7e5e88142598e6b331850342673/lib/bolognese/readers/datacite_reader.rb#L128

But reading the datacite schema spec, fractional dates are allowed and therefore EDTF doesn't quite cover this use case.

I suspect we went with EDTF back in the day because it was closest to what we needed.

If you look at the XSD https://schema.datacite.org/meta/kernel-4.4/metadata.xsd the descriptive text has:
YYYY,YYYY-MM-DD, YYYY-MM-DDThh:mm:ssTZD or any other format or level of granularity described in W3CDTF. Use RKMS-ISO8601 standard for depicting date ranges.

So need a library that conforms to W3CDTF but I believe ISO 8601 is part of this.

If we change this from EDFT then I suspect we need to change every other reader not just datacite_reader, it will also notably break a few more specs when the change is made.

@bklaing2 bklaing2 linked a pull request Oct 14, 2022 that will close this issue
3 tasks
@richardhallett richardhallett removed their assignment Feb 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants