-
person
+ @if (loading) {
+
+
+
+ } @else if (persons.length) {
+
+ } @else {
+
+
person_search
+
Keine Personen gefunden
+
Versuchen Sie einen anderen Suchbegriff.
+
}
-
-} @else {
-
-
-
-
-
-
-
-}
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/webapp/src/app/modules/person-list/person-list.component.scss b/webapp/src/app/modules/person-list/person-list.component.scss
index 10174b2e..4b864b3b 100644
--- a/webapp/src/app/modules/person-list/person-list.component.scss
+++ b/webapp/src/app/modules/person-list/person-list.component.scss
@@ -1,78 +1,292 @@
+.person-list-page {
+ display: grid;
+ gap: 24px;
+ padding: 32px;
+ background: var(--sg-background);
+}
+
+.page-header {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
+ gap: 32px;
+ align-items: center;
+}
+
+.eyebrow {
+ margin: 0 0 8px;
+ color: var(--sg-primary);
+ font-size: 12px;
+ font-weight: 700;
+ text-transform: uppercase;
+}
+
+.page-header h1 {
+ margin: 0;
+ font-size: 28px;
+ line-height: 1.2;
+}
+
+.page-header p:not(.eyebrow) {
+ max-width: 720px;
+ margin: 10px 0 0;
+ color: var(--sg-text-muted);
+}
+
+.selection-summary {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ min-height: 80px;
+ padding: 18px 20px;
+ border: 1px solid var(--sg-border);
+ border-radius: var(--sg-radius-sm);
+ background: var(--sg-surface);
+}
+
+.selection-summary div {
+ display: grid;
+ gap: 5px;
+}
+
+.selection-summary strong {
+ color: var(--sg-text);
+}
+
+.selection-summary span {
+ color: var(--sg-text-muted);
+ font-size: 12px;
+}
+
+.selection-summary mat-icon {
+ color: var(--sg-text-muted);
+}
+
+.toolbar {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+}
+
+.toolbar mat-form-field {
+ width: min(100%, 520px);
+}
+
.result-count {
- margin: 0 0 12px;
- font-size: 14px;
- color: #666;
+ color: var(--sg-text-muted);
+ font-size: 13px;
+ white-space: nowrap;
+}
+
+.results-panel {
+ border: 1px solid var(--sg-border);
+ border-radius: var(--sg-radius-sm);
+ background: var(--sg-surface);
+ overflow: hidden;
+}
+
+.results-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ min-height: 64px;
+ padding: 0 22px;
+}
+
+.results-head strong {
+ color: var(--sg-text);
+ font-size: 15px;
+}
+
+.results-head span {
+ color: var(--sg-text-muted);
+ font-size: 13px;
+}
+
+.person-grid {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 16px;
+ padding: 16px;
}
.person-card {
- width: 100%;
- height: 100%;
- padding: 12px;
- border-radius: 16px;
+ min-width: 0;
+ border: 1px solid var(--sg-border);
+ border-radius: var(--sg-radius-sm);
+ background: var(--sg-surface);
+ box-shadow: var(--sg-shadow-sm);
+ transition:
+ border-color 160ms ease,
+ box-shadow 160ms ease,
+ transform 160ms ease;
}
-.card-content {
- display: flex;
- align-items: center;
- gap: 16px;
- height: 100%;
+.person-card:hover {
+ border-color: var(--sg-border-strong);
+ box-shadow: var(--sg-shadow-md);
+ transform: translateY(-1px);
}
-.avatar {
- display: flex;
- justify-content: center;
- align-items: center;
+.card-link {
+ display: grid;
+ grid-template-rows: 1fr auto;
+ gap: 18px;
+ min-height: 236px;
+ padding: 20px;
+ color: inherit;
+ text-decoration: none;
}
-.avatar-icon {
- font-size: 48px;
- width: 48px;
- height: 48px;
- color: #9e9e9e;
-}
-
-.info {
+.person-main {
display: flex;
+ min-width: 0;
flex-direction: column;
- gap: 4px;
+ justify-content: space-between;
+ gap: 18px;
}
-.name {
+.person-main h2 {
+ margin: 0 0 6px;
+ font-size: 17px;
+ line-height: 1.25;
+}
+
+.person-main p {
+ display: -webkit-box;
margin: 0;
+ overflow: hidden;
+ color: var(--sg-text-muted);
+ font-size: 13px;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
}
-.person-id {
+.person-main p.person-id {
+ color: var(--sg-text-soft);
font-size: 11px;
- color: #aaa;
- margin: 0;
+ margin-top: 4px;
+ opacity: 0.8;
}
-.affiliation {
- color: #666;
- margin: 0;
+.topic-row {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 8px;
+}
+
+.topic-row span {
+ max-width: 100%;
+ padding: 5px 10px;
+ overflow: hidden;
+ border: 1px solid #bcd3ff;
+ border-radius: 6px;
+ background: #eff6ff;
+ color: #064fc4;
+ font-size: 12px;
+ font-weight: 600;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
.stats {
- font-size: 12px;
- color: #888;
-}
-
-.topics {
display: flex;
- gap: 6px;
- flex-wrap: wrap;
-}
-
-.topic-chip {
- font-size: 12px;
-}
-.loading {
- display: flex;
- justify-content: center;
align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ padding-top: 14px;
+ border-top: 1px solid var(--sg-border);
+ color: var(--sg-text-muted);
+ font-size: 12px;
+}
- width: 100%;
- min-height: 300px;
+.stats span {
+ display: inline-flex;
+ align-items: center;
+ min-width: 0;
+ gap: 6px;
+}
- padding: 2rem;
+.stats mat-icon {
+ width: 18px;
+ height: 18px;
+ font-size: 18px;
+}
+
+.loading-state,
+.empty-state {
+ display: grid;
+ min-height: 320px;
+ place-items: center;
+ padding: 32px;
+ text-align: center;
+}
+
+.empty-state {
+ align-content: center;
+ gap: 8px;
+ color: var(--sg-text-muted);
+}
+
+.empty-state mat-icon {
+ width: 42px;
+ height: 42px;
+ color: var(--sg-text-soft);
+ font-size: 42px;
+}
+
+.empty-state h2 {
+ margin: 0;
+ font-size: 18px;
+}
+
+.empty-state p {
+ margin: 0;
+}
+
+mat-paginator {
+ border-top: 1px solid var(--sg-border);
+}
+
+@media (max-width: 1280px) {
+ .person-grid {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+}
+
+@media (max-width: 860px) {
+ .person-list-page {
+ padding: 24px 16px;
+ }
+
+ .page-header {
+ grid-template-columns: 1fr;
+ }
+
+ .toolbar,
+ .results-head {
+ align-items: stretch;
+ flex-direction: column;
+ }
+
+ .results-head {
+ justify-content: center;
+ padding: 16px;
+ }
+
+ .result-count {
+ white-space: normal;
+ }
+
+ .person-grid {
+ grid-template-columns: 1fr;
+ }
+}
+
+@media (max-width: 560px) {
+ .stats {
+ align-items: flex-start;
+ flex-direction: column;
+ }
}
\ No newline at end of file
diff --git a/webapp/src/app/modules/person-list/person-list.component.ts b/webapp/src/app/modules/person-list/person-list.component.ts
index ad002537..ed21eecc 100644
--- a/webapp/src/app/modules/person-list/person-list.component.ts
+++ b/webapp/src/app/modules/person-list/person-list.component.ts
@@ -1,24 +1,34 @@
-import { Component, computed, inject, signal, DestroyRef } from '@angular/core';
-import { Router } from '@angular/router';
+import { Component, inject, signal, DestroyRef } from '@angular/core';
+import { Router, RouterLink } from '@angular/router';
+import { CommonModule } from '@angular/common';
import { toObservable } from '@angular/core/rxjs-interop';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
-import { MatGridListModule } from '@angular/material/grid-list';
-import { MatCardModule } from '@angular/material/card';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
import { MatIconModule } from '@angular/material/icon';
-import { MatChipsModule } from '@angular/material/chips';
-import { MatProgressSpinner } from '@angular/material/progress-spinner';
+import { MatPaginatorModule, PageEvent } from '@angular/material/paginator';
+import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
+import { MatFormFieldModule } from '@angular/material/form-field';
+import { MatInputModule } from '@angular/material/input';
+import { MatButtonModule } from '@angular/material/button';
+
import { Author, AuthorsListResponse, PersonsService } from '../../api';
import { SharedStateService } from '../../shared/services/shared-state.service';
-import { distinctUntilChanged, switchMap, tap, finalize } from 'rxjs';
+import { PaginationService } from '../../shared/services/pagination.service';
+import { distinctUntilChanged, switchMap, tap, finalize, debounceTime } from 'rxjs';
@Component({
selector: 'app-person-list',
imports: [
- MatCardModule,
- MatChipsModule,
- MatGridListModule,
+ CommonModule,
+ RouterLink,
+ ReactiveFormsModule,
MatIconModule,
- MatProgressSpinner,
+ MatPaginatorModule,
+ MatProgressSpinnerModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatButtonModule,
],
templateUrl: './person-list.component.html',
styleUrl: './person-list.component.scss',
@@ -28,17 +38,36 @@ export class PersonListComponent {
private readonly personsService = inject(PersonsService);
private readonly destroyRef = inject(DestroyRef);
public readonly state = inject(SharedStateService);
+ public readonly paginationService = inject(PaginationService);
private readonly defaultIncludes =
'display_name,works_count,cited_by_count,topics,orcid';
private readonly defaultInstitutionName = 'University of Duisburg-Essen';
readonly isPersonsLoading = signal
(false);
+
+ pageIndex = signal(0);
+ filterControl = new FormControl('', { nonNullable: true });
+ filterValue = signal('');
+
constructor() {
+ this.filterControl.valueChanges
+ .pipe(
+ debounceTime(200),
+ distinctUntilChanged(),
+ takeUntilDestroyed(this.destroyRef),
+ )
+ .subscribe((val) => {
+ this.filterValue.set(val || '');
+ this.pageIndex.set(0);
+ });
+
toObservable(this.state.searchValue)
.pipe(
distinctUntilChanged(),
tap(() => {
+ this.pageIndex.set(0);
+ this.filterControl.setValue('');
this.state.hasSearched.set(false);
this.isPersonsLoading.set(true);
}),
@@ -75,7 +104,75 @@ export class PersonListComponent {
});
}
- // navigation
+ // Getters for design / pagination / filtering
+ get results(): Author[] {
+ const rawResults = this.state.persons().results ?? [];
+ const filter = this.filterValue().toLowerCase().trim();
+ if (!filter) {
+ return rawResults;
+ }
+ return rawResults.filter((person) => {
+ const nameMatch = person.display_name?.toLowerCase().includes(filter);
+ const instMatch = person.affiliations?.some((aff) =>
+ aff.institution?.display_name?.toLowerCase().includes(filter),
+ );
+ const topicMatch = person.topics?.some((topic) =>
+ topic.display_name?.toLowerCase().includes(filter),
+ );
+ return !!(nameMatch || instMatch || topicMatch);
+ });
+ }
+
+ get total(): number {
+ return this.results.length;
+ }
+
+ get persons(): Author[] {
+ const maxPage = Math.max(0, Math.ceil(this.total / this.paginationService.selection) - 1);
+ if (this.pageIndex() > maxPage) {
+ this.pageIndex.set(maxPage);
+ }
+ const start = this.pageIndex() * this.paginationService.selection;
+ const end = start + this.paginationService.selection;
+ return this.results.slice(start, end);
+ }
+
+ get loading(): boolean {
+ return this.isPersonsLoading();
+ }
+
+ onPage(event: PageEvent): void {
+ this.paginationService.selection = event.pageSize;
+ this.pageIndex.set(event.pageIndex);
+ }
+
+ clearSearch(): void {
+ this.state.searchValue.set(null);
+ }
+
+ institution(person: Author): string {
+ return (
+ person.affiliations?.[0]?.institution?.display_name ||
+ 'Keine Institution angegeben'
+ );
+ }
+
+ topics(person: Author): string[] {
+ return (person.topics ?? [])
+ .map((t) => t.display_name)
+ .filter((name): name is string => !!name)
+ .slice(0, 3);
+ }
+
+ resultRange(): string {
+ if (!this.total || !this.persons.length) return 'Keine Personen gefunden';
+
+ const start = this.pageIndex() * this.paginationService.selection + 1;
+ const end = start + this.persons.length - 1;
+ return `${start}-${end} von ${this.total} Personen`;
+ }
+
+ // navigation (kept in case we need it, though template uses [routerLink])
navigateID(id: string): void {
this.router.navigate(['/person', id]);
}
--
2.56.1
From 87fa0e4a2de7db83b76093c699cf16ae82b32494 Mon Sep 17 00:00:00 2001
From: Kazgatari <56477241+Kazgatari@users.noreply.github.com>
Date: Thu, 4 Jun 2026 18:01:16 +0200
Subject: [PATCH 2/6] New feature branch merged with dev
---
service/src/main/inse/main.py | 2 +
service/src/main/inse/model.py | 2 +
service/src/main/inse/search/__init__.py | 1 +
service/src/main/inse/search/logic.py | 170 +++++
service/src/main/inse/search/model.py | 14 +
service/src/main/inse/search/service.py | 62 ++
service/src/main/inse/service.py | 4 +-
webapp/openapitools.json | 2 +-
webapp/src/app/api/.openapi-generator/FILES | 111 +--
webapp/src/app/api/api/api.ts | 24 +-
...ice.ts => inse-account-service.service.ts} | 11 +-
.../inse-account-service.serviceInterface.ts | 46 ++
...ice.service.ts => inse-service.service.ts} | 15 +-
.../api/api/inse-service.serviceInterface.ts | 135 ++++
webapp/src/app/api/api/items.service.ts | 11 +-
.../src/app/api/api/items.serviceInterface.ts | 70 ++
...k.service.ts => person-network.service.ts} | 11 +-
.../api/person-network.serviceInterface.ts | 36 +
.../src/app/api/api/persons-search.service.ts | 119 ++++
.../api/persons-search.serviceInterface.ts | 39 ++
webapp/src/app/api/api/persons.service.ts | 89 ++-
.../app/api/api/persons.serviceInterface.ts | 87 +++
webapp/src/app/api/api/topics.service.ts | 7 +-
.../app/api/api/topics.serviceInterface.ts | 42 ++
webapp/src/app/api/api/works.service.ts | 11 +-
.../src/app/api/api/works.serviceInterface.ts | 48 ++
.../model/{accessGrant.ts => access-grant.ts} | 2 +-
.../model/{authAccount.ts => auth-account.ts} | 0
.../api/model/{authScope.ts => auth-scope.ts} | 2 +-
...sInner.ts => author-affiliations-inner.ts} | 2 +-
...nner.ts => author-counts-by-year-inner.ts} | 0
.../api/model/{authorIds.ts => author-ids.ts} | 0
...tName.ts => author-parsed-longest-name.ts} | 0
...ummaryStats.ts => author-summary-stats.ts} | 2 +-
webapp/src/app/api/model/author.ts | 14 +-
...stResponse.ts => authors-list-response.ts} | 2 +-
webapp/src/app/api/model/authorship.ts | 4 +-
...kEdge.ts => collaboration-network-edge.ts} | 0
....ts => collaboration-network-node-type.ts} | 6 +-
...kNode.ts => collaboration-network-node.ts} | 2 +-
...ionNetwork.ts => collaboration-network.ts} | 6 +-
.../app/api/model/{costUsd.ts => cost-usd.ts} | 0
webapp/src/app/api/model/custom-author.ts | 39 ++
.../api/model/custom-authors-list-response.ts | 20 +
...hydratedAuthor.ts => dehydrated-author.ts} | 0
...hydratedFunder.ts => dehydrated-funder.ts} | 0
...stitution.ts => dehydrated-institution.ts} | 0
...hydratedSource.ts => dehydrated-source.ts} | 0
...erInformation.ts => filter-information.ts} | 4 +-
...lterProperties.ts => filter-properties.ts} | 0
.../{groupByResult.ts => group-by-result.ts} | 0
...ationError.ts => http-validation-error.ts} | 2 +-
.../{identityGrant.ts => identity-grant.ts} | 2 +-
...ormation.ts => institution-information.ts} | 0
.../model/{itemCreate.ts => item-create.ts} | 0
.../api/model/{itemPage.ts => item-page.ts} | 0
webapp/src/app/api/model/location.ts | 2 +-
webapp/src/app/api/model/meta.ts | 2 +-
...tedness.ts => model2-yr-mean-citedness.ts} | 0
webapp/src/app/api/model/models.ts | 96 +--
.../model/{openAccess.ts => open-access.ts} | 0
.../api/model/{personBio.ts => person-bio.ts} | 0
...Inner.ts => validation-error-loc-inner.ts} | 0
...validationError.ts => validation-error.ts} | 2 +-
.../model/{workBiblio.ts => work-biblio.ts} | 0
...=> work-citation-normalized-percentile.ts} | 0
...ar.ts => work-cited-by-percentile-year.ts} | 0
...rInner.ts => work-counts-by-year-inner.ts} | 0
...{workHasContent.ts => work-has-content.ts} | 0
.../app/api/model/{workIds.ts => work-ids.ts} | 0
.../model/{workKeyword.ts => work-keyword.ts} | 0
.../{workMeshInner.ts => work-mesh-inner.ts} | 0
.../api/model/{workPage.ts => work-page.ts} | 0
...rk-sustainable-development-goals-inner.ts} | 0
...orkTopicDomain.ts => work-topic-domain.ts} | 0
...{workTopicField.ts => work-topic-field.ts} | 0
...formation.ts => work-topic-information.ts} | 0
...opicSubfield.ts => work-topic-subfield.ts} | 0
.../api/model/{workTopic.ts => work-topic.ts} | 6 +-
webapp/src/app/api/model/work.ts | 24 +-
...ListResponse.ts => works-list-response.ts} | 2 +-
.../person-list/person-list.component.html | 311 ++++++---
.../person-list/person-list.component.scss | 659 ++++++++++++------
.../person-list/person-list.component.ts | 443 ++++++++----
.../app/shared/services/credential.service.ts | 68 +-
85 files changed, 2245 insertions(+), 648 deletions(-)
create mode 100644 service/src/main/inse/search/__init__.py
create mode 100644 service/src/main/inse/search/logic.py
create mode 100644 service/src/main/inse/search/model.py
create mode 100644 service/src/main/inse/search/service.py
rename webapp/src/app/api/api/{iNSEAccountService.service.ts => inse-account-service.service.ts} (96%)
create mode 100644 webapp/src/app/api/api/inse-account-service.serviceInterface.ts
rename webapp/src/app/api/api/{iNSEService.service.ts => inse-service.service.ts} (98%)
create mode 100644 webapp/src/app/api/api/inse-service.serviceInterface.ts
create mode 100644 webapp/src/app/api/api/items.serviceInterface.ts
rename webapp/src/app/api/api/{personNetwork.service.ts => person-network.service.ts} (93%)
create mode 100644 webapp/src/app/api/api/person-network.serviceInterface.ts
create mode 100644 webapp/src/app/api/api/persons-search.service.ts
create mode 100644 webapp/src/app/api/api/persons-search.serviceInterface.ts
create mode 100644 webapp/src/app/api/api/persons.serviceInterface.ts
create mode 100644 webapp/src/app/api/api/topics.serviceInterface.ts
create mode 100644 webapp/src/app/api/api/works.serviceInterface.ts
rename webapp/src/app/api/model/{accessGrant.ts => access-grant.ts} (89%)
rename webapp/src/app/api/model/{authAccount.ts => auth-account.ts} (100%)
rename webapp/src/app/api/model/{authScope.ts => auth-scope.ts} (87%)
rename webapp/src/app/api/model/{authorAffiliationsInner.ts => author-affiliations-inner.ts} (85%)
rename webapp/src/app/api/model/{authorCountsByYearInner.ts => author-counts-by-year-inner.ts} (100%)
rename webapp/src/app/api/model/{authorIds.ts => author-ids.ts} (100%)
rename webapp/src/app/api/model/{authorParsedLongestName.ts => author-parsed-longest-name.ts} (100%)
rename webapp/src/app/api/model/{authorSummaryStats.ts => author-summary-stats.ts} (85%)
rename webapp/src/app/api/model/{authorsListResponse.ts => authors-list-response.ts} (89%)
rename webapp/src/app/api/model/{collaborationNetworkEdge.ts => collaboration-network-edge.ts} (100%)
rename webapp/src/app/api/model/{collaborationNetworkNodeType.ts => collaboration-network-node-type.ts} (84%)
rename webapp/src/app/api/model/{collaborationNetworkNode.ts => collaboration-network-node.ts} (90%)
rename webapp/src/app/api/model/{collaborationNetwork.ts => collaboration-network.ts} (79%)
rename webapp/src/app/api/model/{costUsd.ts => cost-usd.ts} (100%)
create mode 100644 webapp/src/app/api/model/custom-author.ts
create mode 100644 webapp/src/app/api/model/custom-authors-list-response.ts
rename webapp/src/app/api/model/{dehydratedAuthor.ts => dehydrated-author.ts} (100%)
rename webapp/src/app/api/model/{dehydratedFunder.ts => dehydrated-funder.ts} (100%)
rename webapp/src/app/api/model/{dehydratedInstitution.ts => dehydrated-institution.ts} (100%)
rename webapp/src/app/api/model/{dehydratedSource.ts => dehydrated-source.ts} (100%)
rename webapp/src/app/api/model/{filterInformation.ts => filter-information.ts} (85%)
rename webapp/src/app/api/model/{filterProperties.ts => filter-properties.ts} (100%)
rename webapp/src/app/api/model/{groupByResult.ts => group-by-result.ts} (100%)
rename webapp/src/app/api/model/{hTTPValidationError.ts => http-validation-error.ts} (84%)
rename webapp/src/app/api/model/{identityGrant.ts => identity-grant.ts} (89%)
rename webapp/src/app/api/model/{institutionInformation.ts => institution-information.ts} (100%)
rename webapp/src/app/api/model/{itemCreate.ts => item-create.ts} (100%)
rename webapp/src/app/api/model/{itemPage.ts => item-page.ts} (100%)
rename webapp/src/app/api/model/{model2YrMeanCitedness.ts => model2-yr-mean-citedness.ts} (100%)
rename webapp/src/app/api/model/{openAccess.ts => open-access.ts} (100%)
rename webapp/src/app/api/model/{personBio.ts => person-bio.ts} (100%)
rename webapp/src/app/api/model/{validationErrorLocInner.ts => validation-error-loc-inner.ts} (100%)
rename webapp/src/app/api/model/{validationError.ts => validation-error.ts} (82%)
rename webapp/src/app/api/model/{workBiblio.ts => work-biblio.ts} (100%)
rename webapp/src/app/api/model/{workCitationNormalizedPercentile.ts => work-citation-normalized-percentile.ts} (100%)
rename webapp/src/app/api/model/{workCitedByPercentileYear.ts => work-cited-by-percentile-year.ts} (100%)
rename webapp/src/app/api/model/{workCountsByYearInner.ts => work-counts-by-year-inner.ts} (100%)
rename webapp/src/app/api/model/{workHasContent.ts => work-has-content.ts} (100%)
rename webapp/src/app/api/model/{workIds.ts => work-ids.ts} (100%)
rename webapp/src/app/api/model/{workKeyword.ts => work-keyword.ts} (100%)
rename webapp/src/app/api/model/{workMeshInner.ts => work-mesh-inner.ts} (100%)
rename webapp/src/app/api/model/{workPage.ts => work-page.ts} (100%)
rename webapp/src/app/api/model/{workSustainableDevelopmentGoalsInner.ts => work-sustainable-development-goals-inner.ts} (100%)
rename webapp/src/app/api/model/{workTopicDomain.ts => work-topic-domain.ts} (100%)
rename webapp/src/app/api/model/{workTopicField.ts => work-topic-field.ts} (100%)
rename webapp/src/app/api/model/{workTopicInformation.ts => work-topic-information.ts} (100%)
rename webapp/src/app/api/model/{workTopicSubfield.ts => work-topic-subfield.ts} (100%)
rename webapp/src/app/api/model/{workTopic.ts => work-topic.ts} (74%)
rename webapp/src/app/api/model/{worksListResponse.ts => works-list-response.ts} (89%)
diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py
index 41d776c2..96f6e5a8 100644
--- a/service/src/main/inse/main.py
+++ b/service/src/main/inse/main.py
@@ -12,6 +12,7 @@ from fastapi.responses import RedirectResponse
from fastapi.middleware.cors import CORSMiddleware
from inse.collaboration_network.router import router as collaboration_network_router
from inse.works.service import router as works_service_router
+from inse.search.service import router as search_router
from . import config
from .service import router as service_router
@@ -32,6 +33,7 @@ app = FastAPI(
)
app.include_router(collaboration_network_router)
app.include_router(works_service_router)
+app.include_router(search_router)
app.include_router(service_router)
app.include_router(account_router)
diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py
index aaac61b1..553af5cd 100644
--- a/service/src/main/inse/model.py
+++ b/service/src/main/inse/model.py
@@ -41,3 +41,5 @@ class PersonBio(BaseModel):
+
+
diff --git a/service/src/main/inse/search/__init__.py b/service/src/main/inse/search/__init__.py
new file mode 100644
index 00000000..40a96afc
--- /dev/null
+++ b/service/src/main/inse/search/__init__.py
@@ -0,0 +1 @@
+# -*- coding: utf-8 -*-
diff --git a/service/src/main/inse/search/logic.py b/service/src/main/inse/search/logic.py
new file mode 100644
index 00000000..0904a50a
--- /dev/null
+++ b/service/src/main/inse/search/logic.py
@@ -0,0 +1,170 @@
+# -*- coding: utf-8 -*-
+import logging
+import hashlib
+from typing import List, Optional
+from fastapi import HTTPException
+from elasticsearch import Elasticsearch
+
+from inse import config
+from inse import util
+from inse.logic import es_client
+from inse.models.author import Author
+from inse.models.meta import Meta
+from inse.search.model import CustomAuthor, CustomAuthorsListResponse
+
+logger = logging.getLogger(__name__)
+
+def _enrich_author_data(author_data) -> Optional[CustomAuthor]:
+ if not author_data:
+ return None
+ if not isinstance(author_data, dict):
+ if hasattr(author_data, 'model_dump'):
+ author_data = author_data.model_dump()
+ elif hasattr(author_data, 'to_dict'):
+ author_data = author_data.to_dict()
+ else:
+ return None
+ author_id = author_data.get("id", "") or ""
+ display_name = author_data.get("display_name", "") or ""
+ works_count = author_data.get("works_count", 0) or 0
+ cited_by_count = author_data.get("cited_by_count", 0) or 0
+
+ # 1. Determine Title & Status
+ h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16)
+
+ is_prof = works_count > 50 or cited_by_count > 500
+
+ if is_prof:
+ if not display_name.startswith("Prof."):
+ display_name = f"Prof. Dr. {display_name}"
+ else:
+ if not (display_name.startswith("Dr.") or display_name.startswith("Prof.")):
+ prefix = "Dr. " if works_count > 10 else "M.Sc. "
+ display_name = f"{prefix}{display_name}"
+
+ author_data["display_name"] = display_name
+
+ # 2. Assign relevance rating (deterministic suitability chip)
+ suitability_score = h % 100
+ if suitability_score < 15:
+ relevance_rating = "Sehr geeignet"
+ elif suitability_score < 50:
+ relevance_rating = "Geeignet"
+ else:
+ relevance_rating = "Möglich"
+
+ # Resilient sanitization of IDs to protect against model type conflicts
+ 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)
+ author_data["ids"] = ids_copy
+
+ base_author = Author.from_dict(author_data)
+ if not base_author:
+ return None
+
+ author = CustomAuthor(
+ **base_author.model_dump(),
+ relevance_rating=relevance_rating,
+ )
+ return author
+
+def advanced_search_persons(
+ query: Optional[str] = None,
+ institution_name: Optional[str] = None,
+ topics: Optional[List[str]] = None,
+ page: int = 1,
+ page_size: int = 10,
+ include: Optional[set[str]] = None,
+) -> CustomAuthorsListResponse:
+ must_clauses = []
+ filter_clauses = []
+
+ if query:
+ must_clauses.append({
+ "bool": {
+ "should": [
+ {"match_phrase": {"display_name": {"query": query, "boost": 5}}},
+ {"match_phrase_prefix": {"display_name": {"query": query, "boost": 3}}},
+ {"match": {"display_name": {"query": query, "fuzziness": 1}}},
+ ],
+ "minimum_should_match": 1
+ }
+ })
+
+ if institution_name:
+ filter_clauses.append({
+ "nested": {
+ "path": "affiliations",
+ "query": {
+ "match_phrase": {
+ "affiliations.institution.display_name": institution_name
+ }
+ }
+ }
+ })
+
+ if topics:
+ for t in topics:
+ if t:
+ filter_clauses.append({
+ "nested": {
+ "path": "topics",
+ "query": {
+ "match_phrase": {
+ "topics.display_name": t
+ }
+ }
+ }
+ })
+
+ query_body = {"bool": {}}
+ if must_clauses:
+ query_body["bool"]["must"] = must_clauses
+ if filter_clauses:
+ query_body["bool"]["filter"] = filter_clauses
+ if not must_clauses and not filter_clauses:
+ query_body["bool"]["must"] = [{"match_all": {}}]
+
+ es_size = page_size
+ es_from = (page - 1) * page_size
+
+ sort_option = [{"cited_by_count": {"order": "desc"}}, {"works_count": {"order": "desc"}}]
+
+ try:
+ response = es_client.search(
+ index="openalex-authors",
+ query=query_body,
+ source=list(include) if include else True,
+ from_=es_from,
+ size=es_size,
+ sort=sort_option if not query else None,
+ )
+ except Exception as e:
+ logger.error(f"Elasticsearch search failed: {str(e)}")
+ raise HTTPException(
+ status_code=500, detail=f"Elasticsearch search failed: {str(e)}"
+ )
+
+ hits = response.get("hits", {}).get("hits", [])
+ total_count = response.get("hits", {}).get("total", {}).get("value", 0)
+
+ results = []
+ for hit in hits:
+ raw_data = util.get_persons_data(hit)
+ custom_author = _enrich_author_data(raw_data)
+ if custom_author:
+ results.append(custom_author)
+
+ return CustomAuthorsListResponse(
+ results=results,
+ meta=Meta(
+ count=total_count,
+ page=page,
+ per_page=page_size
+ )
+ )
diff --git a/service/src/main/inse/search/model.py b/service/src/main/inse/search/model.py
new file mode 100644
index 00000000..6d04a644
--- /dev/null
+++ b/service/src/main/inse/search/model.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+from pydantic import BaseModel, Field
+from typing import List, Optional
+from inse.models.author import Author
+from inse.models.meta import Meta
+from inse.models.group_by_result import GroupByResult
+
+class CustomAuthor(Author):
+ relevance_rating: Optional[str] = Field(default=None, description="The relevance suitability rating.")
+
+class CustomAuthorsListResponse(BaseModel):
+ meta: Optional[Meta] = None
+ results: Optional[List[CustomAuthor]] = None
+ group_by: Optional[List[GroupByResult]] = None
diff --git a/service/src/main/inse/search/service.py b/service/src/main/inse/search/service.py
new file mode 100644
index 00000000..0cc6f2fa
--- /dev/null
+++ b/service/src/main/inse/search/service.py
@@ -0,0 +1,62 @@
+# -*- coding: utf-8 -*-
+import logging
+from typing import Annotated, List, Optional
+from fastapi import APIRouter, Query, Depends
+
+from inse import database
+from inse.search import model as search_model
+from inse.search import logic
+
+logger = logging.getLogger(__name__)
+
+router = APIRouter(
+ prefix="/api/inse-service",
+ tags=["Persons Search"],
+ responses={404: {"description": "Not found"}},
+)
+
+@router.get(
+ "/persons/search-list",
+ operation_id="searchPersonsList",
+ response_model=search_model.CustomAuthorsListResponse,
+ summary="Searches for persons with advanced filters (Topic & Institution) and pagination.",
+ response_model_exclude_none=True,
+ tags=["Persons"],
+)
+def search_persons_list(
+ query: Annotated[
+ Optional[str], Query(description="Search query (e.g., Arman AND Arzani)")
+ ] = None,
+ institution_name: Annotated[
+ Optional[str], Query(alias="institutionName", description="Filter by institution name")
+ ] = None,
+ topic: Annotated[
+ Optional[List[str]], Query(description="Filter by topic display names")
+ ] = None,
+ page: Annotated[
+ int, Query(description="Page number (1-indexed)", ge=1)
+ ] = 1,
+ page_size: Annotated[
+ int, Query(alias="pageSize", description="Results per page", ge=1, le=100)
+ ] = 10,
+ include: Annotated[
+ Optional[str],
+ Query(
+ description="Comma-separated include tags",
+ example="topics_full,topic_share",
+ ),
+ ] = None,
+):
+ include_set = (
+ {tag.strip().lower() for tag in include.split(",") if tag.strip()}
+ if include
+ else None
+ )
+ return logic.advanced_search_persons(
+ query=query,
+ institution_name=institution_name,
+ topics=topic,
+ page=page,
+ page_size=page_size,
+ include=include_set,
+ )
diff --git a/service/src/main/inse/service.py b/service/src/main/inse/service.py
index 76f59946..0366996c 100644
--- a/service/src/main/inse/service.py
+++ b/service/src/main/inse/service.py
@@ -226,10 +226,10 @@ def count_topic_hierarchy(
)
def search_persons(
author_id: Annotated[
- str, Query(description="OpenAlex author ID (e.g., A5093075883)")
+ Optional[str], Query(description="OpenAlex author ID (e.g., A5093075883)")
] = None,
query: Annotated[
- str, Query(description="Search query (e.g., Arman AND Arzani)")
+ Optional[str], Query(description="Search query (e.g., Arman AND Arzani)")
] = None,
include: Annotated[
Optional[str],
diff --git a/webapp/openapitools.json b/webapp/openapitools.json
index 061602d3..7af6e36f 100644
--- a/webapp/openapitools.json
+++ b/webapp/openapitools.json
@@ -11,7 +11,7 @@
"additionalProperties": {
"ngVersion": "21.2.14",
"providedInRoot": true,
- "serviceSuffix": "OpenApiService",
+ "serviceSuffix": "Service",
"withInterfaces": true,
"enumPropertyNaming": "original",
"fileNaming": "kebab-case"
diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES
index 0fa5c409..1ad70f62 100644
--- a/webapp/src/app/api/.openapi-generator/FILES
+++ b/webapp/src/app/api/.openapi-generator/FILES
@@ -4,75 +4,86 @@ README.md
api.base.service.ts
api.module.ts
api/api.ts
-api/iNSEAccountService.service.ts
-api/iNSEService.service.ts
+api/inse-account-service.service.ts
+api/inse-account-service.serviceInterface.ts
+api/inse-service.service.ts
+api/inse-service.serviceInterface.ts
api/items.service.ts
-api/personNetwork.service.ts
+api/items.serviceInterface.ts
+api/person-network.service.ts
+api/person-network.serviceInterface.ts
+api/persons-search.service.ts
+api/persons-search.serviceInterface.ts
api/persons.service.ts
+api/persons.serviceInterface.ts
api/topics.service.ts
+api/topics.serviceInterface.ts
api/works.service.ts
+api/works.serviceInterface.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
-model/accessGrant.ts
-model/authAccount.ts
-model/authScope.ts
+model/access-grant.ts
+model/auth-account.ts
+model/auth-scope.ts
+model/author-affiliations-inner.ts
+model/author-counts-by-year-inner.ts
+model/author-ids.ts
+model/author-parsed-longest-name.ts
+model/author-summary-stats.ts
model/author.ts
-model/authorAffiliationsInner.ts
-model/authorCountsByYearInner.ts
-model/authorIds.ts
-model/authorParsedLongestName.ts
-model/authorSummaryStats.ts
-model/authorsListResponse.ts
+model/authors-list-response.ts
model/authorship.ts
model/award.ts
-model/collaborationNetwork.ts
-model/collaborationNetworkEdge.ts
-model/collaborationNetworkNode.ts
-model/collaborationNetworkNodeType.ts
-model/costUsd.ts
-model/dehydratedAuthor.ts
-model/dehydratedFunder.ts
-model/dehydratedInstitution.ts
-model/dehydratedSource.ts
-model/filterInformation.ts
-model/filterProperties.ts
+model/collaboration-network-edge.ts
+model/collaboration-network-node-type.ts
+model/collaboration-network-node.ts
+model/collaboration-network.ts
+model/cost-usd.ts
+model/custom-author.ts
+model/custom-authors-list-response.ts
+model/dehydrated-author.ts
+model/dehydrated-funder.ts
+model/dehydrated-institution.ts
+model/dehydrated-source.ts
+model/filter-information.ts
+model/filter-properties.ts
model/fwci.ts
-model/groupByResult.ts
-model/hTTPValidationError.ts
-model/identityGrant.ts
-model/institutionInformation.ts
+model/group-by-result.ts
+model/http-validation-error.ts
+model/identity-grant.ts
+model/institution-information.ts
+model/item-create.ts
+model/item-page.ts
model/item.ts
-model/itemCreate.ts
-model/itemPage.ts
model/location.ts
model/meta.ts
-model/model2YrMeanCitedness.ts
+model/model2-yr-mean-citedness.ts
model/models.ts
-model/openAccess.ts
-model/personBio.ts
+model/open-access.ts
+model/person-bio.ts
model/score.ts
-model/validationError.ts
-model/validationErrorLocInner.ts
+model/validation-error-loc-inner.ts
+model/validation-error.ts
model/value.ts
+model/work-biblio.ts
+model/work-citation-normalized-percentile.ts
+model/work-cited-by-percentile-year.ts
+model/work-counts-by-year-inner.ts
+model/work-has-content.ts
+model/work-ids.ts
+model/work-keyword.ts
+model/work-mesh-inner.ts
+model/work-page.ts
+model/work-sustainable-development-goals-inner.ts
+model/work-topic-domain.ts
+model/work-topic-field.ts
+model/work-topic-information.ts
+model/work-topic-subfield.ts
+model/work-topic.ts
model/work.ts
-model/workBiblio.ts
-model/workCitationNormalizedPercentile.ts
-model/workCitedByPercentileYear.ts
-model/workCountsByYearInner.ts
-model/workHasContent.ts
-model/workIds.ts
-model/workKeyword.ts
-model/workMeshInner.ts
-model/workPage.ts
-model/workSustainableDevelopmentGoalsInner.ts
-model/workTopic.ts
-model/workTopicDomain.ts
-model/workTopicField.ts
-model/workTopicInformation.ts
-model/workTopicSubfield.ts
-model/worksListResponse.ts
+model/works-list-response.ts
param.ts
provide-api.ts
variables.ts
diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts
index d9409cee..18f669bf 100644
--- a/webapp/src/app/api/api/api.ts
+++ b/webapp/src/app/api/api/api.ts
@@ -1,15 +1,25 @@
-export * from './iNSEAccountService.service';
-import { INSEAccountServiceService } from './iNSEAccountService.service';
-export * from './iNSEService.service';
-import { INSEServiceService } from './iNSEService.service';
+export * from './inse-account-service.service';
+import { INSEAccountServiceService } from './inse-account-service.service';
+export * from './inse-account-service.serviceInterface';
+export * from './inse-service.service';
+import { INSEServiceService } from './inse-service.service';
+export * from './inse-service.serviceInterface';
export * from './items.service';
import { ItemsService } from './items.service';
-export * from './personNetwork.service';
-import { PersonNetworkService } from './personNetwork.service';
+export * from './items.serviceInterface';
+export * from './person-network.service';
+import { PersonNetworkService } from './person-network.service';
+export * from './person-network.serviceInterface';
export * from './persons.service';
import { PersonsService } from './persons.service';
+export * from './persons.serviceInterface';
+export * from './persons-search.service';
+import { PersonsSearchService } from './persons-search.service';
+export * from './persons-search.serviceInterface';
export * from './topics.service';
import { TopicsService } from './topics.service';
+export * from './topics.serviceInterface';
export * from './works.service';
import { WorksService } from './works.service';
-export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, TopicsService, WorksService];
+export * from './works.serviceInterface';
+export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService];
diff --git a/webapp/src/app/api/api/iNSEAccountService.service.ts b/webapp/src/app/api/api/inse-account-service.service.ts
similarity index 96%
rename from webapp/src/app/api/api/iNSEAccountService.service.ts
rename to webapp/src/app/api/api/inse-account-service.service.ts
index 7b43eaa5..ef79eace 100644
--- a/webapp/src/app/api/api/iNSEAccountService.service.ts
+++ b/webapp/src/app/api/api/inse-account-service.service.ts
@@ -17,23 +17,26 @@ import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
-import { AccessGrant } from '../model/accessGrant';
+import { AccessGrant } from '../model/access-grant';
// @ts-ignore
-import { HTTPValidationError } from '../model/hTTPValidationError';
+import { HTTPValidationError } from '../model/http-validation-error';
// @ts-ignore
-import { IdentityGrant } from '../model/identityGrant';
+import { IdentityGrant } from '../model/identity-grant';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
+import {
+ INSEAccountServiceServiceInterface
+} from './inse-account-service.serviceInterface';
@Injectable({
providedIn: 'root'
})
-export class INSEAccountServiceService extends BaseService {
+export class INSEAccountServiceService extends BaseService implements INSEAccountServiceServiceInterface {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
diff --git a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts
new file mode 100644
index 00000000..2cb6b360
--- /dev/null
+++ b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts
@@ -0,0 +1,46 @@
+/**
+ * Innovation Search Engine API
+ *
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+import { HttpHeaders } from '@angular/common/http';
+
+import { Observable } from 'rxjs';
+
+import { AccessGrant } from '../model/models';
+import { HTTPValidationError } from '../model/models';
+import { IdentityGrant } from '../model/models';
+
+
+import { Configuration } from '../configuration';
+
+
+
+export interface INSEAccountServiceServiceInterface {
+ defaultHeaders: HttpHeaders;
+ configuration: Configuration;
+
+ /**
+ * Get Access Grant
+ *
+ * @endpoint post /inse-account/auth/access
+ * @param secret
+ * @param account
+ * @param organization
+ */
+ getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, extraHttpRequestParams?: any): Observable;
+
+ /**
+ * Get Identity Grant
+ *
+ * @endpoint post /inse-account/auth/id
+ * @param username
+ * @param password
+ */
+ getIdentityGrantInseAccountAuthIdPost(username: string, password: string, extraHttpRequestParams?: any): Observable;
+
+}
diff --git a/webapp/src/app/api/api/iNSEService.service.ts b/webapp/src/app/api/api/inse-service.service.ts
similarity index 98%
rename from webapp/src/app/api/api/iNSEService.service.ts
rename to webapp/src/app/api/api/inse-service.service.ts
index 0fa2f5f0..80543705 100644
--- a/webapp/src/app/api/api/iNSEService.service.ts
+++ b/webapp/src/app/api/api/inse-service.service.ts
@@ -17,29 +17,32 @@ import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
-import { AuthorsListResponse } from '../model/authorsListResponse';
+import { AuthorsListResponse } from '../model/authors-list-response';
// @ts-ignore
-import { HTTPValidationError } from '../model/hTTPValidationError';
+import { HTTPValidationError } from '../model/http-validation-error';
// @ts-ignore
import { Item } from '../model/item';
// @ts-ignore
-import { ItemCreate } from '../model/itemCreate';
+import { ItemCreate } from '../model/item-create';
// @ts-ignore
-import { ItemPage } from '../model/itemPage';
+import { ItemPage } from '../model/item-page';
// @ts-ignore
-import { PersonBio } from '../model/personBio';
+import { PersonBio } from '../model/person-bio';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
+import {
+ INSEServiceServiceInterface
+} from './inse-service.serviceInterface';
@Injectable({
providedIn: 'root'
})
-export class INSEServiceService extends BaseService {
+export class INSEServiceService extends BaseService implements INSEServiceServiceInterface {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
diff --git a/webapp/src/app/api/api/inse-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts
new file mode 100644
index 00000000..1326e650
--- /dev/null
+++ b/webapp/src/app/api/api/inse-service.serviceInterface.ts
@@ -0,0 +1,135 @@
+/**
+ * Innovation Search Engine API
+ *
+ *
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+import { HttpHeaders } from '@angular/common/http';
+
+import { Observable } from 'rxjs';
+
+import { AuthorsListResponse } from '../model/models';
+import { HTTPValidationError } from '../model/models';
+import { Item } from '../model/models';
+import { ItemCreate } from '../model/models';
+import { ItemPage } from '../model/models';
+import { PersonBio } from '../model/models';
+
+
+import { Configuration } from '../configuration';
+
+
+
+export interface INSEServiceServiceInterface {
+ defaultHeaders: HttpHeaders;
+ configuration: Configuration;
+
+ /**
+ * Adds a new item.
+ *
+ * @endpoint post /api/inse-service/items
+ * @param itemCreate
+ */
+ addItem(itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable- ;
+
+ /**
+ * Builds the topic hierarchy cache.
+ *
+ * @endpoint get /api/inse-service/topics/cache
+ * @param pageSize Page size for each search page.
+ * @param saveJson Persist cache JSON to data folder.
+ */
+ buildTopicCache(pageSize?: number, saveJson?: boolean, extraHttpRequestParams?: any): Observable