Added openalex institution id for predefined organizations
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-06-30 08:23:42 +02:00
parent ae92c44092
commit eb8780e9f9
2 changed files with 13 additions and 4 deletions
+3 -3
View File
@@ -6,15 +6,15 @@
},
{
"name": "Universität Duisburg-Essen",
"openalex_instution_id": "https://openalex.org/I62318514"
"openalex_institution_id": "I62318514"
},
{
"name": "Ruhr-Universität Bochum",
"openalex_instution_id": "https://openalex.org/I904495901"
"openalex_institution_id": "I904495901"
},
{
"name": "TU Dortmund",
"openalex_instution_id": "https://openalex.org/I200332995"
"openalex_institution_id": "I200332995"
}
],
"accounts": [
+10 -1
View File
@@ -87,7 +87,16 @@ def create_predefined_accounts(session: Session, file_path: str):
if organization_id is not None:
organization_id = uuid.UUID(organization_id)
organization_name = organization_data["name"]
organization = Organization(id=organization_id, name=organization_name)
openalex_institution_id = organization_data.get(
"openalex_institution_id"
)
if openalex_institution_id is not None:
openalex_institution_id = str(openalex_institution_id)
organization = Organization(
id=organization_id,
name=organization_name,
openalex_institution_id=openalex_institution_id,
)
session.add(organization)
for account_data in data.get("accounts", []):
organization_id = uuid.UUID(account_data["organization_id"])