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

Facet license missing #1315

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Facet license missing #1315

merged 2 commits into from
Jan 15, 2025

Conversation

jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Jan 15, 2025

Purpose

This pull request introduces a new facet for licenses in the DataCite DOIs controller that accounts for missing values. It enhances the faceting capabilities by enabling the retrieval of license identifiers along with an additional entry for licenses that are missing, thus providing a more comprehensive view of the licenses associated with DOIs.

Key Modifications:

  1. New Facet Method:

    • Introduced facet_by_license_and_other method in the Facetable concern. This method aggregates license data and includes an additional entry for licenses that are missing.
  2. Updates in Controller:

    • Modified the DataciteDoisController to include the new licenses_with_missing facet, mapping it to the newly created method.
    • Updated the facets_to_bucket_path to accommodate the new facet.
  3. Model Changes:

    • Altered the Doi model to define the licenses_with_missing facet with a query for terms that includes a missing condition.
  4. Testing Additions:

    • Added a new request spec to validate the functionality of the licenses_with_missing facet, confirming that it returns expected results when a DOI does not have a specified license.

Technical Details:

  • The new facet_by_license_and_other method consolidates the logic of faceting licenses while adding functionality to handle and display missing license identifiers.
  • The query for licenses_with_missing in the Doi model uses { "missing": "__missing__" } to effectively capture entries lacking a specified rights identifier.
  • The added specs ensure that the API correctly returns results with missing license values when requested, enhancing the robustness of the data retrieval process.

This PR aims to improve the usability and accuracy of license data in the DataCite system, allowing users to better understand the licensing landscape of DOIs.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@jrhoads jrhoads merged commit b8bdba0 into master Jan 15, 2025
19 checks passed
@jrhoads jrhoads deleted the facet-license-missing branch January 15, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants