Skip to content

Add Person ORCID Organization ROR_ID#654

Open
eleftherioszisis wants to merge 7 commits into
mainfrom
orcid_rorid
Open

Add Person ORCID Organization ROR_ID#654
eleftherioszisis wants to merge 7 commits into
mainfrom
orcid_rorid

Conversation

@eleftherioszisis

@eleftherioszisis eleftherioszisis commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
pytest 97.76% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/db/model.py 99.15% <100.00%> (+<0.01%) ⬆️
app/filters/organization.py 100.00% <100.00%> (ø)
app/filters/person.py 100.00% <100.00%> (ø)
app/schemas/agent.py 100.00% <100.00%> (ø)
app/utils/pydantic_validators.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread app/utils/pydantic_validators.py Outdated

from pydantic import AfterValidator

ORCID_REGEX = re.compile(r"^\d{4}-\d{4}-\d{4}-\d{4}$")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the specs, seems like valid ORCIDs may have an "X" character as well at the last position (checksum), see https://support.orcid.org/hc/en-us/articles/360006897674-Structure-of-the-ORCID-Identifier.

Also, would be great if we could even check the checksum as additional after-validation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and added checksum validation

Comment thread app/utils/pydantic_validators.py Outdated
from pydantic import AfterValidator

ORCID_REGEX = re.compile(r"^\d{4}-\d{4}-\d{4}-\d{4}$")
ROR_REGEX = re.compile(r"^0[a-z0-9]{8}$")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the specs, the regular expression to validate should be: ^0[a-hj-km-np-tv-z|0-9]{6}[0-9]{2}$, see https://ror.readme.io/docs/identifier.

The last two digits are also a checksum which could be validated I suppose.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed and added checksum validation

Comment thread app/db/model.py Outdated
Comment thread app/db/model.py Outdated
Comment thread app/utils/pydantic_validators.py
Comment thread app/utils/pydantic_validators.py Outdated
@jplanasc

Copy link
Copy Markdown

Other than the comments above, LGTM.

@chr-pok I can do the ORCID / ROR ID checks on obi-one side.

@eleftherioszisis

Copy link
Copy Markdown
Contributor Author

Other than the comments above, LGTM.

@chr-pok I can do the ORCID / ROR ID checks on obi-one side.

Note that they will still be added here in the application layer.

@chr-pok

chr-pok commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@chr-pok I can do the ORCID / ROR ID checks on obi-one side.

Sure, I guess the earlier we check the better. But I suppose if the user provides a wrong ORCID / ROR ID, you won't be able to fetch any metadata anyway.

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.

4 participants