remove openalex_id, change publication & citation to german
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit

This commit is contained in:
Kazgatari
2026-06-06 12:45:31 +02:00
parent 59a718aeaf
commit c3865a8660
7 changed files with 29 additions and 46 deletions
+13 -16
View File
@@ -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)
+4 -5
View File
@@ -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)
@@ -97,8 +97,8 @@
</p>
<p class="person-id">{{ getDistinguishingId(person) }}</p>
<p class="stats">
Works: {{ person.works_count }} ·
Citations: {{ person.cited_by_count }}
Publikationen: {{ person.works_count }} ·
Zitationen: {{ person.cited_by_count }}
</p>
</div>
</div>
@@ -184,9 +184,7 @@
}
</div>
<app-topic-hierarchy
[selectedTopics]="selectedTopics"
[searchQuery]="topicSearchControl.value"
<app-topic-hierarchy [selectedTopics]="selectedTopics" [searchQuery]="topicSearchControl.value"
(selectionChange)="onTopicSelectionChange($event)">
</app-topic-hierarchy>
</div>
@@ -220,16 +218,15 @@
style="font-size: 12px; color: var(--sg-text);">Seit</span></mat-radio-button>
</mat-radio-group>
<mat-form-field appearance="outline"
style="width: 100%; font-size: 13px; margin-top: 4px;">
<mat-form-field appearance="outline" style="width: 100%; font-size: 13px; margin-top: 4px;">
<mat-label>Jahr</mat-label>
<input matInput type="number" [formControl]="filterYearControl" (change)="applySidebarFilters()"
(keyup.enter)="applySidebarFilters()" placeholder="Z. B. 2025" />
@if (filterYearControl.hasError('min')) {
<mat-error>Jahr muss ≥ 1900 sein</mat-error>
<mat-error>Jahr muss ≥ 1900 sein</mat-error>
}
@if (filterYearControl.hasError('max')) {
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error>
<mat-error>Zukünftige Jahre sind nicht erlaubt</mat-error>
}
</mat-form-field>
</div>
@@ -271,7 +271,7 @@
.institution {
display: flex;
align-items: center;
gap:15px;
gap: 15px;
margin: 0;
font-size: 12px;
color: var(--sg-text-muted);
@@ -279,10 +279,12 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.flag-img{
.flag-img {
border: 1px solid;
vertical-align: -10px;
}
.person-id {
margin: 2px 0 0;
font-size: 10px;
@@ -294,7 +296,7 @@
.stats {
margin: 4px 0 0;
font-size: 12px;
font-size: 10px;
color: var(--sg-text-muted);
}
@@ -661,4 +663,4 @@
align-items: flex-start;
gap: 8px;
}
}
}
@@ -402,9 +402,6 @@ export class PersonListComponent {
if (person.orcid) {
return person.orcid.replace('https://orcid.org/', '');
}
if (person.id) {
return person.id.replace('https://openalex.org/', '');
}
return '';
}
@@ -32,14 +32,6 @@
<mat-icon>mail</mat-icon>
<span>uni-email@uni-due.de</span>
</div>
<!-->
@if (openAlexId()) {
<div>
<mat-icon>person</mat-icon>
<span>{{ openAlexId() }}</span>
</div>
}
<!-->
@if (orcid()) {
<div>
<mat-icon class="orcid">verified</mat-icon>
@@ -121,7 +121,6 @@ readonly personBio = toSignal(
this.orcid() ? `https://orcid.org/${this.orcid()}` : null,
);
readonly worksApiUrl = computed(() => this.person()?.works_api_url ?? null);
readonly openAlexId = computed(() => this.person()?.id ?? null);
readonly topicsFull = computed(
() => this.person()?.topics ?? [],