Added openalex institution id for predefined organizations
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
This commit is contained in:
@@ -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": [
|
||||
|
||||
@@ -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"])
|
||||
|
||||
Reference in New Issue
Block a user