Add affiliation-country filter for DOI queries via ROR-to-country mapping#1483
Draft
Add affiliation-country filter for DOI queries via ROR-to-country mapping#1483
Conversation
Copilot
AI
changed the title
[WIP] Add affiliation-country filter to /dois backed by ROR country mappings
Add affiliation-country filter for DOI queries via ROR-to-country mapping
Feb 18, 2026
535d824 to
55fcf0b
Compare
…exing Co-authored-by: ashwinisukale <1137325+ashwinisukale@users.noreply.github.com>
Co-authored-by: ashwinisukale <1137325+ashwinisukale@users.noreply.github.com>
55fcf0b to
6008c3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue - https://github.com/datacite/product-backlog/issues/674
https://github.com/datacite/product-backlog/issues/671
Implements
/dois?affiliation-country=US,GBquery parameter to filter DOIs by countries inferred from ROR affiliations in creators/contributors metadata.Implementation
ROR-to-country resolution
ROR_TO_COUNTRIESmapping loaded fromapp/resources/ror_to_countries.json(populated via S3 workflow)get_countries_from_ror(ror_id)helper in Rorable concern normalizes ROR IDs and returns ISO 3166-1 alpha-2 codesElasticsearch indexing
affiliation_countrieskeyword field in DOI mappingDoi#affiliation_countriestraversescreators/contributors, extracts ROR affiliations, resolves to countries, deduplicatesextract_countries_from_people(people)helper eliminates code duplicationQuery filtering
affiliation_countryparameter inDoi.queryparses comma-separated values, normalizes to uppercase, applies EStermsfilterS3 sync workflow
update-ror-mappings.ymlto download/updateror_to_countries.jsonwith semantic JSON comparisonUsage
Pattern consistency
Follows established approach from PR #1437 (funder mappings): static JSON resource, boot-time constant loading, Rorable helper, indexed field, comma-separated filter syntax.
Testing
get_countries_from_ror(various ROR formats, edge cases)affiliation_countries(creator/contributor aggregation, deduplication)Post-merge steps
update-ror-mappingsworkflow to populate production ROR-to-country dataaffiliation_countriesfieldOriginal prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.