From c3865a8660a3e4418f290e56b0406595ab0b009e Mon Sep 17 00:00:00 2001 From: Kazgatari <56477241+Kazgatari@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:45:31 +0200 Subject: [PATCH] remove openalex_id, change publication & citation to german --- service/src/main/inse/persons/logic.py | 29 +++++++++---------- service/src/main/inse/util.py | 9 +++--- .../person-list/person-list.component.html | 15 ++++------ .../person-list/person-list.component.scss | 10 ++++--- .../person-list/person-list.component.ts | 3 -- .../app/modules/person/person.component.html | 8 ----- .../app/modules/person/person.component.ts | 1 - 7 files changed, 29 insertions(+), 46 deletions(-) diff --git a/service/src/main/inse/persons/logic.py b/service/src/main/inse/persons/logic.py index 64a649f1..a4dc5c0f 100644 --- a/service/src/main/inse/persons/logic.py +++ b/service/src/main/inse/persons/logic.py @@ -51,11 +51,10 @@ def search_persons( # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.get("ids") if isinstance(ids, dict): - ids_copy = dict(ids) - for str_field in ["openalex", "orcid", "scopus"]: - val = ids_copy.get(str_field) - if val is not None and not isinstance(val, str): - ids_copy[str_field] = str(val) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy author = Author.from_dict(source_copy) @@ -257,11 +256,10 @@ def search_persons_autocomplete(author_name: str, limit: Optional[int] = 5, incl # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.get("ids") if isinstance(ids, dict): - ids_copy = dict(ids) - for str_field in ["openalex", "orcid", "scopus"]: - val = ids_copy.get(str_field) - if val is not None and not isinstance(val, str): - ids_copy[str_field] = str(val) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy for key,value in fields.items(): @@ -325,7 +323,7 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: else: return None author_id = author_data.get("id", "") or "" - + # Not implemented yet h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16) @@ -341,11 +339,10 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: # Resilient sanitization of IDs to protect against model type conflicts (Generated) TODO: multiple code occurrences (e.g. in util.py) => refactor into seperate utility function (if required, after all merges) ids = author_data.get("ids") if isinstance(ids, dict): - ids_copy = dict(ids) - for str_field in ["openalex", "orcid", "scopus"]: - val = ids_copy.get(str_field) - if val is not None and not isinstance(val, str): - ids_copy[str_field] = str(val) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) author_data["ids"] = ids_copy base_author = Author.from_dict(author_data) diff --git a/service/src/main/inse/util.py b/service/src/main/inse/util.py index da4fc410..645e2235 100644 --- a/service/src/main/inse/util.py +++ b/service/src/main/inse/util.py @@ -28,11 +28,10 @@ def get_persons_data(hit:dict): # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) ids = source_copy.get("ids") if isinstance(ids, dict): - ids_copy = dict(ids) - for str_field in ["openalex", "orcid", "scopus"]: - val = ids_copy.get(str_field) - if val is not None and not isinstance(val, str): - ids_copy[str_field] = str(val) + ids_copy = {} + orcid_val = ids.get("orcid") + if orcid_val: + ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy author = Author.from_dict(source_copy) diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index f4aa67e2..2b9d5f40 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -97,8 +97,8 @@
{{ getDistinguishingId(person) }}
- Works: {{ person.works_count }} · - Citations: {{ person.cited_by_count }} + Publikationen: {{ person.works_count }} · + Zitationen: {{ person.cited_by_count }}
@@ -184,9 +184,7 @@ } -