Skip to content

add -e flag to enrich metadata via external APIs (OpenAlex, OpenAIRE,Zenodo). Fixes #1006#1009

Merged
dgarijo merged 8 commits into
KnowledgeCaptureAndDiscovery:devfrom
juanjemdIos:fix-1006-enrichment
Jul 2, 2026
Merged

add -e flag to enrich metadata via external APIs (OpenAlex, OpenAIRE,Zenodo). Fixes #1006#1009
dgarijo merged 8 commits into
KnowledgeCaptureAndDiscovery:devfrom
juanjemdIos:fix-1006-enrichment

Conversation

@juanjemdIos

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/somef/utils/enrichment.py Outdated


def get_openaire_project(identifier):
"""Busca un proyecto en OpenAIRE por grant ID o call identifier"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add this in English

Comment thread src/somef/utils/enrichment.py Outdated
return None
record_id = match.group(1)

url = f"https://zenodo.org/api/records/{record_id}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a constant. Don't we extract the swh ids already in the readmes? It would be nice to check if we already have this information

Comment thread README.md Outdated
- `project_acronym`: Project acronym
- `grant_id`: Call/grant identifier
- **Identifier**: Identifier associated with the software (if any), such as Digital Object Identifiers and Software Heritage identifiers (SWH). DOIs associated with publications will also be detected. When using `-e`, the following enrichment identifiers are also added:
- `openalex_id`: OpenAlex ID for the software

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

OpenAlex does not have ids for software, so far. It has ids for papers. I don't understand this

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you mean the OpenAlex id of the publication

Comment thread README.md Outdated
- `grant_id`: Call/grant identifier
- **Identifier**: Identifier associated with the software (if any), such as Digital Object Identifiers and Software Heritage identifiers (SWH). DOIs associated with publications will also be detected. When using `-e`, the following enrichment identifiers are also added:
- `openalex_id`: OpenAlex ID for the software
- `openaire_id`: URL to the OpenAIRE explore page

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The explore page... of what?

Comment thread src/somef/utils/enrichment.py Outdated
for citation in results.get(constants.CAT_CITATION, []):
doi = extract_doi(citation["result"])
if doi:
citation["result"][constants.PROP_OPENALEX_ID] = get_openalex_id(doi)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are you enriching from both open aire and open alex at the same time?
I would first look for the project info in one (probably openaire, since it also has the info on the projects), and if not found, then I would look in open alex

@dgarijo

dgarijo commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

There are comments to address here. Please have a look
Also, I think more testing is needed. How are projects enriched? Authors with ORCID?

@dgarijo

dgarijo commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

@juanjemdIos this PR still has conflicts. Can you please address them?

@dgarijo dgarijo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There are pending comment

Comment thread README.md Outdated
- `project_acronym`: Project acronym
- `grant_id`: Call/grant identifier
- **Identifier**: Identifier associated with the software (if any), such as Digital Object Identifiers and Software Heritage identifiers (SWH). DOIs associated with publications will also be detected. When using `-e`, the following enrichment identifiers are also added:
- `openalex_id`: OpenAlex ID of the publication

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is not the identifier of the software. It is not correct. It's the identifier of the publication, it should not go here

@dgarijo dgarijo merged commit c06d4c7 into KnowledgeCaptureAndDiscovery:dev Jul 2, 2026
2 checks passed
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