samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
183 stars 123 forks source link

Support for EDTF dates #5079

Open acklose opened 3 years ago

acklose commented 3 years ago

Descriptive summary

Provide support for a subset of the Extended Date Time Format (http://www.loc.gov/standards/datetime/) in Hyrax as an optional feature in the core stack. Several Hyrax implementers support it already with the EDTF Humanize gem (https://github.com/inukshuk/edtf-ruby) e.g. Duke University Libraries (https://github.com/duke-libraries/edtf-humanize). However, the gem is based on the draft version of EDTF. Minimal changes have been made to the spec since it was formalized. EDTF is a profile of ISO 8601 and is becoming more prevalent in the LAM community.

Rationale

This gem allows metadata to be entered and stored as machine-readable dates for search and browse while converting these values to human-readable values (see https://duldev.atlassian.net/wiki/spaces/DDRDOC/pages/10813606/Dates+EDTF+Implementation) and internationalization (https://blogs.library.duke.edu/bitstreams/2020/07/29/edtf-humanize-2-0-with-improved-internationalization-support/).

Expected behavior

Convert EDTF encoded values to human-readable values. Some examples: "1989~" displays as "circa 1989 "1989/2019" displays as "1989 to 2019" "18XX" displays as "1800s" Encoded dates also allow for better options with finding content by date in a timeline facet (see Duke's year facet with a timeline slider, https://repository.duke.edu/dc?f%5Bcommon_model_name_ssi%5D%5B%5D=Item)

Actual behavior

Currently, there is no support for the features listed in "Expected behavior." Users can add EDTF dates. However, there is no conversion of them in Samvera Hyrax unless specific institutions do that development work.

Related work

Various scripts to support EDTF, https://www.loc.gov/standards/datetime/implementations.html

no-reply commented 3 years ago

cc @samvera/hyrax-metadataists

as @acklose reports, individual applications can relatively easily implement this feature. it would be nice to spec out support needs in Hyrax:

acklose commented 3 years ago

Depending on the configuration, there are several date fields with Dublin Core that would be potential candidates. DC recommends EDTF for dc:date (https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/date). The dct:created field is a sub-property of dc:date (https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/created). If you go by the "out of the box" metadata for Hyrax (https://samvera.github.io/metadata_application_profile.html), dct:created would be the most appropriate. For out-of-the-box, dct:created would also be best for "humanize" in the user display, on the record display and search results. In terms of facets, the "year" (timeline) facet that Duke University is a great example of how to employ EDTF. For example, anything encoded as 18XX (1800s) will be searchable if the users selects anything from 1800 to 1899.

I'm not a developer. However, I'm happy to be involved with any testing for this.