Skip to content

Commit

Permalink
awards: fixed program in openaire transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
0einstein0 committed Oct 3, 2024
1 parent 780fa96 commit e317fbc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions invenio_vocabularies/contrib/awards/datastreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,7 @@ def apply(self, stream_entry, **kwargs):

funding = next(iter(record.get("funding", [])), None)
if funding:
funding_stream_id = funding.get("funding_stream", {}).get("id", "")
# Example funding stream ID: `EC::HE::HORIZON-AG-UN`. We need the `EC`
# string, i.e. the second "part" of the identifier.
program = next(iter(funding_stream_id.split("::")[1:2]), "")
program = funding.get("fundingStream", {}).get("id", "")
if program:
award["program"] = program

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
}
],
"dynamic": "true",
"dynamic": "strict",
"properties": {
"$schema": {
"type": "keyword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
}
],
"dynamic": "true",
"dynamic": "strict",
"properties": {
"$schema": {
"type": "keyword",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
}
],
"dynamic": "true",
"dynamic": "strict",
"properties": {
"$schema": {
"type": "keyword",
Expand Down

0 comments on commit e317fbc

Please sign in to comment.