diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 00000000..8e7ed0c5 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,11 @@ +#!/bin/sh +FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g') +[ -z "$FILES" ] && exit 0 + +# Prettify all selected files +echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown --write + +# Add back the modified/prettified files to staging +echo "$FILES" | xargs git add + +exit 0 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 94df2f26..50b40718 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,7 @@ src/python/account/ node_modules/ angular-app/.angular -llm_evaluations/bio_generation/.venv +# Ignore sentence-transformer local model cache +service/sentence_transformer/models/ + +llm_evaluations/bio_generation/.venv \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 00000000..8b919b36 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,11 @@ +{ + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "semi": true, + "bracketSpacing": true, + "arrowParens": "always", + "trailingComma": "all", + "bracketSameLine": true, + "printWidth": 80 +} diff --git a/Jenkinsfile b/Jenkinsfile index 4af1befe..c0715dad 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,9 @@ pipeline { } stage('Save Docker image') { + when { + branch 'main' + } steps { sh 'docker save ${IMAGE_PREFIX}-app:${IMAGE_VERSION} | gzip > app-image.tar.gz' } diff --git a/README.md b/README.md index 6bf00309..0c7c8707 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ A minimal full-stack web application using Docker, Gradle, FastAPI and Angular. ## Build System: Gradle (Root) -| File | Purpose | -|------|---------| -| build.gradle | Root config defining Docker image name (`inse`), prefix, and version (`1.0.0`) | -| settings.gradle | Declares the three submodules: `:service`, `:webapp`, `:app` | -| libs.versions.toml | Centralized dependency version catalog | +| File | Purpose | +| ------------------ | ------------------------------------------------------------------------------ | +| build.gradle | Root config defining Docker image name (`inse`), prefix, and version (`1.0.0`) | +| settings.gradle | Declares the three submodules: `:service`, `:webapp`, `:app` | +| libs.versions.toml | Centralized dependency version catalog | Gradle orchestrates the entire build, including Docker image creation and the Angular frontend. @@ -26,36 +26,38 @@ Gradle orchestrates the entire build, including Docker image creation and the An A REST API running in Docker, exposing **three mounted FastAPI sub-applications**: -| Mount path | Description | -|---|---| -| `/inse-service` | Main resource API (items CRUD) | -| `/inse-webapp` | Serves the static Angular SPA | +| Mount path | Description | +| --------------- | ------------------------------------- | +| `/inse-service` | Main resource API (items CRUD) | +| `/inse-webapp` | Serves the static Angular SPA | | `/inse-account` | Authentication service (login/tokens) | ### Key source files in inse: -| File | Role | -|---|---| -| main.py | FastAPI app bootstrap, mounts the three sub-apps | -| service.py | CRUD REST endpoints for `Item` resources (GET, POST, PUT, DELETE), protected by JWT roles | -| model.py | Pydantic response models: `Item`, `ItemCreate`, `ItemPage` (generic pagination) | -| schema.py | SQLAlchemy ORM table definitions — `Item` table in SQLite | -| logic.py | Business logic layer (called by the service) | -| database.py | SQLAlchemy engine/session setup, reads from `config` | -| security.py | JWT decoding, `Principal` / `Account` models, role-based access via `roles_allowed()` | -| config.py | App settings via env vars prefixed `inse_` (DB URL, auth secret, feature flags) | -| webapp.py | Mounts the static Angular build as a `StaticFiles` app | -| util.py | Utility helpers (e.g. `raise_not_found_if_none`) | +| File | Role | +| ----------- | ----------------------------------------------------------------------------------------- | +| main.py | FastAPI app bootstrap, mounts the three sub-apps | +| service.py | CRUD REST endpoints for `Item` resources (GET, POST, PUT, DELETE), protected by JWT roles | +| model.py | Pydantic response models: `Item`, `ItemCreate`, `ItemPage` (generic pagination) | +| schema.py | SQLAlchemy ORM table definitions — `Item` table in SQLite | +| logic.py | Business logic layer (called by the service) | +| database.py | SQLAlchemy engine/session setup, reads from `config` | +| security.py | JWT decoding, `Principal` / `Account` models, role-based access via `roles_allowed()` | +| config.py | App settings via env vars prefixed `inse_` (DB URL, auth secret, feature flags) | +| webapp.py | Mounts the static Angular build as a `StaticFiles` app | +| util.py | Utility helpers (e.g. `raise_not_found_if_none`) | ### `account/` sub-package (account): Handles authentication independently: + - account/service.py — `POST /auth/id` (username+password → identity token) and `POST /auth/access` (ID token → access token) - account/logic.py — validates users from users.json - account/model.py — Pydantic models for `IdentityGrant`, `AccessGrant` - account/security.py — JWT signing ### Data & Config: + - users.json — Hardcoded user accounts (superadmin/user) - log-config.yaml — Logging configuration - entrypoint.sh — Docker entrypoint script @@ -69,20 +71,20 @@ An **Angular 18 SPA** using Angular Material, built with Node.js + Gradle. ### App structure in app: -| Directory/File | Role | -|---|---| -| app.routes.ts | Routes: `/login` → `AppLoginComponent`, `/items` → `ListItemComponent` (guarded), `**` → redirect to login | -| app.config.ts | Angular app bootstrap config (providers, interceptors) | -| `app-login/` | Login form component | -| `app-layout/` | Shell/layout wrapper component | -| `app-menu/` | Navigation menu component | -| `list-item/` | The main feature page — lists `Item` resources with pagination | -| `confirmation-dialog/` | Reusable dialog for destructive actions | -| `guards/` | Route guards: `user.guard.ts` (authenticated), `admin.guard.ts` (admin role) | -| `interceptors/` | authentication.interceptor.ts — attaches JWT Bearer token to all requests except auth endpoints | -| `services/` | api.service.ts (CRUD calls to `/inse-service`), `credential.service.ts` (token management), `pagination.service.ts` | -| `pipes/` | `truncate.pipe.ts` — truncates long strings in templates | -| `utils/` | Utility helpers | +| Directory/File | Role | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------- | +| app.routes.ts | Routes: `/login` → `AppLoginComponent`, `/items` → `ListItemComponent` (guarded), `**` → redirect to login | +| app.config.ts | Angular app bootstrap config (providers, interceptors) | +| `app-login/` | Login form component | +| `app-layout/` | Shell/layout wrapper component | +| `app-menu/` | Navigation menu component | +| `list-item/` | The main feature page — lists `Item` resources with pagination | +| `confirmation-dialog/` | Reusable dialog for destructive actions | +| `guards/` | Route guards: `user.guard.ts` (authenticated), `admin.guard.ts` (admin role) | +| `interceptors/` | authentication.interceptor.ts — attaches JWT Bearer token to all requests except auth endpoints | +| `services/` | api.service.ts (CRUD calls to `/inse-service`), `credential.service.ts` (token management), `pagination.service.ts` | +| `pipes/` | `truncate.pipe.ts` — truncates long strings in templates | +| `utils/` | Utility helpers | --- @@ -111,7 +113,6 @@ Browser **Auth flow**: The Angular interceptor calls `/inse-account/auth/id` with credentials → receives an ID token → exchanges it for an access JWT via `/inse-account/auth/access` → attaches the access token as `Authorization: Bearer` on all subsequent requests. The backend's security.py decodes and validates this JWT to enforce role-based access control (`SUPER_ADMIN`, `UNI_ADMIN`). - ## Prerequisites - Docker @@ -155,7 +156,22 @@ The app will be available at `http://localhost:8080/inse-webapp/`. Defined in `service/src/data/users.json`: -| Username | Password | Role | -|-------------|-------------|-------------| -| superadmin | superadmin | SUPER_ADMIN | -| user | user | UNI_ADMIN | \ No newline at end of file +| Username | Password | Role | +| ---------- | ---------- | ----------- | +| superadmin | superadmin | SUPER_ADMIN | +| user | user | UNI_ADMIN | + +## Prettier pre-commit hook + +- Install Prettier + +```bash +npm install +``` + +- To enable automatic code formatting with Prettier on commit, copy the pre-commit hook script to the Git hooks directory and make it executable: + +```shell +cp .githooks/pre-commit .git/hooks/pre-commit +chmod +x .git/hooks/pre-commit +``` diff --git a/openalex_ude_hr_sample.csv b/openalex_ude_hr_sample.csv new file mode 100644 index 00000000..807b8407 --- /dev/null +++ b/openalex_ude_hr_sample.csv @@ -0,0 +1,1360 @@ +openalex_author_id,openalex_source_id,display_name,orcid,works_count,cited_by_count,institution_scope,matching_institution,company_count,roles,statuses,common_name_warning,warning_de +A5040796987,https://openalex.org/A5040796987,Ahmet Karkar,https://orcid.org/0000-0003-3338-5202,3,30,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5119657791,https://openalex.org/A5119657791,Aleksandar Milosevic,,1,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5114121778,https://openalex.org/A5114121778,Alexander Eitner,,1,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5038673553,https://openalex.org/A5038673553,Alexander Hoppe,https://orcid.org/0000-0001-6710-788X,29,142,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5048333515,https://openalex.org/A5048333515,Alexander Porsch,,4,27,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5086212982,https://openalex.org/A5086212982,Alexander Possberg,https://orcid.org/0000-0002-9149-1938,11,33,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5042180141,https://openalex.org/A5042180141,Alexander Weitz,,7,234,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5015160914,https://openalex.org/A5015160914,Alexandra Beckmann,,1,87,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5006118048,https://openalex.org/A5006118048,Alexandra Heinrich,,4,21,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5102559736,https://openalex.org/A5102559736,Alina Becker,,1,5,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5095550948,https://openalex.org/A5095550948,Andrea Budde,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5041659654,https://openalex.org/A5041659654,Andrea Kiesewetter,https://orcid.org/0000-0002-7805-9294,1,12,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5094255071,https://openalex.org/A5094255071,Andrea van Wasen,,1,13,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5082709720,https://openalex.org/A5082709720,Andreas Clément,,9,0,child_of_ude,Institut für Energie- und Umwelttechnik,1,Prokurist:1,removed:1,no, +A5123856046,https://openalex.org/A5123856046,Andreas Metzger,,2,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5124394183,https://openalex.org/A5124394183,Andreas Metzger,,1,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5102482202,https://openalex.org/A5102482202,Andreas Mueller,,2,78,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5111642526,https://openalex.org/A5111642526,Andreas Mueller,,2,17,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5055408774,https://openalex.org/A5055408774,Andreas Ranft,https://orcid.org/0000-0003-4424-7569,151,3148,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5121527342,https://openalex.org/A5121527342,Andreas Ranft,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5040303703,https://openalex.org/A5040303703,Andreas Scharff,,22,435,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5045510897,https://openalex.org/A5045510897,Andreas Smolka,,1,24,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1,removed:1,no, +A5000133541,https://openalex.org/A5000133541,Andreas Tacke,,2,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5050109106,https://openalex.org/A5050109106,Andreas Unterberger,https://orcid.org/0000-0002-5216-1514,22,279,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2; Prokurist:2,currently registered:1,no, +A5070284444,https://openalex.org/A5070284444,Andreas Wohlleben,,1,52,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1,currently registered:1,no, +A5043288842,https://openalex.org/A5043288842,Andrey Krekhov,https://orcid.org/0000-0003-0637-6263,33,335,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5045504111,https://openalex.org/A5045504111,Anette Reinders,,1,52,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5024125758,https://openalex.org/A5024125758,Angelika Pietsch,,17,1452,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5128214934,https://openalex.org/A5128214934,Anh Duc Vu,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5052830111,https://openalex.org/A5052830111,Anita Winter,,48,550,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5021812220,https://openalex.org/A5021812220,Anja Stecker,,1,12,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5078754334,https://openalex.org/A5078754334,Anja Stein,https://orcid.org/0000-0002-0497-4609,125,1780,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5000474957,https://openalex.org/A5000474957,Anke Kramer,,2,14,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5029441982,https://openalex.org/A5029441982,Anna Michel,https://orcid.org/0000-0003-1420-5878,40,1684,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5111354878,https://openalex.org/A5111354878,Anna Volz,https://orcid.org/0000-0003-0444-1893,30,127,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5023261750,https://openalex.org/A5023261750,Anna Zeller,,1,27,direct_ude,University of Duisburg-Essen,1,Inhaber:2,currently registered:1,no, +A5106082671,https://openalex.org/A5106082671,Anne Pfeiffer,,1,29,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5110587738,https://openalex.org/A5110587738,Annette Förster,,50,76,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5076856973,https://openalex.org/A5076856973,Annika Becker,https://orcid.org/0000-0003-2374-6502,4,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5055641653,https://openalex.org/A5055641653,Annika Lenkeit,https://orcid.org/0000-0002-9698-4723,13,95,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5113291297,https://openalex.org/A5113291297,Anto Filipovic,,1,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5078752887,https://openalex.org/A5078752887,Arne Sönnichsen,https://orcid.org/0000-0002-4921-3758,13,10,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5103427814,https://openalex.org/A5103427814,Barbara Vogt,,1,3,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5123684310,https://openalex.org/A5123684310,Bastian Wegner,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5003893010,https://openalex.org/A5003893010,Beate Römer,,3,46,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5007119880,https://openalex.org/A5007119880,Benedikt Frank,https://orcid.org/0000-0001-8837-9489,123,1863,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5020852620,https://openalex.org/A5020852620,Benjamin Kersten,,2,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5048760511,https://openalex.org/A5048760511,Benjamin Scheller,,3,14,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Prokurist:1,currently registered:1,no, +A5128122987,https://openalex.org/A5128122987,Bernd Ringel,,1,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5040027495,https://openalex.org/A5040027495,Bernd Schultze,,26,107,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5047506887,https://openalex.org/A5047506887,Bettina Binder,,3,101,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5099050002,https://openalex.org/A5099050002,Bianca Nowak,https://orcid.org/0000-0001-5858-6735,6,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5008086801,https://openalex.org/A5008086801,Bianca Reitberger,,1,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5042450540,https://openalex.org/A5042450540,Birgit Kremer,,7,9,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5058122544,https://openalex.org/A5058122544,Birgit Maranca-Hüwel,,1,7,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5094640509,https://openalex.org/A5094640509,Brigitte Mai,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5062262517,https://openalex.org/A5062262517,Brunhilde Krüger,,4,77,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5090497666,https://openalex.org/A5090497666,Bruno Albrecht,,13,309,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5109563230,https://openalex.org/A5109563230,Bruno Schramm,,3,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5040325392,https://openalex.org/A5040325392,Carina Büttner,,3,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5117488673,https://openalex.org/A5117488673,Carl Barthel,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5038023543,https://openalex.org/A5038023543,Carsten Hohendorf,,3,38,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5079004093,https://openalex.org/A5079004093,Carsten Seeger,,2,38,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5077645687,https://openalex.org/A5077645687,Cemal Öztürk,https://orcid.org/0000-0003-3607-1356,52,340,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5127327286,https://openalex.org/A5127327286,Cemal Öztürk,,5,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5061307187,https://openalex.org/A5061307187,Charlotte Rudolph,https://orcid.org/0000-0001-9060-8850,18,141,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2; Liquidator:1,removed:1,no, +A5049180230,https://openalex.org/A5049180230,Christian Fehring,,2,112,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5087346407,https://openalex.org/A5087346407,Christian Heid,https://orcid.org/0000-0003-3344-6909,16,402,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5020001154,https://openalex.org/A5020001154,Christian Högel,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5009387190,https://openalex.org/A5009387190,Christian Jenne,,4,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5119533775,https://openalex.org/A5119533775,Christian Mütze,,1,0,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5084543947,https://openalex.org/A5084543947,Christian Stienen,,20,54,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5121031569,https://openalex.org/A5121031569,Christian Taube,,4,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5017500482,https://openalex.org/A5017500482,Christian Wiethoff,,7,105,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5012023718,https://openalex.org/A5012023718,Christiane Jürgens,,5,7,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5080114872,https://openalex.org/A5080114872,Christiane Lübke,,31,288,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5058580008,https://openalex.org/A5058580008,Christine Heil,https://orcid.org/0009-0000-5232-6924,7,2,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5122756265,https://openalex.org/A5122756265,Christof Schulz,,3,0,direct_ude,University of Duisburg-Essen,1,Prokurist:2; Geschäftsführer:1,currently registered:1,no, +A5113697261,https://openalex.org/A5113697261,Christoph Hassel,,5,138,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:3,currently registered:1,no, +A5012658572,https://openalex.org/A5012658572,Christoph Katzer,,3,90,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5056018215,https://openalex.org/A5056018215,Christoph Warnecke,,2,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5071643310,https://openalex.org/A5071643310,Christoph Wotzlaw,,23,1531,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5029514013,https://openalex.org/A5029514013,Christoph Wölper,,1126,4801,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5047171248,https://openalex.org/A5047171248,Christopher Eckert,,14,152,direct_ude,University of Duisburg-Essen,1,Prokurist:2; Geschäftsführer:1,currently registered:1,no, +A5091701081,https://openalex.org/A5091701081,Christopher Kruse,https://orcid.org/0000-0001-8490-8363,9,59,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5056320023,https://openalex.org/A5056320023,Christopher Schroeder,https://orcid.org/0000-0002-9283-3012,105,2301,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5108151622,https://openalex.org/A5108151622,Christopher Schroeder,,3,226,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5126942232,https://openalex.org/A5126942232,Claudia Graser,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5046218941,https://openalex.org/A5046218941,Claudia Lenzen,,4,127,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5062074938,https://openalex.org/A5062074938,Claudia Padberg,https://orcid.org/0000-0002-2475-1525,6,90,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5043039034,https://openalex.org/A5043039034,Claudia Pieper,https://orcid.org/0000-0001-5986-9788,35,371,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5017886365,https://openalex.org/A5017886365,Claudia Veltkamp,,2,33,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5068914203,https://openalex.org/A5068914203,Claudia Veltkamp,,25,2419,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5085149735,https://openalex.org/A5085149735,Daniel Brandenburger,,8,35,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5058208716,https://openalex.org/A5058208716,Daniel Kilimann,,3,10,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5050883082,https://openalex.org/A5050883082,Daniel Sacher,,21,222,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5043673838,https://openalex.org/A5043673838,Daniel Sager,,4,154,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5065290634,https://openalex.org/A5065290634,Daniela Freyer,,2,66,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5101998061,https://openalex.org/A5101998061,David Schuster,https://orcid.org/0000-0003-4868-7107,82,212,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5016239306,https://openalex.org/A5016239306,Dennis Dreyer,,1,92,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1,currently registered:1,no, +A5024576582,https://openalex.org/A5024576582,Diana Lindner,https://orcid.org/0000-0001-5477-769X,117,4555,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5113506669,https://openalex.org/A5113506669,Dieter Hoffmeister,,1,27,direct_ude,University of Duisburg-Essen,1,Inhaber:1,removed:1,no, +A5057831135,https://openalex.org/A5057831135,Dietmar Knop,,17,563,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5069955866,https://openalex.org/A5069955866,Dietmar Lohmann,https://orcid.org/0000-0002-2624-9889,313,11546,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5045510904,https://openalex.org/A5045510904,Dirk Straub,,3,3,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5070772777,https://openalex.org/A5070772777,Dominic Winter,https://orcid.org/0000-0001-6788-6641,105,3612,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5008449217,https://openalex.org/A5008449217,Dominik Raab,https://orcid.org/0000-0003-4514-1053,25,38,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5020803751,https://openalex.org/A5020803751,Dominik Reiner,https://orcid.org/0000-0002-9255-3686,4,67,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5107653304,https://openalex.org/A5107653304,Doris Brandt,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5101478947,https://openalex.org/A5101478947,Ekaterina Morozova,https://orcid.org/0009-0001-1024-512X,35,193,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2; Liquidator:1,removed:1,no, +A5114144035,https://openalex.org/A5114144035,Elisabeth Funk,,2,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5026676335,https://openalex.org/A5026676335,Enno Lohmann,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5038704518,https://openalex.org/A5038704518,Erik Lange,,3,15,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5045815179,https://openalex.org/A5045815179,Erwin Amann,https://orcid.org/0000-0001-6396-2061,79,464,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5117255976,https://openalex.org/A5117255976,Erwin Amann,,3,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5117255984,https://openalex.org/A5117255984,Erwin Amann,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5005872032,https://openalex.org/A5005872032,Eva Koch,,4,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5050141868,https://openalex.org/A5050141868,Eva Overfeld,,1,20,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5039035463,https://openalex.org/A5039035463,Eva Ziegler,,2,20,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5000766657,https://openalex.org/A5000766657,Fabian Hübner,,2,5,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1,removed:1,no, +A5004725011,https://openalex.org/A5004725011,Fabian Lutz,,3,17,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5000166770,https://openalex.org/A5000166770,Fawad Sheikh,https://orcid.org/0000-0003-4112-5988,66,577,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5062848747,https://openalex.org/A5062848747,Felix Meurer,,5,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5101894409,https://openalex.org/A5101894409,Feng Zheng,https://orcid.org/0000-0002-9031-5043,83,837,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5045333748,https://openalex.org/A5045333748,Florian Blum,https://orcid.org/0000-0002-2307-2387,16,151,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5089485313,https://openalex.org/A5089485313,Florian Stehling,https://orcid.org/0000-0002-2417-2048,157,2194,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5037918949,https://openalex.org/A5037918949,Frank Bonin,,8,1213,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5059162112,https://openalex.org/A5059162112,Frank Kensy,,33,1425,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5041417063,https://openalex.org/A5041417063,Frank Liepold,,2,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5073457797,https://openalex.org/A5073457797,Frank Saßmannshausen,,1,11,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5090814925,https://openalex.org/A5090814925,Frank Schreier,,6,90,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5011988694,https://openalex.org/A5011988694,Frank Stock,,3,177,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5085471055,https://openalex.org/A5085471055,Franz-Josef Schumacher,,12,162,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5104724077,https://openalex.org/A5104724077,Frederik Hamm,https://orcid.org/0009-0002-2482-9916,7,56,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5112848045,https://openalex.org/A5112848045,Friederike Schmidt,,84,877,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5077223798,https://openalex.org/A5077223798,Friedrich Waag,,22,1043,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5004249555,https://openalex.org/A5004249555,Gabriel Gomez,https://orcid.org/0000-0003-1917-8768,33,260,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5040165911,https://openalex.org/A5040165911,Gabriele Gauß,,15,116,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5027843014,https://openalex.org/A5027843014,Gaby Herrmann,,14,213,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5070896019,https://openalex.org/A5070896019,Georg Hennecke,,2,12,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:2,currently registered:1,no, +A5105675784,https://openalex.org/A5105675784,Gerhard Bösch,https://orcid.org/0000-0002-7629-985X,421,3209,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5002241289,https://openalex.org/A5002241289,Gerhard Rapp,,4,10,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5060415016,https://openalex.org/A5060415016,Günther Hilger,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5076616002,https://openalex.org/A5076616002,Halil-Ibrahim Karadag,,3,17,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5111945828,https://openalex.org/A5111945828,Hans Dieter Sitz,,2,54,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5017865330,https://openalex.org/A5017865330,Hans Rupp,,33,277,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5036866194,https://openalex.org/A5036866194,Hans-Christian Schnack,,2,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5090778840,https://openalex.org/A5090778840,Hans-Jörg Köhler,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5081070872,https://openalex.org/A5081070872,Harald Sanders,,3,28,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5030236051,https://openalex.org/A5030236051,Harpreet Kaur,https://orcid.org/0009-0006-3209-0890,164,1545,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5087755476,https://openalex.org/A5087755476,Hauke Springer,https://orcid.org/0000-0002-4288-6431,161,6647,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5080797073,https://openalex.org/A5080797073,Heidi Meyer,,7,5,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:2,currently registered:1,no, +A5080795837,https://openalex.org/A5080795837,Heike Hesse,https://orcid.org/0000-0002-8398-2518,26,143,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5076442919,https://openalex.org/A5076442919,Heike Heuer,https://orcid.org/0000-0001-7094-6959,186,5774,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5064670118,https://openalex.org/A5064670118,Heinz Kaminski,,88,2400,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:1,currently registered:1,no, +A5067868124,https://openalex.org/A5067868124,Helmut Breier,,2,10,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5109552942,https://openalex.org/A5109552942,Hendrik Schäfer,,5,8,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5020103124,https://openalex.org/A5020103124,Henrik Hanke,,7,9,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5118899748,https://openalex.org/A5118899748,Henrik Schneider,https://orcid.org/0009-0002-5072-5758,389,68,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5061706562,https://openalex.org/A5061706562,Herbert Marschall,,10,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5093728336,https://openalex.org/A5093728336,Horst Tonn,,1,0,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5047671213,https://openalex.org/A5047671213,Hubertus von Stein,,2,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5017272004,https://openalex.org/A5017272004,Ina Schumann,,1,17,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5088398932,https://openalex.org/A5088398932,Irmgard Winkels,,4,16,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5061578974,https://openalex.org/A5061578974,Isabelle Kraft,,3,19,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5071231662,https://openalex.org/A5071231662,Israa Al-Qaysi,,4,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5066538226,https://openalex.org/A5066538226,Ivan Radev,https://orcid.org/0000-0002-3895-6871,60,799,child_of_ude,The Hydrogen and Fuel Cell Center,1,Geschäftsführer:2,removed:1,no, +A5128575435,https://openalex.org/A5128575435,Ivan Radev,,1,0,child_of_ude,The Hydrogen and Fuel Cell Center,1,Geschäftsführer:2,removed:1,no, +A5128676335,https://openalex.org/A5128676335,Ivan Radev,,1,0,child_of_ude,The Hydrogen and Fuel Cell Center,1,Geschäftsführer:2,removed:1,no, +A5068780119,https://openalex.org/A5068780119,Ivana Radulovic,https://orcid.org/0000-0003-4949-6011,3,30,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5057279620,https://openalex.org/A5057279620,Jacqueline Hassel,,6,8,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5004726913,https://openalex.org/A5004726913,Jan Gehrmann,,1,30,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5110748857,https://openalex.org/A5110748857,Jan Martini,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5114492513,https://openalex.org/A5114492513,Jan Siefert,,1,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5118574914,https://openalex.org/A5118574914,Jan Siefert,,1,0,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5108666196,https://openalex.org/A5108666196,Janine Biermann,,37,536,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5008876995,https://openalex.org/A5008876995,Jelka Müller,,1,55,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5036054187,https://openalex.org/A5036054187,Jennifer Klatt,,13,299,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5072503343,https://openalex.org/A5072503343,Jennifer Schäfer,,6,51,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5005916878,https://openalex.org/A5005916878,Jens Leber,https://orcid.org/0009-0004-3369-9310,8,7,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,removed:1,no, +A5070743643,https://openalex.org/A5070743643,Jens Leister,,1,46,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5019237165,https://openalex.org/A5019237165,Jens Voskuhl,https://orcid.org/0000-0002-9612-2306,191,2824,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5039380118,https://openalex.org/A5039380118,Jessica Wagner,,34,1379,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:3,currently registered:1,no, +A5065950441,https://openalex.org/A5065950441,Joachim Felix,,2,64,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5093010306,https://openalex.org/A5093010306,Jochen Laub,,1,2,child_of_ude,Institute for Advanced Study in the Humanities Essen,1,Geschäftsführer:2; Liquidator:1,currently registered:1,no, +A5052002212,https://openalex.org/A5052002212,Jochen Schiemann,,8,123,child_of_ude,Institut für Energie- und Umwelttechnik,1,Liquidator:1,removed:1,no, +A5039240740,https://openalex.org/A5039240740,Jochen Welker,,1,6,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5070209669,https://openalex.org/A5070209669,Johanna Christina Czeschik,https://orcid.org/0000-0002-9254-0084,29,1692,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5048923333,https://openalex.org/A5048923333,Johannes Fuß,https://orcid.org/0000-0003-0445-5021,143,3507,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5120144706,https://openalex.org/A5120144706,Johannes Fuß,,4,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5129542229,https://openalex.org/A5129542229,Johannes Fuß,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5112955990,https://openalex.org/A5112955990,Johannes Kubacki,,1,4,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5092455758,https://openalex.org/A5092455758,Johannes Morzeck,,3,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5032636758,https://openalex.org/A5032636758,Johannes Tiemer,,1,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5062591501,https://openalex.org/A5062591501,Jonas Dorlöchter,,2,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5049096789,https://openalex.org/A5049096789,Jonas Schäfer,,4,75,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5013982747,https://openalex.org/A5013982747,Julia Kotte,,3,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5104300770,https://openalex.org/A5104300770,Julia Specht,,3,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5037354453,https://openalex.org/A5037354453,Julia Wiedmann,,4,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5010618332,https://openalex.org/A5010618332,Julian Börner,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5048272221,https://openalex.org/A5048272221,Julian Friedrich,https://orcid.org/0000-0003-1364-4596,17,222,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Prokurist:1,currently registered:1,no, +A5071196344,https://openalex.org/A5071196344,Julian Klein,https://orcid.org/0000-0003-2349-6953,14,555,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5049967267,https://openalex.org/A5049967267,Juliane Hauschild,,2,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5030302430,https://openalex.org/A5030302430,Jutta Langer,,1,26,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5038720735,https://openalex.org/A5038720735,Jörg Uhlemann,https://orcid.org/0000-0001-9542-7055,57,420,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Prokurist:1,currently registered:1,no, +A5056682397,https://openalex.org/A5056682397,Jörg Wissler,https://orcid.org/0000-0002-2099-2444,15,59,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5024741328,https://openalex.org/A5024741328,Jürgen Turek,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5071760917,https://openalex.org/A5071760917,Karin Kress,,2,0,direct_ude,University of Duisburg-Essen,1,Prokurist:2,removed:1,no, +A5013765314,https://openalex.org/A5013765314,Katharina Nebel,,25,690,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5050045690,https://openalex.org/A5050045690,Kathrin Bischof,,2,12,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5073438747,https://openalex.org/A5073438747,Katrin Moses,,7,914,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5027732212,https://openalex.org/A5027732212,Kerstin Heise,,11,428,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5016450244,https://openalex.org/A5016450244,Kerstin Linke,,2,20,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5020366724,https://openalex.org/A5020366724,Kerstin Schiffer,,2,2,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5016337319,https://openalex.org/A5016337319,Kira Schmidt,https://orcid.org/0000-0002-2308-509X,20,144,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5036108521,https://openalex.org/A5036108521,Konrad Mueller,,14,493,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5071311431,https://openalex.org/A5071311431,Kurt Retter,,1,0,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5013704112,https://openalex.org/A5013704112,Lars Großmann,,15,549,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5093724216,https://openalex.org/A5093724216,Lars Mohren,,2,6,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5094240143,https://openalex.org/A5094240143,Lars Mohren,https://orcid.org/0009-0002-8990-7487,3,32,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5060428160,https://openalex.org/A5060428160,Lars Pape,https://orcid.org/0000-0002-3635-6418,396,8930,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5114129179,https://openalex.org/A5114129179,Lars Pape,,2,3,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5014404906,https://openalex.org/A5014404906,Laura Beutel,,4,4,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5065808255,https://openalex.org/A5065808255,Lena Zimmer,,1,26,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5066702983,https://openalex.org/A5066702983,Leoni Bussmann,,3,14,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5121364042,https://openalex.org/A5121364042,Li Song,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5056185884,https://openalex.org/A5056185884,Lina Philipp,,1,2,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5009329425,https://openalex.org/A5009329425,Linda Sauter,,3,653,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5108670181,https://openalex.org/A5108670181,Lisa Kroll,,2,200,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5024649380,https://openalex.org/A5024649380,Lisa Richter,,14,124,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5103009677,https://openalex.org/A5103009677,Lisa Walter,https://orcid.org/0000-0003-3453-1304,11,169,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5118565942,https://openalex.org/A5118565942,Lisa Walter,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5064923908,https://openalex.org/A5064923908,Lisa Zimmer,https://orcid.org/0000-0002-3680-3521,376,20577,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5126334393,https://openalex.org/A5126334393,Lisa Zimmer,,17,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5066213830,https://openalex.org/A5066213830,Lothar Wefers,,3,20,child_of_ude,Deutsches Textilforschungszentrum Nord-West,1,Geschäftsführer:1,currently registered:1,no, +A5093091778,https://openalex.org/A5093091778,Lucas Schulz,,2,2,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5098906756,https://openalex.org/A5098906756,Lukas Höptner,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5064434141,https://openalex.org/A5064434141,Maic Masuch,https://orcid.org/0000-0002-7965-6269,135,2233,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5126271856,https://openalex.org/A5126271856,Maic Masuch,,5,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5114071897,https://openalex.org/A5114071897,Maik Arnold,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5078750152,https://openalex.org/A5078750152,Maik Dreyer,https://orcid.org/0000-0001-8158-3946,17,241,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5036867308,https://openalex.org/A5036867308,Maike Reinders,,3,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5053746965,https://openalex.org/A5053746965,Maike Uhlig,,1,35,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5057673751,https://openalex.org/A5057673751,Mandy Sander,https://orcid.org/0000-0003-3335-6217,15,195,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5113171169,https://openalex.org/A5113171169,Manfred Jensen,,49,1236,direct_ude,University of Duisburg-Essen,1,Liquidator:1,currently registered:1,no, +A5068530955,https://openalex.org/A5068530955,Manja Jonas,,8,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5047587792,https://openalex.org/A5047587792,Marc Bosse,,5,21,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5054058904,https://openalex.org/A5054058904,Marc Hitzke,,2,49,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5113907885,https://openalex.org/A5113907885,Marcel Rohde,,2,3,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5005068080,https://openalex.org/A5005068080,Marcel Wöllbrink,,2,20,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5019879976,https://openalex.org/A5019879976,Marcin Krawczyk,https://orcid.org/0000-0002-0113-0777,574,7435,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5049534528,https://openalex.org/A5049534528,Marco Russ,,5,59,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5007170803,https://openalex.org/A5007170803,Marcus Handte,https://orcid.org/0000-0003-4054-1306,107,843,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5079117291,https://openalex.org/A5079117291,Maren Schulze,https://orcid.org/0000-0002-4577-6473,58,1306,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5033725849,https://openalex.org/A5033725849,Marion Gallus,,4,88,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5079458733,https://openalex.org/A5079458733,Marion Lindner,https://orcid.org/0000-0002-4689-8659,28,274,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5024781039,https://openalex.org/A5024781039,Marius Reinders,,2,113,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:2,currently registered:1,no, +A5110087827,https://openalex.org/A5110087827,Mark Bormann,,1,54,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5058616263,https://openalex.org/A5058616263,Markus Feurstein,,72,1273,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5073381146,https://openalex.org/A5073381146,Markus Großweischede,,9,10,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5008210663,https://openalex.org/A5008210663,Markus Kuepper,,7,75,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5001509958,https://openalex.org/A5001509958,Marten Clausen,,35,492,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5049699371,https://openalex.org/A5049699371,Martin Braunersreuther,,1,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5001167896,https://openalex.org/A5001167896,Martin Glas,https://orcid.org/0000-0003-3167-3403,450,6081,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5013459956,https://openalex.org/A5013459956,Martin Goeke,https://orcid.org/0000-0003-1026-8716,21,55,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5057981860,https://openalex.org/A5057981860,Martin Heisler,,8,133,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5078670601,https://openalex.org/A5078670601,Martin Kowalski,,5,12,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5050989539,https://openalex.org/A5050989539,Martin Mackowiak,,2,120,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5110936047,https://openalex.org/A5110936047,Martin Pelzer,,2,53,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5074197647,https://openalex.org/A5074197647,Martin Rosenkranz,,5,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5100167482,https://openalex.org/A5100167482,Martin Schlosser,,1,0,child_of_ude,Institute for Advanced Study in the Humanities Essen,1,Prokurist:1,currently registered:1,no, +A5106679393,https://openalex.org/A5106679393,Martina Velten,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5067906488,https://openalex.org/A5067906488,Matthias Czerwonka,,3,16,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5078302132,https://openalex.org/A5078302132,Matthias Stüwe,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5006138482,https://openalex.org/A5006138482,Max Frei,https://orcid.org/0000-0001-8992-7205,17,207,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5055234849,https://openalex.org/A5055234849,Maximilian Petri,https://orcid.org/0000-0002-1424-2815,27,1510,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5081973623,https://openalex.org/A5081973623,Mehmet Sanlialp,https://orcid.org/0000-0003-1159-1427,16,754,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5104045857,https://openalex.org/A5104045857,Melanie Baumann,,21,286,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5087645890,https://openalex.org/A5087645890,Melanie Kaufmann,,1,5,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5062241567,https://openalex.org/A5062241567,Michael Beißwenger,https://orcid.org/0000-0001-9442-5402,101,807,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5105097515,https://openalex.org/A5105097515,Michael Beißwenger,,7,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5080063285,https://openalex.org/A5080063285,Michael Ehrmann,https://orcid.org/0000-0002-1927-260X,354,20372,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5108960748,https://openalex.org/A5108960748,Michael Ehrmann,,3,1,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5034866368,https://openalex.org/A5034866368,Michael Eisinger,,16,252,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5057021245,https://openalex.org/A5057021245,Michael Lorke,https://orcid.org/0000-0002-9716-855X,121,2558,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5128167886,https://openalex.org/A5128167886,Michael Lorke,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5006409004,https://openalex.org/A5006409004,Michael Michalski,,2,10,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5015834718,https://openalex.org/A5015834718,Michael Neurath,,3,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5013942006,https://openalex.org/A5013942006,Michael Noweski,https://orcid.org/0000-0002-7113-9320,29,58,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5011767928,https://openalex.org/A5011767928,Michael Pingen,,4,25,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5015241303,https://openalex.org/A5015241303,Michael Siebers,https://orcid.org/0000-0003-1891-3572,54,463,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5120585934,https://openalex.org/A5120585934,Michael Siebers,https://orcid.org/0000-0002-1400-2176,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5041200016,https://openalex.org/A5041200016,Michael Wagenknecht,,5,0,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5054232482,https://openalex.org/A5054232482,Michael Wohlgemuth,,4,101,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5088820865,https://openalex.org/A5088820865,Michelle Kulbatzki,,1,20,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5064463286,https://openalex.org/A5064463286,Ming Sun,https://orcid.org/0000-0002-6416-312X,87,1147,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5047402970,https://openalex.org/A5047402970,Mirco Kaponig,,2,66,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5107202957,https://openalex.org/A5107202957,Miriam Schilling,,4,1,direct_ude,University of Duisburg-Essen,1,Liquidator:1,currently registered:1,no, +A5115559958,https://openalex.org/A5115559958,Mohamed Hassoun,,2,5,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5090678919,https://openalex.org/A5090678919,Mohammed Youssef,,1,16,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5034793612,https://openalex.org/A5034793612,Monika Hardt,,7,61,direct_ude,University of Duisburg-Essen,1,Inhaber:2,removed:1,no, +A5044829228,https://openalex.org/A5044829228,Monika Rogge,,7,81,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5069356501,https://openalex.org/A5069356501,Muhammad Asif,https://orcid.org/0000-0002-6944-5214,6,60,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5037609071,https://openalex.org/A5037609071,Nadine Coym,,1,10,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5103228465,https://openalex.org/A5103228465,Nadine Schroeder,https://orcid.org/0000-0003-0909-9572,2,25,direct_ude,University of Duisburg-Essen,1,Inhaber:1,removed:1,no, +A5110970122,https://openalex.org/A5110970122,Nadine Schroeder,,4,47,direct_ude,University of Duisburg-Essen,1,Inhaber:1,removed:1,no, +A5053960816,https://openalex.org/A5053960816,Natalie Wolff,,8,106,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5005921146,https://openalex.org/A5005921146,Nico Koch,,3,20,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5127359118,https://openalex.org/A5127359118,Nico Schreiber,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5126212355,https://openalex.org/A5126212355,Nico Schwarz,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5079749161,https://openalex.org/A5079749161,Nicole Hülsmann,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5015620831,https://openalex.org/A5015620831,Nicole Lewandowski,,16,930,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5013799951,https://openalex.org/A5013799951,Nikolai Fischer,,1,15,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5112613860,https://openalex.org/A5112613860,Nils Dieckmann,,5,18,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5068650603,https://openalex.org/A5068650603,Nils Hartmann,https://orcid.org/0000-0001-6804-514X,93,1333,direct_ude,University of Duisburg-Essen,1,Persönlich haftender Gesellschafter:1,currently registered:1,no, +A5048433515,https://openalex.org/A5048433515,Nina Winkler,,2,32,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5062473614,https://openalex.org/A5062473614,Nora Meyer,,2,4,child_of_ude,Institute for Advanced Study in the Humanities Essen,1,Geschäftsführer:1,currently registered:1,no, +A5017423020,https://openalex.org/A5017423020,Norbert Fröhler,,40,50,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5012071823,https://openalex.org/A5012071823,Norbert Runge,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5009985094,https://openalex.org/A5009985094,Norbert Schwab,,2,3,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5014326133,https://openalex.org/A5014326133,Olaf Wiesner,,71,2681,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5108364487,https://openalex.org/A5108364487,Oliver Woll,,1,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5107158979,https://openalex.org/A5107158979,Onur Keskin,,1,2,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5017974502,https://openalex.org/A5017974502,Patrick Clasen,https://orcid.org/0000-0002-5804-2057,3,9,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5102793926,https://openalex.org/A5102793926,Patrick Urban,https://orcid.org/0000-0003-1051-5086,2,15,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5039495249,https://openalex.org/A5039495249,Paul Mauer,,11,5,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5036166423,https://openalex.org/A5036166423,Peter Czerner,,6,121,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5062834348,https://openalex.org/A5062834348,Peter Englisch,,2,0,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5061591858,https://openalex.org/A5061591858,Peter Faupel,,8,38,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5050784184,https://openalex.org/A5050784184,Peter Hüsken,,4,21,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5034367329,https://openalex.org/A5034367329,Peter Sutter,,2,46,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5016091481,https://openalex.org/A5016091481,Petra Mersmann,,8,727,child_of_ude,Deutsches Textilforschungszentrum Nord-West,1,Geschäftsführer:1,currently registered:1,no, +A5083616686,https://openalex.org/A5083616686,Petra Wyrowski,,1,55,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5108471127,https://openalex.org/A5108471127,Philip Vogel,,10,120,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5127716714,https://openalex.org/A5127716714,Philipp Jansen,,1,0,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5101606624,https://openalex.org/A5101606624,Ping Zhou,https://orcid.org/0000-0003-3837-8458,338,7011,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5123782002,https://openalex.org/A5123782002,Ping Zhou,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5089821209,https://openalex.org/A5089821209,Ralf Flassenberg,,1,24,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5007200360,https://openalex.org/A5007200360,Ralf Maibaum,,1,372,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2; Prokurist:2,currently registered:1,no, +A5028172633,https://openalex.org/A5028172633,Ralf Reißmann,,5,12,direct_ude,University of Duisburg-Essen,1,Prokurist:2; Geschäftsführer:1,currently registered:1,no, +A5112890667,https://openalex.org/A5112890667,Regina König,,3,2,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5053507266,https://openalex.org/A5053507266,Regina Schleicher,,18,1,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5029651565,https://openalex.org/A5029651565,Robert Marks,https://orcid.org/0000-0002-8196-8114,15,203,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5109458583,https://openalex.org/A5109458583,Robert Potthoff,,5,118,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5025407978,https://openalex.org/A5025407978,Robin Sprenger,,11,4,direct_ude,University of Duisburg-Essen,1,Inhaber:1,removed:1,no, +A5065126328,https://openalex.org/A5065126328,Roland Broll,https://orcid.org/0000-0002-9223-8141,3,47,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5011282396,https://openalex.org/A5011282396,Rolf Moeller,,3,7,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5064030128,https://openalex.org/A5064030128,Sabine Erkens,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5060940363,https://openalex.org/A5060940363,Sabine Schramm,,27,864,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5102793521,https://openalex.org/A5102793521,Sarah Hofmann,,7,24,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:3,currently registered:1,no, +A5101692938,https://openalex.org/A5101692938,Sarah Schmid,https://orcid.org/0000-0002-2392-7234,27,632,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2; Liquidator:1,currently registered:1,no, +A5012945966,https://openalex.org/A5012945966,Sarah Tillmann,,2,52,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5018830497,https://openalex.org/A5018830497,Sascha Lang,https://orcid.org/0000-0001-6850-0464,7,126,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5103336903,https://openalex.org/A5103336903,Sascha Lang,,1,8,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5062425859,https://openalex.org/A5062425859,Sascha Nolte,,1,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5039669109,https://openalex.org/A5039669109,Saskia Schmidt,https://orcid.org/0000-0001-8043-7912,4,29,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5030054874,https://openalex.org/A5030054874,Sebastian Bartling,,4,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5050737096,https://openalex.org/A5050737096,Sebastian Bartling,,3,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5035946845,https://openalex.org/A5035946845,Sebastian Blume,https://orcid.org/0000-0001-6504-0343,28,217,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5029172573,https://openalex.org/A5029172573,Sebastian Hofmeister,,3,19,direct_ude,University of Duisburg-Essen,1,Prokurist:2,removed:1,no, +A5112675659,https://openalex.org/A5112675659,Sebastian Hofmeister,,5,119,direct_ude,University of Duisburg-Essen,1,Prokurist:2,removed:1,no, +A5013243118,https://openalex.org/A5013243118,Sebastian Jeschke,,39,155,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5054728144,https://openalex.org/A5054728144,Sebastian Krull,,6,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5090567165,https://openalex.org/A5090567165,Sebastian Putz,,2,25,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5010475697,https://openalex.org/A5010475697,Sebastian Tewes,,7,20,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5053166425,https://openalex.org/A5053166425,Sebastian Tewes,,2,0,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5033560201,https://openalex.org/A5033560201,Siegfried Frey,,2,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5020497154,https://openalex.org/A5020497154,Siegfried Jahnke,https://orcid.org/0000-0002-4086-2567,120,3004,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5112745971,https://openalex.org/A5112745971,Silke Dittmer,,9,205,direct_ude,University of Duisburg-Essen,1,Liquidator:1,currently registered:1,no, +A5094406658,https://openalex.org/A5094406658,Simon Heide,,1,0,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5058898852,https://openalex.org/A5058898852,Simon Thies,https://orcid.org/0000-0002-7041-145X,6,63,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5022438334,https://openalex.org/A5022438334,Solveig Hofmann,,4,61,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5063699777,https://openalex.org/A5063699777,Songül Özdemir,,1,13,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5110829775,https://openalex.org/A5110829775,Sonja Krebs,,1,3,direct_ude,University of Duisburg-Essen,1,Liquidator:1,currently registered:1,no, +A5080839320,https://openalex.org/A5080839320,Sonja Schmittmann,https://orcid.org/0000-0003-3886-3453,6,29,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5007861447,https://openalex.org/A5007861447,Stefan Kasper,https://orcid.org/0000-0002-5947-8733,294,13092,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5069191084,https://openalex.org/A5069191084,Stefan Kirschner,,3,25,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5051936861,https://openalex.org/A5051936861,Stefan Löbbecke,,46,524,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5062839956,https://openalex.org/A5062839956,Stefan Schmiedel,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5026810932,https://openalex.org/A5026810932,Stefan Sell,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5045604426,https://openalex.org/A5045604426,Stefan Zillmann,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5057341721,https://openalex.org/A5057341721,Stefan Zöllner,,43,1274,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5056027753,https://openalex.org/A5056027753,Stefanie Beckmann,,2,134,child_of_ude,Institut für Energie- und Umwelttechnik,1,Geschäftsführer:2,currently registered:1,no, +A5091298186,https://openalex.org/A5091298186,Stefanie Köhler,https://orcid.org/0000-0002-7176-1240,5,73,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5112814108,https://openalex.org/A5112814108,Steffen Bender,,12,8,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5016825386,https://openalex.org/A5016825386,Stephan Brauckmann,,6,124,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5051908628,https://openalex.org/A5051908628,Stephan Durst,,3,309,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5033015229,https://openalex.org/A5033015229,Stephan Schweig,https://orcid.org/0000-0001-9869-2479,19,58,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5053376953,https://openalex.org/A5053376953,Stephan Tiedemann,,2,263,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5069502596,https://openalex.org/A5069502596,Susanne Fiedler,,8,432,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5034766781,https://openalex.org/A5034766781,Susanne Gäde,,3,17,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5059835114,https://openalex.org/A5059835114,Susanne Löhr,,2,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,currently registered:1,no, +A5091297759,https://openalex.org/A5091297759,Sven Sachse,https://orcid.org/0009-0006-7742-4743,4,3,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5089516451,https://openalex.org/A5089516451,Swen Hesse,https://orcid.org/0000-0002-2055-2764,274,5314,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5061378179,https://openalex.org/A5061378179,Sylvia Hartmann,https://orcid.org/0000-0003-3424-1091,262,9391,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5101314779,https://openalex.org/A5101314779,Sören Köhler,,4,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5118718256,https://openalex.org/A5118718256,Tanja Ulrich,,2,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5106922500,https://openalex.org/A5106922500,Thomas Beckers,,8,358,direct_ude,University of Duisburg-Essen,1,Inhaber:1,removed:1,no, +A5115787598,https://openalex.org/A5115787598,Thomas Homm,,1,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5023405815,https://openalex.org/A5023405815,Thomas Johanndeiter,,2,20,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5030597886,https://openalex.org/A5030597886,Thomas Rampp,,119,1687,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5124530922,https://openalex.org/A5124530922,Thomas Rampp,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5084945725,https://openalex.org/A5084945725,Thomas Retzmann,,45,147,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5081741992,https://openalex.org/A5081741992,Thomas Sawitowski,,31,1263,direct_ude,University of Duisburg-Essen,1,Prokurist:2,currently registered:1,no, +A5009457064,https://openalex.org/A5009457064,Thomas Scholten,,2,31,direct_ude,University of Duisburg-Essen,1,Prokurist:1,removed:1,no, +A5015351093,https://openalex.org/A5015351093,Thomas Schweer,,2,19,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5060560919,https://openalex.org/A5060560919,Thomas Schweer,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5027775756,https://openalex.org/A5027775756,Thomas Spitzley,,47,59,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5022478353,https://openalex.org/A5022478353,Thomas Theiselmann,,1,1,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5030354170,https://openalex.org/A5030354170,Thorsten Brenner,https://orcid.org/0000-0002-4570-877X,351,8344,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5125191411,https://openalex.org/A5125191411,Thorsten Brenner,,6,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5126942268,https://openalex.org/A5126942268,Thorsten Brenner,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,currently registered:1,no, +A5087080432,https://openalex.org/A5087080432,Tim Brand,https://orcid.org/0000-0002-3375-3178,21,206,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5083757409,https://openalex.org/A5083757409,Timo Bartel,,3,19,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5112755428,https://openalex.org/A5112755428,Timo Bartel,,22,129,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5043034757,https://openalex.org/A5043034757,Tobias Hagemeier,,2,22,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:2,removed:1,no, +A5102457222,https://openalex.org/A5102457222,Tobias Kollmann,,45,2,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5021881029,https://openalex.org/A5021881029,Torsten Binder,https://orcid.org/0000-0001-6578-8992,7,77,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5013171104,https://openalex.org/A5013171104,Torsten Endres,https://orcid.org/0000-0001-8100-3921,55,433,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5123411133,https://openalex.org/A5123411133,Torsten Endres,,1,0,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5111443707,https://openalex.org/A5111443707,Torsten Heine,,3,126,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5015797087,https://openalex.org/A5015797087,Ulrich Dierkes,https://orcid.org/0000-0002-6938-6912,72,834,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5036657126,https://openalex.org/A5036657126,Ulrich Kilian,,4,1,direct_ude,University of Duisburg-Essen,1,Liquidator:1,removed:1,no, +A5095550945,https://openalex.org/A5095550945,Ulrike Berger,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5074941150,https://openalex.org/A5074941150,Ute Pascher,,10,18,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5095550961,https://openalex.org/A5095550961,Ute Reusch,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1; Liquidator:1,removed:1,no, +A5036671939,https://openalex.org/A5036671939,Uwe Knierim,,2,6,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5000119283,https://openalex.org/A5000119283,Uwe Pflaum,,1,5,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5052599699,https://openalex.org/A5052599699,Verena Beck,,15,1013,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5027154134,https://openalex.org/A5027154134,Werner Gaulke,,22,127,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5071766547,https://openalex.org/A5071766547,Wilfried Eberhardt,https://orcid.org/0000-0003-4284-3586,496,38376,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5019228221,https://openalex.org/A5019228221,Wilhelm Koop,,14,88,direct_ude,University of Duisburg-Essen,1,Inhaber:1,currently registered:1,no, +A5095335388,https://openalex.org/A5095335388,Willi Eßer,,2,4,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5063395947,https://openalex.org/A5063395947,Wojciech Kowalczyk,https://orcid.org/0000-0002-7390-2836,87,718,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5097337259,https://openalex.org/A5097337259,Wolfgang Kleem,,2,20,direct_ude,University of Duisburg-Essen,1,Prokurist:1,currently registered:1,no, +A5062554171,https://openalex.org/A5062554171,Xiaoxiao Zhou,,104,1760,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5007716502,https://openalex.org/A5007716502,Xiaxiao Zhou,,1,0,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5055394334,https://openalex.org/A5055394334,Yan Qi,,3,25,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5065806273,https://openalex.org/A5065806273,Yan Qi,https://orcid.org/0009-0007-4565-7232,19,63,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5023904510,https://openalex.org/A5023904510,Yingying Wang,https://orcid.org/0000-0002-9437-8447,4,29,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,removed:1,no, +A5101477617,https://openalex.org/A5101477617,Yuqing Wu,https://orcid.org/0009-0002-7623-5677,34,1185,direct_ude,University of Duisburg-Essen,1,Geschäftsführer:1,currently registered:1,no, +A5030044886,https://openalex.org/A5030044886,Alexander Berges,,1,11,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5028232392,https://openalex.org/A5028232392,Alexander Bäuerle,,15,27,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5083878535,https://openalex.org/A5083878535,Alexander Bäuerle,https://orcid.org/0000-0003-1488-8592,138,2805,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5124212331,https://openalex.org/A5124212331,Alexander Bäuerle,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5125542871,https://openalex.org/A5125542871,Alexander Bäuerle,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5125724201,https://openalex.org/A5125724201,Alexander Bäuerle,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5126543706,https://openalex.org/A5126543706,Alexander Bäuerle,,4,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5126964584,https://openalex.org/A5126964584,Alexander Bäuerle,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5120154138,https://openalex.org/A5120154138,Alexander Kuß,https://orcid.org/0000-0002-9304-8403,1,3,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5074256634,https://openalex.org/A5074256634,Alexander Neuhaus,https://orcid.org/0000-0003-0477-3281,26,621,direct_ude,University of Duisburg-Essen,2,Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5102914099,https://openalex.org/A5102914099,Alexander Neuhaus,https://orcid.org/0009-0001-6844-1924,4,34,direct_ude,University of Duisburg-Essen,2,Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5124241431,https://openalex.org/A5124241431,Alexander Neuhaus,,1,0,direct_ude,University of Duisburg-Essen,2,Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5036432950,https://openalex.org/A5036432950,Alexandra Frey,https://orcid.org/0000-0001-5502-581X,50,293,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5012900736,https://openalex.org/A5012900736,Amir Ahmadi,https://orcid.org/0000-0002-5747-7112,103,3534,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5023371876,https://openalex.org/A5023371876,Andreas Jaekel,,7,109,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Liquidator:1,removed:2,no, +A5038964333,https://openalex.org/A5038964333,André Heuer,,16,96,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:1; removed:1,no, +A5056731063,https://openalex.org/A5056731063,André Niemann,https://orcid.org/0009-0001-6428-9427,37,193,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5061572098,https://openalex.org/A5061572098,Angelika Eßer,,16,28,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3; Liquidator:2,currently registered:1; removed:1,no, +A5040988642,https://openalex.org/A5040988642,Anja Mayer,,3,66,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5072170197,https://openalex.org/A5072170197,Anna Caspari,,4,27,child_of_ude,Institut für Energie- und Umwelttechnik,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5113404409,https://openalex.org/A5113404409,Anna Knorr,https://orcid.org/0009-0004-6377-4529,5,8,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,removed:2,no, +A5039446944,https://openalex.org/A5039446944,Annette Kaiser,https://orcid.org/0000-0001-7873-3958,58,1211,direct_ude,University of Duisburg-Essen,2,Inhaber:2; Prokurist:1,currently registered:2,no, +A5085521861,https://openalex.org/A5085521861,Arne Grundmann,,1,2,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,removed:2,no, +A5103103785,https://openalex.org/A5103103785,Barbara König,https://orcid.org/0000-0002-4193-2889,229,2070,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5122594045,https://openalex.org/A5122594045,Barbara König,,4,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5086434486,https://openalex.org/A5086434486,Beate Lux,,10,510,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5117522592,https://openalex.org/A5117522592,Benedikt Roth,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5051561955,https://openalex.org/A5051561955,Benedikt Sommer,,4,85,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1,currently registered:2,no, +A5047053024,https://openalex.org/A5047053024,Benjamin Hildebrandt,https://orcid.org/0000-0002-0011-3801,3,7,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5022511826,https://openalex.org/A5022511826,Bernhard Neuhaus,,5,294,direct_ude,University of Duisburg-Essen,2,Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5037766479,https://openalex.org/A5037766479,Bernhard Schütz,https://orcid.org/0000-0002-9449-5088,53,562,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5004181272,https://openalex.org/A5004181272,Birgit Meier,,2,30,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5100614119,https://openalex.org/A5100614119,Bo Yu,https://orcid.org/0000-0002-0910-2228,13,380,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5091592150,https://openalex.org/A5091592150,Britta Ervens,https://orcid.org/0000-0001-9534-9616,1,2,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5035407848,https://openalex.org/A5035407848,Burkhard Stüve,,11,124,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5109274767,https://openalex.org/A5109274767,Carmen Nickel,,24,1871,child_of_ude,Institut für Energie- und Umwelttechnik,2,Geschäftsführer:2,currently registered:2,no, +A5113286606,https://openalex.org/A5113286606,Carsten Schroeder,,6,22,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5047582798,https://openalex.org/A5047582798,Chris Schönherr,,1,11,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3; Liquidator:1,currently registered:1; removed:1,no, +A5058870391,https://openalex.org/A5058870391,Christian Schweiger,,2,456,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5113313442,https://openalex.org/A5113313442,Christian Temme,,1,3,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5065413632,https://openalex.org/A5065413632,Christina Alt,,9,1836,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1,currently registered:2,no, +A5031278214,https://openalex.org/A5031278214,Christine Kube,,19,106,child_of_ude,Institut für Energie- und Umwelttechnik,2,Geschäftsführer:2,currently registered:2,no, +A5076386821,https://openalex.org/A5076386821,Christoph Leonhardt,,24,28,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5100905519,https://openalex.org/A5100905519,Christoph Mueller,,5,7,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1; Liquidator:1,currently registered:2,no, +A5113921527,https://openalex.org/A5113921527,Christoph Mueller,,2,92,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1; Liquidator:1,currently registered:2,no, +A5074697803,https://openalex.org/A5074697803,Christoph Oster,https://orcid.org/0000-0002-0683-0430,62,224,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5096227567,https://openalex.org/A5096227567,Christoph Oster,,1,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5111926807,https://openalex.org/A5111926807,Claudia Voigt,,13,269,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5104165371,https://openalex.org/A5104165371,Dana Hofmann,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5087006281,https://openalex.org/A5087006281,Daniel Preuß,,3,14,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5057327561,https://openalex.org/A5057327561,Daniel Reimann,https://orcid.org/0000-0002-9083-4396,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5058315719,https://openalex.org/A5058315719,Dennis Michels,https://orcid.org/0000-0002-7530-9104,23,78,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:2,no, +A5113426808,https://openalex.org/A5113426808,Dennis Nagel,https://orcid.org/0009-0004-2911-9301,6,16,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5003692129,https://openalex.org/A5003692129,Diana Klein,https://orcid.org/0000-0002-1770-443X,137,3054,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5061726728,https://openalex.org/A5061726728,Dieter Loos,,5,18,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5047514819,https://openalex.org/A5047514819,Dirk Blasius,,5,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:2,no, +A5027161261,https://openalex.org/A5027161261,Dobromir Dobrev,https://orcid.org/0000-0002-4612-117X,640,61209,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5126402560,https://openalex.org/A5126402560,Dobromir Dobrev,,3,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5127444535,https://openalex.org/A5127444535,Dobromir Dobrev,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5130073673,https://openalex.org/A5130073673,Dobromir Dobrev,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5016661814,https://openalex.org/A5016661814,Dominik Esser,,16,754,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5116347062,https://openalex.org/A5116347062,Dorothee Nitsch,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:1; removed:1,no, +A5009897292,https://openalex.org/A5009897292,Elisabeth Maurer,,2,33,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5061252774,https://openalex.org/A5061252774,Elke Wessel,,7,185,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5011988398,https://openalex.org/A5011988398,Fatih Özcan,https://orcid.org/0000-0002-2584-7000,43,269,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5086528994,https://openalex.org/A5086528994,Fatih Özcan,https://orcid.org/0000-0002-3922-7902,51,500,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5123512479,https://openalex.org/A5123512479,Fatih Özcan,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5125278989,https://openalex.org/A5125278989,Fatih Özcan,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5065356264,https://openalex.org/A5065356264,Felix Bergmann,https://orcid.org/0000-0002-1224-9036,369,5442,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5103117681,https://openalex.org/A5103117681,Felix Bergmann,https://orcid.org/0009-0005-5621-6972,52,521,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5121086538,https://openalex.org/A5121086538,Felix Bergmann,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5024294120,https://openalex.org/A5024294120,Felix Kraus,,2,18,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1; Persönlich haftender Gesellschafter:1,currently registered:2,no, +A5111920811,https://openalex.org/A5111920811,Felix Wiegand,,33,66,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5111023305,https://openalex.org/A5111023305,Ferdinand Beckmann,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Persönlich haftender Gesellschafter:1,currently registered:2,no, +A5060063811,https://openalex.org/A5060063811,Florian Buchner,https://orcid.org/0000-0001-9440-1566,25,602,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Persönlich haftender Gesellschafter:1,currently registered:2,no, +A5071929694,https://openalex.org/A5071929694,Frank Heidtmann,,3,16,direct_ude,University of Duisburg-Essen,2,Persönlich haftender Gesellschafter:2,currently registered:1; removed:1,no, +A5058553419,https://openalex.org/A5058553419,Franz-Josef Glandorf,,5,66,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:1; removed:1,no, +A5081067232,https://openalex.org/A5081067232,Georg von Oepen,,2,0,child_of_ude,Rhein-Ruhr Institut für Sozialforschung und Politikberatung,2,Prokurist:5,currently registered:1; removed:1,no, +A5087443584,https://openalex.org/A5087443584,Gerhard Lackner,,10,266,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5074872047,https://openalex.org/A5074872047,Hans Josef Dohmen,https://orcid.org/0000-0003-0828-2324,102,1346,direct_ude,University of Duisburg-Essen,2,Prokurist:2,currently registered:2,no, +A5071612550,https://openalex.org/A5071612550,Hansjobst Hirschfelder,,2,1,child_of_ude,Institut für Energie- und Umwelttechnik,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5055774787,https://openalex.org/A5055774787,Heike Averbeck,,4,104,direct_ude,University of Duisburg-Essen,2,Prokurist:2,currently registered:2,no, +A5080287017,https://openalex.org/A5080287017,Heike Mauer,https://orcid.org/0000-0002-5597-2283,122,120,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5087252344,https://openalex.org/A5087252344,Heike Siegert,,2,14,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5116888667,https://openalex.org/A5116888667,Heinrich Stork,,1,2,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5034936069,https://openalex.org/A5034936069,Hendrik Kramer,,12,124,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5059829997,https://openalex.org/A5059829997,Herbert Sanders,,4,36,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,removed:2,no, +A5009182476,https://openalex.org/A5009182476,Hermann Nienhaus,https://orcid.org/0000-0002-6549-6188,143,2979,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Persönlich haftender Gesellschafter:1,currently registered:2,no, +A5087499823,https://openalex.org/A5087499823,Holger Hilmer,,4,15,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,removed:2,no, +A5017579702,https://openalex.org/A5017579702,Holger Hirsch,,104,368,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5106329054,https://openalex.org/A5106329054,Hülya Yildirim,,2,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:1; removed:1,no, +A5116866984,https://openalex.org/A5116866984,Hülya Yildirim,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:1; removed:1,no, +A5083388613,https://openalex.org/A5083388613,Jakob Penner,,12,41,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5017110462,https://openalex.org/A5017110462,Jan Berends,https://orcid.org/0000-0003-4224-5455,3,58,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:1; removed:1,no, +A5044443427,https://openalex.org/A5044443427,Jens Hämmerling,,6,20,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5005124395,https://openalex.org/A5005124395,Johannes Köster,https://orcid.org/0000-0001-9818-9320,137,11545,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5022044556,https://openalex.org/A5022044556,Johannes Köster,,12,611,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5120888419,https://openalex.org/A5120888419,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5121626672,https://openalex.org/A5121626672,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5122765175,https://openalex.org/A5122765175,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5123007760,https://openalex.org/A5123007760,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5123186606,https://openalex.org/A5123186606,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5123260579,https://openalex.org/A5123260579,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5123387479,https://openalex.org/A5123387479,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5123477225,https://openalex.org/A5123477225,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5124078048,https://openalex.org/A5124078048,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5124781563,https://openalex.org/A5124781563,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5125090843,https://openalex.org/A5125090843,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5125141745,https://openalex.org/A5125141745,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5125388610,https://openalex.org/A5125388610,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5126295394,https://openalex.org/A5126295394,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5126796725,https://openalex.org/A5126796725,Johannes Köster,,4,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5128643085,https://openalex.org/A5128643085,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5129873775,https://openalex.org/A5129873775,Johannes Köster,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5130620706,https://openalex.org/A5130620706,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5130740025,https://openalex.org/A5130740025,Johannes Köster,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5089418966,https://openalex.org/A5089418966,Johannes Wiebe,,3,15,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,removed:2,no, +A5103436086,https://openalex.org/A5103436086,Jonathan Herrmann,,2,220,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5054049165,https://openalex.org/A5054049165,Judith Schröder,https://orcid.org/0000-0002-9916-8334,7,28,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5111911281,https://openalex.org/A5111911281,Judith Wagner,,58,401,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:1; removed:1,no, +A5068324427,https://openalex.org/A5068324427,Jutta Walter,,2,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,removed:2,no, +A5017014003,https://openalex.org/A5017014003,Jörg Niemeyer,,5,14,direct_ude,University of Duisburg-Essen,2,Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:2,no, +A5093067464,https://openalex.org/A5093067464,Kai Schröer,,7,23,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5103019792,https://openalex.org/A5103019792,Khanh Do,https://orcid.org/0000-0001-7834-3781,87,1267,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5050451281,https://openalex.org/A5050451281,Kristina Kirsch,,1,49,direct_ude,University of Duisburg-Essen,2,Prokurist:4,currently registered:2,no, +A5053330077,https://openalex.org/A5053330077,Lars Breuer,https://orcid.org/0000-0002-7797-9662,61,416,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5123426135,https://openalex.org/A5123426135,Lars Breuer,,3,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5047592898,https://openalex.org/A5047592898,Liane John,,3,75,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5006651872,https://openalex.org/A5006651872,Ludmilla Schumacher,,14,182,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1,currently registered:1; removed:1,no, +A5104440681,https://openalex.org/A5104440681,Manfred Baer,,17,480,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:2,no, +A5017950910,https://openalex.org/A5017950910,Manfred Mai,,117,398,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:1; removed:1,no, +A5056975067,https://openalex.org/A5056975067,Marc Eulerich,https://orcid.org/0000-0002-9965-7584,275,2429,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,currently registered:2,no, +A5113933991,https://openalex.org/A5113933991,Marc Eulerich,,5,92,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,currently registered:2,no, +A5123580203,https://openalex.org/A5123580203,Marc Eulerich,,1,0,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,currently registered:2,no, +A5128493173,https://openalex.org/A5128493173,Marc Eulerich,,1,0,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,currently registered:2,no, +A5010126702,https://openalex.org/A5010126702,Marcus Urbani,,2,32,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:2,currently registered:2,no, +A5111666539,https://openalex.org/A5111666539,Margit Schröder,,2,56,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5112074473,https://openalex.org/A5112074473,Maria Schröder,,14,312,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5091405189,https://openalex.org/A5091405189,Marina Braun,,2,11,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:2,no, +A5019356146,https://openalex.org/A5019356146,Markus Deckert,,6,63,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5112653053,https://openalex.org/A5112653053,Markus Taube,https://orcid.org/0000-0003-1202-2023,100,1353,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5032578309,https://openalex.org/A5032578309,Martin Hermes,,2,47,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Geschäftsführer:1,removed:2,no, +A5044199100,https://openalex.org/A5044199100,Martin Mittendorff,https://orcid.org/0000-0003-3998-2518,120,2075,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5110287782,https://openalex.org/A5110287782,Martin Panitz,,1,40,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5047010496,https://openalex.org/A5047010496,Matthias Jeschke,https://orcid.org/0000-0001-5110-2080,13,130,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:2,no, +A5123364852,https://openalex.org/A5123364852,Matthias Jeschke,,1,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:2,no, +A5047692972,https://openalex.org/A5047692972,Matthias Matthes,,1,7,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5053309957,https://openalex.org/A5053309957,Melanie Hirt,https://orcid.org/0000-0003-2085-6124,1,17,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:2,no, +A5051242665,https://openalex.org/A5051242665,Michael Klocke,,2,3,direct_ude,University of Duisburg-Essen,2,Prokurist:3; Geschäftsführer:1,currently registered:2,no, +A5081701545,https://openalex.org/A5081701545,Michael Leineweber,,2,135,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:1; removed:1,no, +A5071583742,https://openalex.org/A5071583742,Michael Ruwe,,1,29,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:2,no, +A5110739861,https://openalex.org/A5110739861,Michael Westermann,,2,71,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5026680251,https://openalex.org/A5026680251,Michaela Wirtz,,20,382,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:1; removed:1,no, +A5121300831,https://openalex.org/A5121300831,Michaela Wirtz,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:1; removed:1,no, +A5012499865,https://openalex.org/A5012499865,Muhammad Aslam,https://orcid.org/0000-0002-8529-4217,120,1455,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5083269491,https://openalex.org/A5083269491,Nico Hahn,https://orcid.org/0000-0003-0554-0076,12,22,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5029227325,https://openalex.org/A5029227325,Nicole Unger,https://orcid.org/0000-0002-5161-8711,114,1781,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5049371415,https://openalex.org/A5049371415,Nina Bauer,https://orcid.org/0009-0003-6137-1585,33,529,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5011621994,https://openalex.org/A5011621994,Nina Schulze,,36,1034,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:2,no, +A5058184980,https://openalex.org/A5058184980,Nina Völkel,,3,22,direct_ude,University of Duisburg-Essen,2,Prokurist:2; Inhaber:1,currently registered:2,no, +A5082158679,https://openalex.org/A5082158679,Olga Just,,1,26,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,removed:2,no, +A5077536077,https://openalex.org/A5077536077,Oliver Ehret,,11,201,child_of_ude,The Hydrogen and Fuel Cell Center,2,Geschäftsführer:2,currently registered:2,no, +A5035410961,https://openalex.org/A5035410961,Oliver Kamp,https://orcid.org/0000-0001-7593-4471,38,762,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:1; removed:1,no, +A5010051651,https://openalex.org/A5010051651,Pascal Krahmer,,1,17,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,removed:2,no, +A5101791113,https://openalex.org/A5101791113,Patrick May,https://orcid.org/0000-0003-1311-6267,4,81,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5025829015,https://openalex.org/A5025829015,Patrick Thiel,https://orcid.org/0000-0001-5838-4658,6,9,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,removed:2,no, +A5089882657,https://openalex.org/A5089882657,Paul Graf,,4,25,direct_ude,University of Duisburg-Essen,2,Prokurist:3,currently registered:2,no, +A5020390680,https://openalex.org/A5020390680,Peter Pfänder,,3,1,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5094782607,https://openalex.org/A5094782607,Peter Schroth,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Inhaber:1,currently registered:2,no, +A5082288318,https://openalex.org/A5082288318,Peter Waldmann,,3,17,direct_ude,University of Duisburg-Essen,2,Persönlich haftender Gesellschafter:1; Vorstand:1,currently registered:2,no, +A5050553334,https://openalex.org/A5050553334,Philipp Jahn,https://orcid.org/0000-0003-2062-1421,4,51,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Persönlich haftender Gesellschafter:1,removed:2,no, +A5100405791,https://openalex.org/A5100405791,Ping Zhang,https://orcid.org/0000-0002-0647-0375,31,67,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5046113011,https://openalex.org/A5046113011,Renate Petersen,,15,37,direct_ude,University of Duisburg-Essen,2,Liquidator:2; Geschäftsführer:1,currently registered:2,no, +A5020998418,https://openalex.org/A5020998418,Robert Haensel,,1,24,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5047093707,https://openalex.org/A5047093707,Robert Schaefer,https://orcid.org/0000-0002-1669-2086,223,4378,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5038123873,https://openalex.org/A5038123873,Roland Schwarzer,https://orcid.org/0000-0002-7497-5180,59,736,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5001845440,https://openalex.org/A5001845440,Rouven Malecki,,1,9,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5019419369,https://openalex.org/A5019419369,Rudi Schäfer,https://orcid.org/0000-0002-8987-7313,63,962,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5070249489,https://openalex.org/A5070249489,Sascha Maassen,https://orcid.org/0000-0002-1022-0563,11,106,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5064200928,https://openalex.org/A5064200928,Sebastian Eck,https://orcid.org/0000-0002-1931-1023,4,3,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5128723742,https://openalex.org/A5128723742,Sebastian Eck,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5034621075,https://openalex.org/A5034621075,Sebastian Just,,7,165,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,removed:2,no, +A5083681670,https://openalex.org/A5083681670,Sebastian Urban,,4,64,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5021113981,https://openalex.org/A5021113981,Sebastian Willen,,8,143,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,removed:2,no, +A5107669141,https://openalex.org/A5107669141,Sebastian Willen,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,removed:2,no, +A5076891196,https://openalex.org/A5076891196,Silvia Ernst,,4,59,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5108495045,https://openalex.org/A5108495045,Simone Schmid,,1,5,direct_ude,University of Duisburg-Essen,2,Inhaber:1; Prokurist:1,currently registered:1; removed:1,no, +A5077785097,https://openalex.org/A5077785097,Stefan Eßer,https://orcid.org/0000-0002-3625-9650,234,5993,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:1; removed:1,no, +A5084459124,https://openalex.org/A5084459124,Stefan Felder,https://orcid.org/0000-0002-5029-7274,241,3781,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:2,no, +A5024987770,https://openalex.org/A5024987770,Stefan Konermann,,2,44,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3; Prokurist:1,currently registered:2,no, +A5061640496,https://openalex.org/A5061640496,Stefan Westermann,https://orcid.org/0000-0001-6921-9113,88,4333,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5006353407,https://openalex.org/A5006353407,Stefanie Hanke,https://orcid.org/0000-0002-9952-1919,87,1215,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:1; removed:1,no, +A5054932604,https://openalex.org/A5054932604,Steffen Köcher,,6,137,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5089406272,https://openalex.org/A5089406272,Stephan Faust,,4,111,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Prokurist:1,currently registered:2,no, +A5060126568,https://openalex.org/A5060126568,Stephan Grimm,,2,6,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5003700004,https://openalex.org/A5003700004,Sven Brandau,https://orcid.org/0000-0002-2702-4163,288,14467,direct_ude,University of Duisburg-Essen,2,Prokurist:3; Geschäftsführer:1,currently registered:2,no, +A5125629313,https://openalex.org/A5125629313,Sven Brandau,,1,0,direct_ude,University of Duisburg-Essen,2,Prokurist:3; Geschäftsführer:1,currently registered:2,no, +A5128284510,https://openalex.org/A5128284510,Sven Brandau,,1,0,direct_ude,University of Duisburg-Essen,2,Prokurist:3; Geschäftsführer:1,currently registered:2,no, +A5002483227,https://openalex.org/A5002483227,Sven Frost,,13,143,direct_ude,University of Duisburg-Essen,2,Inhaber:2,currently registered:2,no, +A5040840923,https://openalex.org/A5040840923,Sven Manske,https://orcid.org/0000-0002-5098-1682,53,332,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,removed:2,no, +A5094303760,https://openalex.org/A5094303760,Thomas Droll,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5026909134,https://openalex.org/A5026909134,Thomas Lodzinski,,1,4,direct_ude,University of Duisburg-Essen,2,Prokurist:2,currently registered:2,no, +A5009253164,https://openalex.org/A5009253164,Thomas Mühlmann,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5012875198,https://openalex.org/A5012875198,Thorsten Schultze,,10,11,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5078030262,https://openalex.org/A5078030262,Thorsten Schultze,https://orcid.org/0009-0007-3690-8714,64,398,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5069586127,https://openalex.org/A5069586127,Tobias Altmann,https://orcid.org/0000-0001-7294-7808,71,373,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5130207347,https://openalex.org/A5130207347,Tobias Hackel,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5034475438,https://openalex.org/A5034475438,Tobias Hesse,,15,82,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Liquidator:1,currently registered:1; removed:1,no, +A5027780655,https://openalex.org/A5027780655,Tobias Rasche,,3,7,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5012619076,https://openalex.org/A5012619076,Torsten Ulmer,,4,5,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5079685335,https://openalex.org/A5079685335,Ulrich Görtz,https://orcid.org/0000-0001-5584-0558,86,1096,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5055349387,https://openalex.org/A5055349387,Ulrich Schroeder,,6,106,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5091133675,https://openalex.org/A5091133675,Ulrike Behrens,,2,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4,currently registered:2,no, +A5039550945,https://openalex.org/A5039550945,Umut Kaya,,6,20,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5038671684,https://openalex.org/A5038671684,Ursula Renner,,4,1,direct_ude,University of Duisburg-Essen,2,Prokurist:2,currently registered:2,no, +A5053345209,https://openalex.org/A5053345209,Ursula Renner,,2,1,direct_ude,University of Duisburg-Essen,2,Prokurist:2,currently registered:2,no, +A5059841395,https://openalex.org/A5059841395,Valerie Lemke,,8,19,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2; Liquidator:1,currently registered:1; removed:1,no, +A5062324759,https://openalex.org/A5062324759,Verena Schröder,,7,61,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Prokurist:1,currently registered:2,no, +A5094421324,https://openalex.org/A5094421324,Volker Schanz,,1,0,direct_ude,University of Duisburg-Essen,2,Inhaber:1; Persönlich haftender Gesellschafter:1,currently registered:1; removed:1,no, +A5101821492,https://openalex.org/A5101821492,Wei Cheng,https://orcid.org/0000-0003-4369-6530,27,100,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:4; Liquidator:1,removed:2,no, +A5055278591,https://openalex.org/A5055278591,Wiebke Hansen,https://orcid.org/0000-0002-6020-0886,137,4810,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5053083092,https://openalex.org/A5053083092,Wolfgang Burghardt,,59,845,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:1; Inhaber:1,currently registered:2,no, +A5026378357,https://openalex.org/A5026378357,Wolfgang Löhr,,12,154,direct_ude,University of Duisburg-Essen,2,Inhaber:1; Prokurist:1,currently registered:1; removed:1,no, +A5071475574,https://openalex.org/A5071475574,Wu Chen,https://orcid.org/0000-0002-1835-7564,426,8138,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:1; removed:1,no, +A5092103086,https://openalex.org/A5092103086,Xiaoyu Zhang,https://orcid.org/0000-0002-0565-6370,4,3,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:2,no, +A5033912226,https://openalex.org/A5033912226,Yao Li,https://orcid.org/0000-0002-1151-7369,2,19,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5130026761,https://openalex.org/A5130026761,Yao Wang,,1,0,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:2,currently registered:2,no, +A5015043554,https://openalex.org/A5015043554,Yvonne Krause,,7,232,direct_ude,University of Duisburg-Essen,2,Geschäftsführer:3,currently registered:1; removed:1,no, +A5082223886,https://openalex.org/A5082223886,Achim Koch,https://orcid.org/0000-0002-1616-4873,134,1632,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5041164084,https://openalex.org/A5041164084,Alexander Diel,https://orcid.org/0000-0002-4362-8856,32,281,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:2; removed:1,no, +A5082773640,https://openalex.org/A5082773640,Alexander Heinemann,,3,16,direct_ude,University of Duisburg-Essen,3,Liquidator:3; Geschäftsführer:2,removed:3,no, +A5077174863,https://openalex.org/A5077174863,Alexander Oldenburger,,2,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Inhaber:1,currently registered:2; removed:1,no, +A5041217146,https://openalex.org/A5041217146,Alexander Ries,,6,87,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Persönlich haftender Gesellschafter:2,currently registered:3,no, +A5017791085,https://openalex.org/A5017791085,Andreas Büchter,https://orcid.org/0000-0001-8411-1004,103,303,direct_ude,University of Duisburg-Essen,3,Persönlich haftender Gesellschafter:2; Geschäftsführer:1,currently registered:3,no, +A5030807249,https://openalex.org/A5030807249,Andreas Kunzmann,,34,802,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:2,currently registered:2; removed:1,no, +A5080262061,https://openalex.org/A5080262061,Andreas Stang,https://orcid.org/0000-0001-6363-9061,630,38057,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5102144950,https://openalex.org/A5102144950,Andreas Stang,,8,51,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5032121745,https://openalex.org/A5032121745,Andrej Klassen,,4,3,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:2,removed:2; currently registered:1,no, +A5063166257,https://openalex.org/A5063166257,Anja Steinbach,https://orcid.org/0000-0002-3642-2374,106,1564,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:2; removed:1,no, +A5102461913,https://openalex.org/A5102461913,Anja Steinbach,,6,1,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:2; removed:1,no, +A5064009668,https://openalex.org/A5064009668,Barbara Jeschke,,12,332,direct_ude,University of Duisburg-Essen,3,Inhaber:3; Geschäftsführer:1,currently registered:2; removed:1,no, +A5015901810,https://openalex.org/A5015901810,Benjamin Köhler,,5,81,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:2; removed:1,no, +A5116789043,https://openalex.org/A5116789043,Benjamin Schröer,,4,2,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5053327457,https://openalex.org/A5053327457,Bernd Schweiger,https://orcid.org/0000-0002-8037-2159,97,1240,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,removed:3,no, +A5123200218,https://openalex.org/A5123200218,Bernd Schweiger,,3,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,removed:3,no, +A5103078784,https://openalex.org/A5103078784,Bernd Weiß,https://orcid.org/0000-0002-1176-8408,92,738,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5123007937,https://openalex.org/A5123007937,Bernd Weiß,,7,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5030980984,https://openalex.org/A5030980984,Carsten Reinhardt,https://orcid.org/0000-0003-2905-1920,160,5068,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,currently registered:2; removed:1,no, +A5037448733,https://openalex.org/A5037448733,Christian Marschner,,5,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:3,no, +A5103899403,https://openalex.org/A5103899403,Christian Mette,,19,252,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5103255017,https://openalex.org/A5103255017,Christian Preuss,https://orcid.org/0009-0003-9837-0746,25,141,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5109008810,https://openalex.org/A5109008810,Christine Ritter,,1,1,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5032774881,https://openalex.org/A5032774881,Christopher Reimann,,3,4,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5109152416,https://openalex.org/A5109152416,Claudia Frank,,24,586,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:3,no, +A5000724228,https://openalex.org/A5000724228,Claudia Freimuth,,2,7,direct_ude,University of Duisburg-Essen,3,Prokurist:3,currently registered:3,no, +A5015122896,https://openalex.org/A5015122896,Cornelius Grimm,,6,27,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,currently registered:2; removed:1,no, +A5035540236,https://openalex.org/A5035540236,Daniel Erni,https://orcid.org/0000-0002-1467-6373,398,5023,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,currently registered:2; removed:1,no, +A5031147249,https://openalex.org/A5031147249,Daniel Hering,https://orcid.org/0000-0002-5436-4753,326,18868,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:3,no, +A5101579321,https://openalex.org/A5101579321,Daniel Wendt,https://orcid.org/0000-0001-7257-444X,246,5268,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,currently registered:2; removed:1,no, +A5104534944,https://openalex.org/A5104534944,Daniel Wendt,,1,1,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,currently registered:2; removed:1,no, +A5041645777,https://openalex.org/A5041645777,Dennis Meier,https://orcid.org/0000-0002-8623-6705,205,5614,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,currently registered:3,no, +A5072771601,https://openalex.org/A5072771601,Dietrich Koch,,3,129,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,currently registered:3,no, +A5123869890,https://openalex.org/A5123869890,Dirk Hermann,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Liquidator:1,removed:2; currently registered:1,no, +A5110137004,https://openalex.org/A5110137004,Erika König,,2,28,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Liquidator:1; Prokurist:1,removed:2; currently registered:1,no, +A5029058702,https://openalex.org/A5029058702,Eva Berndt,,3,70,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Inhaber:1,currently registered:2; removed:1,no, +A5114036991,https://openalex.org/A5114036991,Florian Kühne,,9,50,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:2; removed:1,no, +A5041694590,https://openalex.org/A5041694590,Frank Kleemann,https://orcid.org/0000-0002-3588-7022,106,1097,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:2; removed:1,no, +A5114433523,https://openalex.org/A5114433523,Frank Kleemann,,7,2,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:2; removed:1,no, +A5023299755,https://openalex.org/A5023299755,Friedrich Jaeger,,4,1,child_of_ude,Institute for Advanced Study in the Humanities Essen,3,Geschäftsführer:4,removed:3,no, +A5111518819,https://openalex.org/A5111518819,Fritz Götz,,18,627,direct_ude,University of Duisburg-Essen,3,Prokurist:3,currently registered:3,no, +A5110262484,https://openalex.org/A5110262484,Fritz Sörgel,,247,7546,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5058950547,https://openalex.org/A5058950547,Georg Hein,,59,192,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Liquidator:1,removed:2; currently registered:1,no, +A5086068040,https://openalex.org/A5086068040,Gerhard Bäcker,,138,973,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:3,no, +A5066679330,https://openalex.org/A5066679330,Gerhard Starke,https://orcid.org/0000-0001-5985-173X,85,1619,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5015113224,https://openalex.org/A5015113224,Gertrud Schmitz,https://orcid.org/0000-0002-3373-7901,74,270,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:3,no, +A5037573739,https://openalex.org/A5037573739,Grit Hoffmann,,6,50,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:2; removed:1,no, +A5065313412,https://openalex.org/A5065313412,Guido Sieber,https://orcid.org/0000-0002-7966-5368,15,152,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5; Prokurist:2,currently registered:3,no, +A5090395061,https://openalex.org/A5090395061,Heiko Jacobs,https://orcid.org/0000-0003-1261-6593,36,1342,direct_ude,University of Duisburg-Essen,3,Liquidator:2; Prokurist:1,removed:2; currently registered:1,no, +A5025346693,https://openalex.org/A5025346693,Hendrik Schröder,,119,684,direct_ude,University of Duisburg-Essen,3,Inhaber:2; Geschäftsführer:1,currently registered:3,no, +A5007315178,https://openalex.org/A5007315178,Holger Kraus,,2,68,child_of_ude,The Hydrogen and Fuel Cell Center,3,Prokurist:2; Geschäftsführer:1; Inhaber:1,currently registered:3,no, +A5033169519,https://openalex.org/A5033169519,Hubert Kuhn,https://orcid.org/0000-0001-5122-2189,2,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Liquidator:1; Prokurist:1,currently registered:2; removed:1,no, +A5111939993,https://openalex.org/A5111939993,Jan Busch,,30,712,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5075848932,https://openalex.org/A5075848932,Jan Dinter,,12,38,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5087145453,https://openalex.org/A5087145453,Joachim Prinz,,55,847,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:2,removed:2; currently registered:1,no, +A5031265819,https://openalex.org/A5031265819,Jochen Heß,https://orcid.org/0000-0002-9902-5368,89,871,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,removed:2; currently registered:1,no, +A5123334300,https://openalex.org/A5123334300,Jochen Heß,,2,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,removed:2; currently registered:1,no, +A5001673346,https://openalex.org/A5001673346,Jochen Türk,,24,208,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Inhaber:1; Prokurist:1,currently registered:2; removed:1,no, +A5128463492,https://openalex.org/A5128463492,Johannes Breuer,,2,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Inhaber:1,currently registered:2; removed:1,no, +A5129911625,https://openalex.org/A5129911625,Johannes Breuer,,4,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Inhaber:1,currently registered:2; removed:1,no, +A5111266639,https://openalex.org/A5111266639,Johannes Jäger,https://orcid.org/0009-0003-3697-0973,14,34,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:3,no, +A5031838990,https://openalex.org/A5031838990,Johannes Oertel,https://orcid.org/0000-0003-2621-8422,8,111,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:2,currently registered:3,no, +A5042511428,https://openalex.org/A5042511428,Johannes Specht,,9,239,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5091734620,https://openalex.org/A5091734620,Jürgen Kampf,https://orcid.org/0000-0001-8370-6882,31,117,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:2; removed:1,no, +A5046205825,https://openalex.org/A5046205825,Katharina König,,2,4,direct_ude,University of Duisburg-Essen,3,Prokurist:3; Geschäftsführer:2,currently registered:2; removed:1,no, +A5020102768,https://openalex.org/A5020102768,Katja Bergmann,,3,45,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Liquidator:1; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:2; removed:1,no, +A5045432311,https://openalex.org/A5045432311,Kerstin Köhler,,3,61,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:2,currently registered:2; removed:1,no, +A5020367700,https://openalex.org/A5020367700,Kerstin Schmitz,,2,71,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:3,no, +A5029238621,https://openalex.org/A5029238621,Kristina Wagner,,2,207,direct_ude,University of Duisburg-Essen,3,Prokurist:3; Geschäftsführer:1,currently registered:3,no, +A5112896037,https://openalex.org/A5112896037,Lina Weber,,2,5,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:2; removed:1,no, +A5113914021,https://openalex.org/A5113914021,Marc Stevens,,63,1318,direct_ude,University of Duisburg-Essen,3,Prokurist:3; Geschäftsführer:1,currently registered:2; removed:1,no, +A5050357599,https://openalex.org/A5050357599,Marcel Walter,,6,3,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,removed:2; currently registered:1,no, +A5049325057,https://openalex.org/A5049325057,Markus May,https://orcid.org/0000-0003-3869-9681,25,109,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5093034515,https://openalex.org/A5093034515,Martin Kurka,,1,1,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:2; removed:1,no, +A5113019777,https://openalex.org/A5113019777,Martin Kurka,,2,0,direct_ude,University of Duisburg-Essen,3,Prokurist:4,currently registered:2; removed:1,no, +A5095550954,https://openalex.org/A5095550954,Martin Lücke,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,currently registered:3,no, +A5074594733,https://openalex.org/A5074594733,Martin Schild,,7,189,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5; Liquidator:1,removed:2; currently registered:1,no, +A5061363376,https://openalex.org/A5061363376,Martin Teufel,https://orcid.org/0000-0003-2120-1840,431,9270,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5063762172,https://openalex.org/A5063762172,Martina Sauer,https://orcid.org/0000-0002-4787-3189,120,239,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:1,currently registered:3,no, +A5123363823,https://openalex.org/A5123363823,Martina Schmid,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5103929943,https://openalex.org/A5103929943,Mathias Kamp,,3,45,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5049457314,https://openalex.org/A5049457314,Maximilian Krug,https://orcid.org/0000-0002-8979-3099,27,143,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Inhaber:1,currently registered:2; removed:1,no, +A5031978837,https://openalex.org/A5031978837,Maximilian Pohl,,16,5,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:3,no, +A5045722123,https://openalex.org/A5045722123,Maximilian Pohl,,2,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:3,no, +A5004156626,https://openalex.org/A5004156626,Melanie Fiedler,,2,9,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5042895787,https://openalex.org/A5042895787,Melanie Fiedler,,82,1691,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5124761678,https://openalex.org/A5124761678,Melanie Fiedler,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5024170181,https://openalex.org/A5024170181,Melanie Geisler,,1,569,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5109228350,https://openalex.org/A5109228350,Michael Küper,,25,1095,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Inhaber:1; Liquidator:1,currently registered:2; removed:1,no, +A5113345650,https://openalex.org/A5113345650,Michael Pfitzner,,25,53,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Inhaber:1; Prokurist:1,currently registered:2; removed:1,no, +A5120461949,https://openalex.org/A5120461949,Michael Staiger,https://orcid.org/0009-0002-0975-6392,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4; Prokurist:1,currently registered:2; removed:1,no, +A5086049958,https://openalex.org/A5086049958,Michael Thome,https://orcid.org/0009-0002-0525-7289,7,18,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5009526667,https://openalex.org/A5009526667,Michael Wittlinger,,16,534,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:3,no, +A5045457334,https://openalex.org/A5045457334,Mohammad Sharif,https://orcid.org/0000-0002-1241-007X,55,712,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,currently registered:2; removed:1,no, +A5117379408,https://openalex.org/A5117379408,Mohammad Sharif,,2,1,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,currently registered:2; removed:1,no, +A5082612844,https://openalex.org/A5082612844,Nadine Schröder,https://orcid.org/0000-0001-6650-4656,10,45,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:3,no, +A5077392508,https://openalex.org/A5077392508,Oliver Blatt,,1,16,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5006686937,https://openalex.org/A5006686937,Oliver Gries,,130,587,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5016035673,https://openalex.org/A5016035673,Peter Roch,,15,25,direct_ude,University of Duisburg-Essen,3,Prokurist:6; Geschäftsführer:1,removed:2; currently registered:1,no, +A5091927263,https://openalex.org/A5091927263,Petra Denk,,1,0,child_of_ude,Institut für Energie- und Umwelttechnik,3,Geschäftsführer:2; Prokurist:1,currently registered:2; removed:1,no, +A5110542142,https://openalex.org/A5110542142,Phillip Becker,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:4,removed:2; currently registered:1,no, +A5002710564,https://openalex.org/A5002710564,Pia Buck,,2,1,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Persönlich haftender Gesellschafter:1,removed:2; currently registered:1,no, +A5034120685,https://openalex.org/A5034120685,Reinhard Lechner,,14,21,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5102665422,https://openalex.org/A5102665422,Sandy Müller,,3,17,direct_ude,University of Duisburg-Essen,3,Inhaber:2; Geschäftsführer:1,currently registered:3,no, +A5103951416,https://openalex.org/A5103951416,Sebastian Otten,,11,150,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Prokurist:1,currently registered:3,no, +A5028042436,https://openalex.org/A5028042436,Sebastian Pfeifer,,4,12,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Inhaber:1; Prokurist:1,currently registered:2; removed:1,no, +A5042525920,https://openalex.org/A5042525920,Sebastian Schröer,,32,118,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5055485518,https://openalex.org/A5055485518,Simone Schwarz,,33,335,direct_ude,University of Duisburg-Essen,3,Liquidator:2; Inhaber:1,removed:3,no, +A5024212155,https://openalex.org/A5024212155,Stefan Hermes,https://orcid.org/0000-0001-7487-3945,33,145,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:2; removed:1,no, +A5114514120,https://openalex.org/A5114514120,Stefan Hermes,,1,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3; Liquidator:1,currently registered:2; removed:1,no, +A5049577078,https://openalex.org/A5049577078,Stefan Kleine,,9,349,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5032635842,https://openalex.org/A5032635842,Stefan Reining,https://orcid.org/0000-0002-5295-8101,18,140,direct_ude,University of Duisburg-Essen,3,Prokurist:3; Geschäftsführer:2,currently registered:3,no, +A5060348004,https://openalex.org/A5060348004,Stefan Thür,,1,9,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Prokurist:2,currently registered:3,no, +A5091427277,https://openalex.org/A5091427277,Steffen Jost,,11,1048,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Persönlich haftender Gesellschafter:1,currently registered:3,no, +A5022354254,https://openalex.org/A5022354254,Steffen Spitzner,,17,5,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:6,currently registered:3,no, +A5009094490,https://openalex.org/A5009094490,Thomas Mönnig,,7,0,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:2; Liquidator:2,currently registered:2; removed:1,no, +A5054911713,https://openalex.org/A5054911713,Thomas Pfeil,,3,0,child_of_ude,Institut für Energie- und Umwelttechnik,3,Geschäftsführer:3; Inhaber:2,currently registered:3,no, +A5017921085,https://openalex.org/A5017921085,Thomas Zadow,,1,34,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:5,removed:3,no, +A5085076144,https://openalex.org/A5085076144,Tim Schulte,,6,34,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5009664226,https://openalex.org/A5009664226,Ulrich Hecker,,4,140,direct_ude,University of Duisburg-Essen,3,Liquidator:2; Geschäftsführer:1,currently registered:2; removed:1,no, +A5034434556,https://openalex.org/A5034434556,Ulrich Westphal,,270,6262,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:1; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:2; removed:1,no, +A5075663980,https://openalex.org/A5075663980,Ursula Neumann,https://orcid.org/0000-0001-8578-5641,4,6,direct_ude,University of Duisburg-Essen,3,Persönlich haftender Gesellschafter:2; Geschäftsführer:1; Liquidator:1; Prokurist:1,currently registered:2; removed:1,no, +A5019626840,https://openalex.org/A5019626840,Vanessa Fischer,https://orcid.org/0000-0002-2601-3825,8,28,direct_ude,University of Duisburg-Essen,3,Prokurist:2; Geschäftsführer:1,currently registered:3,no, +A5035200670,https://openalex.org/A5035200670,Viktor Fuchs,,3,3,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:3,no, +A5100357649,https://openalex.org/A5100357649,Xiaoyu Wu,https://orcid.org/0000-0003-2985-0917,101,442,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5108120374,https://openalex.org/A5108120374,Xiaoyu Wu,https://orcid.org/0009-0002-5426-5373,38,688,direct_ude,University of Duisburg-Essen,3,Geschäftsführer:3,currently registered:2; removed:1,no, +A5014094111,https://openalex.org/A5014094111,Alexandra König,https://orcid.org/0000-0003-1439-1156,161,1148,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5076816539,https://openalex.org/A5076816539,Andrea Wasmuth,,1,25,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5013535629,https://openalex.org/A5013535629,Andreas Hölzer,,19,1224,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Liquidator:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5017514329,https://openalex.org/A5017514329,André Busch,https://orcid.org/0000-0002-7440-9015,64,911,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5007643000,https://openalex.org/A5007643000,Anke Walendzik,,4,3,direct_ude,University of Duisburg-Essen,4,Prokurist:4; Geschäftsführer:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5012054701,https://openalex.org/A5012054701,Anke Walendzik,https://orcid.org/0000-0001-9687-7525,93,199,direct_ude,University of Duisburg-Essen,4,Prokurist:4; Geschäftsführer:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5037434171,https://openalex.org/A5037434171,Aylin Yildirim,,2,203,child_of_ude,Institut für Energie- und Umwelttechnik,4,Geschäftsführer:4,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5062438505,https://openalex.org/A5062438505,Bettina Kunz,,1,72,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Geschäftsführer:2; Liquidator:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5086977297,https://openalex.org/A5086977297,Björn Sossong,,2,7,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Prokurist:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5067354713,https://openalex.org/A5067354713,Carmen Wolf,https://orcid.org/0000-0001-9362-942X,3,43,child_of_ude,Institut für Energie- und Umwelttechnik,4,Geschäftsführer:6,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110744314,https://openalex.org/A5110744314,Carmen Wolf,,28,189,child_of_ude,Institut für Energie- und Umwelttechnik,4,Geschäftsführer:6,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102928755,https://openalex.org/A5102928755,Christian Büscher,https://orcid.org/0000-0002-3447-6854,21,77,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Prokurist:2; Liquidator:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5039677720,https://openalex.org/A5039677720,Christian Köster,,10,409,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:1; Inhaber:1; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5112440783,https://openalex.org/A5112440783,Christian Lösch,,23,1181,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5081119418,https://openalex.org/A5081119418,Christian Pohlmann,,17,4,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5075679674,https://openalex.org/A5075679674,Christina Schröder,,143,862,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Prokurist:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5045337336,https://openalex.org/A5045337336,Christoph Schlee,,3,42,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5082105394,https://openalex.org/A5082105394,Christoph Schlee,,6,24,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5064594118,https://openalex.org/A5064594118,Christoph Wieland,https://orcid.org/0000-0002-7020-5568,11,241,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4; Prokurist:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5128881947,https://openalex.org/A5128881947,Christoph Wieland,,1,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4; Prokurist:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5007180322,https://openalex.org/A5007180322,David Huber,,3,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Prokurist:2,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5037283509,https://openalex.org/A5037283509,Dirk Bruns,,5,6,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5; Inhaber:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5084473679,https://openalex.org/A5084473679,Falk Hoppe,,1,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5022373299,https://openalex.org/A5022373299,Florian Schmitz,https://orcid.org/0000-0001-6368-628X,79,3610,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5091546460,https://openalex.org/A5091546460,Frank Hölscher,,7,63,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Geschäftsführer:2; Liquidator:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5003188843,https://openalex.org/A5003188843,Gerd Witt,,152,2279,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Geschäftsführer:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5094372701,https://openalex.org/A5094372701,Gerhard Igl,,10,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5023292691,https://openalex.org/A5023292691,Harald Stephan,,40,2848,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Inhaber:2; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5059941495,https://openalex.org/A5059941495,Helmut Bendig,,1,2,child_of_ude,Institut für Energie- und Umwelttechnik,4,Prokurist:8,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5072230284,https://openalex.org/A5072230284,Horst Wegner,,9,34,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Inhaber:1,removed:3; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5066093773,https://openalex.org/A5066093773,Jens Neugebauer,https://orcid.org/0000-0003-2549-8354,38,260,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Prokurist:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5061411374,https://openalex.org/A5061411374,Jochen Seitz,https://orcid.org/0000-0002-0110-7980,156,9308,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108765608,https://openalex.org/A5108765608,Jochen Seitz,,4,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110518795,https://openalex.org/A5110518795,Jochen Seitz,,7,0,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5090731199,https://openalex.org/A5090731199,Jochen Vöge,,4,191,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5005493564,https://openalex.org/A5005493564,Johannes Deckers,,6,61,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Persönlich haftender Gesellschafter:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5013058102,https://openalex.org/A5013058102,Johannes Kunkel,https://orcid.org/0000-0002-4265-8498,24,489,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5017017370,https://openalex.org/A5017017370,Julia Schröder,https://orcid.org/0000-0002-7185-9280,4,7,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:7,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5045562580,https://openalex.org/A5045562580,Jörg Miller,,2,10,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5029505640,https://openalex.org/A5029505640,Kai Werner,,10,34,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Inhaber:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5024005570,https://openalex.org/A5024005570,Klaus Küppers,,13,154,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Geschäftsführer:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5015992672,https://openalex.org/A5015992672,Lars Schulz,,2,33,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:1; Inhaber:1; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110937581,https://openalex.org/A5110937581,Lena Weber,,1,0,direct_ude,University of Duisburg-Essen,4,Prokurist:4; Geschäftsführer:1; Liquidator:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111126900,https://openalex.org/A5111126900,Leon Müller,https://orcid.org/0009-0000-8974-3537,8,2,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Geschäftsführer:2,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5057966782,https://openalex.org/A5057966782,Lokman Coban,,1,7,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:6,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5035281768,https://openalex.org/A5035281768,Lukas Schmidt,,5,10,child_of_ude,The Hydrogen and Fuel Cell Center,4,Geschäftsführer:7; Prokurist:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5009817478,https://openalex.org/A5009817478,Manuel Gruber,https://orcid.org/0000-0002-8353-4651,102,2255,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111377943,https://openalex.org/A5111377943,Marcel Blum,,2,61,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4; Prokurist:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5039476363,https://openalex.org/A5039476363,Marcel Jung,https://orcid.org/0000-0002-8277-3052,5,18,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5083133917,https://openalex.org/A5083133917,Marion Meier,,1,6,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Inhaber:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5050705095,https://openalex.org/A5050705095,Marion Richter,,7,442,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5012138747,https://openalex.org/A5012138747,Martin Dickmann,,3,31,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5; Liquidator:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5107484510,https://openalex.org/A5107484510,Mathias Baumann,,1,92,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Prokurist:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5005757538,https://openalex.org/A5005757538,Mathis Richter,https://orcid.org/0000-0002-3110-6137,26,211,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5045407269,https://openalex.org/A5045407269,Mirko Krüger,https://orcid.org/0000-0002-4739-7151,17,125,direct_ude,University of Duisburg-Essen,4,Inhaber:5; Geschäftsführer:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5041244680,https://openalex.org/A5041244680,Nadia Schneider,,2,22,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5040325001,https://openalex.org/A5040325001,Nicolas Witte,,4,6,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5; Prokurist:2,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5003921169,https://openalex.org/A5003921169,Norbert Knoche,,21,119,direct_ude,University of Duisburg-Essen,4,Prokurist:4,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069883065,https://openalex.org/A5069883065,Oliver Westphal,https://orcid.org/0000-0001-8947-0348,6,10,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Prokurist:2,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5071329147,https://openalex.org/A5071329147,Peter Seydel,,9,187,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Prokurist:2,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108210549,https://openalex.org/A5108210549,Ping Liu,,1,35,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5113645671,https://openalex.org/A5113645671,Rudolph Meyer,,17,375,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:6,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5118598124,https://openalex.org/A5118598124,Rudolph Meyer,,6,2,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:6,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5088354669,https://openalex.org/A5088354669,Simon Schumacher,https://orcid.org/0000-0001-5807-0878,7,184,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Inhaber:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102108148,https://openalex.org/A5102108148,Simon Schumacher,,2,160,child_of_ude,Deutsches Textilforschungszentrum Nord-West,4,Geschäftsführer:3; Inhaber:1,currently registered:2; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5009757205,https://openalex.org/A5009757205,Thomas Dreier,,3,33,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5028487967,https://openalex.org/A5028487967,Thomas Dreier,https://orcid.org/0000-0001-8313-4992,338,3764,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:2; Liquidator:1; Prokurist:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5089311554,https://openalex.org/A5089311554,Thomas Rinke,,2,3,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:3; Inhaber:1,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5104619148,https://openalex.org/A5104619148,Tim Richter,https://orcid.org/0009-0003-8310-6803,1,7,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108850477,https://openalex.org/A5108850477,Tim Richter,,2,4,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:4,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5109529212,https://openalex.org/A5109529212,Ulrich Stephan,,25,178,direct_ude,University of Duisburg-Essen,4,Prokurist:3; Inhaber:1,currently registered:3; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5113843371,https://openalex.org/A5113843371,Wilhelm Kuttler,https://orcid.org/0000-0002-7789-8280,83,2332,direct_ude,University of Duisburg-Essen,4,Geschäftsführer:5,currently registered:4,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5035165383,https://openalex.org/A5035165383,Adrian Engel,,17,29,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5121332174,https://openalex.org/A5121332174,Adrian Engel,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5127667725,https://openalex.org/A5127667725,Adrian Engel,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5128742521,https://openalex.org/A5128742521,Adrian Engel,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5082525618,https://openalex.org/A5082525618,Alexander Beer,,17,212,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5109845912,https://openalex.org/A5109845912,Alexander Korn,https://orcid.org/0009-0002-6258-6791,2,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:6,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5032835186,https://openalex.org/A5032835186,Andreas Sprengel,,5,238,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036222998,https://openalex.org/A5036222998,Andreas de Vries,https://orcid.org/0000-0001-5754-2749,27,297,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5016563483,https://openalex.org/A5016563483,Angelika Sommer,,2,8,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:6; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5064827445,https://openalex.org/A5064827445,Anja Weiß,https://orcid.org/0000-0002-9676-8326,94,977,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Persönlich haftender Gesellschafter:2; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5073916434,https://openalex.org/A5073916434,Astrid Müller,https://orcid.org/0000-0001-6176-2947,347,10183,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Inhaber:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069214188,https://openalex.org/A5069214188,Carolin Schneider,https://orcid.org/0000-0001-7923-0965,7,25,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100337531,https://openalex.org/A5100337531,Chen Wang,https://orcid.org/0000-0002-0213-9642,91,2510,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5012757803,https://openalex.org/A5012757803,Christine Ludwig,,31,563,direct_ude,University of Duisburg-Essen,5,Prokurist:2; Geschäftsführer:1; Inhaber:1; Liquidator:1; Persönlich haftender Gesellschafter:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5072032162,https://openalex.org/A5072032162,Christoph Abraham,https://orcid.org/0000-0003-3536-6507,19,122,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5052392832,https://openalex.org/A5052392832,Christoph Jansen,https://orcid.org/0009-0008-1823-8283,36,290,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103022752,https://openalex.org/A5103022752,Christoph Jansen,https://orcid.org/0000-0001-7473-4160,90,207,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5053198971,https://openalex.org/A5053198971,Daniel Jokisch,,28,1245,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5021967698,https://openalex.org/A5021967698,Daniel Pieper,,2,4,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5081487814,https://openalex.org/A5081487814,Daniela Richter,,3,14,direct_ude,University of Duisburg-Essen,5,Prokurist:4; Geschäftsführer:3; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5021650598,https://openalex.org/A5021650598,Dieter Schramm,https://orcid.org/0000-0002-7945-1853,442,2524,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1; Liquidator:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5105506256,https://openalex.org/A5105506256,Dieter Schramm,,4,9,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1; Liquidator:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5076502958,https://openalex.org/A5076502958,Dirk Reinhardt,https://orcid.org/0000-0002-7027-4483,1032,22797,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:3,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110565330,https://openalex.org/A5110565330,Dominik Schröder,,7,153,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:3,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5002410327,https://openalex.org/A5002410327,Gerd Stein,,2,0,child_of_ude,Deutsches Textilforschungszentrum Nord-West,5,Prokurist:4; Geschäftsführer:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5024573522,https://openalex.org/A5024573522,Harald Heim,,19,1,child_of_ude,Deutsches Textilforschungszentrum Nord-West,5,Geschäftsführer:6; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5086342121,https://openalex.org/A5086342121,Hartmut Finger,,4,103,child_of_ude,Institut für Energie- und Umwelttechnik,5,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5058549966,https://openalex.org/A5058549966,Hubert Beyer,,1,21,child_of_ude,The Hydrogen and Fuel Cell Center,5,Geschäftsführer:6; Persönlich haftender Gesellschafter:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102174490,https://openalex.org/A5102174490,Jens Kuhn,,2,7,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:3,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5088818714,https://openalex.org/A5088818714,Julia Hartmann,https://orcid.org/0000-0002-8873-1419,1,4,direct_ude,University of Duisburg-Essen,5,Prokurist:6; Geschäftsführer:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5004185689,https://openalex.org/A5004185689,Karsten Klemm,,3,26,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:9; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5014302673,https://openalex.org/A5014302673,Klaus Hagedorn,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:6; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110055012,https://openalex.org/A5110055012,Klaus Klemm,,142,1646,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:9,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5117494989,https://openalex.org/A5117494989,Lukas Becker,,2,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5006359291,https://openalex.org/A5006359291,Magdalena Wagner,,1,4,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Prokurist:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5021645988,https://openalex.org/A5021645988,Martin Wagener,https://orcid.org/0000-0001-9180-268X,11,282,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103485046,https://openalex.org/A5103485046,Matthias Schramm,,19,896,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Prokurist:2; Liquidator:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5083099474,https://openalex.org/A5083099474,Michael Bätz,,5,120,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5007586290,https://openalex.org/A5007586290,Michael Lehner,,5,1,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5062924220,https://openalex.org/A5062924220,Michael Lehner,,2,1,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102435026,https://openalex.org/A5102435026,Niklas Müller,https://orcid.org/0009-0005-7904-3525,17,6,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5071569590,https://openalex.org/A5071569590,Nils Beckmann,https://orcid.org/0000-0001-6415-0217,11,94,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5088798409,https://openalex.org/A5088798409,Peter Brockhaus,,3,31,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5070887199,https://openalex.org/A5070887199,Peter Hopp,,3,106,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5049104171,https://openalex.org/A5049104171,Philip Kahl,https://orcid.org/0000-0003-2362-8645,14,742,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5037780525,https://openalex.org/A5037780525,Philipp Richter,,2,2,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Liquidator:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5101450663,https://openalex.org/A5101450663,Philipp Richter,https://orcid.org/0000-0002-8891-3861,21,165,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Liquidator:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5088027497,https://openalex.org/A5088027497,Sascha Neumann,,4,121,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036698793,https://openalex.org/A5036698793,Sebastian Grimm,https://orcid.org/0000-0002-7378-3224,10,117,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:8,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5079723288,https://openalex.org/A5079723288,Sebastian Voigt,https://orcid.org/0000-0003-1544-9903,231,5623,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5020707312,https://openalex.org/A5020707312,Stefan Stoll,https://orcid.org/0000-0002-3656-417X,114,4901,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5030899511,https://openalex.org/A5030899511,Sven Behnke,,4,77,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5; Inhaber:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125290627,https://openalex.org/A5125290627,Sven Lang,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Inhaber:2; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5042329879,https://openalex.org/A5042329879,Tanja Becker,,69,907,direct_ude,University of Duisburg-Essen,5,Prokurist:3; Geschäftsführer:2; Inhaber:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5041130965,https://openalex.org/A5041130965,Tanja Werner,,62,1319,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5028122232,https://openalex.org/A5028122232,Thomas Bogenschütz,,7,166,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:7,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108367853,https://openalex.org/A5108367853,Tim Schmitz,,4,78,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Prokurist:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5060917094,https://openalex.org/A5060917094,Torsten Franz,https://orcid.org/0000-0002-8879-0814,15,217,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:5,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5074048659,https://openalex.org/A5074048659,Ulrich Hagemann,https://orcid.org/0000-0002-1880-6550,170,2550,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Liquidator:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5062127160,https://openalex.org/A5062127160,Ulrich Martin,,3,5,child_of_ude,Institut für Energie- und Umwelttechnik,5,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5047969867,https://openalex.org/A5047969867,Ulrich Pickartz,,2,5,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5001987856,https://openalex.org/A5001987856,Viktor Grünwald,https://orcid.org/0000-0003-2083-7687,637,19737,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Inhaber:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5130826226,https://openalex.org/A5130826226,Viktor Grünwald,,1,0,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Inhaber:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5012503494,https://openalex.org/A5012503494,Volker Hans,,39,303,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:3; Prokurist:2; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5054284319,https://openalex.org/A5054284319,Wolfgang Trautmann,,4,11,direct_ude,University of Duisburg-Essen,5,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108949396,https://openalex.org/A5108949396,Ali Ahmad,,2,17,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111293900,https://openalex.org/A5111293900,Ali Ahmad,,8,35,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5130533550,https://openalex.org/A5130533550,Ali Ahmad,,2,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5130685520,https://openalex.org/A5130685520,Ali Ahmad,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5022652001,https://openalex.org/A5022652001,Andrea Herrmann,https://orcid.org/0000-0002-7850-8344,214,2110,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Prokurist:2; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069736561,https://openalex.org/A5069736561,Andreas Junker,https://orcid.org/0000-0002-8063-9765,67,2524,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5022998651,https://openalex.org/A5022998651,Andreas Vogelsang,https://orcid.org/0000-0003-1041-0815,225,1477,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:2,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5127045878,https://openalex.org/A5127045878,Andreas Vogelsang,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:2,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5026173847,https://openalex.org/A5026173847,André Giese,https://orcid.org/0000-0002-8987-8009,1,33,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Liquidator:2; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5070250060,https://openalex.org/A5070250060,Anja Neumann,https://orcid.org/0000-0002-0921-1360,200,2152,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100857275,https://openalex.org/A5100857275,Anja Neumann,,1,41,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123255867,https://openalex.org/A5123255867,Anja Neumann,,2,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100813838,https://openalex.org/A5100813838,Anja Schwarz,,3,1,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Prokurist:2; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5032007353,https://openalex.org/A5032007353,Bernhard Ganter,https://orcid.org/0000-0003-0767-1379,111,10305,child_of_ude,The Hydrogen and Fuel Cell Center,6,Geschäftsführer:4; Liquidator:3,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5013556611,https://openalex.org/A5013556611,Carsten Ullrich,https://orcid.org/0000-0003-2826-9821,212,2884,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5114883287,https://openalex.org/A5114883287,Christian Scheller,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:7; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5002582354,https://openalex.org/A5002582354,Christoph Blume,,6,43,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:8,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5002857697,https://openalex.org/A5002857697,Felix Weber,https://orcid.org/0000-0002-5910-7182,26,223,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111523838,https://openalex.org/A5111523838,Fritz Beck,,17,32,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Persönlich haftender Gesellschafter:2; Inhaber:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5093811094,https://openalex.org/A5093811094,Gerhard Stahl,,2,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Liquidator:3,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111350063,https://openalex.org/A5111350063,Jasmin Schmidt,,2,1,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036037677,https://openalex.org/A5036037677,Jens Kohlmann,,5,38,direct_ude,University of Duisburg-Essen,6,Prokurist:5; Geschäftsführer:3,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5082298383,https://openalex.org/A5082298383,Jessica Schneider,,4,42,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:2; Liquidator:2; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5046233775,https://openalex.org/A5046233775,Joachim Schuler,,17,103,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103409660,https://openalex.org/A5103409660,Jochen Peters,,7,242,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5024590692,https://openalex.org/A5024590692,Johanna Müller,https://orcid.org/0000-0001-5699-7047,9,71,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:2; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5010069325,https://openalex.org/A5010069325,Katharina Klein,,3,25,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Liquidator:1; Vorstand:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5039487332,https://openalex.org/A5039487332,Malte Weber,https://orcid.org/0009-0006-3074-4205,14,68,direct_ude,University of Duisburg-Essen,6,Prokurist:3; Geschäftsführer:1; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108620165,https://openalex.org/A5108620165,Mario Werner,https://orcid.org/0000-0003-3432-5471,98,1176,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:3; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5046094206,https://openalex.org/A5046094206,Martin Blüggel,,48,1831,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Prokurist:4,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108951191,https://openalex.org/A5108951191,Martin Schuler,,5,11,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123864478,https://openalex.org/A5123864478,Martin Schuler,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5127353107,https://openalex.org/A5127353107,Martin Schuler,,22,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5129089154,https://openalex.org/A5129089154,Martin Schuler,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102185738,https://openalex.org/A5102185738,Maximilian Wolf,,7,41,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103891301,https://openalex.org/A5103891301,Maximilian Wolf,,32,138,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123135447,https://openalex.org/A5123135447,Maximilian Wolf,,1,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5058513513,https://openalex.org/A5058513513,Mike Wenzel,,272,2227,child_of_ude,Institut für Energie- und Umwelttechnik,6,Geschäftsführer:3; Prokurist:2; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5113888013,https://openalex.org/A5113888013,Mike Wenzel,,6,210,child_of_ude,Institut für Energie- und Umwelttechnik,6,Geschäftsführer:3; Prokurist:2; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103078695,https://openalex.org/A5103078695,Nicole Krämer,https://orcid.org/0000-0002-4224-0059,22,395,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5030114850,https://openalex.org/A5030114850,Oliver Martens,,2,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5088381140,https://openalex.org/A5088381140,Peter Kratzer,https://orcid.org/0000-0001-5947-1366,258,6049,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:4,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5003116527,https://openalex.org/A5003116527,Qi Zhang,https://orcid.org/0009-0004-3982-1217,6,14,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100641189,https://openalex.org/A5100641189,Qi Zhang,https://orcid.org/0000-0003-3359-2172,16,101,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5074280631,https://openalex.org/A5074280631,Ralf Kuhlmann,,3,13,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5017131649,https://openalex.org/A5017131649,Robert Seifert,https://orcid.org/0000-0001-5985-7701,197,3380,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5127119058,https://openalex.org/A5127119058,Robert Seifert,,3,0,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:5; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5021741090,https://openalex.org/A5021741090,Rüdiger Schultz,,134,3581,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:6,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5079342266,https://openalex.org/A5079342266,Sebastian Schuster,https://orcid.org/0000-0002-2055-1163,72,741,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Prokurist:3,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5054081254,https://openalex.org/A5054081254,Simone Weiß,,14,504,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Inhaber:2; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5022241592,https://openalex.org/A5022241592,Tobias Stein,https://orcid.org/0000-0001-5145-3630,30,71,direct_ude,University of Duisburg-Essen,6,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5089753284,https://openalex.org/A5089753284,Andreas Hellmann,https://orcid.org/0000-0002-3573-5344,151,1720,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:4; Liquidator:1; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5066213817,https://openalex.org/A5066213817,Andreas Hüttner,,1,7,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Inhaber:2,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5056706108,https://openalex.org/A5056706108,Andreas Roos,https://orcid.org/0000-0003-2833-0928,264,3999,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5091715739,https://openalex.org/A5091715739,Andreas Roos,,28,479,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108819622,https://openalex.org/A5108819622,Andreas Roos,,24,123,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5113291047,https://openalex.org/A5113291047,Andreas Roos,,7,20,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123688451,https://openalex.org/A5123688451,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125129945,https://openalex.org/A5125129945,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125749206,https://openalex.org/A5125749206,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5126021790,https://openalex.org/A5126021790,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5126630247,https://openalex.org/A5126630247,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5128123846,https://openalex.org/A5128123846,Andreas Roos,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5129683483,https://openalex.org/A5129683483,Andreas Roos,,1,1,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5041211483,https://openalex.org/A5041211483,Anja Lange,,25,650,direct_ude,University of Duisburg-Essen,7,Prokurist:5; Geschäftsführer:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5028653294,https://openalex.org/A5028653294,Axel Klein,https://orcid.org/0000-0002-4203-2938,86,282,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:8,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5101697057,https://openalex.org/A5101697057,Axel Klein,https://orcid.org/0000-0002-1762-0201,41,189,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:8,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5008201488,https://openalex.org/A5008201488,Daniel Diekmann,https://orcid.org/0000-0002-0941-4096,27,177,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:5,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5040913972,https://openalex.org/A5040913972,Dennis Schneider,,12,19,direct_ude,University of Duisburg-Essen,7,Prokurist:6; Geschäftsführer:3,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5086202332,https://openalex.org/A5086202332,Dirk Broska,,4,30,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:9; Prokurist:2; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5108458907,https://openalex.org/A5108458907,Günter Zimmer,,17,144,direct_ude,University of Duisburg-Essen,7,Prokurist:3; Geschäftsführer:2; Persönlich haftender Gesellschafter:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100396981,https://openalex.org/A5100396981,Hao Zhang,https://orcid.org/0000-0002-9447-1019,176,1380,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:7; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5008052136,https://openalex.org/A5008052136,Jörg Schaller,https://orcid.org/0000-0003-0477-5877,139,2479,direct_ude,University of Duisburg-Essen,7,Prokurist:3; Geschäftsführer:2; Persönlich haftender Gesellschafter:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125152883,https://openalex.org/A5125152883,Jörg Schaller,,3,0,direct_ude,University of Duisburg-Essen,7,Prokurist:3; Geschäftsführer:2; Persönlich haftender Gesellschafter:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5112788772,https://openalex.org/A5112788772,Jürgen Bruckner,,26,424,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:6; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100612485,https://openalex.org/A5100612485,Katharina Schmidt,https://orcid.org/0000-0001-9397-5285,52,557,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:7; Liquidator:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103840064,https://openalex.org/A5103840064,Katharina Schmidt,,17,454,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:7; Liquidator:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069715592,https://openalex.org/A5069715592,Klaus Barth,,2,1,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5091584361,https://openalex.org/A5091584361,Klaus Barth,,2,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5052755853,https://openalex.org/A5052755853,Marina Schmidt,,2,26,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102080356,https://openalex.org/A5102080356,Max Weber,,8,25,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:4; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5057316063,https://openalex.org/A5057316063,Michael Kloster,https://orcid.org/0000-0001-9244-4925,68,510,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:7,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5085192643,https://openalex.org/A5085192643,Olaf Liedtke,,3,11,direct_ude,University of Duisburg-Essen,7,Prokurist:3; Geschäftsführer:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5033748664,https://openalex.org/A5033748664,Pascal Schneider,,6,11,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Inhaber:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5111726893,https://openalex.org/A5111726893,Peter Rath,,25,424,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Persönlich haftender Gesellschafter:2; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5022560140,https://openalex.org/A5022560140,Rainer Schnell,https://orcid.org/0000-0001-7843-4974,359,3923,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:5; Inhaber:1; Liquidator:1,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5073162924,https://openalex.org/A5073162924,Simon Ritter,,2,24,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5076980201,https://openalex.org/A5076980201,Stefan Friese,,4,10,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:7; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5034732630,https://openalex.org/A5034732630,Thorsten Sander,https://orcid.org/0000-0002-0880-8843,26,226,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:6; Liquidator:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123978064,https://openalex.org/A5123978064,Thorsten Sander,,1,0,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:6; Liquidator:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5000662140,https://openalex.org/A5000662140,Tim Krüger,,2,5,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5080716370,https://openalex.org/A5080716370,Volker Clausen,,52,268,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:6; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5076575576,https://openalex.org/A5076575576,Walter Reinhardt,https://orcid.org/0000-0002-8713-5279,68,1134,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:4; Liquidator:2,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5014001330,https://openalex.org/A5014001330,Wolfgang Gruber,https://orcid.org/0000-0003-2186-9269,191,4152,direct_ude,University of Duisburg-Essen,7,Geschäftsführer:6,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5115595123,https://openalex.org/A5115595123,Andreas Albert,,1,1,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Inhaber:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5115603880,https://openalex.org/A5115603880,Andreas Albert,https://orcid.org/0000-0002-0582-2674,133,4162,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Inhaber:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5063056312,https://openalex.org/A5063056312,André Haase,https://orcid.org/0000-0002-4529-1396,12,72,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5; Prokurist:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5095550956,https://openalex.org/A5095550956,Birgit Meyer,,1,0,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069912429,https://openalex.org/A5069912429,Christian Knobloch,https://orcid.org/0000-0001-5131-039X,7,7,direct_ude,University of Duisburg-Essen,8,Prokurist:3; Geschäftsführer:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5029326684,https://openalex.org/A5029326684,Christoph Horn,https://orcid.org/0000-0002-2762-6463,6,39,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102865092,https://openalex.org/A5102865092,Christopher Schröder,https://orcid.org/0000-0002-4483-8951,134,1823,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5062096123,https://openalex.org/A5062096123,Dirk Schlüter,,5,7,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5019895745,https://openalex.org/A5019895745,Franz-Josef Meyer,,2,53,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:6; Liquidator:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5069914957,https://openalex.org/A5069914957,Henning Kuhlmann,,5,22,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:6; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5076247663,https://openalex.org/A5076247663,Jing Zhang,https://orcid.org/0000-0002-3750-374X,548,27348,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:7,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5045144525,https://openalex.org/A5045144525,Jochen Vogt,,2,0,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5039736409,https://openalex.org/A5039736409,Manuel Weber,https://orcid.org/0000-0002-8649-5977,239,4548,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Inhaber:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5046636790,https://openalex.org/A5046636790,Martina Richter,,40,287,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5; Liquidator:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100869399,https://openalex.org/A5100869399,Martina Richter,,36,62,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5; Liquidator:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5068775949,https://openalex.org/A5068775949,Matthias Benz,https://orcid.org/0000-0002-7577-9691,178,7014,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036362880,https://openalex.org/A5036362880,Patrick Bohn,https://orcid.org/0000-0002-8515-2067,39,626,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:6; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5085357328,https://openalex.org/A5085357328,Peter Rettig,,1,1,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:6; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100667510,https://openalex.org/A5100667510,Qi Liu,https://orcid.org/0000-0003-0110-7750,181,2253,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:5,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5018713421,https://openalex.org/A5018713421,Sascha Hagemann,,16,532,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Inhaber:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036922099,https://openalex.org/A5036922099,Thomas Bartz,,13,64,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103078122,https://openalex.org/A5103078122,Thomas Kiefer,https://orcid.org/0000-0002-7283-4990,120,2701,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:2; Inhaber:1; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5023162593,https://openalex.org/A5023162593,Tobias Braun,,2,0,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:9,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102983474,https://openalex.org/A5102983474,Tobias Braun,https://orcid.org/0000-0001-9336-9306,1,28,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:9,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110556007,https://openalex.org/A5110556007,Tobias Thiele,,43,501,direct_ude,University of Duisburg-Essen,8,Geschäftsführer:4; Persönlich haftender Gesellschafter:2; Inhaber:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5015016155,https://openalex.org/A5015016155,Albert Beer,,2,12,direct_ude,University of Duisburg-Essen,9,Prokurist:3; Geschäftsführer:1; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5054828466,https://openalex.org/A5054828466,Albert Beer,,6,0,direct_ude,University of Duisburg-Essen,9,Prokurist:3; Geschäftsführer:1; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5087345789,https://openalex.org/A5087345789,Alexander Brüning,,2,18,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:8,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5006251667,https://openalex.org/A5006251667,Andreas Thieme,,6,7,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:4; Prokurist:4; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5073100876,https://openalex.org/A5073100876,Andreas Thieme,https://orcid.org/0000-0001-6221-8601,65,585,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:4; Prokurist:4; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125618394,https://openalex.org/A5125618394,Andreas Thieme,,1,0,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:4; Prokurist:4; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5102797453,https://openalex.org/A5102797453,Christoph Marx,https://orcid.org/0009-0000-7620-8017,100,231,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:7,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5067642493,https://openalex.org/A5067642493,Frank Pfeifer,,48,1981,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:3; Inhaber:1; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5057804983,https://openalex.org/A5057804983,Klaus Bartl,,3,59,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:8,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5056334688,https://openalex.org/A5056334688,Manuel Fiedler,,22,25,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:8,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125542216,https://openalex.org/A5125542216,Marcus Roth,,1,0,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:9,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5036507802,https://openalex.org/A5036507802,Martin Schüler,https://orcid.org/0000-0002-2166-3394,996,44791,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5000482421,https://openalex.org/A5000482421,Michael Meltzer,,17,418,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:5,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5121940305,https://openalex.org/A5121940305,Peter Hoyer,,1,0,direct_ude,University of Duisburg-Essen,9,Prokurist:3; Geschäftsführer:2; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5110586432,https://openalex.org/A5110586432,Stefanie Becker,,2,11,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:6; Liquidator:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5006447283,https://openalex.org/A5006447283,Thomas Küpper,,22,1,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5011345883,https://openalex.org/A5011345883,Tobias Hübner,,2,3,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:7,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103027229,https://openalex.org/A5103027229,Tobias Kuhn,https://orcid.org/0000-0002-6725-3470,2,10,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:6,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100380339,https://openalex.org/A5100380339,Yan Li,https://orcid.org/0000-0002-3906-9481,200,3860,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103876626,https://openalex.org/A5103876626,Yan Li,https://orcid.org/0000-0002-3450-6806,14,38,direct_ude,University of Duisburg-Essen,9,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103881897,https://openalex.org/A5103881897,Andrea Schmitz,,44,673,direct_ude,University of Duisburg-Essen,10,Prokurist:3; Geschäftsführer:2; Persönlich haftender Gesellschafter:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5047071096,https://openalex.org/A5047071096,Andrea Schäfer,,2,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5091806917,https://openalex.org/A5091806917,Andreas Behr,https://orcid.org/0000-0002-6818-1878,107,1172,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5001746184,https://openalex.org/A5001746184,Andreas Kempf,,227,6307,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:2; Inhaber:2; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5128774002,https://openalex.org/A5128774002,Andreas Kempf,,1,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:2; Inhaber:2; Prokurist:2,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5065059084,https://openalex.org/A5065059084,Andreas Kopf,https://orcid.org/0000-0002-0111-4638,2,15,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:2; Prokurist:2; Persönlich haftender Gesellschafter:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5046865796,https://openalex.org/A5046865796,Andreas Stöhr,https://orcid.org/0000-0003-1036-2120,291,5084,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5126618638,https://openalex.org/A5126618638,Anja Niemann,,1,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Inhaber:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5026130647,https://openalex.org/A5026130647,Carsten Krause,,20,172,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5112174027,https://openalex.org/A5112174027,Dieter Reinhardt,,4,5,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5074831805,https://openalex.org/A5074831805,Guido Wolf,,23,46,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Inhaber:1; Prokurist:1,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5006001806,https://openalex.org/A5006001806,Jan Siebert,https://orcid.org/0000-0001-7378-3876,6,8,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:7,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5103234025,https://openalex.org/A5103234025,Jens Schumacher,https://orcid.org/0000-0003-4884-7764,10,124,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5035003250,https://openalex.org/A5035003250,Klaus Pohl,,6,30,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5074036780,https://openalex.org/A5074036780,Klaus Pohl,https://orcid.org/0000-0003-2199-5257,306,12954,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5039283594,https://openalex.org/A5039283594,Marco Meier,https://orcid.org/0000-0002-6080-8904,1,8,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5086007116,https://openalex.org/A5086007116,Matthias Linke,https://orcid.org/0000-0002-8814-6316,9,100,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5044176437,https://openalex.org/A5044176437,Michael Erkelenz,https://orcid.org/0000-0003-3485-0380,30,868,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5105098228,https://openalex.org/A5105098228,Michael Erkelenz,,2,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5; Prokurist:1,removed:4; currently registered:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5085748095,https://openalex.org/A5085748095,Michael Fleischer,https://orcid.org/0000-0002-5720-8393,39,827,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5079734558,https://openalex.org/A5079734558,Michael Stratmann,,3,63,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:7; Liquidator:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5062809846,https://openalex.org/A5062809846,Peter Berndt,,2,19,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:4; Inhaber:1; Liquidator:1,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5090934184,https://openalex.org/A5090934184,Petra Stein,,60,651,direct_ude,University of Duisburg-Essen,10,Prokurist:4; Geschäftsführer:2; Inhaber:2,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5035669105,https://openalex.org/A5035669105,Rolf Küpper,,1,11,direct_ude,University of Duisburg-Essen,10,Prokurist:4; Geschäftsführer:2,removed:3; currently registered:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5011673386,https://openalex.org/A5011673386,Simone Lange,,11,1539,direct_ude,University of Duisburg-Essen,10,Prokurist:4; Geschäftsführer:3,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5053775098,https://openalex.org/A5053775098,Stefan Hölscher,,2,8,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:5,currently registered:4; removed:1,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5030649192,https://openalex.org/A5030649192,Stephan Lang,https://orcid.org/0009-0000-4420-9664,873,16973,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5122822060,https://openalex.org/A5122822060,Stephan Lang,,2,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125675957,https://openalex.org/A5125675957,Stephan Lang,,6,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5125682548,https://openalex.org/A5125682548,Stephan Lang,,1,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5126583281,https://openalex.org/A5126583281,Stephan Lang,,2,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5126658578,https://openalex.org/A5126658578,Stephan Lang,,1,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5130106768,https://openalex.org/A5130106768,Stephan Lang,,1,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:5,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5100383092,https://openalex.org/A5100383092,Ying Chen,https://orcid.org/0000-0002-8894-0085,15,285,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5123572043,https://openalex.org/A5123572043,Ying Chen,,8,0,direct_ude,University of Duisburg-Essen,10,Geschäftsführer:6,currently registered:3; removed:2,no,Mehrere Handelsregister-Treffer für denselben Namen; manuelle Prüfung empfohlen. +A5120052452,https://openalex.org/A5120052452,Alex Hoppe,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5020656602,https://openalex.org/A5020656602,Alexander Hahn,https://orcid.org/0000-0002-9305-1768,1,2,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5015660909,https://openalex.org/A5015660909,Alexander Hoffmann,https://orcid.org/0000-0002-8360-6862,129,2699,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5068899403,https://openalex.org/A5068899403,Alexander Huber,,18,181,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:2; Persönlich haftender Gesellschafter:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5124753921,https://openalex.org/A5124753921,Alexander Huber,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:2; Persönlich haftender Gesellschafter:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5108639570,https://openalex.org/A5108639570,Alexander Jahn,,10,171,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5025003490,https://openalex.org/A5025003490,Alexander Neumann,https://orcid.org/0000-0003-1457-354X,64,1058,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:4,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5013496413,https://openalex.org/A5013496413,Alexander Schmitz,https://orcid.org/0000-0002-1018-7054,16,259,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5019137844,https://openalex.org/A5019137844,Alexander Schramm,https://orcid.org/0000-0001-7670-7529,571,16274,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5027254219,https://openalex.org/A5027254219,Alexander Schwarz,https://orcid.org/0000-0003-2276-5947,70,449,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5048818593,https://openalex.org/A5048818593,Alexander Thomas,https://orcid.org/0000-0003-4013-8963,15,90,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102020873,https://openalex.org/A5102020873,Alexander Thomas,https://orcid.org/0000-0001-8185-6828,176,2011,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5103267686,https://openalex.org/A5103267686,Alexander Wagner,https://orcid.org/0000-0002-6162-4875,22,1199,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5039847128,https://openalex.org/A5039847128,Andreas Bayer,,5,44,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5126946569,https://openalex.org/A5126946569,Andreas Giese,,1,0,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:3; Persönlich haftender Gesellschafter:2; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5082807445,https://openalex.org/A5082807445,Andreas Göbel,,7,66,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5082867129,https://openalex.org/A5082867129,Andreas Hüttmann,https://orcid.org/0000-0003-2230-3873,192,8323,direct_ude,University of Duisburg-Essen,>=11,Liquidator:3; Geschäftsführer:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5114186435,https://openalex.org/A5114186435,Andreas Hüttmann,,1,95,direct_ude,University of Duisburg-Essen,>=11,Liquidator:3; Geschäftsführer:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125397163,https://openalex.org/A5125397163,Andreas Hüttmann,,1,0,direct_ude,University of Duisburg-Essen,>=11,Liquidator:3; Geschäftsführer:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5030957194,https://openalex.org/A5030957194,Andreas Jansen,,15,59,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5088483719,https://openalex.org/A5088483719,Andreas Kraus,,25,581,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5014874075,https://openalex.org/A5014874075,Andreas Köhler,https://orcid.org/0000-0001-8904-0380,16,50,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5086206513,https://openalex.org/A5086206513,Andreas Müller,,17,17,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5087818310,https://openalex.org/A5087818310,Andreas Müller,https://orcid.org/0000-0002-7447-700X,132,3425,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5126339947,https://openalex.org/A5126339947,Andreas Müller,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128888404,https://openalex.org/A5128888404,Andreas Müller,,2,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5084350670,https://openalex.org/A5084350670,Andreas Nickel,https://orcid.org/0000-0001-6847-6011,50,268,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Inhaber:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5066427300,https://openalex.org/A5066427300,Andreas Peters,https://orcid.org/0000-0002-3868-7552,152,1212,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1; Prokurist:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5066751418,https://openalex.org/A5066751418,Andreas Pieper,https://orcid.org/0000-0002-9054-7274,34,216,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5058513288,https://openalex.org/A5058513288,Andreas Schönfeld,,35,238,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5004942312,https://openalex.org/A5004942312,Andreas Schütte,https://orcid.org/0000-0002-9915-0601,48,956,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Persönlich haftender Gesellschafter:1,removed:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5034195386,https://openalex.org/A5034195386,André Lorenz,,12,63,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5037792167,https://openalex.org/A5037792167,André Müller,https://orcid.org/0000-0002-7804-8640,68,409,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5078993317,https://openalex.org/A5078993317,Benjamin Otto,,7,10,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5090083006,https://openalex.org/A5090083006,Bernd Menzel,,2,20,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,removed:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5049751836,https://openalex.org/A5049751836,Bernd Wagner,https://orcid.org/0000-0003-0877-6906,29,581,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5090572749,https://openalex.org/A5090572749,Bernhard Müller,https://orcid.org/0000-0002-9573-1417,284,6315,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3; Inhaber:1; Liquidator:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5110010176,https://openalex.org/A5110010176,Christian Baier,,1,39,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5108402711,https://openalex.org/A5108402711,Christian Berg,,14,478,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5086730050,https://openalex.org/A5086730050,Christian Hoffmann,https://orcid.org/0000-0002-5776-439X,16,79,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5038994918,https://openalex.org/A5038994918,Christian Johannes,,69,3119,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5022286426,https://openalex.org/A5022286426,Christian Mayer,https://orcid.org/0000-0003-1681-0553,242,5370,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5075343853,https://openalex.org/A5075343853,Christian Müller,https://orcid.org/0000-0002-2950-446X,75,630,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5120610207,https://openalex.org/A5120610207,Christian Scholz,https://orcid.org/0009-0003-2601-2202,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Persönlich haftender Gesellschafter:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101815496,https://openalex.org/A5101815496,Christian Thiel,https://orcid.org/0000-0002-2290-8242,33,267,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5081725415,https://openalex.org/A5081725415,Christian Vogel,,7,23,direct_ude,University of Duisburg-Essen,>=11,Inhaber:2; Prokurist:2; Geschäftsführer:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5100603203,https://openalex.org/A5100603203,Christian Weber,https://orcid.org/0000-0003-4610-8714,1837,99587,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Persönlich haftender Gesellschafter:2; Inhaber:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5103691262,https://openalex.org/A5103691262,Christian Witt,,32,526,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101676729,https://openalex.org/A5101676729,Christoph Müller,https://orcid.org/0009-0006-0910-9135,11,12,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Inhaber:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5013924170,https://openalex.org/A5013924170,Christoph Schramm,https://orcid.org/0000-0001-6752-0690,93,740,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5065790260,https://openalex.org/A5065790260,Christoph Weber,https://orcid.org/0000-0003-0197-7991,545,5820,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5121605940,https://openalex.org/A5121605940,Christoph Weber,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5123271660,https://openalex.org/A5123271660,Christoph Weber,,1,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5129104343,https://openalex.org/A5129104343,Christoph Weber,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5034523099,https://openalex.org/A5034523099,Claus Günther,,2,25,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5074555350,https://openalex.org/A5074555350,Daniel Hoffmann,https://orcid.org/0000-0003-2973-7869,332,7243,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5100660461,https://openalex.org/A5100660461,Daniel Huber,,7,161,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104102189,https://openalex.org/A5104102189,Daniel Schäfer,,24,303,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5124708205,https://openalex.org/A5124708205,Daniel Schäfer,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5049860860,https://openalex.org/A5049860860,Daniel Steiner,https://orcid.org/0000-0002-1061-9064,34,189,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5105122933,https://openalex.org/A5105122933,Daniel Steiner,,3,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125298692,https://openalex.org/A5125298692,Daniel Steiner,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5007177481,https://openalex.org/A5007177481,Daniel Ziegler,,4,9,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5114803792,https://openalex.org/A5114803792,David Fuchs,https://orcid.org/0009-0008-1483-0714,15,946,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5013220191,https://openalex.org/A5013220191,David Meyer,,12,37,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5024490563,https://openalex.org/A5024490563,Dieter Wolters,,1,13,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5086437544,https://openalex.org/A5086437544,Florian Kunz,https://orcid.org/0000-0002-6640-1814,2,23,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5098818654,https://openalex.org/A5098818654,Frank Becker,,6,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102274030,https://openalex.org/A5102274030,Frank Becker,,2,5,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5107174442,https://openalex.org/A5107174442,Frank Becker,,5,9,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5016436943,https://openalex.org/A5016436943,Frank Kirchner,https://orcid.org/0000-0002-1713-9784,463,6924,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5111842190,https://openalex.org/A5111842190,Frank Schmidt,,159,4718,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:3; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5026728906,https://openalex.org/A5026728906,Frank Schneider,,3,65,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5032121594,https://openalex.org/A5032121594,Frank Weber,https://orcid.org/0000-0002-0995-667X,244,5651,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Persönlich haftender Gesellschafter:2; Liquidator:1; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5062189732,https://openalex.org/A5062189732,Frank Weber,https://orcid.org/0000-0001-8285-5544,394,9324,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Persönlich haftender Gesellschafter:2; Liquidator:1; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5123207204,https://openalex.org/A5123207204,Frank Weber,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Persönlich haftender Gesellschafter:2; Liquidator:1; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5010957617,https://openalex.org/A5010957617,Georg Jansen,https://orcid.org/0000-0002-0724-3895,191,7215,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5090280161,https://openalex.org/A5090280161,Gregor Braun,,4,5,direct_ude,University of Duisburg-Essen,11,Liquidator:4; Geschäftsführer:3,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5095407533,https://openalex.org/A5095407533,Hans Bach,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Prokurist:2; Liquidator:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5035617524,https://openalex.org/A5035617524,Hartmut Engler,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5015932441,https://openalex.org/A5015932441,Hartmut Schmidt,https://orcid.org/0000-0002-2402-7764,1031,21471,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5064646832,https://openalex.org/A5064646832,Hartmut Schmidt,,60,371,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5110660963,https://openalex.org/A5110660963,Heiko Schmidt,,1,38,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5017152518,https://openalex.org/A5017152518,Heiko Schulz,,4,7,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5026150065,https://openalex.org/A5026150065,Helmut Schneider,,9,7,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5038040583,https://openalex.org/A5038040583,Hubert Müller,,51,817,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2; Inhaber:1; Liquidator:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5108956560,https://openalex.org/A5108956560,Hui Wang,,5,30,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:2; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5032210373,https://openalex.org/A5032210373,Jan Müller,,6,30,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5068488252,https://openalex.org/A5068488252,Jan Weber,https://orcid.org/0000-0002-2799-7352,190,4567,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Liquidator:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5059941086,https://openalex.org/A5059941086,Jens Bauer,,20,268,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5087449583,https://openalex.org/A5087449583,Jens Krüger,https://orcid.org/0000-0002-9197-0613,67,1176,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:8; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5036965906,https://openalex.org/A5036965906,Jens Meyer,https://orcid.org/0000-0001-7265-1628,8,143,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5082133427,https://openalex.org/A5082133427,Jens Zimmermann,,2,2,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:3,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5112145711,https://openalex.org/A5112145711,Jochen Schmitz,,72,7028,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5108419254,https://openalex.org/A5108419254,Johannes Koch,,43,1006,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5113022614,https://openalex.org/A5113022614,Johannes Koch,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5008300748,https://openalex.org/A5008300748,Johannes Wendt,,10,152,direct_ude,University of Duisburg-Essen,11,Prokurist:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5034230486,https://openalex.org/A5034230486,Jörg Meyer,,9,388,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101542746,https://openalex.org/A5101542746,Jörg Schröder,https://orcid.org/0000-0001-7167-6022,102,277,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101542747,https://openalex.org/A5101542747,Jörg Schröder,https://orcid.org/0000-0001-7960-9553,550,6814,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5106830254,https://openalex.org/A5106830254,Jörg Schröder,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5120984621,https://openalex.org/A5120984621,Jörg Schröder,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5019933867,https://openalex.org/A5019933867,Jörg Simon,,3,209,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5109281644,https://openalex.org/A5109281644,Jürgen Berger,,5,1705,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Persönlich haftender Gesellschafter:2; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5005751493,https://openalex.org/A5005751493,Jürgen Herzog,https://orcid.org/0000-0002-2971-2859,351,8302,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5072189999,https://openalex.org/A5072189999,Jürgen Herzog,,18,268,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5110555184,https://openalex.org/A5110555184,Jürgen Herzog,,10,6,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5127161804,https://openalex.org/A5127161804,Jürgen Jung,,14,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5032714872,https://openalex.org/A5032714872,Jürgen König,https://orcid.org/0000-0003-3836-4611,255,8464,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Persönlich haftender Gesellschafter:2; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5040353606,https://openalex.org/A5040353606,Jürgen Ziegler,https://orcid.org/0000-0001-9603-5272,359,3119,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5114019148,https://openalex.org/A5114019148,Jürgen Ziegler,,16,3,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5127157117,https://openalex.org/A5127157117,Jürgen Ziegler,,8,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104427325,https://openalex.org/A5104427325,Karina Kruse,,1,16,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5045780650,https://openalex.org/A5045780650,Karsten Schmidt,https://orcid.org/0000-0001-8373-9406,153,2581,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104361385,https://openalex.org/A5104361385,Klaus Jacobs,,2,2,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5108971031,https://openalex.org/A5108971031,Konrad Müller,,36,1258,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5005130277,https://openalex.org/A5005130277,Lars Becker,https://orcid.org/0000-0001-7876-2580,88,500,direct_ude,University of Duisburg-Essen,>=11,Persönlich haftender Gesellschafter:3; Geschäftsführer:2; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5123109097,https://openalex.org/A5123109097,Lars Becker,,1,0,direct_ude,University of Duisburg-Essen,>=11,Persönlich haftender Gesellschafter:3; Geschäftsführer:2; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5015192554,https://openalex.org/A5015192554,Lars Geiger,,16,402,direct_ude,University of Duisburg-Essen,>=11,Prokurist:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5025015463,https://openalex.org/A5025015463,Lars Johannsen,,38,1177,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5109197029,https://openalex.org/A5109197029,Lars Meyer,,103,1275,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128958719,https://openalex.org/A5128958719,Lars Möller,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Vorstand:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5083295173,https://openalex.org/A5083295173,Lars Schmidt,,6,45,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5105774195,https://openalex.org/A5105774195,Lars Schmidt,,10,3,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5027311573,https://openalex.org/A5027311573,Maike Müller,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Liquidator:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5045955262,https://openalex.org/A5045955262,Manfred Lange,,17,228,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5083105835,https://openalex.org/A5083105835,Marc Birkner,,2,79,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5017148486,https://openalex.org/A5017148486,Marcel Kremer,https://orcid.org/0000-0001-9130-7670,14,121,direct_ude,University of Duisburg-Essen,>=11,Persönlich haftender Gesellschafter:4; Geschäftsführer:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5018246741,https://openalex.org/A5018246741,Marcel Noack,,18,57,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:8,removed:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5003062229,https://openalex.org/A5003062229,Marcus Brinkmann,https://orcid.org/0000-0001-6370-5380,28,761,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:4,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5127193245,https://openalex.org/A5127193245,Marcus Schmitt,,9,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5027482134,https://openalex.org/A5027482134,Marion Weber,,4,12,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5024191146,https://openalex.org/A5024191146,Markus Kaiser,https://orcid.org/0000-0002-6540-8520,359,8863,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5028999855,https://openalex.org/A5028999855,Martin Beck,https://orcid.org/0000-0002-7397-1321,252,18495,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Inhaber:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5049649829,https://openalex.org/A5049649829,Martin Busch,,4,191,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5002958357,https://openalex.org/A5002958357,Martin Friedrich,,2,19,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Liquidator:1; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5045477517,https://openalex.org/A5045477517,Martin Lang,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5072066931,https://openalex.org/A5072066931,Martin Lemke,,4,44,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125936671,https://openalex.org/A5125936671,Martin May,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Liquidator:1; Prokurist:1,removed:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5007762483,https://openalex.org/A5007762483,Martin Schäfer,https://orcid.org/0000-0002-4580-6337,100,2270,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Persönlich haftender Gesellschafter:2; Geschäftsführer:1; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5016786021,https://openalex.org/A5016786021,Martin Steinmetz,https://orcid.org/0000-0002-9109-0720,2,7,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5047106177,https://openalex.org/A5047106177,Matthias Brand,https://orcid.org/0000-0001-7194-7697,80,1420,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5121446709,https://openalex.org/A5121446709,Matthias Brand,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5123730804,https://openalex.org/A5123730804,Matthias Brand,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125038989,https://openalex.org/A5125038989,Matthias Brand,,1,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5129971313,https://openalex.org/A5129971313,Matthias Brand,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5130612736,https://openalex.org/A5130612736,Matthias Brand,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5018982548,https://openalex.org/A5018982548,Matthias Bähr,https://orcid.org/0000-0003-2598-1442,27,146,child_of_ude,The Hydrogen and Fuel Cell Center,>=11,Geschäftsführer:5,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5083966487,https://openalex.org/A5083966487,Matthias Kramer,https://orcid.org/0000-0002-4865-7023,12,4,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5003105833,https://openalex.org/A5003105833,Michael Berger,https://orcid.org/0000-0002-3469-0076,185,6927,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5085864136,https://openalex.org/A5085864136,Michael Berger,,10,55,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102099848,https://openalex.org/A5102099848,Michael Berger,,41,3027,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125930652,https://openalex.org/A5125930652,Michael Berger,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5045643257,https://openalex.org/A5045643257,Michael Braun,https://orcid.org/0000-0002-3961-6211,33,608,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5103428777,https://openalex.org/A5103428777,Michael Braun,,15,117,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104591730,https://openalex.org/A5104591730,Michael Faust,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5039072748,https://openalex.org/A5039072748,Michael Giese,https://orcid.org/0000-0001-6355-536X,239,3476,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5073979306,https://openalex.org/A5073979306,Michael Jahn,https://orcid.org/0000-0002-7493-205X,72,1278,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Inhaber:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5080777994,https://openalex.org/A5080777994,Michael Kamp,https://orcid.org/0000-0001-6231-0694,71,1138,child_of_ude,Institute for Advanced Study in the Humanities Essen,>=11,Geschäftsführer:7; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5067507616,https://openalex.org/A5067507616,Michael Klein,https://orcid.org/0000-0002-1448-9535,83,908,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5060412934,https://openalex.org/A5060412934,Michael Korn,,3,36,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5073107581,https://openalex.org/A5073107581,Michael Philipp,,202,3070,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5061602677,https://openalex.org/A5061602677,Michael Pies,,5,24,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:8,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5117265306,https://openalex.org/A5117265306,Michael Schmitz,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5025836402,https://openalex.org/A5025836402,Michael Steffen,,42,379,child_of_ude,The Hydrogen and Fuel Cell Center,>=11,Geschäftsführer:3; Prokurist:3; Inhaber:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101742920,https://openalex.org/A5101742920,Michael Wurm,https://orcid.org/0000-0002-3419-2202,7,50,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5034259217,https://openalex.org/A5034259217,Norbert Schwarz,https://orcid.org/0000-0002-8868-7067,764,91389,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Inhaber:1; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5007001298,https://openalex.org/A5007001298,Oliver Schwarz,https://orcid.org/0000-0003-3434-5640,209,1803,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5118729889,https://openalex.org/A5118729889,Oliver Schwarz,https://orcid.org/0000-0003-0930-9752,1,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5069695058,https://openalex.org/A5069695058,Peter Bayer,https://orcid.org/0000-0003-0435-7202,163,4001,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5122335477,https://openalex.org/A5122335477,Peter Haase,,4,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5126565073,https://openalex.org/A5126565073,Peter Haase,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128761798,https://openalex.org/A5128761798,Peter Haase,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128789493,https://openalex.org/A5128789493,Peter Haase,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5044056577,https://openalex.org/A5044056577,Peter Hinz,,2,35,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5015245862,https://openalex.org/A5015245862,Peter Jung,https://orcid.org/0000-0001-7679-9697,894,22945,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101501818,https://openalex.org/A5101501818,Peter Jung,https://orcid.org/0000-0001-7002-8840,62,70,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5130157755,https://openalex.org/A5130157755,Peter Jung,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5130524017,https://openalex.org/A5130524017,Peter Jung,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5095512590,https://openalex.org/A5095512590,Peter Klein,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Liquidator:2; Inhaber:1; Prokurist:1,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5073786564,https://openalex.org/A5073786564,Peter Kramer,,4,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5005284699,https://openalex.org/A5005284699,Peter Vogel,,1,0,child_of_ude,Deutsches Textilforschungszentrum Nord-West,>=11,Geschäftsführer:3; Liquidator:1; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5078736126,https://openalex.org/A5078736126,Peter Vogel,,2,0,child_of_ude,Deutsches Textilforschungszentrum Nord-West,>=11,Geschäftsführer:3; Liquidator:1; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5073677785,https://openalex.org/A5073677785,Philipp Heim,,40,677,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5000527934,https://openalex.org/A5000527934,Ralf Herrmann,,99,3438,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5091333429,https://openalex.org/A5091333429,Ralf Küppers,https://orcid.org/0000-0002-6691-7191,510,44299,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:4; Liquidator:1; Persönlich haftender Gesellschafter:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5103187419,https://openalex.org/A5103187419,Ralf Müller,,200,4724,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1; Liquidator:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5077021691,https://openalex.org/A5077021691,Ralf Sauer,,3,32,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:1; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5014597935,https://openalex.org/A5014597935,Reinhard Schulz,,1,0,direct_ude,University of Duisburg-Essen,>=11,Liquidator:3; Geschäftsführer:2; Prokurist:2,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101832860,https://openalex.org/A5101832860,Robert Huber,https://orcid.org/0000-0002-0133-5334,746,81882,direct_ude,University of Duisburg-Essen,>=11,Prokurist:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5113600462,https://openalex.org/A5113600462,Robert Huber,,7,794,direct_ude,University of Duisburg-Essen,>=11,Prokurist:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5078738600,https://openalex.org/A5078738600,Rolf Braun,,4,11,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5129673745,https://openalex.org/A5129673745,Rudolf Walter,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,removed:4; currently registered:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5122103793,https://openalex.org/A5122103793,Sebastian Bauer,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5127808287,https://openalex.org/A5127808287,Sebastian Bauer,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5130591899,https://openalex.org/A5130591899,Sebastian Bauer,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7; Prokurist:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104110302,https://openalex.org/A5104110302,Sebastian Klein,,123,992,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5078421413,https://openalex.org/A5078421413,Sebastian Seidel,,6,72,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5028574608,https://openalex.org/A5028574608,Stefan Behrendt,,2,31,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:3; Prokurist:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5058806029,https://openalex.org/A5058806029,Stefan Blum,,4,56,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:3; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5072469617,https://openalex.org/A5072469617,Stefan Esser,,19,574,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:5,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125494958,https://openalex.org/A5125494958,Stefan Esser,,2,0,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:5,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5111761334,https://openalex.org/A5111761334,Stefan Franke,,1,14,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2; Liquidator:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5079997249,https://openalex.org/A5079997249,Stefan Heimann,,40,469,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Prokurist:2; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5029839616,https://openalex.org/A5029839616,Stefan Klein,,4,29,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5090938768,https://openalex.org/A5090938768,Stefan Wagner,https://orcid.org/0000-0001-9737-2246,123,1396,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Inhaber:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5062639221,https://openalex.org/A5062639221,Steffen Schulze,,2,1,child_of_ude,The Hydrogen and Fuel Cell Center,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5004351252,https://openalex.org/A5004351252,Stephan Schulz,https://orcid.org/0000-0003-2896-4488,991,10298,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5081179735,https://openalex.org/A5081179735,Stephan Schulz,https://orcid.org/0000-0002-3271-0897,10,20,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128899158,https://openalex.org/A5128899158,Stephan Schulz,,1,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5114232030,https://openalex.org/A5114232030,Sven Kaiser,,2,12,child_of_ude,The Hydrogen and Fuel Cell Center,>=11,Geschäftsführer:6; Liquidator:2,removed:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5080964269,https://openalex.org/A5080964269,Sven Schulz,https://orcid.org/0000-0002-2663-5157,76,438,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:1; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5039812689,https://openalex.org/A5039812689,Sven Simon,https://orcid.org/0000-0002-6204-5437,229,2665,direct_ude,University of Duisburg-Essen,>=11,Prokurist:5,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5003438467,https://openalex.org/A5003438467,Thilo Krämer,https://orcid.org/0000-0001-8806-8138,2,26,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5126851559,https://openalex.org/A5126851559,Thomas Brock,,1,0,child_of_ude,The Hydrogen and Fuel Cell Center,11,Geschäftsführer:3; Liquidator:2; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5107844819,https://openalex.org/A5107844819,Thomas Ernst,,93,8229,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128656245,https://openalex.org/A5128656245,Thomas Günther,,2,0,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Geschäftsführer:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5104272425,https://openalex.org/A5104272425,Thomas Herold,,135,2512,direct_ude,University of Duisburg-Essen,>=11,Prokurist:4; Liquidator:1,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5071644998,https://openalex.org/A5071644998,Thomas Kaiser,https://orcid.org/0000-0001-9679-5968,542,5080,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5111380960,https://openalex.org/A5111380960,Thomas Kaiser,,2,43,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5112411494,https://openalex.org/A5112411494,Thomas Kaiser,,36,182,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5121025589,https://openalex.org/A5121025589,Thomas Kaiser,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5122994949,https://openalex.org/A5122994949,Thomas Kaiser,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5128141811,https://openalex.org/A5128141811,Thomas Kaiser,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5043600020,https://openalex.org/A5043600020,Thomas Keller,https://orcid.org/0000-0002-0126-4206,11,56,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5001102432,https://openalex.org/A5001102432,Thomas Klaus,,7,73,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5100733589,https://openalex.org/A5100733589,Thomas Schmidt,https://orcid.org/0000-0003-0026-6450,431,2352,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Inhaber:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5111432183,https://openalex.org/A5111432183,Thomas Schrader,,5,188,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2; Inhaber:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5101881137,https:/A5101881137/openalex.org/,Thomas Wagner,https://orcid.org/0000-0002-6853-0572,81,2335,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:2; Persönlich haftender Gesellschafter:2; Prokurist:2; Inhaber:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5082063437,https://openalex.org/A5082063437,Thomas Weber,https://orcid.org/0000-0002-3758-4279,42,154,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:1,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5089915448,https://openalex.org/A5089915448,Thomas Wilke,,2,6,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Inhaber:1; Liquidator:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5001069608,https://openalex.org/A5001069608,Tim Becker,https://orcid.org/0009-0005-2072-4801,10,27,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102492004,https://openalex.org/A5102492004,Tim Becker,,6,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5123126640,https://openalex.org/A5123126640,Tobias Koch,,2,0,child_of_ude,Institut für Energie- und Umwelttechnik,>=11,Geschäftsführer:6,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5036606635,https://openalex.org/A5036606635,Tobias Lerchner,https://orcid.org/0000-0003-1120-4087,15,59,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5114473811,https://openalex.org/A5114473811,Tobias Schwarz,,1,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:6; Prokurist:3,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5013486947,https://openalex.org/A5013486947,Ulrich Frank,https://orcid.org/0000-0002-8057-1836,281,5408,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5113980542,https://openalex.org/A5113980542,Ulrich Frank,,2,9,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:3,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5028558427,https://openalex.org/A5028558427,Ulrich Schmitz,https://orcid.org/0000-0002-9975-9716,185,985,direct_ude,University of Duisburg-Essen,>=11,Prokurist:3; Geschäftsführer:2,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5112081965,https://openalex.org/A5112081965,Ulrich Schneider,,9,4,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5010002069,https://openalex.org/A5010002069,Ulrich Schreiber,https://orcid.org/0000-0002-3775-5058,649,6664,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102336075,https://openalex.org/A5102336075,Ulrich Schreiber,,6,13,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5120714179,https://openalex.org/A5120714179,Ulrich Schreiber,,1,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:3; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5088909041,https://openalex.org/A5088909041,Uwe Martens,,3,9,direct_ude,University of Duisburg-Essen,11,Geschäftsführer:4; Prokurist:2; Liquidator:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5028270597,https://openalex.org/A5028270597,Verena Schmitt,https://orcid.org/0000-0002-6951-6406,42,638,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:7,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5009676373,https://openalex.org/A5009676373,Wolfgang Franke,,4,28,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:3,currently registered:5,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5024948331,https://openalex.org/A5024948331,Wolfgang Funk,,1,2,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Inhaber:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5102399620,https://openalex.org/A5102399620,Wolfgang Günther,,5,8,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Prokurist:2,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5085834772,https://openalex.org/A5085834772,Wolfgang Schmidt,,2,0,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:4; Liquidator:1; Persönlich haftender Gesellschafter:1; Prokurist:1,currently registered:4; removed:1,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5070205178,https://openalex.org/A5070205178,Wolfgang Stein,,3,0,child_of_ude,Deutsches Textilforschungszentrum Nord-West,>=11,Geschäftsführer:5; Liquidator:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5125267612,https://openalex.org/A5125267612,Xin Wang,,4,1,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5; Inhaber:1,removed:3; currently registered:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. +A5066622183,https://openalex.org/A5066622183,Yu Zhang,https://orcid.org/0000-0003-3579-4675,1,23,direct_ude,University of Duisburg-Essen,>=11,Geschäftsführer:5,currently registered:3; removed:2,yes,Häufig vorkommender Name: Die Ergebnisse basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten. diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..a285f721 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,28 @@ +{ + "name": "smartguide", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "prettier": "^3.8.3" + } + }, + "node_modules/prettier": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", + "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..c689305c --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "prettier": "^3.8.3" + } +} diff --git a/projects_eu_all_names.txt b/projects_eu_all_names.txt new file mode 100644 index 00000000..2f5cc250 --- /dev/null +++ b/projects_eu_all_names.txt @@ -0,0 +1,8 @@ +UNIVERSITAET DUISBURG-ESSEN +UNIVERSITAET DUISBURG-ESSEN - STANDORT DUISBURG +UNIVERSITÄT DUISBURG-ESSEN +UNIVERSITAET DUISBURG-ESSEN - STANDORT ESSEN +UNIVERSITAET DUISBURG-ESSEN (UNIVERSITY OF DUISBURG-ESSEN) +UNIVERSITAT DUISBURG-ESSEN +UNIVERSITY OF DUISBURG-ESSEN +UNIVERSITÄT DUISBURG ESSEN \ No newline at end of file diff --git a/service/Dockerfile b/service/Dockerfile index 2335ec87..90d1a619 100644 --- a/service/Dockerfile +++ b/service/Dockerfile @@ -1,9 +1,7 @@ -FROM python:3.12-slim-bookworm +ARG BASE_IMAGE=inse-base-static:latest +FROM $BASE_IMAGE -RUN mkdir /test && \ - mkdir /data && \ - pip install --root-user-action=ignore --no-cache-dir --upgrade pip && \ - pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-check \ +RUN pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-check \ "fastapi~=0.115.0" \ "SQLAlchemy~=2.0.0" \ "pyjwt~=2.8.0" \ diff --git a/service/Dockerfile.base b/service/Dockerfile.base new file mode 100644 index 00000000..b278044a --- /dev/null +++ b/service/Dockerfile.base @@ -0,0 +1,10 @@ +FROM python:3.12-slim-bookworm + +RUN mkdir /test && \ + mkdir /data && \ + pip install --root-user-action=ignore --no-cache-dir --upgrade pip && \ + pip install --root-user-action=ignore --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ + pip install --root-user-action=ignore --no-cache-dir "sentence-transformers~=5.5.1" + +ENV SENTENCE_TRANSFORMERS_HOME=/models +RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('intfloat/multilingual-e5-base')" diff --git a/service/README.md b/service/README.md index da2cffce..ca09165c 100644 --- a/service/README.md +++ b/service/README.md @@ -10,8 +10,8 @@ To build the container: `./gradlew :service:build` To launch the service with hot-reload: `./gradlew :service:serve` -This mounts the source directory into the container and enables uvicorn hot-reloading. Press *ENTER* to stop. +This mounts the source directory into the container and enables uvicorn hot-reloading. Press _ENTER_ to stop. ## Testing -Run tests: `./gradlew :service:test` \ No newline at end of file +Run tests: `./gradlew :service:test` diff --git a/service/build.gradle b/service/build.gradle index 0d569c9c..066a7af3 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -2,7 +2,32 @@ plugins { id 'base' } +task createBaseImage(type: Exec) { + commandLine 'docker', 'build', '--platform', "${targetPlatform}", '-f', 'Dockerfile.base', '-t', "${imagePrefix}-base-static:latest", '.' +} + +task buildBaseImageIfNeeded { + doLast { + def baseImage = "${imagePrefix}-base-static:latest" + def checkCmd = ["docker", "image", "inspect", baseImage] + def process = checkCmd.execute() + process.waitFor() + if (process.exitValue() != 0) { + println "Base image ${baseImage} not found. Building it..." + def buildCmd = ["docker", "build", "--platform", "${targetPlatform}", "-f", "Dockerfile.base", "-t", baseImage, "."] + def buildProcess = buildCmd.execute([], projectDir) + buildProcess.consumeProcessOutput(System.out, System.err) + if (buildProcess.waitFor() != 0) { + throw new GradleException("Failed to build base image.") + } + } else { + println "Base image ${baseImage} found. Skipping build." + } + } +} + task createImage(type: Exec) { + dependsOn buildBaseImageIfNeeded commandLine 'docker', 'build', '--platform', "${targetPlatform}", '-t', "${imagePrefix}-service:${imageVersion}", '.' } @@ -24,7 +49,7 @@ task exportOpenApiSpec(type: Exec) { commandLine 'docker', 'run', '--rm', '--platform', "${targetPlatform}", '-w', '/home', - '-v', "${projectDir}/src/main:/home", + //'-v', "${projectDir}/src/main:/home", the source code is already baked into the image at build time '-v', "${openApiDir}:/mnt/openapi", '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", '--name', "${imageName}-service-openapi", diff --git a/service/pyproject.toml b/service/pyproject.toml index 689f20cf..9e45ebc4 100644 --- a/service/pyproject.toml +++ b/service/pyproject.toml @@ -19,4 +19,14 @@ dependencies = [ "pyyaml~=6.0.1", "sqlalchemy~=2.0.0", "uvicorn~=0.29.0", + "sentence-transformers~=5.5.1", + "torch", ] + +[[tool.uv.index]] +name = "pytorch-cpu" +url = "https://download.pytorch.org/whl/cpu" +explicit = true + +[tool.uv.sources] +torch = { index = "pytorch-cpu" } diff --git a/service/sentence_transformer/download_model.py b/service/sentence_transformer/download_model.py new file mode 100644 index 00000000..60db0a4b --- /dev/null +++ b/service/sentence_transformer/download_model.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +""" +Download the sentence-transformers model to the default cache directory +so it is available for local runs or testing. + +Usage (run once from project root): + python service/sentence_transformer/download_model.py +""" +from sentence_transformers import SentenceTransformer + +MODEL_NAME = "paraphrase-multilingual-mpnet-base-v2" +print(f"Downloading '{MODEL_NAME}' to default cache directory...") +model = SentenceTransformer(MODEL_NAME) +print("Done.") diff --git a/service/sentence_transformer/index_topics.py b/service/sentence_transformer/index_topics.py new file mode 100644 index 00000000..12f29a9d --- /dev/null +++ b/service/sentence_transformer/index_topics.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python3 +""" +Script to fetch all topics from 'openalex-topics', +vectorize display names, full descriptions, and individual keywords using the sentence-transformers model, +and push them to the 'topicvectors' index with multi-vector mapping. +""" +import sys +import json +from pathlib import Path +import httpx +from dotenv import load_dotenv + +# Add service/src/main to python path to load settings +current_dir = Path(__file__).parent.resolve() +project_root = current_dir.parent.parent.resolve() +env_path = project_root / "service" / "src" / "main" / "inse" / ".env" +load_dotenv(dotenv_path=env_path) + +sys.path.append(str(project_root / "service" / "src" / "main")) +from inse.config import settings + +ELASTIC_URL = settings.elasticsearch_url +if ELASTIC_URL and not ELASTIC_URL.endswith("/"): + ELASTIC_URL += "/" +API_KEY = settings.elasticsearch_api_key +MODEL_NAME = settings.sentence_transformers_model_name + +# Import sentence-transformers +from sentence_transformers import SentenceTransformer + +headers = { + "Authorization": f"ApiKey {API_KEY}", + "Content-Type": "application/json" +} + +def fetch_all_topics(): + print("Fetching topics from 'openalex-topics'...") + topics = [] + size = 1000 + offset = 0 + + with httpx.Client(timeout=60.0) as client: + while True: + payload = { + "query": {"match_all": {}}, + "from": offset, + "size": size + } + resp = client.post( + f"{ELASTIC_URL}openalex-topics/_search", + json=payload, + headers=headers + ) + resp.raise_for_status() + data = resp.json() + hits = data.get("hits", {}).get("hits", []) + if not hits: + break + topics.extend(hits) + offset += len(hits) + print(f"Fetched {len(topics)} topics so far...") + if len(hits) < size: + break + + print(f"Total topics fetched: {len(topics)}") + return topics + +def update_mappings(): + print("Checking/updating mappings for 'topicvectors'...") + mapping_payload = { + "properties": { + "display_name_vector": { + "type": "dense_vector", + "dims": 768, + "index": True, + "similarity": "cosine", + "index_options": { + "type": "int8_hnsw", + "m": 16, + "ef_construction": 100 + } + }, + "keyword_vectors": { + "type": "nested", + "properties": { + "vector": { + "type": "dense_vector", + "dims": 768, + "index": True, + "similarity": "cosine", + "index_options": { + "type": "int8_hnsw", + "m": 16, + "ef_construction": 100 + } + } + } + } + } + } + with httpx.Client(timeout=30.0) as client: + # Check if index exists + check_resp = client.get(f"{ELASTIC_URL}topicvectors", headers=headers) + if check_resp.status_code == 404: + print("Index 'topicvectors' does not exist. Creating it...") + create_payload = { + "mappings": mapping_payload + } + resp = client.put(f"{ELASTIC_URL}topicvectors", json=create_payload, headers=headers) + resp.raise_for_status() + else: + print("Index 'topicvectors' exists. Updating mappings...") + resp = client.put(f"{ELASTIC_URL}topicvectors/_mapping", json=mapping_payload, headers=headers) + resp.raise_for_status() + print("Mappings update process completed.") + +def bulk_index_topics(topics, display_name_vectors, keyword_vectors_list): + print("Bulk indexing vectorized topics into 'topicvectors'...") + batch_size = 500 + + with httpx.Client(timeout=60.0) as client: + for i in range(0, len(topics), batch_size): + batch_topics = topics[i:i+batch_size] + batch_name_vecs = display_name_vectors[i:i+batch_size] + batch_kw_vecs_list = keyword_vectors_list[i:i+batch_size] + + bulk_lines = [] + for t, name_vec, kw_vecs in zip(batch_topics, batch_name_vecs, batch_kw_vecs_list): + source = t["_source"] + + source.pop("siblings", None) # drop siblings field when making the copy + source.pop("description", None) # drop description field entirely + + # Assign name vector as a standard float list + source["display_name_vector"] = name_vec.tolist() + + # Assign nested keyword vectors + source["keyword_vectors"] = [ + {"vector": vec.tolist()} for vec in kw_vecs + ] + + # Meta line + meta = {"index": {"_index": "topicvectors", "_id": t["_id"]}} + bulk_lines.append(json.dumps(meta)) + # Document line + bulk_lines.append(json.dumps(source)) + + payload = "\n".join(bulk_lines) + "\n" + resp = client.post( + f"{ELASTIC_URL}_bulk", + content=payload, + headers={"Authorization": f"ApiKey {API_KEY}", "Content-Type": "application/x-ndjson"} + ) + resp.raise_for_status() + resp_data = resp.json() + if resp_data.get("errors"): + print("Bulk indexing encountered errors! First few failed items:") + failed_items = [item for item in resp_data.get("items", []) if item.get("index", {}).get("status", 200) >= 400] + for item in failed_items[:5]: + print(json.dumps(item, indent=2)) + raise ValueError("Bulk indexing failed with document errors.") + print(f"Indexed batch {i} to {i + len(batch_topics)}") + +def main(): + update_mappings() + + topics = fetch_all_topics() + if not topics: + print("No topics found. Exiting.") + return + + print(f"Initializing SentenceTransformer model '{MODEL_NAME}'...") + model = SentenceTransformer(MODEL_NAME) + + # 1. Gather all texts to embed + keywords_by_topic = [] + all_texts_to_embed = [] + + for t in topics: + source = t["_source"] + + name = source.get("display_name") or "" + all_texts_to_embed.append(name) + + kws = source.get("keywords") or [] + if not isinstance(kws, list): + kws = [kws] if kws else [] + keywords_by_topic.append(kws) + all_texts_to_embed.extend(kws) + + print(f"Embedding {len(all_texts_to_embed)} texts (display names and keywords)...") + all_vectors = model.encode(all_texts_to_embed, show_progress_bar=True, batch_size=32) + + # 2. Map embeddings back to topics + display_name_vectors = [] + keyword_vectors_list = [] + + vector_idx = 0 + for idx, t in enumerate(topics): + + display_name_vectors.append(all_vectors[vector_idx]) + vector_idx += 1 + + kws = keywords_by_topic[idx] + topic_kw_vecs = [] + for _ in range(len(kws)): + topic_kw_vecs.append(all_vectors[vector_idx]) + vector_idx += 1 + keyword_vectors_list.append(topic_kw_vecs) + + # Bulk index + bulk_index_topics(topics, display_name_vectors, keyword_vectors_list) + print("Done!") + +if __name__ == "__main__": + main() diff --git a/service/src/data/topic_hierarchy_cache.json b/service/src/data/topic_hierarchy_cache.json index 01664b6b..6e6c2acc 100644 --- a/service/src/data/topic_hierarchy_cache.json +++ b/service/src/data/topic_hierarchy_cache.json @@ -27095,4 +27095,4 @@ "field": "Medicine", "domain": "Health Sciences" } -} \ No newline at end of file +} diff --git a/service/src/data/users.json b/service/src/data/users.json index 2ff26e5a..450db22c 100644 --- a/service/src/data/users.json +++ b/service/src/data/users.json @@ -1,18 +1,22 @@ { - "users": [ - { - "account": 0, - "organization": 0, - "username": "superadmin", - "password": "superadmin", - "superadmin": true - }, - { - "account": 1, - "organization": 1, - "username": "user", - "password": "user", - "superadmin": false - } - ] -} \ No newline at end of file + "users": [ + { + "username": "superadmin", + "password": "superadmin", + "email": "some_email@uni-due.de", + "account": 0, + "organization": 0, + "organization_name": "University of Duisburg-Essen", + "superadmin": true + }, + { + "username": "user", + "password": "user", + "email": "user_email@uni-due.de", + "account": 1, + "organization": 1, + "organization_name": "University of Duisburg-Essen", + "superadmin": false + } + ] +} diff --git a/service/src/main/inse/.env b/service/src/main/inse/.env index f2fc4762..05a15cad 100644 --- a/service/src/main/inse/.env +++ b/service/src/main/inse/.env @@ -3,4 +3,20 @@ ELASTICSEARCH_API_KEY=am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ LLM_API_URL=https://project.nes.uni-due.de/llm2/v1/ LLM_API_KEY=c2d5e7ccf7a4760dd3d19bed2caed9d85ff7437400e0ea82a6d6f912ebc2f212 -LLM_MODEL=gemma4-e4b \ No newline at end of file +LLM_MODEL=gemma4-e4b + +# Patent search (EPO + USPTO) +PATENT_ELASTICSEARCH_URL=https://inse.nes.uni-due.de/elastic +PATENT_ELASTICSEARCH_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +ELASTICSEARCH_URL=https://project.nes.uni-due.de/elastic +ELASTICSEARCH_API_KEY=am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ + +ELASTICSEARCH_INSE_URL=https://inse.nes.uni-due.de/elastic +ELASTICSEARCH_INSE_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== + +LLM_API_URL=https://project.nes.uni-due.de/llm2/v1/ +LLM_API_KEY=c2d5e7ccf7a4760dd3d19bed2caed9d85ff7437400e0ea82a6d6f912ebc2f212 +LLM_MODEL=gemma4-e4b + +# Sentence Transformers Configuration +SENTENCE_TRANSFORMERS_MODEL_NAME=intfloat/multilingual-e5-base diff --git a/service/src/main/inse/account/logic.py b/service/src/main/inse/account/logic.py index 96257b7e..b443254c 100644 --- a/service/src/main/inse/account/logic.py +++ b/service/src/main/inse/account/logic.py @@ -33,3 +33,34 @@ def validate_user(username: str, password: str) -> typing.Optional[model.User]: if user and user.password == password: return user return None + +def create_user(username, password, email, institution, superadmin) -> typing.Optional[model.User]: + ''' Adds a new user to the user configuration file. ''' + users = _get_users() + if any(u.username == username for u in users): + logger.warning("Attempt to create duplicate user: %s", username) + return None + + # Determine new IDs + next_account = max((u.account for u in users), default=0) + 1 + next_org = max((u.organization for u in users), default=0) + 1 + + new_user = model.User( + username=username, + password=password, + email=email, + account=next_account, + organization=next_org, + organization_name=institution, + superadmin=superadmin + ) + + users.append(new_user) + user_file = model.UserFile(users=users) + try: + with open('../data/users.json', 'w') as file: + file.write(user_file.model_dump_json(indent=4)) + return new_user + except Exception as e: + logger.error('Could not write user configuration file.', exc_info=e) + return None diff --git a/service/src/main/inse/account/model.py b/service/src/main/inse/account/model.py index dd409091..6a2cca19 100644 --- a/service/src/main/inse/account/model.py +++ b/service/src/main/inse/account/model.py @@ -13,8 +13,10 @@ class User(BaseModel): ''' An entry in the user configuration file. ''' username: str = Field(description="The username of the user.") password: str = Field(description="The password of the user.") + email: str = Field(description="The email of the user.") account: StrictInt = Field(description="The account id of the user.") organization: StrictInt = Field(description="The organization id of the user.") + organization_name: str = Field(description="The organization name of the user.") superadmin: bool = Field(default=False, description="Indicates whether the user is a superadmin.") @@ -27,6 +29,8 @@ class AuthAccount(BaseModel): i: int l: str o: int + e: str + on: str class AuthScope(BaseModel): diff --git a/service/src/main/inse/account/service.py b/service/src/main/inse/account/service.py index 7e67bb19..ae99cd7b 100644 --- a/service/src/main/inse/account/service.py +++ b/service/src/main/inse/account/service.py @@ -27,6 +27,7 @@ router = fastapi.APIRouter( @router.post( "/auth/id", + operation_id="getIdentityGrant", responses={ HTTP_200_OK: {"model": model.IdentityGrant}, HTTP_400_BAD_REQUEST: { @@ -55,7 +56,11 @@ async def get_identity_grant( exp = 12 * 60 * 60 token = security.id_token(user, exp=exp) account = model.AuthAccount( - i=user.account, l=user.username, o=user.organization + i=user.account, + l=user.username, + o=user.organization, + e=user.email, + on=user.organization_name, ) scope = model.AuthScope(t="ID", a=account, d=None, r=[]) grant = model.IdentityGrant( @@ -70,6 +75,7 @@ async def get_identity_grant( @router.post( "/auth/access", + operation_id="getAccessGrant", responses={ HTTP_200_OK: {"model": model.AccessGrant}, HTTP_400_BAD_REQUEST: { @@ -104,7 +110,11 @@ async def get_access_grant( token = security.access_token(user, exp=exp) refresh = security.refresh_token(user, exp=exp) auth_account = model.AuthAccount( - i=user.account, l=user.username, o=user.organization + i=user.account, + l=user.username, + o=user.organization, + e=user.email, + on=user.organization_name, ) scope = model.AuthScope( t="ACCESS", @@ -124,3 +134,36 @@ async def get_access_grant( except Exception as e: logger.error("Token generation failed (%s).", user.username, exc_info=e) raise fastapi.HTTPException(status_code=HTTP_500_INTERNAL_SERVER_ERROR) + + +@router.post( + "/create", + operation_id="createUser", + responses={ + HTTP_200_OK: {"model": model.User}, + HTTP_400_BAD_REQUEST: { + "model": None, + "description": "User creation failed (e.g. duplicate username).", + }, + HTTP_500_INTERNAL_SERVER_ERROR: { + "model": None, + "description": "Internal server error.", + }, + }, +) +async def create_user( + username: typing.Annotated[str, fastapi.Body()], + password: typing.Annotated[str, fastapi.Body()], + email: typing.Annotated[str, fastapi.Body()], + institution: typing.Annotated[str, fastapi.Body()], + superadmin: typing.Annotated[bool, fastapi.Body()] = False, +): + user = logic.create_user(username, password, email, institution, superadmin) + if user is None: + logger.info("User creation failed for (%s).", username) + raise fastapi.HTTPException( + status_code=HTTP_400_BAD_REQUEST, + detail="User creation failed. Username might already exist." + ) + logger.info("User created successfully (%s).", username) + return user diff --git a/service/src/main/inse/collaboration_network/schemas.py b/service/src/main/inse/collaboration_network/schemas.py index 421c7b4d..6830b0f1 100644 --- a/service/src/main/inse/collaboration_network/schemas.py +++ b/service/src/main/inse/collaboration_network/schemas.py @@ -1,9 +1,9 @@ from enum import Enum -from typing import List, Optional +from typing import List, Optional, Set from pydantic import BaseModel, Field -from inse.models.work_topic import WorkTopic +from inse.models.openalex.work_topic import WorkTopic from inse.utils import extract_raw_topic_id @@ -84,38 +84,65 @@ class FilterInformation(BaseModel): ) -class FilterProperties(BaseModel): - start_year: Optional[int] = Field( +class WorksFilterProperties(BaseModel): + start_year: int = Field( + default=0, title="Start Year", description="The start publication year for the works to include in the collaboration network.", ) - end_year: Optional[int] = Field( + end_year: int = Field( + default=9999, title="End Year", description="The end publication year for the works to include in the collaboration network.", ) - allowed_institutions: Optional[List[str]] = Field( - title="Allowed Institutions", - description="The list of raw institution IDs to include in the collaboration network. If not provided, all institutions will be included.", - ) - allowed_topics: Optional[List[str]] = Field( + allowed_topics: List[str] = Field( + default_factory=list, title="Allowed Topics", - description="The list of raw topic IDs to include in the collaboration network. If not provided, all topics will be included.", + description="The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included.", ) - min_collaborators: Optional[int] = Field( - title="Minimum Collaborators", - description="The minimum number of collaborators required for a work to be included in the collaboration network. If not provided, all works will be included regardless of the number of collaborators.", + min_contributors: int = Field( + default=1, + title="Minimum Contributors", + description="The minimum number of contributors required for a work to be included in the collaboration network.", ) - max_collaborators: Optional[int] = Field( - title="Maximum Collaborators", - description="The maximum number of collaborators allowed for a work to be included in the collaboration network. If not provided, all works will be included regardless of the number of collaborators.", + max_contributors: int = Field( + default=100, + title="Maximum Contributors", + description="The maximum number of contributors allowed for a work to be included in the collaboration network.", ) - min_collaborations: Optional[int] = Field( + + +class AuthorsFilterProperties(BaseModel): + allowed_institutions: List[str] = Field( + default_factory=list, + title="Allowed Institutions", + description="The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included.", + ) + min_collaborations: int = Field( + default=1, title="Minimum Collaborations", - description="The minimum number of collaborations required for a collaboration edge to be included in the collaboration network. If not provided, all collaboration edges will be included regardless of the number of collaborations.", + description="The minimum number of collaborations required for an author to be included in the collaboration network.", ) - max_collaborations: Optional[int] = Field( + max_collaborations: int = Field( + default=1000, title="Maximum Collaborations", - description="The maximum number of collaborations allowed for a collaboration edge to be included in the collaboration network. If not provided, all collaboration edges will be included regardless of the number of collaborations.", + description="The maximum number of collaborations allowed for an author to be included in the collaboration network.", + ) + + +class FilterProperties(BaseModel): + filter_by: str = Field( + default="works", + title="Filter By", + description="The type of filter to apply when generating the collaboration network. Can be either 'works' or 'authors'. If 'works', the filter properties in the 'works_filter_properties' field will be used. If 'authors', the filter properties in the 'authors_filter_properties' field will be used.", + ) + works_filter_properties: Optional[WorksFilterProperties] = Field( + title="Works Filter Properties", + description="The filter properties to apply when filtering works for the collaboration network. This field is only applicable if the 'filter_by' field is set to 'works'.", + ) + authors_filter_properties: Optional[AuthorsFilterProperties] = Field( + title="Authors Filter Properties", + description="The filter properties to apply when filtering authors for the collaboration network. This field is only applicable if the 'filter_by' field is set to 'authors'.", ) @@ -141,6 +168,45 @@ class CollaborationNetworkNode(BaseModel): return hash(self.raw_id) +class WorkNetworkNode(CollaborationNetworkNode): + publication_year: Optional[int] = Field( + title="Publication Year", + description="The publication year of the work represented by this node. This field is only applicable if the category of the node is 'work'.", + ) + work_topics_information: Optional[Set[WorkTopicInformation]] = Field( + title="Work Topics Information", + description="The list of topic information associated with the work represented by this node. This field is only applicable if the category of the node is 'work'.", + ) + + def __eq__(self, value: object) -> bool: + if isinstance(value, WorkNetworkNode): + return self.raw_id == value.raw_id + return False + + def __hash__(self) -> int: + return hash(self.raw_id) + + +class AuthorNetworkNode(CollaborationNetworkNode): + def __eq__(self, value: object) -> bool: + if isinstance(value, AuthorNetworkNode): + return self.raw_id == value.raw_id + return False + + def __hash__(self) -> int: + return hash(self.raw_id) + + +class InstitutionNetworkNode(CollaborationNetworkNode): + def __eq__(self, value: object) -> bool: + if isinstance(value, InstitutionNetworkNode): + return self.raw_id == value.raw_id + return False + + def __hash__(self) -> int: + return hash(self.raw_id) + + class CollaborationNetworkEdge(BaseModel): raw_source_id: str = Field( title="Source Raw ID", @@ -185,13 +251,21 @@ class CollaborationNetwork(BaseModel): title="Raw Person ID", description="The raw person ID of the person whose collaboration network this is.", ) - nodes: List[CollaborationNetworkNode] = Field( - title="Collaboration Network Nodes", - description="The nodes in the collaboration network.", + work_nodes: List[WorkNetworkNode] = Field( + title="Collaboration Network Work Nodes", + description="The work nodes in the collaboration network.", ) - edges: List[CollaborationNetworkEdge] = Field( + author_nodes: List[AuthorNetworkNode] = Field( + title="Collaboration Network Author Nodes", + description="The author nodes in the collaboration network.", + ) + institution_nodes: List[InstitutionNetworkNode] = Field( + title="Collaboration Network Institution Nodes", + description="The institution nodes in the collaboration network.", + ) + collaboration_edges: List[CollaborationNetworkEdge] = Field( title="Collaboration Network Edges", - description="The edges in the collaboration network.", + description="The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I", ) filter_information: FilterInformation = Field( title="Filter Information", diff --git a/service/src/main/inse/collaboration_network/service.py b/service/src/main/inse/collaboration_network/service.py index 19c18e45..8122f91f 100644 --- a/service/src/main/inse/collaboration_network/service.py +++ b/service/src/main/inse/collaboration_network/service.py @@ -3,14 +3,18 @@ import logging from typing import List, Optional, Set, Tuple from inse.collaboration_network.schemas import ( + AuthorNetworkNode, + AuthorsFilterProperties, CollaborationNetwork, CollaborationNetworkEdge, - CollaborationNetworkNode, CollaborationNetworkNodeType, FilterInformation, FilterProperties, InstitutionInformation, + InstitutionNetworkNode, + WorkNetworkNode, WorkTopicInformation, + WorksFilterProperties, ) from inse.works import logic as work_logic @@ -22,25 +26,28 @@ from inse.utils import ( extract_raw_topic_id, extract_raw_work_id, ) -from inse.models.author import Author -from inse.models.authorship import Authorship -from inse.models.dehydrated_author import DehydratedAuthor -from inse.models.dehydrated_institution import DehydratedInstitution -from inse.models.institution import Institution +from inse.models.openalex.author import Author +from inse.models.openalex.authorship import Authorship +from inse.models.openalex.dehydrated_author import DehydratedAuthor +from inse.models.openalex.dehydrated_institution import DehydratedInstitution +from inse.models.openalex.institution import Institution logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) + async def get_collaboration_network( raw_user_id: str, - filter_properties: Optional[FilterProperties] = None, + filter_properties: FilterProperties, ) -> CollaborationNetwork: - """Gets the collaboration network for a given user ID. + """Generates a collaboration network for a given user ID based on the works associated with that user, and applies filtering to the network based on the specified filter properties, which may include criteria such as publication year range, allowed topics, minimum/maximum number of contributors, and minimum/maximum number of collaborations. + The function returns a collaboration network that includes the works, authors, and institutions that are relevant to the specified user and meet the filtering criteria defined in the filter properties. Args: - raw_user_id (str): The raw user ID for whom to get the collaboration network. - filter_properties (Optional[FilterProperties]): The filter properties for the collaboration network. + raw_user_id (str): The raw user ID for whom to generate the collaboration network. + filter_properties (FilterProperties): The filter properties for the collaboration network. Returns: CollaborationNetwork: The collaboration network for the given user. @@ -51,8 +58,476 @@ async def get_collaboration_network( work_page = await work_logic.get_all_author_works(author_id=raw_user_id) works: List[Work] = work_page.results or [] - return build_collaboration_network( - raw_user_id=raw_user_id, works=works, filter_properties=filter_properties + collaboration_network = build_collaboration_network( + raw_user_id=raw_user_id, works=works + ) + if filter_properties.filter_by == "works": + if not filter_properties.works_filter_properties: + filter_properties.works_filter_properties = WorksFilterProperties() + return filter_collaboration_network_by_works( + raw_user_id=raw_user_id, + collaboration_network=collaboration_network, + works_filter_properties=filter_properties.works_filter_properties, + ) + elif filter_properties.filter_by == "authors": + if not filter_properties.authors_filter_properties: + filter_properties.authors_filter_properties = AuthorsFilterProperties() + return filter_collaboration_network_by_authors( + raw_user_id=raw_user_id, + collaboration_network=collaboration_network, + filter_properties=filter_properties.authors_filter_properties, + ) + else: + logger.warning( + f"Invalid filter_by value in filter properties: {filter_properties.filter_by}. Expected 'works' or 'authors'. No additional filtering will be applied." + ) + return collaboration_network + + +def filter_collaboration_network_by_authors( + raw_user_id: str, + collaboration_network: CollaborationNetwork, + filter_properties: AuthorsFilterProperties, +) -> CollaborationNetwork: + """Filters the given collaboration network based on the specified author filter properties, which may include criteria such as allowed institutions and minimum/maximum number of collaborations. + The function returns a new collaboration network that only includes authors that meet the specified criteria, along with their associated works and institutions. + + Args: + raw_user_id (str): The raw user ID for whom to filter the collaboration network. + collaboration_network (CollaborationNetwork): The collaboration network to filter. + filter_properties (AuthorsFilterProperties): The filter properties for the author filtering. + + Returns: + CollaborationNetwork: The filtered collaboration network. + """ + logger.debug( + f"Filtering collaboration network for user {raw_user_id} with author filter properties: {filter_properties}" + ) + + all_author_nodes = set(collaboration_network.author_nodes) + remaining_author_ids = {node.raw_id for node in all_author_nodes} + remaining_institution_nodes = set(collaboration_network.institution_nodes) + + logger.debug(f"Remaining author IDs before filtering: {remaining_author_ids}") + # 1. Filter author nodes based on allowed institutions in filter properties + if len(filter_properties.allowed_institutions) > 0: + logger.debug( + f"Filtering author nodes based on allowed institutions: {filter_properties.allowed_institutions}" + ) + remaining_author_ids = { + edge.raw_source_id + for edge in collaboration_network.collaboration_edges + if edge.raw_target_id in filter_properties.allowed_institutions + } + remaining_institution_nodes = { + node + for node in collaboration_network.institution_nodes + if node.raw_id in filter_properties.allowed_institutions + } + logger.debug( + f"Remaining author IDs after filtering by allowed institutions: {remaining_author_ids}" + ) + + # 2. Filter out collaboration edges that are associated with author nodes that have been filtered out + remaining_work_edges = { + edge + for edge in collaboration_network.collaboration_edges + if edge.raw_source_id in remaining_author_ids + and edge.raw_target_id.lower().startswith("w") + } + logger.debug( + f"Remaining work edges after filtering by allowed institutions: {len(remaining_work_edges)}" + ) + + works_per_author = defaultdict(set) + for edge in remaining_work_edges: + if ( + edge.raw_source_id in remaining_author_ids + and edge.raw_target_id.lower().startswith("w") + ): + works_per_author[edge.raw_source_id].add(edge.raw_target_id) + + logger.debug( + f"Works per author after filtering by allowed institutions: {dict(works_per_author)}" + ) + + # 3. Filter out author that do not have enough collaborations based on the filter properties + remaining_author_ids = { + author_id + for author_id, work_ids in works_per_author.items() + if filter_properties.min_collaborations + <= len(work_ids) + <= filter_properties.max_collaborations + } + remaining_author_ids.add(raw_user_id) # main author always included + remaining_author_nodes = { + node + for node in collaboration_network.author_nodes + if node.raw_id in remaining_author_ids + } + + remaining_institutions_edges = { + edge + for edge in collaboration_network.collaboration_edges + if edge.raw_source_id in remaining_author_ids + and edge.raw_target_id.lower().startswith("i") + } + + # 4. Remove institution nodes that are not connected to any of the remaining author nodes + institution_ids_with_remaining_authors = { + edge.raw_target_id + for edge in remaining_institutions_edges + if edge.raw_source_id in remaining_author_ids + } + remaining_institution_nodes = { + node + for node in remaining_institution_nodes + if node.raw_id in institution_ids_with_remaining_authors + } + + return CollaborationNetwork( + raw_person_id=raw_user_id, + work_nodes=collaboration_network.work_nodes, + author_nodes=list(remaining_author_nodes), + institution_nodes=list(remaining_institution_nodes), + collaboration_edges=list(remaining_work_edges) + + list(remaining_institutions_edges), + filter_information=collaboration_network.filter_information, + ) + + +def filter_collaboration_network_by_works( + raw_user_id: str, + collaboration_network: CollaborationNetwork, + works_filter_properties: WorksFilterProperties, +) -> CollaborationNetwork: + """Filters the given collaboration network based on the specified works filter properties, which may include criteria such as publication year range, allowed topics, and minimum/maximum number of contributors. + The function returns a new collaboration network that only includes works that meet the specified criteria, along with their associated authors and institutions. + + Args: + raw_user_id (str): _description_ + collaboration_network (CollaborationNetwork): _description_ + works_filter_properties (WorksFilterProperties): _description_ + + Returns: + CollaborationNetwork: The filtered collaboration network. + """ + if not works_filter_properties: + return collaboration_network + + all_work_nodes = set(collaboration_network.work_nodes) + valid_work_ids = {node.raw_id for node in all_work_nodes} + + # 1. Filter out works that are not in the specified year range or do not have allowed topics, and update valid_work_ids accordingly + valid_work_ids = filter_works_by_year_and_topic( + works=all_work_nodes, + filter_properties=works_filter_properties, + valid_work_ids=valid_work_ids, + ) + + # 2. Filter out works that do not have enough collaborators based on the filter properties, and update valid_work_ids accordingly + if ( + works_filter_properties.min_contributors + or works_filter_properties.max_contributors + ): + contributors_per_work = defaultdict(set) + for edge in collaboration_network.collaboration_edges: + if ( + edge.raw_target_id.lower().startswith("w") + and edge.raw_target_id in valid_work_ids + ): + contributors_per_work[edge.raw_target_id].add(edge.raw_source_id) + + valid_work_ids = set() + for work_id, contributors in contributors_per_work.items(): + contributors_count = len(contributors) + if has_enough_contributors( + contributors_count=contributors_count, + filter_properties=works_filter_properties, + ): + valid_work_ids.add(work_id) + + # 3. Filter out collaboration edges that are associated with works that have been filtered out + remaining_work_edges = { + edge + for edge in collaboration_network.collaboration_edges + if edge.raw_target_id in valid_work_ids + and edge.raw_target_id.lower().startswith("w") + } + + # 4. Identify author nodes that are still valid based on their association with the remaining valid works + author_ids_with_valid_works = {edge.raw_source_id for edge in remaining_work_edges} + + # 5. Identify institution nodes that are still valid based on their association with the remaining valid author nodes + institution_ids_with_valid_authors = { + edge.raw_target_id + for edge in collaboration_network.collaboration_edges + if edge.raw_source_id in author_ids_with_valid_works + and edge.raw_target_id.lower().startswith("i") + } + + remaining_collaboration_edges = { + edge + for edge in collaboration_network.collaboration_edges + if ( + edge.raw_target_id in valid_work_ids + and edge.raw_target_id.lower().startswith("w") + ) + or ( + edge.raw_source_id in author_ids_with_valid_works + and edge.raw_target_id.lower().startswith("i") + ) + or ( + edge.raw_source_id in author_ids_with_valid_works + and edge.raw_target_id in institution_ids_with_valid_authors + ) + } + remaining_work_nodes = { + node + for node in collaboration_network.work_nodes + if node.raw_id in valid_work_ids + } + remaining_author_nodes = { + node + for node in collaboration_network.author_nodes + if node.raw_id in author_ids_with_valid_works + } + remaining_institution_nodes = { + node + for node in collaboration_network.institution_nodes + if node.raw_id in institution_ids_with_valid_authors + } + + return CollaborationNetwork( + raw_person_id=raw_user_id, + work_nodes=list(remaining_work_nodes), + author_nodes=list(remaining_author_nodes), + institution_nodes=list(remaining_institution_nodes), + collaboration_edges=list(remaining_collaboration_edges), + filter_information=collaboration_network.filter_information, + ) + + +def filter_works_by_year_and_topic( + works: Set[WorkNetworkNode], + filter_properties: WorksFilterProperties, + valid_work_ids: Set[str], +): + """Determines the set of valid work IDs by filtering the given set of works based on the specified year range and allowed topics defined in the filter properties. + + Args: + works (Set[WorkNetworkNode]): The set of works to filter. + filter_properties (WorksFilterProperties): The filter properties containing the year range and allowed topics. + valid_work_ids (Set[str]): The set of valid work IDs to update. + + Returns: + Set[str]: The updated set of valid work IDs. + """ + if not any( + [ + filter_properties.start_year, + filter_properties.end_year, + filter_properties.allowed_topics, + ] + ): + return valid_work_ids + + for work in works: + if not is_in_year_range( + year=work.publication_year or -1, + works_filter_properties=filter_properties, + ) or not has_allowed_topic(work, filter_properties): + valid_work_ids.discard(work.raw_id) + + return valid_work_ids + + +def is_in_year_range(year: int, works_filter_properties: WorksFilterProperties) -> bool: + """Determines whether a given year falls within the specified year range defined in the filter properties. + + Args: + year (int): The year to check. + works_filter_properties (WorksFilterProperties): The filter properties containing the year range. + + Returns: + bool: True if the year falls within the specified range, False otherwise. + """ + # no year extracted, excluding work by default + if year == -1: + return False + + if works_filter_properties.start_year and year < works_filter_properties.start_year: + return False + + if works_filter_properties.end_year and year > works_filter_properties.end_year: + return False + + return True + + +def has_allowed_topic( + work: WorkNetworkNode, filter_properties: WorksFilterProperties +) -> bool: + """Determines whether a given work has at least one topic that is included in the allowed topics specified in the filter properties. + + Args: + work (WorkNetworkNode): The work for which to check the topics. + filter_properties (WorksFilterProperties): The filter properties containing the allowed topics. + + Returns: + bool: True if the work has at least one allowed topic, False otherwise. + """ + if len(filter_properties.allowed_topics) == 0: + return True + return any( + topic.raw_topic_id in filter_properties.allowed_topics + for topic in work.work_topics_information or set() + ) + + +def has_enough_contributors( + contributors_count: int, filter_properties: WorksFilterProperties +) -> bool: + """Determines whether a given number of contributors meets the specified minimum and maximum contributor requirements defined in the filter properties. + + Args: + contributors_count (int): The number of contributors to check. + filter_properties (WorksFilterProperties): The filter properties containing the contributor requirements. + + Returns: + bool: True if the contributor count meets the requirements, False otherwise. + """ + if filter_properties and contributors_count < filter_properties.min_contributors: + return False + if ( + filter_properties.max_contributors + and contributors_count > filter_properties.max_contributors + ): + return False + return True + + +def build_collaboration_network( + raw_user_id: str, + works: List[Work], +) -> CollaborationNetwork: + """Builds a collaboration network for a given user ID based on the provided list of works. + + Args: + raw_user_id (str): The raw ID of the user for whom to build the collaboration network. + works (List[Work]): The list of works for which to build the collaboration network. + + Returns: + CollaborationNetwork: The built collaboration network. + """ + min_possible_year = float("inf") + max_possible_year = float("-inf") + + work_nodes: Set[WorkNetworkNode] = set() + all_author_nodes: Set[AuthorNetworkNode] = set() + all_institution_nodes: Set[InstitutionNetworkNode] = set() + all_collaboration_edges: Set[CollaborationNetworkEdge] = set() + + work_topics_information: Set[WorkTopicInformation] = set() + for work in works: + work_node, author_nodes, institution_nodes, collaboration_edges = process_work( + work=work + ) + if not work_node: + continue + + min_possible_year = min( + min_possible_year, work_node.publication_year or float("inf") + ) + max_possible_year = max( + max_possible_year, work_node.publication_year or float("-inf") + ) + work_topics_information.update(work_node.work_topics_information or set()) + work_nodes.add(work_node) + all_author_nodes.update(author_nodes) + all_institution_nodes.update(institution_nodes) + all_collaboration_edges.update(collaboration_edges) + + return CollaborationNetwork( + raw_person_id=raw_user_id, + work_nodes=list(work_nodes), + author_nodes=list(all_author_nodes), + institution_nodes=list(all_institution_nodes), + collaboration_edges=list(all_collaboration_edges), + filter_information=FilterInformation( + min_possible_year=int(min_possible_year), + max_possible_year=int(max_possible_year), + institutions=sorted( + { + InstitutionInformation( + raw_id=institution.raw_id, display_name=institution.display_name + ) + for institution in all_institution_nodes + }, + key=lambda inst: inst.display_name, + ), + topics=sorted( + work_topics_information, key=lambda topic: topic.display_name + ), + ), + ) + + +def process_work( + work: Work, +) -> Tuple[ + Optional[WorkNetworkNode], + Set[AuthorNetworkNode], + Set[InstitutionNetworkNode], + Set[CollaborationNetworkEdge], +]: + """Processes a given work to extract the associated work node, author nodes, institution nodes, and collaboration edges for the collaboration network. + + Args: + work (Work): The work to process. + + Returns: + Tuple[ Optional[WorkNetworkNode], Set[AuthorNetworkNode], Set[InstitutionNetworkNode], Set[CollaborationNetworkEdge], ]: A tuple containing the associated work node, author nodes, institution nodes, and collaboration edges. + """ + year = get_work_year(work) + topics_information = extract_topics_information(work=work) + + work_node = create_work_node( + work=work, year=year, work_topics_information=topics_information + ) + if not work_node: + return None, set(), set(), set() + + authorships = work.authorships + if not authorships: + return work_node, set(), set(), set() + + author_nodes: Set[AuthorNetworkNode] = set() + institution_nodes: Set[InstitutionNetworkNode] = set() + collaboration_edges: Set[CollaborationNetworkEdge] = set() + + for authorship in authorships: + author_node, institution_nodes, associated_institution_edges = ( + process_authorship(authorship=authorship) + ) + if not author_node: + continue + + work_author_edge = CollaborationNetworkEdge( + raw_source_id=author_node.raw_id, + raw_target_id=work_node.raw_id, + ) + + author_nodes.add(author_node) + collaboration_edges.add(work_author_edge) + institution_nodes.update(institution_nodes) + collaboration_edges.update(associated_institution_edges) + + return ( + work_node, + author_nodes, + institution_nodes, + collaboration_edges, ) @@ -73,236 +548,110 @@ def get_work_year(work: Work) -> int: return -1 -def filter_works( - min_year: Optional[int], - max_year: Optional[int], - works: List[Work], -) -> List[Work]: - """Filters a list of works based on a given year range. +def create_work_node( + work: Work, year: int, work_topics_information: Set[WorkTopicInformation] +) -> Optional[WorkNetworkNode]: + """Creates a collaboration network node representing a work based on the provided work data, publication year, and topic information. Args: - min_year (Optional[int]): The minimum publication year for the works to include. - max_year (Optional[int]): The maximum publication year for the works to include. - works (List[Work]): The list of works to filter. + work (Work): The work from which to create the collaboration network node. + year (int): The publication year of the work. + work_topics_information (Set[WorkTopicInformation]): The topic information of the work. Returns: - List[Work]: A list of works that fall within the specified year range. + Optional[WorkNetworkNode]: The collaboration network node representing the work, or None if the work data is invalid. """ - filtered_works = [] - for work in works: - work_year = get_work_year(work) - if min_year is not None and work_year < min_year: + if not work or not work.id or not work.display_name: + return None + + work_id = extract_raw_work_id(work.id) + display_name = work.display_name + + return WorkNetworkNode( + raw_id=work_id, + display_name=display_name, + category=CollaborationNetworkNodeType.WORK, + publication_year=year, + work_topics_information=work_topics_information, + ) + + +def extract_topics_information(work: Work) -> Set[WorkTopicInformation]: + """Extracts the topic information from a given work and returns it as a set of WorkTopicInformation objects. + + Args: + work (Work): The work from which to extract topic information. + + Returns: + Set[WorkTopicInformation]: A set of WorkTopicInformation objects representing the topics of the work. + """ + topics_information: Set[WorkTopicInformation] = set() + for topic in work.topics or []: + if not topic.id or not topic.display_name: continue - if max_year is not None and work_year > max_year: - continue - filtered_works.append(work) - return filtered_works - - -def get_year_range(works: List[Work]) -> Tuple[int, int]: - """Determines the minimum and maximum publication years from a list of works. - - Args: - works (List[Work]): The list of works from which to determine the year range. - - Returns: - Tuple[int, int]: A tuple containing the minimum and maximum publication years, respectively. - """ - min_year = float("inf") - max_year = float("-inf") - - for work in works: - work_year = get_work_year(work) - if work_year != -1: # Only consider valid years - min_year = min(min_year, work_year) - max_year = max(max_year, work_year) - - return int(min_year), int(max_year) - - -def build_collaboration_network( - raw_user_id: str, - works: List[Work], - filter_properties: Optional[FilterProperties] = None, -) -> CollaborationNetwork: - """Builds a collaboration network for a given user based on their works. - - Args: - raw_user_id (str): The raw user ID for whom the collaboration network is being built. - works (List[Work]): A list of works for which to build the collaboration network. - filter_properties (Optional[FilterProperties]): The filter properties for the collaboration network. - - Returns: - CollaborationNetwork: The built collaboration network. - """ - collaboration_nodes: Set[CollaborationNetworkNode] = set() - collaboration_edges: Set[CollaborationNetworkEdge] = set() - - min_possible_year, max_possible_year = get_year_range(works) - - min_year = ( - filter_properties.start_year - if filter_properties - and filter_properties.start_year is not None - and filter_properties.start_year >= min_possible_year - else min_possible_year - ) - max_year = ( - filter_properties.end_year - if filter_properties - and filter_properties.end_year is not None - and filter_properties.end_year <= max_possible_year - else max_possible_year - ) - - filtered_works = filter_works( - min_year=min_year, - max_year=max_year, - works=works, - ) - - for work in filtered_works: - nodes, edges = process_work(work=work, filter_properties=filter_properties) - - work_year = get_work_year(work) - min_possible_year = min(min_possible_year, work_year) - max_possible_year = max(max_possible_year, work_year) - - collaboration_nodes.update(nodes) - collaboration_edges.update(edges) - - filter_information = FilterInformation( - min_possible_year=int(min_possible_year), - max_possible_year=int(max_possible_year), - institutions=sorted( - extract_institutions(works=works), key=lambda inst: inst.display_name - ), - topics=sorted( - extract_topics(works=works), key=lambda topic: topic.display_name - ), - ) - - collaboration_nodes, collaboration_edges = reduce_collaboration_network( - collaboration_nodes=collaboration_nodes, - collaboration_edges=collaboration_edges, - filter_properties=filter_properties, - ) - - return CollaborationNetwork( - raw_person_id=raw_user_id, - nodes=list(collaboration_nodes), - edges=list(collaboration_edges), - filter_information=filter_information, - ) - - -def reduce_collaboration_network( - collaboration_nodes: Set[CollaborationNetworkNode], - collaboration_edges: Set[CollaborationNetworkEdge], - filter_properties: Optional[FilterProperties], -) -> Tuple[Set[CollaborationNetworkNode], Set[CollaborationNetworkEdge]]: - if not filter_properties or ( - filter_properties.min_collaborations is None - and filter_properties.max_collaborations is None - ): - return collaboration_nodes, collaboration_edges - - collaboration_counts = defaultdict(int) - for collaboration_edge in collaboration_edges: - # only count works as collaborations, not institution affiliations - if collaboration_edge.raw_target_id.lower().startswith("w"): - collaboration_counts[collaboration_edge.raw_source_id] += 1 - - min_collaborations = filter_properties.min_collaborations or 0 - max_collaborations = filter_properties.max_collaborations or float("inf") - valid_node_ids = { - node_id - for node_id, count in collaboration_counts.items() - if min_collaborations <= count <= max_collaborations - } - - collaboration_nodes = { - node - for node in collaboration_nodes - if node.raw_id.startswith("W") - or node.raw_id.startswith("I") - or node.raw_id in valid_node_ids - } - - return collaboration_nodes, {edge for edge in collaboration_edges if edge.raw_source_id in valid_node_ids} - - -def extract_institutions(works: List[Work]) -> Set[InstitutionInformation]: - """Extracts a set of unique institutions from a list of works. - - Args: - works (List[Work]): The list of works from which to extract institutions. - - Returns: - Set[InstitutionInformation]: A set of unique institution information associated with the works. - """ - institutions: Set[InstitutionInformation] = set() - for work in works: - if work.authorships: - for authorship in work.authorships: - if authorship.institutions: - for institution in authorship.institutions: - if not institution.id or not institution.display_name: - continue - institution_id = extract_raw_institution_id(institution.id) - institution_info = InstitutionInformation( - raw_id=institution_id, - display_name=str(institution.display_name), - ) - institutions.add(institution_info) - return institutions - - -def extract_topics(works: List[Work]) -> Set[WorkTopicInformation]: - """Extracts a set of unique topics from a list of works. - - Args: - works (List[Work]): The list of works from which to extract topics. - - Returns: - Set[WorkTopicInformation]: A set of unique topic information associated with the works. - """ - topics: Set[WorkTopicInformation] = set() - for work in works: - if work.topics: - for topic in work.topics: - if not topic.id or not topic.display_name: - continue - topic_info = WorkTopicInformation.from_topic(topic) - topics.add(topic_info) - return topics + raw_topic_id = extract_raw_topic_id(topic.id) + topics_information.add( + WorkTopicInformation( + raw_topic_id=raw_topic_id, display_name=topic.display_name + ) + ) + return topics_information def process_authorship( authorship: Authorship, ) -> Tuple[ - Optional[CollaborationNetworkNode], - Set[CollaborationNetworkNode], + Optional[AuthorNetworkNode], + Set[InstitutionNetworkNode], Set[CollaborationNetworkEdge], ]: - """Processes an authorship to extract the corresponding collaboration network node and associated institutions. + """Processes a given authorship to extract the associated author node, institution nodes, and collaboration edges. Args: - authorship (Authorship): The authorship to process. + authorship (Authorship): The authorship data to process. + Returns: - Tuple[CollaborationNetworkNode, List[CollaborationNetworkNode]]: A tuple containing the collaboration network node and a list of associated institution nodes. + Tuple[ Optional[AuthorNetworkNode], Set[InstitutionNetworkNode], Set[CollaborationNetworkEdge], ]: A tuple containing the associated author node, institution nodes, and collaboration edges. """ author = authorship.author if not author or not author.id or not author.display_name: return None, set(), set() - author_node = get_author_node(author) + author_node = create_author_node(author) if not author_node: return None, set(), set() - institution_nodes = get_institution_nodes(authorship.institutions or []) + institution_nodes: Set[InstitutionNetworkNode] = set() + for institution in authorship.institutions or []: + institution_id = extract_raw_institution_id(institution.id or "") + if not institution_id or not institution.display_name: + continue - associated_institution_edges = { + institution_node = create_institution_node(institution) + if institution_node: + institution_nodes.add(institution_node) + + associated_institution_edges = create_associated_institution_edges( + author_node=author_node, institution_nodes=institution_nodes + ) + + return author_node, institution_nodes, associated_institution_edges + + +def create_associated_institution_edges( + author_node: AuthorNetworkNode, + institution_nodes: Set[InstitutionNetworkNode], +) -> Set[CollaborationNetworkEdge]: + """Creates a set of collaboration network edges representing the associations between an author and their affiliated institutions. + + Args: + author_node (AuthorNetworkNode): The collaboration network node representing the author. + institution_nodes (Set[InstitutionNetworkNode]): A set of collaboration network nodes representing the institutions affiliated with the author. + + Returns: + Set[CollaborationNetworkEdge]: A set of collaboration network edges representing the associations between the author and their affiliated institutions. + """ + return { CollaborationNetworkEdge( raw_source_id=author_node.raw_id, raw_target_id=institution_node.raw_id, @@ -310,90 +659,17 @@ def process_authorship( for institution_node in institution_nodes } - return author_node, institution_nodes, associated_institution_edges - -def get_institution_nodes( - institutions: List[Institution] | List[DehydratedInstitution], -) -> Set[CollaborationNetworkNode]: - """Processes a list of institutions to extract the corresponding collaboration network nodes. - - Args: - institutions (List[Institution]): The list of institutions to process. - - Returns: - Set[CollaborationNetworkNode]: A set of collaboration network nodes corresponding to the institutions. - """ - institution_nodes: Set[CollaborationNetworkNode] = set() - for institution in institutions: - institution_node = get_institution_node(institution) - if institution_node: - institution_nodes.add(institution_node) - return institution_nodes - - -def get_institution_node( - institution: Institution | DehydratedInstitution, -) -> Optional[CollaborationNetworkNode]: - """Processes an institution to extract the corresponding collaboration network node. - - Args: - institution (Institution): The institution to process. - - Returns: - CollaborationNetworkNode: The collaboration network node corresponding to the institution, or None if the institution is invalid. - """ - if not institution or not institution.id or not institution.display_name: - return None - - institution_id = extract_raw_institution_id(institution.id) - display_name = institution.display_name - - return CollaborationNetworkNode( - raw_id=institution_id, - display_name=display_name, - category=CollaborationNetworkNodeType.INSTITUTION, - ) - - -def get_work_node( - work: Work, filter_properties: Optional[FilterProperties] -) -> Optional[CollaborationNetworkNode]: - """Processes a work to extract the corresponding collaboration network node. - - Args: - work (Work): The work to process. - filter_properties (Optional[FilterProperties]): The filter properties containing the list of allowed topics. Defaults to None. - - Returns: - Optional[CollaborationNetworkNode]: The collaboration network node corresponding to the work, or None if the work is invalid. - """ - if not work or not work.id or not work.display_name: - return None - - if not has_allowed_topic(work=work, filter_properties=filter_properties): - return None - - work_id = extract_raw_work_id(work.id) - display_name = work.display_name - - return CollaborationNetworkNode( - raw_id=work_id, - display_name=display_name, - category=CollaborationNetworkNodeType.WORK, - ) - - -def get_author_node( +def create_author_node( author: Author | DehydratedAuthor, -) -> Optional[CollaborationNetworkNode]: - """Processes an author to extract the corresponding collaboration network node. +) -> Optional[AuthorNetworkNode]: + """Creates a collaboration network node representing an author based on the provided author data. Args: - author (Author): The author to process. + author (Author | DehydratedAuthor): The author data from which to create the collaboration network node. Returns: - CollaborationNetworkNode: The collaboration network node corresponding to the author, or None if the author is invalid. + Optional[AuthorNetworkNode]: The collaboration network node representing the author, or None if the author data is invalid. """ if not author or not author.id or not author.display_name: return None @@ -401,150 +677,32 @@ def get_author_node( author_id = extract_raw_author_id(author.id) display_name = author.display_name - return CollaborationNetworkNode( + return AuthorNetworkNode( raw_id=author_id, display_name=display_name, category=CollaborationNetworkNodeType.AUTHOR, ) -def process_work( - work: Work, - filter_properties: Optional[FilterProperties] = None, -) -> Tuple[Set[CollaborationNetworkNode], Set[CollaborationNetworkEdge]]: - """Processes a work to extract the corresponding collaboration network nodes and edges. +def create_institution_node( + institution: Institution | DehydratedInstitution, +) -> Optional[InstitutionNetworkNode]: + """Creates a collaboration network node representing an institution based on the provided institution data. Args: - work (Work): The work to process. + institution (Institution | DehydratedInstitution): The institution data from which to create the collaboration network node. Returns: - Tuple[Set[CollaborationNetworkNode], Set[CollaborationNetworkEdge]]: A tuple containing a set of collaboration network nodes and edges. + Optional[InstitutionNetworkNode]: The collaboration network node representing the institution, or None if the institution data is invalid. """ - work_node = get_work_node(work=work, filter_properties=filter_properties) - if not work_node: - return set(), set() + if not institution or not institution.id or not institution.display_name: + return None - authorships = work.authorships - if not authorships: - return set(), set() + institution_id = extract_raw_institution_id(institution.id) + display_name = institution.display_name - collaboration_nodes: Set[CollaborationNetworkNode] = {work_node} - collaboration_edges: Set[CollaborationNetworkEdge] = set() - - for authorship in authorships: - author_node, institution_nodes, associated_institution_edges = ( - process_authorship(authorship) - ) - if not author_node: - continue - - if not is_member_of_allowed_institution( - institution_nodes=institution_nodes, filter_properties=filter_properties - ): - continue - - work_author_edge = CollaborationNetworkEdge( - raw_source_id=author_node.raw_id, - raw_target_id=work_node.raw_id, - ) - - collaboration_nodes.add(author_node) - collaboration_edges.add(work_author_edge) - collaboration_nodes.update(institution_nodes) - collaboration_edges.update(associated_institution_edges) - - author_nodes = { - node - for node in collaboration_nodes - if node.category == CollaborationNetworkNodeType.AUTHOR - } - - if not has_enough_contributors( - contributors=author_nodes, filter_properties=filter_properties - ): - return set(), set() - - return collaboration_nodes, collaboration_edges - - -def has_enough_contributors( - contributors: Set[CollaborationNetworkNode], - filter_properties: Optional[FilterProperties], -) -> bool: - """Determines whether a work has enough contributors to be included in the collaboration network based on the provided filter properties. - - Args: - contributors (Set[CollaborationNetworkNode]): The set of contributor nodes. - filter_properties (Optional[FilterProperties]): The filter properties containing the minimum and maximum collaborator thresholds. - - Returns: - bool: True if the work has enough contributors to be included in the collaboration network, False otherwise. - """ - if not filter_properties: - return True - - num_contributors = len(contributors) - - if ( - filter_properties.min_collaborators - and num_contributors < filter_properties.min_collaborators - ): - return False - - if ( - filter_properties.max_collaborators - and num_contributors > filter_properties.max_collaborators - ): - return False - - return True - - -def has_allowed_topic( - work: Work, filter_properties: Optional[FilterProperties] -) -> bool: - """Determines whether a work is associated with at least one topic that is in the list of allowed topics specified in the filter properties. - - Args: - work (Work): The work for which to check the topics. - filter_properties (Optional[FilterProperties]): The filter properties containing the list of allowed topics. Defaults to None. - - Returns: - bool: True if at least one of the work's topics is in the list of allowed topics, False otherwise. - """ - if not filter_properties or not filter_properties.allowed_topics: - return True - - if not work.topics: - return False - - for topic in work.topics: - if not topic.id: - continue - topic_id = extract_raw_topic_id(topic.id) - if topic_id in filter_properties.allowed_topics: - return True - return False - - -def is_member_of_allowed_institution( - institution_nodes: Set[CollaborationNetworkNode], - filter_properties: Optional[FilterProperties] = None, -) -> bool: - """Determines whether an author is affiliated with at least one institution that is in the list of allowed institutions specified in the filter properties. - - Args: - institution_nodes (Set[CollaborationNetworkNode]): The set of institution nodes associated with a work. - filter_properties (Optional[FilterProperties], optional): The filter properties containing the list of allowed institutions. Defaults to None. - - Returns: - bool: True if at least one of the institution nodes is in the list of allowed institutions, False otherwise. - """ - - if not filter_properties or not filter_properties.allowed_institutions: - return True - - for institution_node in institution_nodes: - if institution_node.raw_id in filter_properties.allowed_institutions: - return True - return False + return InstitutionNetworkNode( + raw_id=institution_id, + display_name=display_name, + category=CollaborationNetworkNodeType.INSTITUTION, + ) diff --git a/service/src/main/inse/company_connections/__init__.py b/service/src/main/inse/company_connections/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/service/src/main/inse/company_connections/logic.py b/service/src/main/inse/company_connections/logic.py new file mode 100644 index 00000000..1ffea295 --- /dev/null +++ b/service/src/main/inse/company_connections/logic.py @@ -0,0 +1,298 @@ +import logging +from typing import Any + +import httpx +from fastapi import HTTPException +from starlette.status import HTTP_502_BAD_GATEWAY, HTTP_503_SERVICE_UNAVAILABLE + +from . import model +from .search_client import CompanyConnectionsSearchClient, MissingApiKeyError + +logger = logging.getLogger(__name__) + +UDE_OPENALEX_ID = "https://openalex.org/I62318514" +UDE_ROR = "https://ror.org/04mz5ra38" +UDE_DISPLAY_NAME = "University of Duisburg-Essen" + +MATCHING_METHOD = "exact_openalex_display_name_to_handelsregister_officer_name" + + +async def get_company_connections_by_author_id( + author_id: str, + client: CompanyConnectionsSearchClient | None = None, +) -> model.CompanyConnectionsResponse: + search_client = client or CompanyConnectionsSearchClient() + + try: + author_hit = await search_client.get_openalex_author(author_id) + except MissingApiKeyError as exc: + raise HTTPException( + status_code=HTTP_503_SERVICE_UNAVAILABLE, + detail="Elasticsearch is not configured.", + ) from exc + except httpx.HTTPError as exc: + logger.exception("OpenAlex author lookup failed for %s.", author_id) + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex author lookup failed.", + ) from exc + + if author_hit is None: + raise HTTPException(status_code=404, detail=f"Author {author_id} not found.") + + source = author_hit.get("_source", {}) + display_name = _clean(source.get("display_name")) + institution_scope, matching_institutions = _get_ude_institution_scope(source) + is_ude_author = institution_scope is not None + + if not is_ude_author or not display_name: + return model.CompanyConnectionsResponse( + author_id=author_id, + display_name=display_name or None, + is_ude_author=is_ude_author, + institution_scope=institution_scope, + matching_institutions=matching_institutions, + matching_method=None, + company_count=0, + has_more_results=False, + common_name_warning=False, + connections=[], + ) + + try: + hr_response = await search_client.search_handelsregister_by_officer_name( + display_name + ) + except MissingApiKeyError as exc: + raise HTTPException( + status_code=HTTP_503_SERVICE_UNAVAILABLE, + detail="Elasticsearch is not configured.", + ) from exc + except httpx.HTTPError as exc: + logger.exception("Handelsregister lookup failed for %s.", display_name) + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="Handelsregister lookup failed.", + ) from exc + + company_count, company_count_relation = _parse_total(hr_response) + connections = _parse_company_connections( + response=hr_response, + matched_person_name=display_name, + ) + + has_more_results = company_count_relation == "gte" or company_count > len( + connections + ) + common_name_warning = has_more_results or company_count > 3 + + return model.CompanyConnectionsResponse( + author_id=author_id, + display_name=display_name, + is_ude_author=True, + institution_scope=institution_scope, + matching_institutions=matching_institutions, + matching_method=MATCHING_METHOD, + company_count=company_count, + has_more_results=has_more_results, + common_name_warning=common_name_warning, + connections=connections, + ) + + +def _get_ude_institution_scope(source: dict[str, Any]) -> tuple[str | None, list[str]]: + institutions = source.get("last_known_institutions") or [] + + direct_matches: list[str] = [] + child_matches: list[str] = [] + + for institution in institutions: + if not isinstance(institution, dict): + continue + + institution_id = _clean(institution.get("id")) + ror = _clean(institution.get("ror")) + name = _clean(institution.get("display_name")) + lineage = institution.get("lineage") or [] + + label = name or institution_id or ror + + is_direct = ( + institution_id == UDE_OPENALEX_ID + or ror == UDE_ROR + or name == UDE_DISPLAY_NAME + ) + is_child = UDE_OPENALEX_ID in lineage and not is_direct + + if is_direct: + direct_matches.append(label) + elif is_child: + child_matches.append(label) + + if direct_matches: + return "direct_ude", sorted(set(direct_matches)) + + if child_matches: + return "child_of_ude", sorted(set(child_matches)) + + return None, [] + + +def _parse_total(response: dict[str, Any]) -> tuple[int, str]: + total = response.get("hits", {}).get("total", 0) + + if isinstance(total, dict): + return int(total.get("value") or 0), total.get("relation") or "eq" + + return int(total or 0), "eq" + + +def _parse_company_connections( + response: dict[str, Any], + matched_person_name: str, +) -> list[model.CompanyConnection]: + connections: list[model.CompanyConnection] = [] + + hits = response.get("hits", {}).get("hits", []) + + for hit in hits: + source = hit.get("_source", {}) + + matched_officers = _parse_inner_hit_officers(hit) + officers = _parse_source_officers( + source=source, + matched_person_name=matched_person_name, + ) + + connections.append( + model.CompanyConnection( + company_number=source.get("company_number"), + company_name=source.get("name"), + company_status=source.get("current_status"), + register_art=source.get("register_art"), + register_nummer=source.get("register_nummer"), + native_company_number=source.get("native_company_number"), + registrar=source.get("registrar"), + registered_office=source.get("registered_office"), + registered_address=source.get("registered_address"), + retrieved_at=source.get("retrieved_at"), + matched_officers=matched_officers, + officers=officers, + ) + ) + + return connections + + +def _parse_inner_hit_officers(hit: dict[str, Any]) -> list[model.MatchedOfficer]: + inner_hits = ( + hit.get("inner_hits", {}).get("officers", {}).get("hits", {}).get("hits", []) + ) + + officers: list[model.MatchedOfficer] = [] + + for inner_hit in inner_hits: + source = inner_hit.get("_source", {}) + officer_source = _normalize_officer_source(source) + + officers.append( + _to_officer( + officer_source, + is_matched_person=True, + ) + ) + + return _deduplicate_officers(officers) + + +def _parse_source_officers( + source: dict[str, Any], + matched_person_name: str, +) -> list[model.MatchedOfficer]: + raw_officers = source.get("officers") or [] + + if not isinstance(raw_officers, list): + return [] + + officers: list[model.MatchedOfficer] = [] + + for raw_officer in raw_officers: + if not isinstance(raw_officer, dict): + continue + + if _clean(raw_officer.get("type")) != "person": + continue + + officer_name = _clean(raw_officer.get("name")) + is_matched_person = officer_name == matched_person_name + + officers.append( + _to_officer( + raw_officer, + is_matched_person=is_matched_person, + ) + ) + + return _deduplicate_officers(officers) + + +def _to_officer( + source: dict[str, Any], + is_matched_person: bool, +) -> model.MatchedOfficer: + return model.MatchedOfficer( + name=_clean_or_none(source.get("name")), + firstname=_clean_or_none(source.get("firstname")), + lastname=_clean_or_none(source.get("lastname")), + city=_clean_or_none(source.get("city")), + position=_clean_or_none(source.get("position")), + start_date=_clean_or_none(source.get("start_date")), + type=_clean_or_none(source.get("type")), + flag=_clean_or_none(source.get("flag")), + is_matched_person=is_matched_person, + ) + + +def _deduplicate_officers( + officers: list[model.MatchedOfficer], +) -> list[model.MatchedOfficer]: + seen: set[tuple[str, str, str, str]] = set() + deduplicated: list[model.MatchedOfficer] = [] + + for officer in officers: + key = ( + officer.name or "", + officer.position or "", + officer.city or "", + officer.start_date or "", + ) + + if key in seen: + continue + + seen.add(key) + deduplicated.append(officer) + + return deduplicated + + +def _normalize_officer_source(source: dict[str, Any]) -> dict[str, Any]: + officers = source.get("officers") + + if isinstance(officers, dict): + return officers + + return source + + +def _clean_or_none(value: Any) -> str | None: + cleaned = _clean(value) + + return cleaned or None + + +def _clean(value: Any) -> str: + if value is None: + return "" + + return str(value).strip() diff --git a/service/src/main/inse/company_connections/model.py b/service/src/main/inse/company_connections/model.py new file mode 100644 index 00000000..dd7d28c0 --- /dev/null +++ b/service/src/main/inse/company_connections/model.py @@ -0,0 +1,44 @@ +from pydantic import BaseModel, Field + + +class MatchedOfficer(BaseModel): + name: str | None = None + firstname: str | None = None + lastname: str | None = None + city: str | None = None + position: str | None = None + start_date: str | None = None + type: str | None = None + flag: str | None = None + is_matched_person: bool = False + + +class CompanyConnection(BaseModel): + company_number: str | None = None + company_name: str | None = None + company_status: str | None = None + register_art: str | None = None + register_nummer: str | None = None + native_company_number: str | None = None + registrar: str | None = None + registered_office: str | None = None + registered_address: str | None = None + retrieved_at: str | None = None + matched_officers: list[MatchedOfficer] = Field(default_factory=list) + officers: list[MatchedOfficer] = Field(default_factory=list) + + +class CompanyConnectionsResponse(BaseModel): + author_id: str + display_name: str | None = None + is_ude_author: bool + institution_scope: str | None = None + matching_institutions: list[str] = Field(default_factory=list) + + matching_method: str | None = None + + company_count: int + has_more_results: bool + common_name_warning: bool + + connections: list[CompanyConnection] = Field(default_factory=list) diff --git a/service/src/main/inse/company_connections/search_client.py b/service/src/main/inse/company_connections/search_client.py new file mode 100644 index 00000000..4516f4f7 --- /dev/null +++ b/service/src/main/inse/company_connections/search_client.py @@ -0,0 +1,140 @@ +from typing import Any + +import httpx + +from .. import config + + +class MissingApiKeyError(Exception): + pass + + +class CompanyConnectionsSearchClient: + def __init__( + self, + base_url: str | None = None, + api_key: str | None = None, + openalex_index: str = "openalex-authors", + handelsregister_index: str = "handelsregister", + timeout: float = 30.0, + transport: httpx.AsyncBaseTransport | None = None, + ): + self.base_url = ( + base_url + or config.settings.elasticsearch_url + or "" + ).rstrip("/") + self.api_key = ( + api_key + if api_key is not None + else config.settings.elasticsearch_api_key +) + self.openalex_index = openalex_index + self.handelsregister_index = handelsregister_index + self.timeout = timeout + self.transport = transport + + @staticmethod + def openalex_doc_id(author_id: str) -> str: + return author_id.strip().removeprefix("https://openalex.org/") + + async def get_openalex_author(self, author_id: str) -> dict[str, Any] | None: + if not self.api_key: + raise MissingApiKeyError("Elasticsearch API key is not configured.") + + doc_id = self.openalex_doc_id(author_id) + + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.get( + f"/{self.openalex_index}/_doc/{doc_id}", + headers={"Authorization": f"ApiKey {self.api_key}"}, + ) + + if response.status_code == 404: + return None + + response.raise_for_status() + return response.json() + + async def search_handelsregister_by_officer_name( + self, + officer_name: str, + size: int = 10000, + track_total_hits: bool = True, + ) -> dict[str, Any]: + if not self.api_key: + raise MissingApiKeyError("Elasticsearch API key is not configured.") + + payload = self.handelsregister_officer_name_query( + officer_name=officer_name, + size=size, + track_total_hits=track_total_hits, + ) + + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.post( + f"/{self.handelsregister_index}/_search", + headers={"Authorization": f"ApiKey {self.api_key}"}, + json=payload, + ) + response.raise_for_status() + return response.json() + + @staticmethod + def handelsregister_officer_name_query( + officer_name: str, + size: int, + track_total_hits: bool, + ) -> dict[str, Any]: + return { + "track_total_hits": track_total_hits, + "size": size, + "_source": [ + "company_number", + "name", + "current_status", + "registered_address", + "registered_office", + "registrar", + "register_art", + "register_nummer", + "native_company_number", + "retrieved_at", + "officers", + ], + "query": { + "nested": { + "path": "officers", + "query": { + "bool": { + "filter": [ + {"term": {"officers.type": "person"}}, + {"term": {"officers.name.keyword": officer_name}}, + ] + } + }, + "inner_hits": { + "size": 10, + "_source": [ + "officers.name", + "officers.firstname", + "officers.lastname", + "officers.city", + "officers.position", + "officers.start_date", + "officers.type", + "officers.flag", + ], + }, + } + }, + "sort": [{"company_number": {"order": "asc"}}], + } diff --git a/service/src/main/inse/company_connections/service.py b/service/src/main/inse/company_connections/service.py new file mode 100644 index 00000000..a739aa1c --- /dev/null +++ b/service/src/main/inse/company_connections/service.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +REST API for possible company connections of OpenAlex authors. +""" + +from fastapi import APIRouter + +from . import logic, model + +router = APIRouter( + prefix="/api/inse-service/authors", + tags=["Company Connections"], +) + + +@router.get( + "/{author_id}/company-connections", + operation_id="getCompanyConnectionsByAuthor", + response_model=model.CompanyConnectionsResponse, + response_model_exclude_none=True, + summary="Get possible company connections by OpenAlex author ID.", +) +async def get_company_connections_by_author(author_id: str): + return await logic.get_company_connections_by_author_id(author_id) diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py index ad171904..cdb123a1 100644 --- a/service/src/main/inse/config.py +++ b/service/src/main/inse/config.py @@ -26,23 +26,33 @@ class Settings(BaseSettings): auth_disabled: bool = False auth_standalone: bool = True auth_secret: str = "change-me-to-a-secure-secret-key" - # OpenAlex works search config - openalex_works_search_base_url: str = "https://project.nes.uni-due.de/elastic" # IMPORTANT: wildcard * needed to query all work indices openalex_works_search_index: str = "openalex-works*" - openalex_works_api_key: str = ( - "am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==" - ) openalex_works_search_timeout_seconds: float = 30.0 + # OpenAlex public API config + openalex_api_base_url: str = "https://api.openalex.org" + openalex_api_key: Optional[str] = None + openalex_api_timeout_seconds: float = 30.0 + + + # Patent Elasticsearch config + patent_elasticsearch_url: str = "https://inse.nes.uni-due.de/elastic" + patent_elasticsearch_api_key: Optional[str] = None + # LLM config llm_api_url: Optional[str] = None llm_api_key: Optional[str] = None llm_model: Optional[str] = None - # elasticsearch config - elasticsearch_url: Optional[str] = None + # Sentence Transformers config + sentence_transformers_model_name: str = "paraphrase-multilingual-mpnet-base-v2" + + # Elasticsearch config + elasticsearch_url: str = "https://project.nes.uni-due.de/elastic" elasticsearch_api_key: Optional[str] = None + elasticsearch_inse_url: Optional[str] = None + elasticsearch_inse_api_key: Optional[str] = None model_config = SettingsConfigDict(env_file=".env") @@ -52,6 +62,8 @@ class Settings(BaseSettings): {"url": "http://localhost:8000", "description": "Local development server"}, ] + logging_level: str = "DEBUG" + settings = Settings() diff --git a/service/src/main/inse/exceptions.py b/service/src/main/inse/exceptions.py new file mode 100644 index 00000000..772a9607 --- /dev/null +++ b/service/src/main/inse/exceptions.py @@ -0,0 +1,3 @@ +class NotFoundException(Exception): + def __init__(self, message: str): + super().__init__(message) diff --git a/service/src/main/inse/funders/elastic_search_client.py b/service/src/main/inse/funders/elastic_search_client.py index f19cc511..a411cb0a 100644 --- a/service/src/main/inse/funders/elastic_search_client.py +++ b/service/src/main/inse/funders/elastic_search_client.py @@ -23,9 +23,9 @@ class FundedPublicationsSearchClient: timeout: float | None = None, transport: httpx.AsyncBaseTransport | None = None, ): - self.base_url = (base_url or config.settings.openalex_works_search_base_url).rstrip("/") + self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/") self.index = index or config.settings.openalex_works_search_index - self.api_key = api_key if api_key is not None else config.settings.openalex_works_api_key + self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds self.transport = transport @@ -78,22 +78,53 @@ class FundedPublicationsSearchClient: "doi", "title", "display_name", + "abstract_inverted_index", "publication_year", + "publication_date", + "type", + "language", + "cited_by_count", + "is_retracted", "primary_location.landing_page_url", "primary_location.pdf_url", + "primary_location.is_oa", + "primary_location.license", + "primary_location.source.display_name", + "primary_location.source.type", "best_oa_location.landing_page_url", "best_oa_location.pdf_url", + "best_oa_location.is_oa", + "best_oa_location.license", + "best_oa_location.source.display_name", "open_access.oa_url", + "open_access.is_oa", + "open_access.oa_status", + "open_access.any_repository_has_fulltext", + "topics.display_name", + "topics.score", + "primary_topic.display_name", + "primary_topic.subfield.display_name", + "primary_topic.field.display_name", + "primary_topic.domain.display_name", + "keywords.display_name", + "keywords.score", + "counts_by_year.year", + "counts_by_year.cited_by_count", "authorships.author.id", "authorships.author.display_name", "authorships.author_position", + "authorships.institutions.display_name", + "authorships.institutions.country_code", + "authorships.countries", "funders.id", "funders.display_name", "funders.ror", "awards.id", + "awards.display_name", "awards.funder_id", "awards.funder_display_name", "awards.funder_award_id", + "awards.doi", ] @staticmethod diff --git a/service/src/main/inse/funders/logic.py b/service/src/main/inse/funders/logic.py index 74078444..1976a9c8 100644 --- a/service/src/main/inse/funders/logic.py +++ b/service/src/main/inse/funders/logic.py @@ -12,7 +12,7 @@ from pydantic import ValidationError from starlette.status import HTTP_502_BAD_GATEWAY from starlette.status import HTTP_503_SERVICE_UNAVAILABLE -from .. import logic as person_logic +from ..persons import logic as person_logic from . import model from .elastic_search_client import FundedPublicationsSearchClient from .elastic_search_client import MissingApiKeyError @@ -242,6 +242,246 @@ def _resolve_publication_url(publication: dict) -> str | None: return publication.get("id") +def _publication_author_names(publication: dict) -> list[str]: + names: list[str] = [] + for authorship in publication.get("authorships", []): + author_name = authorship.get("author", {}).get("display_name") + if author_name: + names.append(author_name) + return names + + +def _unique_strings(values: list[Any], limit: int | None = None) -> list[str]: + seen: set[str] = set() + unique_values: list[str] = [] + for value in values: + if not value: + continue + text = str(value).strip() + if not text or text in seen: + continue + seen.add(text) + unique_values.append(text) + if limit and len(unique_values) >= limit: + break + return unique_values + + +def _publication_pdf_url(publication: dict) -> str | None: + primary_location = publication.get("primary_location") or {} + best_oa_location = publication.get("best_oa_location") or {} + return primary_location.get("pdf_url") or best_oa_location.get("pdf_url") + + +def _publication_source(publication: dict) -> dict: + primary_location = publication.get("primary_location") or {} + best_oa_location = publication.get("best_oa_location") or {} + primary_source = primary_location.get("source") or {} + best_oa_source = best_oa_location.get("source") or {} + return primary_source or best_oa_source + + +def _publication_license(publication: dict) -> str | None: + primary_location = publication.get("primary_location") or {} + best_oa_location = publication.get("best_oa_location") or {} + return primary_location.get("license") or best_oa_location.get("license") + + +def _publication_is_open_access(publication: dict) -> bool: + primary_location = publication.get("primary_location") or {} + best_oa_location = publication.get("best_oa_location") or {} + open_access = publication.get("open_access") or {} + return bool( + open_access.get("is_oa") + or open_access.get("oa_url") + or primary_location.get("is_oa") + or best_oa_location.get("is_oa") + ) + + +def _publication_has_fulltext(publication: dict) -> bool: + open_access = publication.get("open_access") or {} + return bool(open_access.get("any_repository_has_fulltext") or _publication_pdf_url(publication)) + + +def _publication_topic_names(publication: dict) -> list[str]: + topics = publication.get("topics") + if not isinstance(topics, list): + return [] + + sorted_topics = sorted( + topics, + key=lambda topic: topic.get("score", 0) if isinstance(topic, dict) else 0, + reverse=True, + ) + return _unique_strings( + [topic.get("display_name") for topic in sorted_topics if isinstance(topic, dict)], + limit=6, + ) + + +def _publication_keyword_names(publication: dict) -> list[str]: + keywords = publication.get("keywords") + if not isinstance(keywords, list): + return [] + + sorted_keywords = sorted( + keywords, + key=lambda keyword: keyword.get("score", 0) if isinstance(keyword, dict) else 0, + reverse=True, + ) + return _unique_strings( + [keyword.get("display_name") for keyword in sorted_keywords if isinstance(keyword, dict)], + limit=8, + ) + + +def _publication_institutions(publication: dict) -> list[str]: + institution_names: list[str] = [] + for authorship in publication.get("authorships", []): + if not isinstance(authorship, dict): + continue + for institution in authorship.get("institutions") or []: + if isinstance(institution, dict): + institution_names.append(institution.get("display_name")) + return _unique_strings(institution_names, limit=8) + + +def _publication_countries(publication: dict) -> list[str]: + countries: list[str] = [] + for authorship in publication.get("authorships", []): + if not isinstance(authorship, dict): + continue + countries.extend(authorship.get("countries") or []) + for institution in authorship.get("institutions") or []: + if isinstance(institution, dict): + countries.append(institution.get("country_code")) + return _unique_strings(countries, limit=8) + + +def _publication_counts_by_year(publication: dict) -> list[dict[str, int]]: + counts_by_year = publication.get("counts_by_year") + if not isinstance(counts_by_year, list): + return [] + + sanitized_counts: list[dict[str, int]] = [] + for year_count in counts_by_year: + if not isinstance(year_count, dict): + continue + year = year_count.get("year") + cited_by_count = year_count.get("cited_by_count") + if isinstance(year, int) and isinstance(cited_by_count, int): + sanitized_counts.append({"year": year, "cited_by_count": cited_by_count}) + + return sorted(sanitized_counts, key=lambda year_count: year_count["year"], reverse=True)[:6] + + +def _publication_funder_names(publication: dict) -> list[str]: + names: list[Any] = [] + for funder in publication.get("funders", []): + if isinstance(funder, dict): + names.append(funder.get("display_name")) + + for award in publication.get("awards", []): + if isinstance(award, dict): + names.append(award.get("funder_display_name")) + + return sorted(_unique_strings(names), key=str.casefold) + + +def _publication_grant_labels( + publication: dict, + funder_id: str | None, + funder_name: str | None, +) -> list[str]: + labels: list[str] = [] + for award in publication.get("awards", []): + if not isinstance(award, dict): + continue + award_funder_id = award.get("funder_id") + award_funder_name = award.get("funder_display_name") + matches_funder_id = bool(funder_id and award_funder_id == funder_id) + matches_funder_name = bool(funder_name and award_funder_name == funder_name) + has_funder_reference = bool(award_funder_id or award_funder_name) + if has_funder_reference and not (matches_funder_id or matches_funder_name): + continue + + display_name = award.get("display_name") + if display_name: + labels.append(display_name) + + return _unique_strings(labels, limit=6) + + +def _publication_abstract(publication: dict) -> str | None: + inverted_index = publication.get("abstract_inverted_index") + if not isinstance(inverted_index, dict): + return None + + words: list[tuple[int, str]] = [] + for word, positions in inverted_index.items(): + if not isinstance(positions, list): + continue + for position in positions: + if isinstance(position, int): + words.append((position, word)) + + if not words: + return None + + return " ".join(word for _, word in sorted(words)) + + +def _publication_detail_summary( + publication: dict, + publication_id: str, + publication_url: str | None, + author_position: str, + funder_id: str | None, + funder_name: str | None, +) -> dict[str, Any]: + title = publication.get("title") or publication.get("display_name") or publication_id + source = _publication_source(publication) + open_access = publication.get("open_access") or {} + primary_topic = publication.get("primary_topic") or {} + topic_field = primary_topic.get("field") or {} + topic_subfield = primary_topic.get("subfield") or {} + topic_domain = primary_topic.get("domain") or {} + return { + "id": publication_id, + "title": title, + "abstract": _publication_abstract(publication), + "doi": publication.get("doi"), + "publication_year": publication.get("publication_year"), + "publication_date": publication.get("publication_date"), + "publication_type": publication.get("type"), + "language": publication.get("language"), + "publication_url": publication_url, + "pdf_url": _publication_pdf_url(publication), + "source_name": source.get("display_name"), + "source_type": source.get("type"), + "is_open_access": _publication_is_open_access(publication), + "open_access_status": open_access.get("oa_status"), + "has_fulltext": _publication_has_fulltext(publication), + "license": _publication_license(publication), + "cited_by_count": publication.get("cited_by_count"), + "is_retracted": publication.get("is_retracted"), + "primary_topic": primary_topic.get("display_name"), + "topic_field": topic_field.get("display_name"), + "topic_subfield": topic_subfield.get("display_name"), + "topic_domain": topic_domain.get("display_name"), + "author_position": author_position, + "authors": _publication_author_names(publication), + "funder_names": _publication_funder_names(publication), + "institutions": _publication_institutions(publication), + "countries": _publication_countries(publication), + "topics": _publication_topic_names(publication), + "keywords": _publication_keyword_names(publication), + "grant_labels": _publication_grant_labels(publication, funder_id, funder_name), + "counts_by_year": _publication_counts_by_year(publication), + } + + def _collect_funders_from_publications( results: list[dict], author_id: str, @@ -290,6 +530,8 @@ def _collect_funders_from_publications( "unknown": [], }, "publication_urls": {}, + "publication_titles": {}, + "publication_details": {}, } entry = funder_counts[key] @@ -298,3 +540,15 @@ def _collect_funders_from_publications( entry["publication_ids"][author_position].append(publication_id) if publication_id and publication_url: entry["publication_urls"][publication_id] = publication_url + if publication_id: + title = publication.get("display_name") or publication.get("title") or publication_id + entry["publication_titles"][publication_id] = title + entry["publication_details"][publication_id] = _publication_detail_summary( + publication, + publication_id, + publication_url, + author_position, + funder_id, + funder_name, + ) + diff --git a/service/src/main/inse/funders/model.py b/service/src/main/inse/funders/model.py index d2207541..2f0a2b4b 100644 --- a/service/src/main/inse/funders/model.py +++ b/service/src/main/inse/funders/model.py @@ -1,6 +1,7 @@ from typing import Any from pydantic import BaseModel +from pydantic import Field class PublicationsByAuthorResponse(BaseModel): @@ -27,6 +28,40 @@ class AuthorPositionCount(BaseModel): unknown: int = 0 +class PublicationDetailByFunder(BaseModel): + id: str + title: str + abstract: str | None = None + doi: str | None = None + publication_year: int | None = None + publication_date: str | None = None + publication_type: str | None = None + language: str | None = None + publication_url: str | None = None + pdf_url: str | None = None + source_name: str | None = None + source_type: str | None = None + is_open_access: bool | None = None + open_access_status: str | None = None + has_fulltext: bool | None = None + license: str | None = None + cited_by_count: int | None = None + is_retracted: bool | None = None + primary_topic: str | None = None + topic_field: str | None = None + topic_subfield: str | None = None + topic_domain: str | None = None + author_position: str | None = None + authors: list[str] = Field(default_factory=list) + funder_names: list[str] = Field(default_factory=list) + institutions: list[str] = Field(default_factory=list) + countries: list[str] = Field(default_factory=list) + topics: list[str] = Field(default_factory=list) + keywords: list[str] = Field(default_factory=list) + grant_labels: list[str] = Field(default_factory=list) + counts_by_year: list[dict[str, Any]] = Field(default_factory=list) + + class FunderByAuthor(BaseModel): funder_id: str | None = None funder_name: str | None = None @@ -34,6 +69,8 @@ class FunderByAuthor(BaseModel): author_position_count: AuthorPositionCount publication_ids: PublicationIdsByAuthorPosition publication_urls: dict[str, str] = {} + publication_titles: dict[str, str] = {} + publication_details: dict[str, PublicationDetailByFunder] = Field(default_factory=dict) class FundersByAuthorResponse(BaseModel): diff --git a/service/src/main/inse/funders/service.py b/service/src/main/inse/funders/service.py index a99b661e..b6c8c05f 100644 --- a/service/src/main/inse/funders/service.py +++ b/service/src/main/inse/funders/service.py @@ -12,7 +12,7 @@ from . import logic from . import model -router = APIRouter(prefix="/authors", tags=["Funding"]) +router = APIRouter(prefix="/api/inse-service/authors", tags=["Funding"]) @router.get( diff --git a/service/src/main/inse/funders/test_logic.py b/service/src/main/inse/funders/test_logic.py index 1c519224..234ffdcf 100644 --- a/service/src/main/inse/funders/test_logic.py +++ b/service/src/main/inse/funders/test_logic.py @@ -21,7 +21,11 @@ def _funded_publication_hit( author_position: str = "first", award_funder_id: str | None = None, award_funder_name: str | None = None, + award_display_name: str | None = None, + award_number: str | None = None, pdf_url: str | None = None, + abstract_inverted_index: dict | None = None, + extra_source: dict | None = None, ) -> dict: source: dict = { "id": work_id, @@ -40,6 +44,10 @@ def _funded_publication_hit( "funders": [], "awards": [], } + if abstract_inverted_index: + source["abstract_inverted_index"] = abstract_inverted_index + if extra_source: + source.update(extra_source) if funder_id or funder_name: source["funders"].append( { @@ -52,6 +60,8 @@ def _funded_publication_hit( { "funder_id": award_funder_id, "funder_display_name": award_funder_name, + "display_name": award_display_name, + "funder_award_id": award_number, } ) return {"_source": source} @@ -74,6 +84,59 @@ async def test_get_funders_by_author_id_aggregates_funders_and_awards(monkeypatc funder_name="Funder A", author_position="first", pdf_url="https://example.org/w1.pdf", + abstract_inverted_index={ + "This": [0], + "is": [1], + "an": [2], + "abstract.": [3], + }, + extra_source={ + "title": "Example publication: full detail", + "funders": [ + { + "id": "https://openalex.org/F456", + "display_name": "Funder B", + } + ], + "publication_year": 2020, + "publication_date": "2020-05-10", + "type": "article", + "language": "en", + "cited_by_count": 12, + "is_retracted": False, + "primary_location": { + "pdf_url": "https://example.org/w1.pdf", + "is_oa": True, + "license": "cc-by", + "source": { + "display_name": "Example Journal", + "type": "journal", + }, + }, + "open_access": { + "is_oa": True, + "oa_status": "gold", + "any_repository_has_fulltext": True, + }, + "primary_topic": { + "display_name": "Clinical Trials", + "subfield": {"display_name": "Medicine"}, + "field": {"display_name": "Health Sciences"}, + "domain": {"display_name": "Life Sciences"}, + }, + "topics": [ + {"display_name": "Trials", "score": 0.8}, + {"display_name": "Guidelines", "score": 0.6}, + ], + "keywords": [ + {"display_name": "randomised trials", "score": 0.9}, + {"display_name": "reporting guideline", "score": 0.7}, + ], + "counts_by_year": [ + {"year": 2024, "cited_by_count": 3}, + {"year": 2023, "cited_by_count": 2}, + ], + }, ), _funded_publication_hit( "https://openalex.org/W2", @@ -81,6 +144,8 @@ async def test_get_funders_by_author_id_aggregates_funders_and_awards(monkeypatc funder_name=None, award_funder_id="https://openalex.org/F123", award_funder_name="Funder A", + award_display_name="Project Grant", + award_number="PG-42", author_position="last", ), ], @@ -108,7 +173,7 @@ async def test_get_funders_by_author_id_aggregates_funders_and_awards(monkeypatc assert response.author_id == "https://openalex.org/A5023888391" assert response.author_name == "Example Author" - assert response.funder_count == 1 + assert response.funder_count == 2 assert response.funders[0].funder_id == "https://openalex.org/F123" assert response.funders[0].funder_name == "Funder A" assert response.funders[0].publication_count == 2 @@ -118,6 +183,76 @@ async def test_get_funders_by_author_id_aggregates_funders_and_awards(monkeypatc assert response.funders[0].publication_ids.last == ["https://openalex.org/W2"] assert response.funders[0].publication_urls["https://openalex.org/W1"] == "https://example.org/w1.pdf" assert response.funders[0].publication_urls["https://openalex.org/W2"] == "https://openalex.org/W2" + publication_detail = response.funders[0].publication_details["https://openalex.org/W1"] + assert publication_detail.title == "Example publication: full detail" + assert publication_detail.funder_names == ["Funder A", "Funder B"] + assert publication_detail.abstract == "This is an abstract." + assert publication_detail.publication_date == "2020-05-10" + assert publication_detail.publication_type == "article" + assert publication_detail.source_name == "Example Journal" + assert publication_detail.source_type == "journal" + assert publication_detail.is_open_access is True + assert publication_detail.open_access_status == "gold" + assert publication_detail.has_fulltext is True + assert publication_detail.license == "cc-by" + assert publication_detail.cited_by_count == 12 + assert publication_detail.primary_topic == "Clinical Trials" + assert publication_detail.topic_field == "Health Sciences" + assert publication_detail.topic_subfield == "Medicine" + assert publication_detail.topic_domain == "Life Sciences" + assert publication_detail.topics == ["Trials", "Guidelines"] + assert publication_detail.keywords == ["randomised trials", "reporting guideline"] + assert publication_detail.counts_by_year == [ + {"year": 2024, "cited_by_count": 3}, + {"year": 2023, "cited_by_count": 2}, + ] + assert response.funders[0].publication_details["https://openalex.org/W2"].grant_labels == [ + "Project Grant" + ] + + +@pytest.mark.anyio +async def test_publication_grant_labels_ignore_funder_award_id_without_display_name(monkeypatch): + def handler(request: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "hits": { + "total": {"value": 1}, + "hits": [ + _funded_publication_hit( + "https://openalex.org/W3", + funder_id="https://openalex.org/F123", + funder_name="Funder A", + award_funder_id="https://openalex.org/F123", + award_funder_name="Funder A", + award_display_name=None, + award_number="ANR-12-1234", + ), + ], + }, + }, + ) + + monkeypatch.setattr( + logic.person_logic, + "search_persons", + lambda author_id: type( + "Result", + (), + {"results": [type("Author", (), {"display_name": "Example Author"})()]}, + )(), + ) + + client = FundedPublicationsSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + response = await logic.get_funders_by_author_id("A5023888391", client=client) + + assert response.funders[0].publication_details["https://openalex.org/W3"].grant_labels == [] @pytest.mark.anyio diff --git a/service/src/main/inse/institutions/__init__.py b/service/src/main/inse/institutions/__init__.py new file mode 100644 index 00000000..9be5f207 --- /dev/null +++ b/service/src/main/inse/institutions/__init__.py @@ -0,0 +1 @@ +"""Institution lookup module.""" diff --git a/service/src/main/inse/institutions/institutions_search_client.py b/service/src/main/inse/institutions/institutions_search_client.py new file mode 100644 index 00000000..0e86c8de --- /dev/null +++ b/service/src/main/inse/institutions/institutions_search_client.py @@ -0,0 +1,504 @@ +import logging +from typing import List, Set +from typing import Any, Dict, Literal, Optional + + +from inse.models.openalex.institution import Institution +from inse.exceptions import NotFoundException +from inse.integrations import elasticsearch +from inse.institutions.model import InstitutionPage + + +logger = logging.getLogger(__name__) + + +class InstitutionsSearchClient: + def __init__(self): + """ + Initializes the client. Credentials and URLs are handled by the + centralized elasticsearch integration. + """ + pass + + def get_institution_by_id(self, raw_oa_institution_id: str) -> Institution: + """Retrieves an institution by its raw OpenAlex institution ID. + + Args: + raw_oa_institution_id (str): The raw OpenAlex institution ID to search for. + + Raises: + NotFoundException: If no institution is found with the given ID or if the institution data cannot be parsed. + + Returns: + Institution: The institution corresponding to the given raw OpenAlex institution ID. + """ + query = { + "match": { + "id": f"https://openalex.org/{raw_oa_institution_id.upper()}", + } + } + + res = elasticsearch.search(index="openalex-institutions", query=query, size=1) + + hits = res.get("hits", {}).get("hits", []) + if not hits: + raise NotFoundException( + f"Institution with ID '{raw_oa_institution_id}' not found." + ) + + institution = self._convert_hit_to_institution(hits[0]) + if not institution: + raise NotFoundException( + f"Institution with ID '{raw_oa_institution_id}' could not be parsed." + ) + + return institution + + async def get_eu_organisation_id_by_oa_institution_id( + self, raw_institution_id: str + ) -> Optional[str]: + """Retrieves the corresponding EU organisation ID for a given OpenAlex institution ID, if available. + + Args: + raw_institution_id (str): The raw OpenAlex institution ID for which to retrieve the EU organisation ID. + + Returns: + Optional[str]: The corresponding EU organisation ID, or None if not found. + """ + raw_institution_id = raw_institution_id.upper() + cache = { + "I62318514": "999843312", + } + # TODO: Implement actual retrieval of RCN from Elasticsearch or another source instead of using a hardcoded cache. + return cache.get(raw_institution_id) + + def get_institutions_by_name( + self, + name: str, + page: int = 0, + size: int = 10, + sort_by: Literal[ + "relevance", "name", "works_count", "citations_count" + ] = "relevance", + sorting_direction: Literal["asc", "desc"] = "asc", + ) -> InstitutionPage: + sort_config: list = [] + + if sort_by == "relevance": + sort_config.append( + { + "_score": { + "order": sorting_direction if sorting_direction else "desc" + } + } + ) + elif sort_by == "works_count": + sort_config.append({"works_count": {"order": sorting_direction}}) + elif sort_by == "citations_count": + sort_config.append({"cited_by_count": {"order": sorting_direction}}) + else: + sort_config.append({"display_name.keyword": {"order": sorting_direction}}) + + query: Dict[str, Any] = {"match_all": {}} + + if len(name) > 0: + query = { + "match_phrase_prefix": { + "display_name": { + "query": name, + "max_expansions": 50, + } + } + } + elif sort_by == "relevance": + sort_config = [{"display_name.keyword": {"order": sorting_direction}}] + + logger.debug( + "Searching institutions with name='%s', page=%d, size=%d, sorting_direction='%s', query: %s", + name, + page, + size, + sorting_direction, + query, + ) + try: + response = elasticsearch.search( + index="openalex-institutions", + offset=page * size, + size=size, + sort=sort_config, + query=query, + ) + except Exception as e: + logger.exception("Error while searching for institutions: %s", e) + raise + + return self.response_to_institution_page(response, page, size) + + def response_to_institution_page( + self, response: Dict[str, Any], page: int, size: int + ) -> InstitutionPage: + hits = response.get("hits", {}).get("hits", []) + + institutions = [] + for hit in hits: + institution = self._convert_hit_to_institution(hit) + if institution: + institutions.append(institution) + + total = response.get("hits", {}).get("total", {}).get("value", 0) + logger.debug( + "Parsed institution page: page=%d, size=%d, total=%d", page, size, total + ) + return InstitutionPage( + elements=institutions, + page=page, + size=size, + total=total, + ) + + async def get_authors_by_institution_id(self, raw_institution_id: str) -> List[str]: + """ + Fetches authors associated with an institution. + Note: This query is specifically looking for current affiliations (2026). + """ + query = { + "nested": { + "path": "affiliations", + "query": { + "bool": { + "must": [ + { + "term": { + "affiliations.institution.id": f"https://openalex.org/{raw_institution_id.upper()}" + } + }, + { + "range": { + "affiliations.years": {"gte": 2026, "lte": 2026} + } + }, + ] + } + }, + } + } + logger.debug( + "Fetching authors for institution_id=%s with query: %s", + raw_institution_id, + query, + ) + + res = elasticsearch.search(index="openalex-authors", query=query) + hits = res.get("hits", {}).get("hits", []) + + # Extracting display_name directly from the author document source + authors = { + hit["_source"].get("display_name") + for hit in hits + if hit["_source"].get("display_name") + } + return list(authors) + + def search_institutions( + self, + query_text: str, + country_code: str | None = None, + institution_type: str | None = None, + limit: int = 10, + ) -> list[Institution]: + """ + Autocomplete search for institutions using multi_match on search_as_you_type fields. + Falls back to fuzzy match for typo tolerance on longer queries. + """ + must = [] + + if query_text: + stripped = query_text.strip() + + must.append( + { + "bool": { + "should": [ + { + "wildcard": { + "display_name.keyword": { + "value": f"*{stripped}*", + "boost": 2, + } + } + }, + { + "wildcard": { + "display_name_alternatives.keyword": { + "value": f"*{stripped}*", + "boost": 2, + } + } + }, + { + "wildcard": { + "display_name_acronyms.keyword": { + "value": f"*{stripped.upper()}*", + "boost": 10, + } + } + }, + ], + "minimum_should_match": 1, + } + } + ) + + filter_queries = [] + + if country_code: + filter_queries.append({"term": {"country_code": country_code.upper()}}) + + if institution_type: + filter_queries.append({"term": {"type": institution_type}}) + + query = { + "bool": { + "must": must, + "filter": filter_queries, + } + } + + res = elasticsearch.search( + index="openalex-institutions", + query=query, + size=limit, + # Blend relevance score with works_count popularity signal + sort=[ + {"works_count": {"order": "desc"}}, + ], + source=[ + "id", + "display_name", + "country_code", + "type", + "works_count", + "cited_by_count", + "geo", + ], + ) + + hits = res.get("hits", {}).get("hits", []) + + return [Institution.from_dict(hit["_source"]) for hit in hits] + + def get_institution_aliases_by_oa_institution_id( + self, raw_oa_institution_id: str + ) -> List[str]: + """Get a list of institution aliases for a given institution ID, including both display name alternatives and predefined aliases. + + Args: + raw_oa_institution_id (str): The raw OpenAlex institution ID for which to retrieve aliases. + + Returns: + List[str]: A list of aliases for the given institution ID. + """ + institution = self.get_institution_by_id(raw_oa_institution_id) + aliases = list( + self.augment_aliases(set(institution.display_name_alternatives or [])) + | self.get_predefined_institution_aliases(raw_oa_institution_id) + ) + logger.debug( + "Retrieved aliases for institution_id=%s: %s", + raw_oa_institution_id, + aliases, + ) + return aliases + + def get_predefined_institution_aliases( + self, raw_oa_institution_id: str + ) -> Set[str]: + """Get predefined aliases for a given institution ID. + + Args: + raw_oa_institution_id (str): The raw OpenAlex institution ID for which to retrieve predefined aliases. + + Returns: + Set[str]: A set of predefined aliases for the given institution ID. + """ + raw_oa_institution_id = raw_oa_institution_id.upper() + predefined_aliases = { + "I62318514": [ + "universität duisburg-essen", + "university of duisburg-essen", + "universitaet duisburg-essen", + "universität duisburg-essen", + "universitat duisburg-essen", + ], + } + + return self.augment_aliases( + set(predefined_aliases.get(raw_oa_institution_id, [])) + ) + + def augment_aliases(self, aliases: Set[str]) -> Set[str]: + """Augment a set of aliases by applying the augment_alias function to each alias. + + Args: + aliases (Set[str]): A set of aliases to augment. + + Returns: + Set[str]: A set of augmented aliases. + """ + augmented_aliases = set() + for alias in aliases: + augmented_aliases.update(self.augment_alias(alias)) + return augmented_aliases + + def augment_alias(self, alias: str) -> List[str]: + """Augment an alias by replacing German umlauts and ß with their alternative spellings. + + Args: + alias (str): The alias to augment. + + Returns: + List[str]: A list of augmented aliases. + """ + alias = alias.lower() + aliases = [alias] + aliases.append( + alias.replace("ä", "ae") + .replace("ö", "oe") + .replace("ü", "ue") + .replace("ß", "ss") + ) + aliases.append( + alias.replace("ae", "ä") + .replace("oe", "ö") + .replace("ue", "ü") + .replace("ss", "ß") + ) + aliases.append( + alias.replace("ä", "a") + .replace("ö", "o") + .replace("ü", "u") + .replace("ß", "s") + ) + aliases.append(alias.replace("-", " ")) + return aliases + + def _convert_hit_to_institution(self, hit: Dict[str, Any]) -> Optional[Institution]: + """Convert an Elasticsearch hit to an Institution object, applying necessary data cleaning and validation. + + Args: + hit (Dict[str, Any]): The Elasticsearch hit to convert. + + Returns: + Optional[Institution]: The converted Institution object or None if conversion fails. + """ + source = hit.get("_source") + if not source: + return None + + ALLOWED_TYPES = { + "education", + "healthcare", + "company", + "archive", + "nonprofit", + "government", + "facility", + "other", + } + + cleaned_source = {} + for key, value in source.items(): + if isinstance(value, str) and "T" in value: + cleaned_source[key] = value.split("T")[0] + + elif key == "type" and value not in ALLOWED_TYPES: + cleaned_source[key] = "other" + + else: + cleaned_source[key] = value + + try: + return Institution.model_validate(cleaned_source) + except Exception as e: + logger.exception( + "Failed to validate institution hit ID %s: %s", hit.get("_id"), e + ) + return None + + def get_cordis_eu_organisation_ids_by_oa_institution_id( + self, raw_oa_institution_id: str + ) -> Optional[List[str]]: + """Retrieves the corresponding EU organisation IDs for a given OpenAlex institution ID by searching for institution aliases and matching them against the Cordis EU organisations indices. + + Args: + raw_oa_institution_id (str): The raw OpenAlex institution ID for which to retrieve the corresponding EU organisation IDs. + + Returns: + Optional[List[str]]: A list of corresponding EU organisation IDs or None if the search fails. + """ + + institution_aliases = set( + self.get_institution_aliases_by_oa_institution_id( + raw_oa_institution_id=raw_oa_institution_id + ) + ) + + body = { + "size": 0, + "query": { + "bool": { + "filter": [ + { + "terms": { + "name.keyword": [ + institution_alias.upper() + for institution_alias in institution_aliases + ] + } + } + ] + } + }, + "aggs": { + "organisation_ids": { + "terms": {"field": "organisationID", "size": 10000} + } + }, + } + + logger.debug( + "Searching for EU organisation IDs for raw_oa_institution_id=%s with aliases=%s and query: %s", + raw_oa_institution_id, + institution_aliases, + body, + ) + + try: + # IMPORTANT: The indices are named organizations and not organisations. + 15 Minutes debugging why the search returns 0 results + response = elasticsearch.search( + index="cordis_eu_*_organizations", body=body, cluster="inse" + ) + except Exception as e: + logger.exception("Error while searching for EU organisation IDs: %s", e) + return None + + logger.debug( + "Received response for EU organisation ID search for raw_oa_institution_id=%s: %s", + raw_oa_institution_id, + response, + ) + + aggregations = response.get("aggregations", {}) + organisation_ids_buckets = aggregations.get("organisation_ids", {}).get( + "buckets", [] + ) + organisation_ids = [bucket.get("key") for bucket in organisation_ids_buckets] + + logger.debug( + "Extracted EU organisation IDs for raw_oa_institution_id=%s: %s", + raw_oa_institution_id, + organisation_ids, + ) + + return organisation_ids diff --git a/service/src/main/inse/institutions/logic.py b/service/src/main/inse/institutions/logic.py new file mode 100644 index 00000000..10f53cc6 --- /dev/null +++ b/service/src/main/inse/institutions/logic.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Business logic for OpenAlex institutions. +""" + +import logging +from copy import deepcopy +from typing import Any, Optional + +import httpx +from fastapi import HTTPException +from pydantic import ValidationError +from starlette.status import HTTP_400_BAD_REQUEST +from starlette.status import HTTP_502_BAD_GATEWAY + +from inse.models.openalex.autocomplete_response import AutocompleteResponse +from inse.models.openalex.autocomplete_response_meta import AutocompleteResponseMeta +from inse.models.openalex.autocomplete_response_results_inner import ( + AutocompleteResponseResultsInner, +) +from inse.models.openalex.institutions_list_response import InstitutionsListResponse +from inse.models.openalex.institution import Institution +from .search_client import OpenAlexInstitutionsClient +from inse.institutions.institutions_search_client import InstitutionsSearchClient + +logger = logging.getLogger(__name__) + +_VALID_INSTITUTION_TYPES = { + "education", + "healthcare", + "company", + "archive", + "nonprofit", + "government", + "facility", + "other", +} + + +async def get_institution_by_id( + raw_institution_id: str, client: InstitutionsSearchClient +) -> Institution: + return client.get_institution_by_id(raw_institution_id) + + +async def list_institutions( + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + client: OpenAlexInstitutionsClient | None = None, +) -> InstitutionsListResponse: + if sample is not None and (sort or page not in (None, 1)): + raise HTTPException( + status_code=HTTP_400_BAD_REQUEST, + detail="sample cannot be combined with sort or page.", + ) + + openalex_client = client or OpenAlexInstitutionsClient() + + try: + data = await openalex_client.list_institutions( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ) + except httpx.HTTPStatusError as exc: + status_code = exc.response.status_code + detail = "OpenAlex institutions request failed." + try: + error_body = exc.response.json() + detail = error_body.get("message") or error_body.get("error") or detail + except ValueError: + if exc.response.text: + detail = exc.response.text + raise HTTPException(status_code=status_code, detail=detail) from exc + except httpx.HTTPError as exc: + logger.exception("OpenAlex institutions request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex institutions request failed.", + ) from exc + + try: + normalized_data = _normalize_institutions_response(data) + return ( + InstitutionsListResponse.from_dict(normalized_data) + or InstitutionsListResponse() + ) + except ValidationError as exc: + logger.exception("OpenAlex institutions response could not be parsed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex institutions response could not be parsed.", + ) from exc + + +async def autocomplete_institutions( + *, + query: str, + country_code: str | None = None, + institution_type: str | None = None, + limit: int = 10, + client: InstitutionsSearchClient, +) -> AutocompleteResponse: + """ + Returns institution options for autocomplete inputs using the local + Elasticsearch cluster via the provided client. + """ + institutions = client.search_institutions( + query_text=query, + country_code=country_code, + institution_type=institution_type, + limit=limit, + ) + + results = [] + for institution in institutions: + if not institution.id or not institution.display_name: + continue + + hint_parts = [] + if hasattr(institution, "geo") and institution.geo: + if hasattr(institution.geo, "city") and institution.geo.city: + hint_parts.append(institution.geo.city) + if hasattr(institution.geo, "country") and institution.geo.country: + hint_parts.append(institution.geo.country) + elif institution.country_code: + hint_parts.append(institution.country_code) + if institution.type: + hint_parts.append(institution.type) + + results.append( + AutocompleteResponseResultsInner( + id=institution.id, + display_name=institution.display_name, + hint=" · ".join(hint_parts) if hint_parts else None, + cited_by_count=institution.cited_by_count, + works_count=institution.works_count, + entity_type="institution", + external_id=institution.ror, + ) + ) + + return AutocompleteResponse( + meta=AutocompleteResponseMeta(count=len(results)), + results=results, + ) + + +def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: + normalized = deepcopy(data) + + meta = normalized.get("meta") + if isinstance(meta, dict): + for field in [ + "count", + "db_response_time_ms", + "page", + "per_page", + "groups_count", + ]: + meta[field] = _int_or_none(meta.get(field)) + meta["next_cursor"] = _str_or_none(meta.get("next_cursor")) + meta["cost_usd"] = _number_or_none(meta.get("cost_usd")) + + for institution in normalized.get("results") or []: + if not isinstance(institution, dict): + continue + + for field in [ + "id", + "ror", + "display_name", + "country_code", + "homepage_url", + "image_url", + "image_thumbnail_url", + "works_api_url", + ]: + institution[field] = _str_or_none(institution.get(field)) + + institution_type = institution.get("type") + if ( + institution_type is not None + and institution_type not in _VALID_INSTITUTION_TYPES + ): + institution["type"] = None + else: + institution["type"] = _str_or_none(institution_type) + + institution["display_name_acronyms"] = _str_list_or_none( + institution.get("display_name_acronyms") + ) + institution["display_name_alternatives"] = _str_list_or_none( + institution.get("display_name_alternatives") + ) + institution["lineage"] = _str_list_or_none(institution.get("lineage")) + institution["works_count"] = _int_or_none(institution.get("works_count")) + institution["cited_by_count"] = _int_or_none(institution.get("cited_by_count")) + institution["created_date"] = _date_str_or_none(institution.get("created_date")) + institution["updated_date"] = _datetime_str_or_none( + institution.get("updated_date") + ) + + summary_stats = institution.get("summary_stats") + if isinstance(summary_stats, dict): + summary_stats["2yr_mean_citedness"] = _number_or_none( + summary_stats.get("2yr_mean_citedness") + ) + summary_stats["h_index"] = _int_or_none(summary_stats.get("h_index")) + summary_stats["i10_index"] = _int_or_none(summary_stats.get("i10_index")) + + geo = institution.get("geo") + if isinstance(geo, dict): + for field in [ + "city", + "geonames_city_id", + "region", + "country_code", + "country", + ]: + geo[field] = _str_or_none(geo.get(field)) + geo["latitude"] = _number_or_none(geo.get("latitude")) + geo["longitude"] = _number_or_none(geo.get("longitude")) + + ids = institution.get("ids") + if isinstance(ids, dict): + for field in ["openalex", "ror", "grid", "wikipedia", "wikidata"]: + ids[field] = _str_or_none(ids.get(field)) + ids["mag"] = _int_or_none(ids.get("mag")) + + for counts_by_year in institution.get("counts_by_year") or []: + if not isinstance(counts_by_year, dict): + continue + for field in ["year", "works_count", "cited_by_count"]: + counts_by_year[field] = _int_or_none(counts_by_year.get(field)) + + for group in normalized.get("group_by") or []: + if not isinstance(group, dict): + continue + + group["key"] = _str_or_none(group.get("key")) + group["key_display_name"] = _str_or_none(group.get("key_display_name")) + group["count"] = _int_or_none(group.get("count")) + + return normalized + + +def _str_or_none(value: Any) -> str | None: + if value is None: + return None + if isinstance(value, bool): + return str(value).lower() + return str(value) + + +def _str_list_or_none(value: Any) -> list[str] | None: + if value is None: + return None + if not isinstance(value, list): + return None + return [_str_or_none(item) for item in value if item is not None] + + +def _int_or_none(value: Any) -> int | None: + if value is None or isinstance(value, bool): + return None + if isinstance(value, int): + return value + if isinstance(value, float): + return int(value) + if isinstance(value, str): + try: + return int(float(value)) + except ValueError: + return None + return None + + +def _number_or_none(value: Any) -> int | float | None: + if value is None or isinstance(value, bool): + return None + if isinstance(value, (int, float)): + return value + if isinstance(value, str): + try: + number = float(value) + except ValueError: + return None + return int(number) if number.is_integer() else number + return None + + +def _date_str_or_none(value: Any) -> str | None: + text = _str_or_none(value) + if not text: + return None + return text[:10] + + +def _datetime_str_or_none(value: Any) -> str | None: + text = _str_or_none(value) + if not text: + return None + if len(text) == 10: + return f"{text}T00:00:00Z" + return text diff --git a/service/src/main/inse/institutions/model.py b/service/src/main/inse/institutions/model.py new file mode 100644 index 00000000..0eaf3c61 --- /dev/null +++ b/service/src/main/inse/institutions/model.py @@ -0,0 +1,17 @@ +from typing import List + +from pydantic import BaseModel, Field + +from inse.models.openalex.institution import Institution + + +class InstitutionPage(BaseModel): + elements: List[Institution] = Field( + default_factory=list, description="List of institutions in the current page." + ) + page: int = Field(default=0, description="Current page number. (0-indexed)") + size: int = Field(default=10, description="Number of institutions per page.") + total: int = Field( + default=0, + description="Total number of institutions matching the search criteria.", + ) diff --git a/service/src/main/inse/institutions/router.py b/service/src/main/inse/institutions/router.py new file mode 100644 index 00000000..423281c0 --- /dev/null +++ b/service/src/main/inse/institutions/router.py @@ -0,0 +1,207 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +REST API for OpenAlex institutions. +""" + +from functools import lru_cache +from typing import Annotated, Literal + +from fastapi import APIRouter, Depends, status, Query + +from inse.models.openalex.autocomplete_response import AutocompleteResponse +from inse.models.openalex.institutions_list_response import InstitutionsListResponse +from inse.tags import Tags +from inse.models.openalex.institution import Institution +from inse.institutions.model import InstitutionPage +from . import logic +from inse.institutions.institutions_search_client import InstitutionsSearchClient + + +router = APIRouter(prefix="/api/inse-service/institutions", tags=[Tags.INSTITUTIONS]) + + +@lru_cache +def get_institutions_search_client() -> InstitutionsSearchClient: + return InstitutionsSearchClient() + + +@router.get( + "/search", + summary="Searches for institutions by name.", + description="Searches for institutions by name with pagination.", + operation_id="searchInstitutionsByName", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": InstitutionPage, + }, + }, + response_model_exclude_none=True, +) +async def search_institutions_by_name( + client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + name: Annotated[ + str, + Query( + description="Institution name to search for, for example 'University of Duisburg Essen'.", + ), + ] = "", + page: Annotated[ + int, + Query(description="Page number (0-indexed).", ge=0), + ] = 0, + size: Annotated[ + int, + Query(description="Number of institutions per page.", ge=1, le=100), + ] = 10, + sort_by: Annotated[ + Literal["relevance", "name", "works_count", "citations_count"], + Query( + description="Field to sort by, either 'relevance', 'name', 'works_count', or 'citations_count'.", + regex="^(relevance|name|works_count|citations_count)$", + ), + ] = "name", + sorting_direction: Annotated[ + Literal["asc", "desc"], + Query( + description="Sorting direction, either 'asc' or 'desc'.", + regex="^(asc|desc)$", + ), + ] = "asc", +) -> InstitutionPage: + return client.get_institutions_by_name( + name=name, + page=page, + size=size, + sort_by=sort_by, + sorting_direction=sorting_direction, + ) + + +@router.get( + "/autocomplete", + operation_id="autocompleteInstitutions", + response_model=AutocompleteResponse, + response_model_exclude_none=True, + summary="Returns institution options for autocomplete inputs.", +) +async def autocomplete_institutions( + query: Annotated[ + str, + Query( + description="Institution search text, for example 'Duisburg Essen'.", + min_length=1, + ), + ], + country_code: Annotated[ + str | None, + Query(alias="countryCode", description="Optional ISO country code filter."), + ] = None, + institution_type: Annotated[ + str | None, + Query(alias="type", description="Optional institution type filter."), + ] = None, + limit: Annotated[ + int, + Query(description="Maximum number of autocomplete options.", ge=1, le=25), + ] = 10, + client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ] = None, +): + return await logic.autocomplete_institutions( + query=query, + country_code=country_code, + institution_type=institution_type, + limit=limit, + client=client, + ) + +@router.get( + "/{id}", + summary="Returns a single institution by ID.", + description="Returns a single institution by its OpenAlex ID.", + operation_id="getInstitutionById", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": Institution, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, +) +async def get_institution( + id: str, + client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], +) -> Institution: + return await logic.get_institution_by_id(raw_institution_id=id, client=client) + + + +@router.get( + "", + operation_id="listInstitutions", + response_model=InstitutionsListResponse, + response_model_exclude_none=True, + summary="Returns a list of OpenAlex institutions.", +) +async def list_institutions( + search: Annotated[ + str | None, + Query(description="Full-text search, for example 'Duisburg Essen'."), + ] = None, + filter: Annotated[ + str | None, + Query( + description="OpenAlex filter, for example 'country_code:DE,type:education'." + ), + ] = None, + sort: Annotated[ + str | None, + Query(description="Sort field, for example 'works_count:desc'."), + ] = "works_count:desc", + group_by: Annotated[ + str | None, + Query(description="OpenAlex group_by field, for example 'country_code'."), + ] = None, + per_page: Annotated[ + int, + Query(description="Results per page.", ge=1, le=100), + ] = 25, + page: Annotated[ + int | None, + Query(description="Page number. Use cursor for deep pagination.", ge=1), + ] = 1, + cursor: Annotated[ + str | None, + Query(description="Cursor pagination token. Use '*' to start."), + ] = None, + sample: Annotated[ + int | None, + Query( + description="Random sample size. Cannot be combined with sort or page.", + ge=1, + le=10000, + ), + ] = None, + select: Annotated[ + str | None, + Query(description="Comma-separated fields to return."), + ] = None, +): + return await logic.list_institutions( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ) diff --git a/service/src/main/inse/institutions/search_client.py b/service/src/main/inse/institutions/search_client.py new file mode 100644 index 00000000..9839e24c --- /dev/null +++ b/service/src/main/inse/institutions/search_client.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +HTTP client for OpenAlex institutions. +""" + +from typing import Any + +import httpx + +from .. import config + + +class OpenAlexInstitutionsClient: + def __init__( + self, + base_url: str | None = None, + api_key: str | None = None, + timeout: float | None = None, + transport: httpx.AsyncBaseTransport | None = None, + ): + self.base_url = (base_url or config.settings.openalex_api_base_url).rstrip("/") + self.api_key = ( + api_key if api_key is not None else config.settings.openalex_api_key + ) + self.timeout = ( + timeout + if timeout is not None + else config.settings.openalex_api_timeout_seconds + ) + self.transport = transport + + def list_institutions_params( + self, + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + ) -> dict[str, Any]: + params: dict[str, Any] = {"per_page": per_page} + + if search: + params["search"] = search + if filter: + params["filter"] = filter + if sort: + params["sort"] = sort + if group_by: + params["group_by"] = group_by + if cursor: + params["cursor"] = cursor + elif page is not None: + params["page"] = page + if sample is not None: + params["sample"] = sample + if select: + params["select"] = select + if self.api_key: + params["api_key"] = self.api_key + + return params + + async def list_institutions( + self, + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + ) -> dict[str, Any]: + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.get( + "/institutions", + params=self.list_institutions_params( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ), + ) + response.raise_for_status() + return response.json() diff --git a/service/src/main/inse/institutions/test_logic.py b/service/src/main/inse/institutions/test_logic.py new file mode 100644 index 00000000..bebf52c0 --- /dev/null +++ b/service/src/main/inse/institutions/test_logic.py @@ -0,0 +1,178 @@ +import httpx +import pytest +from fastapi import HTTPException + +from inse.institutions import logic +from inse.institutions.search_client import OpenAlexInstitutionsClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +@pytest.mark.anyio +async def test_list_institutions_maps_openalex_response_to_model(): + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "page": 1, "per_page": 25}, + "results": [ + { + "id": "https://openalex.org/I123", + "ror": "https://ror.org/04mz5ra38", + "display_name": "University of Duisburg-Essen", + "country_code": "DE", + "type": "education", + "homepage_url": "https://www.uni-due.de", + "image_url": "https://example.org/image.jpg", + "image_thumbnail_url": "https://example.org/thumb.jpg", + "display_name_acronyms": ["UDE"], + "display_name_alternatives": ["Universitaet Duisburg-Essen"], + "works_count": 123, + "cited_by_count": 456, + "summary_stats": { + "2yr_mean_citedness": 1.5, + "h_index": 42, + "i10_index": 99, + }, + "geo": { + "city": "Duisburg", + "geonames_city_id": "2934691", + "region": "North Rhine-Westphalia", + "country_code": "DE", + "country": "Germany", + "latitude": 51.4344, + "longitude": 6.7623, + }, + "lineage": ["https://openalex.org/I123"], + "ids": { + "openalex": "https://openalex.org/I123", + "ror": "https://ror.org/04mz5ra38", + "mag": 123, + "grid": "grid.12345.6", + "wikipedia": "https://en.wikipedia.org/wiki/University_of_Duisburg-Essen", + "wikidata": "https://www.wikidata.org/wiki/Q317070", + }, + "counts_by_year": [ + { + "year": 2024, + "works_count": 12, + "cited_by_count": 34, + } + ], + "works_api_url": "https://api.openalex.org/works?filter=institutions.id:I123", + "created_date": "2023-12-25", + "updated_date": "2023-11-07T05:31:56Z", + } + ], + "group_by": [ + { + "key": "DE", + "key_display_name": "Germany", + "count": 1, + } + ], + }, + ) + + client = OpenAlexInstitutionsClient( + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await logic.list_institutions(search="Duisburg Essen", client=client) + + assert result.meta.count == 1 + institution = result.results[0] + assert institution.display_name == "University of Duisburg-Essen" + assert institution.summary_stats.h_index == 42 + assert institution.geo.country == "Germany" + assert institution.ids.mag == 123 + assert institution.counts_by_year[0].year == 2024 + assert result.group_by[0].key_display_name == "Germany" + + +@pytest.mark.anyio +async def test_list_institutions_rejects_sample_with_sort(): + with pytest.raises(HTTPException) as exc_info: + await logic.list_institutions(sample=10, sort="works_count:desc") + + assert exc_info.value.status_code == 400 + + +@pytest.mark.anyio +async def test_list_institutions_accepts_practical_openalex_type_variants(): + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "page": 1, "per_page": 25}, + "results": [ + { + "id": 123, + "ror": 456, + "display_name": "Example Institute", + "country_code": 789, + "type": "unknown-openalex-type", + "display_name_acronyms": ["EI", 123], + "display_name_alternatives": "not-a-list", + "works_count": "12", + "cited_by_count": "34.0", + "summary_stats": { + "2yr_mean_citedness": "1.25", + "h_index": "10.0", + "i10_index": True, + }, + "geo": { + "city": 123, + "geonames_city_id": 12345, + "latitude": "51.4", + "longitude": "6", + }, + "ids": {"openalex": 123, "mag": "123"}, + "counts_by_year": [ + { + "year": "2024", + "works_count": "12.0", + "cited_by_count": False, + } + ], + "created_date": "2023-12-25T10:11:12Z", + "updated_date": "2023-12-25", + } + ], + "group_by": [{"key": True, "count": 1}], + }, + ) + + client = OpenAlexInstitutionsClient( + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await logic.list_institutions(client=client) + + assert result.results[0].id == "123" + assert result.results[0].ror == "456" + assert result.results[0].country_code == "789" + assert result.results[0].type is None + assert result.results[0].display_name_acronyms == ["EI", "123"] + assert result.results[0].display_name_alternatives is None + assert result.results[0].works_count == 12 + assert result.results[0].cited_by_count == 34 + assert result.results[0].summary_stats.var_2yr_mean_citedness == 1.25 + assert result.results[0].summary_stats.h_index == 10 + assert result.results[0].summary_stats.i10_index is None + assert result.results[0].geo.city == "123" + assert result.results[0].geo.geonames_city_id == "12345" + assert result.results[0].geo.latitude == 51.4 + assert result.results[0].geo.longitude == 6 + assert result.results[0].ids.openalex == "123" + assert result.results[0].ids.mag == 123 + assert result.results[0].counts_by_year[0].year == 2024 + assert result.results[0].counts_by_year[0].works_count == 12 + assert result.results[0].counts_by_year[0].cited_by_count is None + assert result.group_by[0].key == "true" + diff --git a/service/src/main/inse/institutions/test_search_client.py b/service/src/main/inse/institutions/test_search_client.py new file mode 100644 index 00000000..0051b8cf --- /dev/null +++ b/service/src/main/inse/institutions/test_search_client.py @@ -0,0 +1,77 @@ +import httpx +import pytest + +from inse.institutions.search_client import OpenAlexInstitutionsClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +def test_list_institutions_params_include_openalex_query_parameters(): + client = OpenAlexInstitutionsClient(api_key="test-key") + + params = client.list_institutions_params( + search="Duisburg Essen", + filter="country_code:DE,type:education", + sort="works_count:desc", + group_by="country_code", + per_page=10, + page=2, + select="id,display_name", + ) + + assert params == { + "search": "Duisburg Essen", + "filter": "country_code:DE,type:education", + "sort": "works_count:desc", + "group_by": "country_code", + "per_page": 10, + "page": 2, + "select": "id,display_name", + "api_key": "test-key", + } + + +def test_list_institutions_params_prefers_cursor_over_page(): + client = OpenAlexInstitutionsClient(api_key="test-key") + + params = client.list_institutions_params(cursor="*", page=3) + + assert params["cursor"] == "*" + assert "page" not in params + + +@pytest.mark.anyio +async def test_list_institutions_calls_openalex_institutions_endpoint(): + def handler(request: httpx.Request) -> httpx.Response: + assert request.method == "GET" + assert request.url.path == "/institutions" + assert request.url.params["search"] == "Duisburg Essen" + assert request.url.params["api_key"] == "test-key" + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "page": 1, "per_page": 25}, + "results": [ + { + "id": "https://openalex.org/I123", + "display_name": "University of Duisburg-Essen", + "country_code": "DE", + "type": "education", + } + ], + }, + ) + + client = OpenAlexInstitutionsClient( + base_url="https://api.openalex.org", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await client.list_institutions(search="Duisburg Essen") + + assert result["meta"]["count"] == 1 + assert result["results"][0]["display_name"] == "University of Duisburg-Essen" diff --git a/service/src/main/inse/integrations/elasticsearch.py b/service/src/main/inse/integrations/elasticsearch.py index 3d744ad9..6c6164be 100644 --- a/service/src/main/inse/integrations/elasticsearch.py +++ b/service/src/main/inse/integrations/elasticsearch.py @@ -1,73 +1,195 @@ -from typing import Any, Optional +import json +import logging +from typing import Any, Dict, List, Optional, Tuple import httpx + +from inse.model import ESCluster, ESIndex from .. import config +logger = logging.getLogger(__name__) + + +def _cluster_credentials(cluster: ESCluster) -> Tuple[str, str]: + """Retrieves the Elasticsearch URL and API key for the specified cluster from the configuration. + + Args: + cluster (ElasticsearchCluster): The cluster for which to retrieve credentials. Allowed values are "nes" and "inse". + + Raises: + ValueError: If the cluster is unknown or the credentials are not set in the configuration. + + Returns: + Tuple[str, str]: The Elasticsearch URL and API key for the specified cluster. + """ + + if cluster == ESCluster.NES: + if ( + not config.settings.elasticsearch_url + or not config.settings.elasticsearch_api_key + ): + raise ValueError( + "Elasticsearch URL and API key must be set in the configuration for cluster 'nes'" + ) + return config.settings.elasticsearch_url, config.settings.elasticsearch_api_key + elif cluster == ESCluster.INSE: + if ( + not config.settings.elasticsearch_inse_url + or not config.settings.elasticsearch_inse_api_key + ): + raise ValueError( + "Elasticsearch INSE URL and API key must be set in the configuration for cluster 'inse'" + ) + + return ( + config.settings.elasticsearch_inse_url, + config.settings.elasticsearch_inse_api_key, + ) + else: + raise ValueError(f"Unknown cluster: {cluster!r} (allowed: 'nes', 'inse')") + + +def _index_to_cluster(index: ESIndex) -> Optional[ESCluster]: + """Determines the Elasticsearch cluster to use based on the specified index. + + Args: + index (ESIndex): The Elasticsearch index for which to determine the cluster. Allowed values are defined in the ESIndex enum. + + Raises: + ValueError: If the index is unknown. + + Returns: + ESCluster: The Elasticsearch cluster to use for the specified index. + """ + + if index in { + ESIndex.OPENALEX_WORKS, + ESIndex.OPENALEX_AUTHORS, + ESIndex.OPENALEX_INSTITUTIONS, + ESIndex.OPENALEX_PUBLICATIONS, + }: + return ESCluster.NES + elif index in { + ESIndex.CORDIS_EU_ORGANIZATIONS_WILDCARD, + ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + ESIndex.CORDIS_EU_PUBLICATIONS_WILDCARD, + ESIndex.PROJECTS_BUND_V1, + ESIndex.PROJECTS_DFG_ALL, + }: + return ESCluster.INSE + else: + return None + def search( - index: str, - query_field: str = None, - query_value: str = None, - query: dict = None, - source = None, - size: int = None, - sort: list = None, - body: dict = None, -) -> dict[str, Any]: + index: ESIndex | List[ESIndex], + query: Optional[Dict] = None, + source: Optional[List] = None, + size: Optional[int] = None, + offset: Optional[int] = None, + sort: Optional[List] = None, + body: Optional[Dict] = None, + track_total_hits=False, + highlight: Optional[Dict] = None, + cluster: ESCluster = ESCluster.NES, +) -> Dict[str, Any]: + """Searches the specified Elasticsearch index using either a simple query string or a full query body. - headers = { - "Authorization": f"ApiKey {config.settings.elasticsearch_api_key}", - "Content-Type": "application/json" - } + Args: + index (ElasticsearchIndex): The Elasticsearch index to search. + query (Optional[Dict], optional): The full query body. Defaults to None. + source (Optional[List], optional): The fields to include in the response. Defaults to None. + size (Optional[int], optional): The maximum number of results to return. Defaults to None. + offset (Optional[int], optional): The number of results to skip. Defaults to None. + sort (Optional[List], optional): The fields to sort by. Defaults to None. + body (Optional[Dict], optional): The full query body. Defaults to None. + track_total_hits (bool, optional): Whether to track the total number of hits. Defaults to False. + cluster (ElasticsearchCluster, optional): The Elasticsearch cluster to search. Defaults to ElasticsearchCluster.NES. + + Returns: + Dict[str, Any]: The search results. + """ + + clusters = set() + if isinstance(index, list): + for idx in index: + cluster_for_index = _index_to_cluster(idx) + if cluster_for_index is not None: + clusters.add(cluster_for_index) + else: + cluster_for_index = _index_to_cluster(index) + if cluster_for_index is not None: + clusters.add(cluster_for_index) + + if len(clusters) > 1: + raise ValueError( + f"All indices in the search request must belong to the same cluster, but found clusters: {clusters}" + ) + elif len(clusters) == 1: + cluster = clusters.pop() + + elasticsearch_url, api_key = _cluster_credentials(cluster) + + headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/json"} + + payload: Dict[str, Any] = {} if body is not None: payload = body - elif query is not None: - payload = {"query": query} + else: + if query is not None: + payload["query"] = query if source is not None: payload["_source"] = source if size is not None: payload["size"] = size + if offset is not None: + payload["from"] = offset if sort is not None: payload["sort"] = sort - else: - payload = { - "query": { - "query_string": { - "default_field": query_field, - "query": query_value - } - } - } + if track_total_hits: + payload["track_total_hits"] = True + if highlight is not None: + payload["highlight"] = highlight + + if len(payload) == 0: + raise ValueError( + "At least one of 'query', 'body', 'source', 'size', 'offset', 'sort' must be provided" + ) + + with httpx.Client(timeout=httpx.Timeout(30.0)) as client: + logger.debug( + f"Sending search request to Elasticsearch cluster '{cluster}' at {elasticsearch_url} for {index} with payload: {json.dumps(payload)}" + ) + if isinstance(index, list): + index_str = ",".join(index) + else: + index_str = index - with httpx.Client() as client: response = client.post( - f"{config.settings.elasticsearch_url}/{index}/_search", - json=payload, - headers=headers + f"{elasticsearch_url}/{index_str}/_search", json=payload, headers=headers ) response.raise_for_status() return response.json() -def get( - index: str, - doc_id:str, - body: dict = None, + +def get( + index: ESIndex, + doc_id: str, + source: Optional[list] = None, + cluster: ESCluster = ESCluster.NES, ) -> dict[str, Any]: - headers = { - "Authorization": f"ApiKey {config.settings.elasticsearch_api_key}", - "Content-Type": "application/json" - } - payload = body - - # get document directly + elasticsearch_url, api_key = _cluster_credentials(cluster) + + headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/json"} + + params = {} + if source is not None: + params["_source_includes"] = ",".join(source) + with httpx.Client() as client: response = client.get( - f"{config.settings.elasticsearch_url}/{index}/_doc/{doc_id}", - json=payload, - headers=headers + f"{elasticsearch_url}/{index}/_doc/{doc_id}", params=params, headers=headers ) response.raise_for_status() return response.json() - - diff --git a/service/src/main/inse/logic.py b/service/src/main/inse/logic.py index 645df10b..19e9dda3 100644 --- a/service/src/main/inse/logic.py +++ b/service/src/main/inse/logic.py @@ -12,46 +12,23 @@ from typing import Type from sqlalchemy.orm import Session from sqlalchemy import select from sqlalchemy import func -from fastapi import HTTPException import logging import httpx import json -import time from . import schema from . import model from . import config -from .integrations import elasticsearch -from .integrations import llm -from . import util -from elasticsearch import Elasticsearch, helpers, NotFoundError, ApiError -from inse.models.author import Author -from inse.models.authors_list_response import AuthorsListResponse -from inse.models.meta import Meta -from inse.models.topic import Topic -from inse.models.topic_subfield import TopicSubfield -from inse.models.topic_field import TopicField -from inse.models.topic_domain import TopicDomain +from inse.models.openalex.topic import Topic +from inse.models.openalex.topic_subfield import TopicSubfield +from inse.models.openalex.topic_field import TopicField +from inse.models.openalex.topic_domain import TopicDomain logger = logging.getLogger(__name__) -def _init_es_client() -> Optional[Elasticsearch]: - es_url = config.settings.elasticsearch_url - if not es_url: - logger.warning("Elasticsearch URL not configured; skipping client init.") - return None - client = Elasticsearch( - hosts=[str(es_url)], - api_key=config.settings.elasticsearch_api_key, - ) - logger.info("Elasticsearch client initialized with URL: %s", es_url) - return client - - -es_client = _init_es_client() topic_cache_filename: str = "topic_hierarchy_cache.json" @@ -113,8 +90,12 @@ def insert_element(db: Session, value: S) -> S: def _load_topic_cache() -> dict: """Loads the topic hierarchy cache from a JSON file.""" + import os try: cache_path = "/data/" + topic_cache_filename + if not os.path.exists(cache_path): + current_dir = os.path.dirname(__file__) + cache_path = os.path.join(current_dir, "..", "data", topic_cache_filename) with open(cache_path, "r", encoding="utf-8") as f: return json.load(f) except Exception as exc: @@ -250,186 +231,56 @@ def count_topic_hierarchy(topic_names: List[str]) -> dict: return counts - -### persons - - -def search_persons( - author_id: Optional[str] = None, - query: Optional[str] = None, - include: Optional[set[str]] = None, -) -> AuthorsListResponse: - if author_id: - query_field = "_id" - query_value = author_id - elif query: - query_field = "display_name" - query_value = query - else: - return AuthorsListResponse(results=[], meta=Meta(count=0)) - - data = elasticsearch.search( - index="openalex-authors", query_field=query_field, query_value=query_value - ) - - authors = [] - for hit in data.get("hits", {}).get("hits", []): - source = hit.get("_source", {}) - source_copy = dict(source) - source_copy["id"] = source_copy.get("id") or hit.get("_id", "") - - # 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) - source_copy["ids"] = ids_copy - - author = Author.from_dict(source_copy) - if author: - authors.append(author) - - return AuthorsListResponse(results=authors, meta=Meta(count=len(authors))) - - -def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> str: - start_time = time.time() - search_result = search_persons(author_id=author_id) - if not search_result.results: - return "No person found." - if len(search_result.results) > 1: - return "Multiple persons found, cannot generate bio." - - person = search_result.results[0] - person_json = json.dumps(person.model_dump_json()) - - system_prompt = """\ - Erstelle auf Basis der bereitgestellten OpenAlex-Daten ein kurzes Porträt der Person in 3-5 Sätzen. Die Person selbst ist das Subjekt: Beginne mit ihrem Namen und beschreibe sie als Forschende:n (z. B. „{name} ist ein:e Forscher:in im Bereich …"). Schreibe nicht über „die Forschung" oder „die Arbeit" im Abstrakten, sondern durchgehend über die Person. - - Gehe dabei auf folgende drei Punkte ein: - - 1. Besonderheiten: Was hebt die Person im Vergleich zu anderen Forschenden ähnlicher Karrierephase und ähnlichen Feldes hervor? (z. B. überdurchschnittlicher Impact gemessen an der aktiven Zeit, hoher Erst-/Korrespondenzautor-Anteil, einzelnes Breakout-Paper, frühe Positionierung in einem später gewachsenen Thema) - 2. Wirtschaftliche Relevanz: Arbeitet die Person in einem grundsätzlich anwendungsnahen/kommerziell interessanten Themenfeld oder eher in der Grundlagenforschung? - 3. Dynamik: Entwickelt sich ihr Publikations-/Zitationsverlauf zuletzt steigend, konstant oder abflachend? - - Stütze jede Aussage auf konkrete Werte aus den Daten und formuliere nichts, was sich nicht belegen lässt. Wenn die Daten für einen Punkt keine klare Aussage zulassen, formuliere ihn entsprechend zurückhaltend oder lasse ihn weg, statt zu spekulieren. Gib nur das Porträt zurück, ohne Einleitung oder Schluss.\ +def get_topic_hierarchy() -> dict: """ - - user_prompt = f"Daten zur Person:\n{person_json}" - - bio = llm.call(system_prompt, user_prompt) - - elapsed_time = time.time() - start_time - logger.info( - f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds" - ) - - return bio - -def get_person_by_id(author_id: str, include: Optional[str] = None) -> AuthorsListResponse: - body = { - "_source":include.split(",") if include else True, - } - - try: - hit = elasticsearch.get( - index="openalex-authors", - body=body, - doc_id=author_id - ) - except NotFoundError: - raise HTTPException( - status_code=404, detail=f"Person with id {author_id} not found" - ) - - except ApiError as e: - raise HTTPException(status_code=500, detail=f"Elasticsearch error: {str(e)}") - persons = [util.get_persons_data(hit)] - - return AuthorsListResponse(results=persons) - - -def search_persons_by_name( - author_name: str, limit: Optional[int] = 10, include: Optional[str] = None -) -> AuthorsListResponse: - if not author_name: - raise HTTPException(status_code=400, detail="name must be provided") - - search_query = { - "bool": { - "should": [ - {"match_phrase": {"display_name": {"query": author_name, "boost": 5}}}, - { - "match_phrase_prefix": { - "display_name": {"query": author_name, "boost": 3} - } - }, - # { - # "match": { - # "display_name": { - # "query": author_name, - # "fuzziness": 1 - # } - # } - # } - ], - "minimum_should_match": 1, - } - } - try: - response = elasticsearch.search( - index="openalex-authors", - query=search_query, - source=include.split(",") if include else True, - size=limit, - ) - - except Exception as e: - raise HTTPException( - status_code=500, detail=f"Elasticsearch search failed: {str(e)}" - ) - - hits = response.get("hits", {}).get("hits", []) - - persons = [util.get_persons_data(hit) for hit in hits] - - return AuthorsListResponse(results=persons) - - -def search_persons_by_institution( - institution_name: str, limit: Optional[int] = 10, include: Optional[str] = None -) -> AuthorsListResponse: - - if not institution_name: - raise HTTPException(status_code=400, detail="institution_name must be provided") - - search_query = { - "nested": { - "path": "affiliations", - "query": { - "match_phrase": { - "affiliations.institution.display_name": institution_name - } - }, - } - } - try: - response = elasticsearch.search( - index="openalex-authors", - query=search_query, - source=include.split(",") if include else True, - size=limit, - sort=[{"works_count": {"order": "desc"}}], - ) - - except Exception as e: - raise HTTPException( - status_code=500, detail=f"Elasticsearch search failed: {str(e)}" - ) - - hits = response.get("hits", {}).get("hits", []) - persons = [util.get_persons_data(hit) for hit in hits] - return AuthorsListResponse(results=persons) + Builds and returns a hierarchical tree structure of topics: + Domains -> Fields -> Subfields -> Topics + """ + flat_cache = _load_topic_cache() + tree = {} + + for topic_name, info in flat_cache.items(): + domain = info.get("domain") or "Unbekannter Bereich" + field = info.get("field") or "Unbekanntes Feld" + subfield = info.get("subfield") or "Unbekanntes Teilfeld" + topic_id = info.get("topic_id", "") + + # Clean topic ID to just be the trailing ID or keep full URL + # For querying, display name is used in persons search, but ID is useful + + if domain not in tree: + tree[domain] = {} + if field not in tree[domain]: + tree[domain][field] = {} + if subfield not in tree[domain][field]: + tree[domain][field][subfield] = [] + + tree[domain][field][subfield].append({ + "id": topic_id, + "name": topic_name + }) + + formatted_domains = [] + for d_name, d_fields in tree.items(): + formatted_fields = [] + for f_name, f_subfields in d_fields.items(): + formatted_subfields = [] + for sf_name, sf_topics in f_subfields.items(): + sf_topics.sort(key=lambda x: x["name"]) + formatted_subfields.append({ + "name": sf_name, + "topics": sf_topics + }) + formatted_subfields.sort(key=lambda x: x["name"]) + formatted_fields.append({ + "name": f_name, + "subfields": formatted_subfields + }) + formatted_fields.sort(key=lambda x: x["name"]) + formatted_domains.append({ + "name": d_name, + "fields": formatted_fields + }) + formatted_domains.sort(key=lambda x: x["name"]) + + return {"domains": formatted_domains} diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 96f6e5a8..24c763de 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -7,16 +7,33 @@ webapp. """ import logging -from fastapi import FastAPI -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 fastapi import FastAPI, Request +from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import JSONResponse, RedirectResponse + +from inse.collaboration_network.router import router as collaboration_network_router +from inse.company_connections.service import router as company_connections_router +from inse.exceptions import NotFoundException +from inse.funders.service import router as funders_service_router +from inse.projects.router import router as projects_router +from inse.university_ranking.router import router as university_ranking_router +# caching +from inse.middleware.etag_cache import ETagCacheMiddleware +from inse.persons.service import router as persons_service_router +from inse.projects.router import router as projects_router +from inse.topics.service import router as topics_service_router +from inse.works.service import router as works_service_router +from inse.persons.service import router as persons_service_router +from inse.funders.service import router as funders_service_router +from inse.news.service import router as news_service_router +from inse.projects.router import router as projects_router +from inse.patents.service import router as patents_service_router + +from inse.institutions.router import router as institutions_router from . import config -from .service import router as service_router from .account.service import router as account_router +from .service import router as service_router logger = logging.getLogger(__name__) @@ -32,20 +49,38 @@ app = FastAPI( servers=settings.servers, ) app.include_router(collaboration_network_router) +app.include_router(institutions_router) +app.include_router(topics_service_router) app.include_router(works_service_router) -app.include_router(search_router) +app.include_router(persons_service_router) +app.include_router(funders_service_router) +app.include_router(news_service_router) +app.include_router(company_connections_router) app.include_router(service_router) app.include_router(account_router) +app.include_router(patents_service_router) +app.include_router(university_ranking_router) +app.include_router(projects_router) +app.add_middleware( + ETagCacheMiddleware, + ttl=300, # 5 minutes expiration time +) app.add_middleware( CORSMiddleware, allow_origins=settings.allowed_origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], + expose_headers=["ETag"], ) +@app.exception_handler(NotFoundException) +async def handle_not_found(request: Request, exc: NotFoundException): + return JSONResponse(status_code=404, content={"message": str(exc)}) + + @app.exception_handler(404) async def redirect(_, __): return RedirectResponse(url="/inse-webapp/") diff --git a/service/src/main/inse/middleware/etag_cache.py b/service/src/main/inse/middleware/etag_cache.py new file mode 100644 index 00000000..547aecb4 --- /dev/null +++ b/service/src/main/inse/middleware/etag_cache.py @@ -0,0 +1,52 @@ +# middleware/etag_cache.py +import hashlib, json, time +from starlette.middleware.base import BaseHTTPMiddleware +from starlette.requests import Request +from starlette.responses import Response + +class ETagCacheMiddleware(BaseHTTPMiddleware): + def __init__(self, app, ttl: int = 60): + super().__init__(app) + self.ttl = ttl # timeout in seconds + self.cache: dict[str, dict] = {} # key → {body, etag, expires} + + def _cache_key(self, request: Request) -> str: + # Include query params and relevant headers in the key + return f"{request.url.path}?{request.url.query}" + + async def dispatch(self, request: Request, call_next): + if request.method != "GET": + return await call_next(request) + + key = self._cache_key(request) + entry = self.cache.get(key) + client_etag = request.headers.get("if-none-match") + + # Cache hit + not expired + if entry and time.time() < entry["expires"]: + if client_etag == entry["etag"]: + return Response(status_code=304, headers={"ETag": entry["etag"]}) + + # Client has stale ETag - return fresh cached body + return Response( + content=entry["body"], + media_type="application/json", + headers={"ETag": entry["etag"], "Cache-Control": f"max-age={self.ttl}"} + ) + + # Cache miss or expired → hit the actual route + response = await call_next(request) + body = b"".join([chunk async for chunk in response.body_iterator]) + etag = f'"{hashlib.md5(body).hexdigest()}"' + + self.cache[key] = { + "body": body, + "etag": etag, + "expires": time.time() + self.ttl + } + return Response( + content=body, + status_code=response.status_code, + media_type="application/json", + headers={"ETag": etag, "Cache-Control": f"max-age={self.ttl}"} + ) \ No newline at end of file diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py index aaac61b1..98aaf28c 100644 --- a/service/src/main/inse/model.py +++ b/service/src/main/inse/model.py @@ -1,9 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- """ - This module defines the model classes returned from - our api using pydantic. +This module defines the model classes returned from +our api using pydantic. """ + +from enum import StrEnum + from pydantic import BaseModel from pydantic import ConfigDict from pydantic import Field @@ -13,31 +16,49 @@ from typing import Generic from typing import Optional -T = TypeVar('T', bound=BaseModel) +T = TypeVar("T", bound=BaseModel) + class Entity(BaseModel): id: int = Field(description="The id of the entity.") + class Item(Entity): model_config = ConfigDict(from_attributes=True) name: str = Field(description="The name of the item.") description: str = Field(description="The description of the item.") + class ItemCreate(BaseModel): name: str = Field(description="The name of the item.") description: str = Field(description="The description of the item.") + class Page(BaseModel, Generic[T]): elements: List[T] = Field(default=[], description="The elements of the page.") offset: int = Field(default=0, description="The page offset in elements.") total: int = Field(default=0, description="The total number of elements.") size: int = Field(default=20, description="The page size in elements.") + class ItemPage(Page[Item]): pass -class PersonBio(BaseModel): - bio: str = Field(description="The generated biography.") + +class ESCluster(StrEnum): + NES = "nes" + INSE = "inse" +class ESIndex(StrEnum): + OPENALEX_WORKS = "openalex-works" + OPENALEX_AUTHORS = "openalex-authors" + OPENALEX_INSTITUTIONS = "openalex-institutions" + OPENALEX_PUBLICATIONS = "openalex-publications" + CORDIS_EU_ORGANIZATIONS_WILDCARD = "cordis_eu_*_organizations" + CORDIS_EU_PROJECTS_WILDCARD = "cordis_eu_*_projects" + CORDIS_EU_PUBLICATIONS_WILDCARD = "cordis_eu_*_publications" + + PROJECTS_BUND_V1 = "projects_bund_v1" + PROJECTS_DFG_ALL = "projects_dfg_all" \ No newline at end of file diff --git a/service/src/main/inse/models/__init__.py b/service/src/main/inse/models/__init__.py index 046bf20e..0c1debe0 100644 --- a/service/src/main/inse/models/__init__.py +++ b/service/src/main/inse/models/__init__.py @@ -1,128 +1 @@ -# coding: utf-8 - -# flake8: noqa -""" - OpenAlex API - - The OpenAlex API provides access to a comprehensive catalog of scholarly works, authors, sources, institutions, topics, keywords, publishers, and funders. OpenAlex indexes over 250 million scholarly works. - - The version of the OpenAPI document: 1.0.0 - Contact: support@openalex.org - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -# import models into model package -from inse.models.author import Author -from inse.models.author_affiliations_inner import AuthorAffiliationsInner -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.author_ids import AuthorIds -from inse.models.author_parsed_longest_name import AuthorParsedLongestName -from inse.models.author_summary_stats import AuthorSummaryStats -from inse.models.author_topics_inner import AuthorTopicsInner -from inse.models.authors_list_response import AuthorsListResponse -from inse.models.authorship import Authorship -from inse.models.autocomplete_response import AutocompleteResponse -from inse.models.autocomplete_response_meta import AutocompleteResponseMeta -from inse.models.autocomplete_response_results_inner import AutocompleteResponseResultsInner -from inse.models.award import Award -from inse.models.award_full import AwardFull -from inse.models.award_full_funder import AwardFullFunder -from inse.models.awards_list_response import AwardsListResponse -from inse.models.concept import Concept -from inse.models.concept_ids import ConceptIds -from inse.models.concepts_list_response import ConceptsListResponse -from inse.models.continent import Continent -from inse.models.continent_ids import ContinentIds -from inse.models.continents_list_response import ContinentsListResponse -from inse.models.countries_list_response import CountriesListResponse -from inse.models.country import Country -from inse.models.country_continent import CountryContinent -from inse.models.country_ids import CountryIds -from inse.models.dehydrated_author import DehydratedAuthor -from inse.models.dehydrated_funder import DehydratedFunder -from inse.models.dehydrated_institution import DehydratedInstitution -from inse.models.dehydrated_source import DehydratedSource -from inse.models.domain import Domain -from inse.models.domain_fields_inner import DomainFieldsInner -from inse.models.domain_ids import DomainIds -from inse.models.domains_list_response import DomainsListResponse -from inse.models.error import Error -from inse.models.fields_list_response import FieldsListResponse -from inse.models.funder import Funder -from inse.models.funder_ids import FunderIds -from inse.models.funders_list_response import FundersListResponse -from inse.models.get_changefile200_response import GetChangefile200Response -from inse.models.get_changefile200_response_meta import GetChangefile200ResponseMeta -from inse.models.get_changefile200_response_results_inner import GetChangefile200ResponseResultsInner -from inse.models.get_changefile200_response_results_inner_formats import GetChangefile200ResponseResultsInnerFormats -from inse.models.get_changefile200_response_results_inner_formats_jsonl import GetChangefile200ResponseResultsInnerFormatsJsonl -from inse.models.get_changefile200_response_results_inner_formats_parquet import GetChangefile200ResponseResultsInnerFormatsParquet -from inse.models.group_by_result import GroupByResult -from inse.models.institution import Institution -from inse.models.institution_geo import InstitutionGeo -from inse.models.institution_ids import InstitutionIds -from inse.models.institution_type import InstitutionType -from inse.models.institution_types_list_response import InstitutionTypesListResponse -from inse.models.institutions_list_response import InstitutionsListResponse -from inse.models.keyword import Keyword -from inse.models.keywords_list_response import KeywordsListResponse -from inse.models.language import Language -from inse.models.languages_list_response import LanguagesListResponse -from inse.models.license import License -from inse.models.licenses_list_response import LicensesListResponse -from inse.models.list_changefiles200_response import ListChangefiles200Response -from inse.models.list_changefiles200_response_meta import ListChangefiles200ResponseMeta -from inse.models.list_changefiles200_response_results_inner import ListChangefiles200ResponseResultsInner -from inse.models.location import Location -from inse.models.meta import Meta -from inse.models.model_field import ModelField -from inse.models.open_access import OpenAccess -from inse.models.publisher import Publisher -from inse.models.publisher_ids import PublisherIds -from inse.models.publisher_parent_publisher import PublisherParentPublisher -from inse.models.publishers_list_response import PublishersListResponse -from inse.models.rate_limit_response import RateLimitResponse -from inse.models.rate_limit_response_rate_limit import RateLimitResponseRateLimit -from inse.models.rate_limit_response_rate_limit_endpoint_costs_usd import RateLimitResponseRateLimitEndpointCostsUsd -from inse.models.sdg import Sdg -from inse.models.sdg_ids import SdgIds -from inse.models.sdgs_list_response import SdgsListResponse -from inse.models.source import Source -from inse.models.source_ids import SourceIds -from inse.models.source_type import SourceType -from inse.models.source_types_list_response import SourceTypesListResponse -from inse.models.sources_list_response import SourcesListResponse -from inse.models.subfield import Subfield -from inse.models.subfield_domain import SubfieldDomain -from inse.models.subfield_field import SubfieldField -from inse.models.subfields_list_response import SubfieldsListResponse -from inse.models.text_classification_response import TextClassificationResponse -from inse.models.text_classification_response_meta import TextClassificationResponseMeta -from inse.models.topic import Topic -from inse.models.topic_domain import TopicDomain -from inse.models.topic_field import TopicField -from inse.models.topic_ids import TopicIds -from inse.models.topic_subfield import TopicSubfield -from inse.models.topics_list_response import TopicsListResponse -from inse.models.work import Work -from inse.models.work_biblio import WorkBiblio -from inse.models.work_citation_normalized_percentile import WorkCitationNormalizedPercentile -from inse.models.work_cited_by_percentile_year import WorkCitedByPercentileYear -from inse.models.work_counts_by_year_inner import WorkCountsByYearInner -from inse.models.work_has_content import WorkHasContent -from inse.models.work_ids import WorkIds -from inse.models.work_keyword import WorkKeyword -from inse.models.work_mesh_inner import WorkMeshInner -from inse.models.work_sustainable_development_goals_inner import WorkSustainableDevelopmentGoalsInner -from inse.models.work_topic import WorkTopic -from inse.models.work_topic_domain import WorkTopicDomain -from inse.models.work_topic_field import WorkTopicField -from inse.models.work_topic_subfield import WorkTopicSubfield -from inse.models.work_type import WorkType -from inse.models.work_types_list_response import WorkTypesListResponse -from inse.models.works_list_response import WorksListResponse -from inse.models.work_page import WorkPage - - +# empty package marker diff --git a/service/src/main/inse/models/bund_project.py b/service/src/main/inse/models/bund_project.py new file mode 100644 index 00000000..6599ed41 --- /dev/null +++ b/service/src/main/inse/models/bund_project.py @@ -0,0 +1,226 @@ +from datetime import datetime, date +from typing import Annotated, Optional + +from pydantic import BaseModel, BeforeValidator, ConfigDict, Field + + +def parse_german_date(value: Optional[str]) -> Optional[date]: + if value is None or isinstance(value, date): + return value + + return datetime.strptime(value, "%d.%m.%Y").date() + + +class BundProject(BaseModel): + model_config = ConfigDict( + populate_by_name=True, + extra="ignore", + ) + + funding_code: Optional[str] = Field( + default=None, + validation_alias="Förderkennzeichen", + description="The funding code of the project", + examples=["19F2266G"], + ) + + department: Optional[str] = Field( + default=None, + validation_alias="Ressort", + description="The department of the project", + examples=["BMDV"], + ) + + department_fullname: Optional[str] = Field( + default=None, + validation_alias="Ressort_fullname", + description="The full name of the department of the project", + examples=["Bundesministerium für Digitales und Verkehr"], + ) + + referat: Optional[str] = Field( + default=None, + validation_alias="Referat", + description="The referat of the project", + examples=["DP20"], + ) + + project_sponsor: Optional[str] = Field( + default=None, + validation_alias="Projektträger", + description="The project sponsor of the project", + examples=["PT-TÜV"], + ) + + project_sponsor_fullname: Optional[str] = Field( + default=None, + validation_alias="Projektträger_fullname", + description="The full name of the project sponsor of the project", + examples=["Projektträger TÜV Rheinland"], + ) + + work_unit: Optional[str] = Field( + default=None, + validation_alias="Arb.-Einh.", + description="The work unit of the project", + examples=["mFUND"], + ) + + recipient: Optional[str] = Field( + default=None, + validation_alias="Zuwendungsempfänger", + description="The recipient of the project", + examples=["Universität Duisburg-Essen"], + ) + + municipal_code: Optional[str] = Field( + default=None, + validation_alias="Gemeindekennziffer", + description="The municipal code of the project", + examples=["05113000"], + ) + + municipality: Optional[str] = Field( + default=None, + validation_alias="Stadt/Gemeinde", + description="The municipality of the project", + examples=["Essen"], + ) + + place: Optional[str] = Field( + default=None, + validation_alias="Ort", + description="The place of the project", + examples=["Essen"], + ) + + state: Optional[str] = Field( + default=None, + validation_alias="Bundesland", + description="The state of the project", + examples=["Nordrhein-Westfalen"], + ) + + country: Optional[str] = Field( + default=None, + validation_alias="Staat", + description="The country of the project", + examples=["Deutschland"], + ) + + implementing_agency: Optional[str] = Field( + default=None, + validation_alias="Ausführende Stelle", + description="The implementing agency of the project", + examples=[ + "Universität Duisburg-Essen - Fachbereich Allgemeine Informatik - Lehrstuhl Networked Embedded Systems (NES)" + ], + ) + + topic: Optional[str] = Field( + default=None, + validation_alias="Thema", + description="The topic of the project", + examples=[ + "Verbundprojekt: Multimodaler Mobilitäts-Index - Moby_Dex -, Teilvorhaben: Universität Duisburg-Essen" + ], + ) + + performance_plan_system: Optional[str] = Field( + default=None, + validation_alias="Leistungsplansystematik", + description="The performance plan system of the project", + examples=["GA6011"], + ) + + performance_plan_system_text: Optional[str] = Field( + default=None, + validation_alias="Klartext Leistungsplansystematik", + description="The performance plan system text of the project", + examples=["Angewandte Forschung und Experimentelle Entwicklung"], + ) + + funding_start: Annotated[ + Optional[date], + Field( + default=None, + validation_alias="Förderbeginn", + description="The funding start date of the project", + examples=["01.09.2023"], + ), + BeforeValidator(parse_german_date), + ] + + funding_end: Annotated[ + Optional[date], + Field( + default=None, + validation_alias="Förderende", + description="The funding end date of the project", + examples=["31.08.2026"], + ), + BeforeValidator(parse_german_date), + ] + + grant_amount: Optional[float] = Field( + default=None, + validation_alias="Fördersumme", + description="The grant amount of the project", + examples=[367651.00], + ) + + funding_profile: Optional[str] = Field( + default=None, + validation_alias="Förderprofil", + description="The funding profile of the project", + examples=["Technologie- und Innovationsförderung"], + ) + + joint_project: Optional[str] = Field( + default=None, + validation_alias="Verbundprojekt", + description="Whether the project is a joint project", + examples=["Moby_Dex"], + ) + + funding_type: Optional[str] = Field( + default=None, + validation_alias="Förderart", + description="The funding type of the project", + examples=["PDIR"], + ) + + publication_date: Optional[str] = Field( + default=None, + validation_alias="Publikationsdatum", + description="The publication date of the project", + examples=["2023"], + ) + + unix_timestamp: Optional[int] = Field( + default=None, + validation_alias="Unix-Timestamp", + description="The unix timestamp of the project", + examples=[1737411518], + ) + + date: Optional[str] = Field( + default=None, + validation_alias="datum", + description="The date of the project", + examples=["20.01.2025"], + ) + + new: Optional[bool] = Field( + default=None, + validation_alias="neu", + description="Whether the project is new", + examples=[False], + ) + + duration: Optional[str] = Field( + default=None, + validation_alias="Laufzeit", + description="The duration of the project", + examples=["von 01.09.2023 bis 31.08.2026"], + ) diff --git a/service/src/main/inse/models/bund_project_details.py b/service/src/main/inse/models/bund_project_details.py new file mode 100644 index 00000000..d7c4baf1 --- /dev/null +++ b/service/src/main/inse/models/bund_project_details.py @@ -0,0 +1,337 @@ +# coding: utf-8 + +""" + Bund Project Clean Model + + Summary model that consolidates scattered fields from the raw projects_bund index + into clean, semantic field names with proper native Python types. +""" + +from datetime import date, datetime +from typing import Optional, List, Set, Any + +from pydantic import BaseModel, ConfigDict, Field, field_validator + + +class BundProjectDetails(BaseModel): + """ + Clean summary model for a Bund (federal) project, consolidating all fields + into semantic English names with proper native types. + """ + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + ) + + # Core identifiers + id: str = Field(description="The ID of the Bund project") + funding_reference: Optional[str] = Field( + default=None, + + description="The funding reference number (Förderkennzeichen)", + ) + + # Project metadata + title: Optional[str] = Field( + default=None, + + description="The project topic/title", + ) + description: Optional[str] = Field( + default=None, + + description="Plain text description of the performance plan classification", + ) + joint_project: Optional[str] = Field( + default=None, + + description="Parent joint project if this is a sub-project", + ) + + # Funding information + funding_type: Optional[str] = Field( + default=None, + + description="Type of funding (Förderart)", + ) + funding_profile: Optional[str] = Field( + default=None, + + description="Funding profile (Förderprofil)", + ) + funding_amount: Optional[float] = Field( + default=None, + + description="Funding amount in EUR", + ) + funding_start_date: Optional[date] = Field( + default=None, + description="Funding start date", + ) + funding_end_date: Optional[date] = Field( + default=None, + description="Funding end date", + ) + duration: Optional[str] = Field( + default=None, + + description="Project duration (Laufzeit)", + ) + + # Classification + performance_plan_code: Optional[str] = Field( + default=None, + + description="Performance plan classification code", + ) + performance_plan_fullname: Optional[str] = Field( + default=None, + + description="Full name of the performance plan classification", + ) + + # Organizational + executing_agency: Optional[str] = Field( + default=None, + + description="Executing agency", + ) + funding_recipient: Optional[str] = Field( + default=None, + + description="Funding recipient", + ) + project_agency: Optional[str] = Field( + default=None, + + description="Project management agency", + ) + project_agency_fullname: Optional[str] = Field( + default=None, + + description="Full name of the project management agency", + ) + + # Government hierarchy + department: Optional[str] = Field( + default=None, + + description="Government department code", + ) + department_fullname: Optional[str] = Field( + default=None, + + description="Full name of the government department", + ) + division: Optional[str] = Field( + default=None, + + description="Division/unit reference", + ) + + # Location + location: Optional[str] = Field( + default=None, + + description="Location/city", + ) + municipality: Optional[str] = Field( + default=None, + + description="City/Municipality", + ) + state: Optional[str] = Field( + default=None, + + description="Federal state", + ) + country: Optional[str] = Field( + default=None, + + description="Country", + ) + municipality_code: Optional[str] = Field( + default=None, + + description="Municipality code", + ) + + # Publication + publication_date: Optional[str] = Field( + default=None, + + description="Publication date", + ) + + # Additional + is_new: Optional[bool] = Field( + default=None, + + description="Flag indicating if the project is new", + ) + record_date: Optional[str] = Field( + default=None, + + description="Record date", + ) + unix_timestamp: Optional[int] = Field( + default=None, + description="Unix timestamp of the record", + ) + + # Unified lists for aggregation + associated_persons: List[str] = Field( + default_factory=list, + description="All persons associated with the Bund project (from nested Arb object)", + ) + institutions: List[str] = Field( + default_factory=list, + description="All institutions associated with the Bund project", + ) + + # --- Validators for type coercion --- + + @field_validator("funding_amount", mode="before") + @classmethod + def parse_funding_amount(cls, v: Any) -> Optional[float]: + """Parse funding amount from string or number.""" + if v is None: + return None + if isinstance(v, (int, float)): + return float(v) + if isinstance(v, str): + # Remove thousands separators and trim + cleaned = v.replace(".", "").replace(",", ".").strip() + try: + return float(cleaned) + except ValueError: + return None + return None + + @field_validator("funding_start_date", "funding_end_date", mode="before") + @classmethod + def parse_german_date(cls, v: Any) -> Optional[date]: + """Parse date from German format (dd.MM.yyyy) or date/datetime object.""" + if v is None: + return None + if isinstance(v, datetime): + return v.date() + if isinstance(v, date): + return v + if isinstance(v, str): + v = v.strip() + # Try German format first: dd.MM.yyyy + try: + return datetime.strptime(v, "%d.%m.%Y").date() + except ValueError: + pass + # Try ISO format: yyyy-MM-dd + try: + return datetime.strptime(v, "%Y-%m-%d").date() + except ValueError: + pass + # Try with time component + try: + return datetime.fromisoformat(v).date() + except ValueError: + pass + return None + + @field_validator("is_new", mode="before") + @classmethod + def parse_is_new(cls, v: Any) -> Optional[bool]: + """Parse is_new from bool or string.""" + if v is None: + return None + if isinstance(v, bool): + return v + if isinstance(v, str): + return v.lower() in ("true", "1", "yes", "ja") + if isinstance(v, (int, float)): + return bool(v) + return None + + @field_validator("unix_timestamp", mode="before") + @classmethod + def parse_unix_timestamp(cls, v: Any) -> Optional[int]: + """Parse unix timestamp from int, float, or string.""" + if v is None: + return None + if isinstance(v, (int, float)): + return int(v) + if isinstance(v, str): + try: + return int(v) + except ValueError: + return None + return None + + @classmethod + def from_elastic_hit(cls, hit: dict) -> "BundProject": + """ + Create a BundProject from an Elasticsearch hit, consolidating all fields. + """ + source = hit.get("_source", {}) + + # --- Extract persons from nested Arb object --- + persons: Set[str] = set() + arb = source.get("Arb") + if arb and isinstance(arb, dict): + for key, value in arb.items(): + if isinstance(value, str) and value.strip(): + for person in value.split(";"): + person = person.strip() + if person: + persons.add(person) + + # --- Extract institutions --- + institutions: Set[str] = set() + inst_fields = [ + "Ausführende Stelle", + "Zuwendungsempfänger", + "Projektträger", + ] + for field in inst_fields: + if field in source and source[field]: + for inst in source[field].split(";"): + inst = inst.strip() + if inst: + institutions.add(inst) + + if source.get("PT_fullname"): + institutions.add(source["PT_fullname"].strip()) + + return cls( + id=hit["_id"], + funding_reference=source.get("Förderkennzeichen"), + title=source.get("Thema"), + description=source.get("Klartext Leistungsplansystematik"), + joint_project=source.get("Verbundprojekt"), + funding_type=source.get("Förderart"), + funding_profile=source.get("Förderprofil"), + funding_amount=source.get("Fördersumme"), + funding_start_date=source.get("funding_start"), + funding_end_date=source.get("funding_end"), + duration=source.get("Laufzeit"), + performance_plan_code=source.get("Leistungsplansystematik"), + performance_plan_fullname=source.get("Leistungsplansystematik_fullname"), + executing_agency=source.get("Ausführende Stelle"), + funding_recipient=source.get("Zuwendungsempfänger"), + project_agency=source.get("Projektträger"), + project_agency_fullname=source.get("PT_fullname"), + department=source.get("Ressort"), + department_fullname=source.get("Ressort_fullname"), + division=source.get("Referat"), + location=source.get("Ort"), + municipality=source.get("Stadt/Gemeinde"), + state=source.get("Bundesland"), + country=source.get("Staat"), + municipality_code=source.get("Gemeindekennziffer"), + publication_date=source.get("Publikationsdatum"), + is_new=source.get("new"), + record_date=source.get("datum"), + unix_timestamp=source.get("unix_timestamp"), + associated_persons=sorted(persons), + institutions=sorted(institutions), + ) \ No newline at end of file diff --git a/service/src/main/inse/models/cordis_eu_project.py b/service/src/main/inse/models/cordis_eu_project.py new file mode 100644 index 00000000..557dfd57 --- /dev/null +++ b/service/src/main/inse/models/cordis_eu_project.py @@ -0,0 +1,62 @@ +from datetime import datetime +from typing import Optional, List, Union +from pydantic import BaseModel, Field + + +class CordisEuProject(BaseModel): + id: str = Field( + description="Unique identifier for the project, typically the CORDIS ID" + ) + rcn: Optional[str] = Field( + None, description="Research and Innovation project number (CORDIS RCN)" + ) + acronym: Optional[str] = Field(None, description="Acronym for the project") + title: Optional[str] = Field(None, description="Title of the project") + objective: Optional[str] = Field(None, description="Objective of the project") + + frameworkProgramme: Optional[str] = Field( + None, description="Framework Programme under which the project was funded" + ) + fundingScheme: Optional[str] = Field( + None, description="Funding scheme of the project" + ) + legalBasis: Optional[str] = Field( + None, description="Legal basis for the project funding" + ) + masterCall: Optional[str] = Field( + None, description="Master call identifier if applicable" + ) + subCall: Optional[str] = Field( + None, description="Sub call identifier if applicable" + ) + topics: Optional[Union[str, List[str]]] = ( + None # Elastic keyword can map to a single string or list of strings + ) + nature: Optional[str] = Field(None, description="Nature of the project") + status: Optional[str] = Field(None, description="Status of the project") + + ecMaxContribution: Optional[float] = Field( + None, description="Maximum European Commission contribution" + ) + totalCost: Optional[float] = Field(None, description="Total cost of the project") + + startDate: Optional[datetime] = Field(None, description="Start date of the project") + endDate: Optional[datetime] = Field(None, description="End date of the project") + ecSignatureDate: Optional[datetime] = Field( + None, description="Date of the European Commission signature" + ) + contentUpdateDate: Optional[datetime] = Field( + None, description="Date when the project content was last updated" + ) + + grantDoi: Optional[str] = Field(None, description="DOI for the project grant") + humanValidated: Optional[bool] = Field( + None, + description="Indicates if the project information has been human validated", + ) + keywords: Optional[Union[str, List[str]]] = Field( + None, description="Keywords associated with the project" + ) + + class Config: + populate_by_name = True diff --git a/service/src/main/inse/models/dfg_project.py b/service/src/main/inse/models/dfg_project.py new file mode 100644 index 00000000..409e0fe5 --- /dev/null +++ b/service/src/main/inse/models/dfg_project.py @@ -0,0 +1,94 @@ +from datetime import date +from typing import Optional, Set + +from pydantic import BaseModel, Field + + +class DfgProject(BaseModel): + id: str = Field(description="The ID of the DFG project") + link: str = Field(description="The link to the DFG project") + title: str = Field(description="The title of the DFG project") + description: str = Field(description="The description of the DFG project") + + project_identifier: str = Field( + description="The project identifier of the DFG project" + ) + + funding_start_date: str = Field( + description="The funding start date of the DFG project" + ) + funding_end_date: str = Field(description="The funding end date of the DFG project") + + associated_persons: list[str] = Field( + description="The associated persons of the DFG project" + ) + + institutions: list[str] = Field( + description="The institutions associated with the DFG project" + ) + + @classmethod + def from_elastic_hit(cls, hit: dict): + source = hit["_source"] + + associated_persons: Set[str] = set() + institutions: Set[str] = set() + + # persons + + if "Antragsteller" in source: + associated_persons.update(source["Antragsteller"].split(";")) + + if "Antragstellerin" in source: + associated_persons.add(source["Antragstellerin"]) + + if "Sprecher" in source: + associated_persons.add(source["Sprecher"]) + + if "Sprecherin" in source: + associated_persons.add(source["Sprecherin"]) + + if "Leiter" in source: + associated_persons.add(source["Leiter"]) + + if "Leiterin" in source: + associated_persons.add(source["Leiterin"]) + + if "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler" in source: + associated_persons.update( + source[ + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler" + ].split(";") + ) + + if "Beteiligte Personen" in source: + associated_persons.update(source["Beteiligte Personen"].split(";")) + + if "Teilprojektleiter" in source: + associated_persons.update(source["Teilprojektleiter"].split(";")) + + # institutions + + if "Antragstellende Institution" in source: + institutions.add(source["Antragstellende Institution"]) + + if "Mitantragstellende Institution" in source: + institutions.add(source["Mitantragstellende Institution"]) + + if "Beteiligte Institution" in source: + institutions.add(source["Beteiligte Institution"]) + + if "Beteiligte Hochschule" in source: + institutions.add(source["Beteiligte Hochschule"]) + + return cls( + id=hit["_id"], + link=source["link"], + title=source["title"], + description=source["description"], + project_identifier=source["Projektkennzeichen"], + funding_start_date=source["funding_start"], + funding_end_date=source["funding_end"], + associated_persons=list(associated_persons), + institutions=list(institutions), + ) diff --git a/service/src/main/inse/models/dfg_project_details.py b/service/src/main/inse/models/dfg_project_details.py new file mode 100644 index 00000000..96ee5dc9 --- /dev/null +++ b/service/src/main/inse/models/dfg_project_details.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + DFG Project Clean Model + + Summary model that consolidates all scattered person and institution fields + from the raw projects_dfg_all index into clean, unified lists. +""" + +from typing import Optional, List, Set + +from pydantic import BaseModel, ConfigDict, Field + + +class DfgProjectDetails(BaseModel): + """ + Clean summary model for a DFG project, consolidating all person roles + and institution references into unified lists. + """ + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + ) + + id: str = Field(description="The ID of the DFG project") + link: Optional[str] = Field(default=None, description="The link to the DFG project") + title: Optional[str] = Field( + default=None, description="The title of the DFG project" + ) + description: Optional[str] = Field( + default=None, description="The description of the DFG project" + ) + + project_identifier: Optional[str] = Field( + default=None, + description="The project identifier of the DFG project", + ) + + funding_start_date: Optional[str] = Field( + default=None, description="The funding start date of the DFG project" + ) + funding_end_date: Optional[str] = Field( + default=None, description="The funding end date of the DFG project" + ) + + dfg_procedure: Optional[str] = Field( + default=None, description="The DFG procedure" + ) + subject_area: Optional[str] = Field( + default=None, + description="The subject area classification", + ) + funding_type: Optional[str] = Field( + default=None, description="The type of funding" + ) + international_reference: Optional[str] = Field( + default=None, + + description="International reference", + ) + + website: Optional[str] = Field( + default=None, description="The project website" + ) + + # Unified person list: all person names from any role + associated_persons: List[str] = Field( + default_factory=list, + description="All persons associated with the DFG project (any role)", + ) + + # Unified institution list: all institutions involved + institutions: List[str] = Field( + default_factory=list, + description="All institutions associated with the DFG project", + ) + + # Sub-project reference + subproject_of: Optional[str] = Field( + default=None, + description="Parent project this is a sub-project of", + ) + + @classmethod + def from_elastic_hit(cls, hit: dict) -> "DfgProjectDetails": + """ + Create a DfgProject from an Elasticsearch hit, consolidating all + person and institution fields into unified lists. + """ + + source = hit.get("_source", {}) + + associated_persons: Set[str] = set() + institutions: Set[str] = set() + + # --- Collect all persons from every person-related field --- + + # Applicant fields + _add_persons(source, associated_persons, "Antragsteller") # semicolon-separated + _add_person(source, associated_persons, "Antragstellerin") + _add_persons( + source, associated_persons, "Antragstellerinnen" + ) # semicolon-separated + _add_persons( + source, associated_persons, "Antragstellerinnen / Antragsteller" + ) # semicolon-separated + + # Co-applicant fields + _add_persons(source, associated_persons, "Mitantragsteller") + _add_person(source, associated_persons, "Mitantragstellerin") + _add_persons(source, associated_persons, "Mitantragstellerinnen") + _add_persons( + source, associated_persons, "Mitantragstellerinnen / Mitantragsteller" + ) + + # Former applicant fields + _add_persons(source, associated_persons, "Ehemalige Antragsteller") + _add_person(source, associated_persons, "Ehemalige Antragstellerin") + _add_persons(source, associated_persons, "Ehemalige Antragstellerinnen") + _add_persons( + source, + associated_persons, + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + ) + _add_person(source, associated_persons, "Ehemaliger Antragsteller") + + # Speaker / coordinator fields + _add_person(source, associated_persons, "Sprecher") + _add_person(source, associated_persons, "Sprecherin") + _add_persons(source, associated_persons, "Sprecherinnen") + _add_persons(source, associated_persons, "Sprecherinnen / Sprecher") + _add_person(source, associated_persons, "Co-Sprecher") + _add_persons(source, associated_persons, "Co-Sprecherinnen / Co-Sprecher") + + # IGK partner speaker fields + _add_person(source, associated_persons, "Sprecher (IGK-Partner)") + _add_person(source, associated_persons, "Sprecherin (IGK-Partner)") + _add_persons( + source, + associated_persons, + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + ) + + # Leader fields + _add_person(source, associated_persons, "Leiter") + _add_person(source, associated_persons, "Leiterin") + _add_persons(source, associated_persons, "Leiterinnen") + _add_persons(source, associated_persons, "Leiterinnen / Leiter") + + # Sub-project leader fields + _add_persons(source, associated_persons, "Teilprojektleiter") + _add_person(source, associated_persons, "Teilprojektleiterin") + _add_persons(source, associated_persons, "Teilprojektleiterinnen") + _add_persons( + source, associated_persons, "Teilprojektleiterinnen / Teilprojektleiter" + ) + + # Participating scientist fields + _add_persons(source, associated_persons, "beteiligte Wissenschaftler") + _add_person(source, associated_persons, "beteiligte Wissenschaftlerin") + _add_persons(source, associated_persons, "beteiligte Wissenschaftlerinnen") + _add_persons( + source, + associated_persons, + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + ) + _add_person(source, associated_persons, "beteiligter Wissenschaftler") + + # Participating person fields + _add_person(source, associated_persons, "Beteiligte Person") + _add_persons(source, associated_persons, "Beteiligte Personen") + + # Host fields (for guest researchers) + _add_person(source, associated_persons, "Gastgeber") + _add_person(source, associated_persons, "Gastgeberin") + _add_persons(source, associated_persons, "Gastgeberinnen") + _add_persons(source, associated_persons, "Gastgeberinnen / Gastgeber") + + # Cooperation partner fields + _add_person(source, associated_persons, "Kooperationspartner") + _add_person(source, associated_persons, "Kooperationspartnerin") + _add_persons(source, associated_persons, "Kooperationspartnerinnen") + _add_persons( + source, associated_persons, "Kooperationspartnerinnen / Kooperationspartner" + ) + + # Co-responsible fields + _add_person(source, associated_persons, "Mitverantwortlich") + _add_person(source, associated_persons, "Mitverantwortlich(e)") + _add_persons(source, associated_persons, "Mitverantwortliche") + + # Application partner + _add_person(source, associated_persons, "Anwendungspartner") + + # Foreign co-applicant fields + _add_persons(source, associated_persons, "ausländische Mitantragsteller") + _add_person(source, associated_persons, "ausländischer Mitantragsteller") + + # Person creator (from nested fields) + if "person_creater_name" in source and source["person_creater_name"]: + associated_persons.add(source["person_creater_name"].strip()) + + # Deputy (stellvertr) - nested object + stellvertr = source.get("stellvertr") + if stellvertr and isinstance(stellvertr, dict): + for field in ["stellvertreter", "stellvertreterin"]: + if field in stellvertr and stellvertr[field]: + associated_persons.add(stellvertr[field].strip()) + + # --- Collect all institutions --- + + _add_institution(source, institutions, "Antragstellende Institution") + _add_institution(source, institutions, "Mitantragstellende Institution") + _add_institution(source, institutions, "Beteiligte Einrichtung") + _add_institution(source, institutions, "Beteiligte Hochschule") + _add_institution(source, institutions, "Beteiligte Institution") + _add_institution(source, institutions, "IGK-Partnerinstitution") + _add_institution(source, institutions, "Partnerorganisation") + _add_institution(source, institutions, "Unternehmen") + + # Foreign institution (nested object) + auslaend = source.get("ausländ") + if auslaend and isinstance(auslaend, dict): + for field in [ + "auslaendischeInstitution", + "auslaendischeInstitution2", + "auslaendischesUnternehmen", + "auslaendischesUnternehmen2", + ]: + if field in auslaend and auslaend[field]: + institutions.add(auslaend[field].strip()) + return cls( + id=hit["_id"], + link=source.get("link"), + title=source.get("title"), + description=source.get("description"), + project_identifier=source.get("Projektkennung"), + funding_start_date=source.get("funding_start"), + funding_end_date=source.get("funding_end"), + dfg_procedure=source.get("DFG-Verfahren"), + subject_area=source.get("Fachliche Zuordnung"), + funding_type=source.get("Förderung"), + international_reference=source.get("Internationaler Bezug"), + website=source.get("Webseite"), + associated_persons=sorted(associated_persons), # sorted for consistency + institutions=sorted(institutions), + subproject_of=source.get("Teilprojekt zu"), + ) + + +# --- Helper functions for parsing source fields --- + +def _add_person(source: dict, persons: Set[str], field: str) -> None: + """Add a single person value from a field.""" + if field in source and source[field]: + value = source[field].strip() + if value: + persons.add(value) + + +def _add_persons(source: dict, persons: Set[str], field: str) -> None: + """Add persons from a semicolon-separated field.""" + if field in source and source[field]: + for person in source[field].split(";"): + cleaned = person.strip() + if cleaned: + persons.add(cleaned) + + +def _add_institution(source: dict, institutions: Set[str], field: str) -> None: + """Add a single institution value from a field.""" + if field in source and source[field]: + value = source[field].strip() + if value: + institutions.add(value) \ No newline at end of file diff --git a/service/src/main/inse/models/eu_project.py b/service/src/main/inse/models/eu_project.py new file mode 100644 index 00000000..a499216a --- /dev/null +++ b/service/src/main/inse/models/eu_project.py @@ -0,0 +1,192 @@ +from typing import List, Optional +from pydantic import BaseModel, ConfigDict, Field + + +class DisplayCodeSplittedNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + single_display_code: Optional[str] = Field( + default=None, + validation_alias="singleDisplayCode", + description="A solitary segment or specific component broken out from the main display code.", + ) + + +class CategoryNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + category: Optional[str] = Field( + default=None, + description="The descriptive classification title or taxonomy name for the project.", + ) + code: Optional[str] = Field( + default=None, description="The system code representing the specific category." + ) + display_code: Optional[str] = Field( + default=None, + validation_alias="displayCode", + description="The alphanumeric code formatted for user interface display purposes.", + ) + # REFINED: Mapped to List[str] because the real data provides an array of strings + display_code_splitted: List[str] = Field( + default_factory=list, + validation_alias="displayCode_splitted", + description="A tokenized hierarchy breakdown of the display code represented as an array of strings.", + ) + display_code_splitted_nested: List[DisplayCodeSplittedNested] = Field( + default_factory=list, + validation_alias="displayCode_splitted_nested", + description="Granular, nested breakdowns of the split parts of the display code.", + ) + + +class KeywordNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + keyword: Optional[str] = Field( + default=None, + description="An individual standalone keyword or tag used for granular search index filtering.", + ) + + +class OrganizationNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + ec_contribution: Optional[str] = Field( + default=None, + validation_alias="ecContribution", + description="The gross European Commission financial contribution allocated to this specific participant organization.", + ) + id: Optional[str] = Field( + default=None, + description="The unique identifier or Participant Identification Code (PIC) of the organization.", + ) + name: Optional[str] = Field( + default=None, + description="The full legal name of the participating organization or institution.", + ) + net_ec_contribution: Optional[str] = Field( + default=None, + validation_alias="netEcContribution", + description="The net European Commission financial funding provided to the organization after adjustments.", + ) + total_cost: Optional[str] = Field( + default=None, + validation_alias="totalCost", + description="The overall individual budget or total cost declared by this organization for its share of work.", + ) + organization_type: Optional[str] = Field( + default=None, + validation_alias="type", + description="The legal entity type or role of the organization (e.g., coordinator, participant).", + ) + + +class ProgrammeNested(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + code: Optional[str] = Field( + default=None, + description="The structural code identifying the framework or specific funding sub-programme.", + ) + id: Optional[str] = Field( + default=None, + description="The unique identifier of the funding program within the registry.", + ) + programme: Optional[str] = Field( + default=None, + description="The official title or description of the EU funding program.", + ) + + +class EuProject(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + acronym: Optional[str] = Field( + default=None, + description="The official, short acronym chosen to identify the EU project.", + ) + categories_nested: List[CategoryNested] = Field( + default_factory=list, + description="Structured lists of classification categories and taxonomy mappings assigned to the project.", + ) + doc_number: Optional[str] = Field( + default=None, + description="The internal administrative document control number or record tracking identifier.", + ) + doi: Optional[str] = Field( + default=None, + description="The Digital Object Identifier (DOI) linked to the project's official metadata or primary publication.", + ) + ec_max_contribution: Optional[str] = Field( + default=None, + validation_alias="ecMaxContribution", + description="The maximum authorized limit for the European Commission's financial grant contribution to the project.", + ) + end_date: Optional[str] = Field( + default=None, + validation_alias="endDate", + description="The calendar date marking the official structural conclusion of the project execution timeline.", + ) + funding_end: Optional[str] = Field( + default=None, + description="The exact calendar termination year for the project's financial eligibility period.", + ) + funding_start: Optional[str] = Field( + default=None, + description="The exact calendar activation year from which project expenses can be billed against the grant.", + ) + id: Optional[str] = Field( + default=None, + description="The unique global record ID for the project document (typically the Grant Agreement Number).", + ) + keywords: Optional[str] = Field( + default=None, + description="A general text string or comma-separated list of keywords applied to the project record.", + ) + keywords_nested: List[KeywordNested] = Field( + default_factory=list, + description="Strictly tokenized and isolated keywords nested for targeted search engine aggregations.", + ) + link: Optional[str] = Field( + default=None, + description="The web URL linking directly to the project's public profile page on CORDIS or an equivalent registry.", + ) + objective: Optional[str] = Field( + default=None, + description="The complete, detailed abstract outlining the goals, methodology, and expected impact of the project.", + ) + organization_nested: List[OrganizationNested] = Field( + default_factory=list, + description="The full roster of academic, public, or private organizations participating in the project consortium.", + ) + programme_nested: List[ProgrammeNested] = Field( + default_factory=list, + description="The nested historical line of EU funding frameworks and structural grants supporting this project.", + ) + source: Optional[str] = Field( + default=None, + description="The specific upstream system or database repository from which this document was fetched or synced.", + ) + start_date: Optional[str] = Field( + default=None, + validation_alias="startDate", + description="The official calendar date marking the active kickoff and formal initiation of the project.", + ) + status: Optional[str] = Field( + default=None, + description="The lifecycle phase of the project (e.g., 'CLOSED', 'ONGOING').", + ) + teaser: Optional[str] = Field( + default=None, + description="A brief, high-level summary or editorial sentence written for general public consumption.", + ) + title: Optional[str] = Field( + default=None, + description="The comprehensive, full legal title describing the scope of the project.", + ) + total_cost: Optional[str] = Field( + default=None, + validation_alias="totalCost", + description="The combined sum total budget estimated for the implementation of the entire project.", + ) diff --git a/service/src/main/inse/models/news_aktuell/aktuell.py b/service/src/main/inse/models/news_aktuell/aktuell.py new file mode 100644 index 00000000..8076484c --- /dev/null +++ b/service/src/main/inse/models/news_aktuell/aktuell.py @@ -0,0 +1,132 @@ +# coding: utf-8 + +""" + Aktuell Index Backend Models + + Pydantic models for the Elasticsearch \"aktuell\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.news_aktuell.link_item import LinkItem +from inse.models.news_aktuell.tag_item import TagItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Aktuell(BaseModel): + """ + Main document model for the aktuell index. + """ # noqa: E501 + author: Optional[StrictStr] = None + var_date: Optional[StrictStr] = Field(default=None, alias="date") + date_full: Optional[StrictInt] = None + date_year: Optional[StrictInt] = None + full_content: Optional[StrictStr] = None + further_content: Optional[StrictStr] = None + intro_content: Optional[StrictStr] = None + links_nested: Optional[List[LinkItem]] = None + main_content: Optional[StrictStr] = None + maintitle: Optional[StrictStr] = None + redaktion: Optional[StrictStr] = None + subtitle: Optional[StrictStr] = None + tags: Optional[StrictStr] = None + tags_nested: Optional[List[TagItem]] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["author", "date", "date_full", "date_year", "full_content", "further_content", "intro_content", "links_nested", "main_content", "maintitle", "redaktion", "subtitle", "tags", "tags_nested", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Aktuell from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in links_nested (list) + _items = [] + if self.links_nested: + for _item_links_nested in self.links_nested: + if _item_links_nested: + _items.append(_item_links_nested.to_dict()) + _dict['links_nested'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in tags_nested (list) + _items = [] + if self.tags_nested: + for _item_tags_nested in self.tags_nested: + if _item_tags_nested: + _items.append(_item_tags_nested.to_dict()) + _dict['tags_nested'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Aktuell from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "author": obj.get("author"), + "date": obj.get("date"), + "date_full": obj.get("date_full"), + "date_year": obj.get("date_year"), + "full_content": obj.get("full_content"), + "further_content": obj.get("further_content"), + "intro_content": obj.get("intro_content"), + "links_nested": [LinkItem.from_dict(_item) for _item in obj["links_nested"]] if obj.get("links_nested") is not None else None, + "main_content": obj.get("main_content"), + "maintitle": obj.get("maintitle"), + "redaktion": obj.get("redaktion"), + "subtitle": obj.get("subtitle"), + "tags": obj.get("tags"), + "tags_nested": [TagItem.from_dict(_item) for _item in obj["tags_nested"]] if obj.get("tags_nested") is not None else None, + "url": obj.get("url") + }) + return _obj + + diff --git a/service/src/main/inse/models/news_aktuell/link_item.py b/service/src/main/inse/models/news_aktuell/link_item.py new file mode 100644 index 00000000..2b3e07c0 --- /dev/null +++ b/service/src/main/inse/models/news_aktuell/link_item.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Aktuell Index Backend Models + + Pydantic models for the Elasticsearch \"aktuell\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LinkItem(BaseModel): + """ + Nested link object within the Aktuell document. + """ # noqa: E501 + text: Optional[StrictStr] = None + url: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["text", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LinkItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LinkItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "text": obj.get("text"), + "url": obj.get("url") + }) + return _obj + + diff --git a/service/src/main/inse/models/news_aktuell/tag_item.py b/service/src/main/inse/models/news_aktuell/tag_item.py new file mode 100644 index 00000000..e7a64e1e --- /dev/null +++ b/service/src/main/inse/models/news_aktuell/tag_item.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Aktuell Index Backend Models + + Pydantic models for the Elasticsearch \"aktuell\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TagItem(BaseModel): + """ + Nested tag object within the Aktuell document. + """ # noqa: E501 + tag: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["tag"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TagItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TagItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "tag": obj.get("tag") + }) + return _obj + + diff --git a/service/src/main/inse/models/openalex/__init__.py b/service/src/main/inse/models/openalex/__init__.py new file mode 100644 index 00000000..31842253 --- /dev/null +++ b/service/src/main/inse/models/openalex/__init__.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +# flake8: noqa +""" + OpenAlex API + + The OpenAlex API provides access to a comprehensive catalog of scholarly works, authors, sources, institutions, topics, keywords, publishers, and funders. OpenAlex indexes over 250 million scholarly works. + + The version of the OpenAPI document: 1.0.0 + Contact: support@openalex.org + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from inse.models.openalex.author import Author +from inse.models.openalex.author_affiliations_inner import AuthorAffiliationsInner +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.author_ids import AuthorIds +from inse.models.openalex.author_parsed_longest_name import AuthorParsedLongestName +from inse.models.openalex.author_summary_stats import AuthorSummaryStats +from inse.models.openalex.author_topics_inner import AuthorTopicsInner +from inse.models.openalex.authors_list_response import AuthorsListResponse +from inse.models.openalex.authorship import Authorship +from inse.models.openalex.autocomplete_response import AutocompleteResponse +from inse.models.openalex.autocomplete_response_meta import AutocompleteResponseMeta +from inse.models.openalex.autocomplete_response_results_inner import AutocompleteResponseResultsInner +from inse.models.openalex.award import Award +from inse.models.openalex.award_full import AwardFull +from inse.models.openalex.award_full_funder import AwardFullFunder +from inse.models.openalex.awards_list_response import AwardsListResponse +from inse.models.openalex.concept import Concept +from inse.models.openalex.concept_ids import ConceptIds +from inse.models.openalex.concepts_list_response import ConceptsListResponse +from inse.models.openalex.continent import Continent +from inse.models.openalex.continent_ids import ContinentIds +from inse.models.openalex.continents_list_response import ContinentsListResponse +from inse.models.openalex.countries_list_response import CountriesListResponse +from inse.models.openalex.country import Country +from inse.models.openalex.country_continent import CountryContinent +from inse.models.openalex.country_ids import CountryIds +from inse.models.openalex.dehydrated_author import DehydratedAuthor +from inse.models.openalex.dehydrated_funder import DehydratedFunder +from inse.models.openalex.dehydrated_institution import DehydratedInstitution +from inse.models.openalex.dehydrated_source import DehydratedSource +from inse.models.openalex.domain import Domain +from inse.models.openalex.domain_fields_inner import DomainFieldsInner +from inse.models.openalex.domain_ids import DomainIds +from inse.models.openalex.domains_list_response import DomainsListResponse +from inse.models.openalex.error import Error +from inse.models.openalex.fields_list_response import FieldsListResponse +from inse.models.openalex.funder import Funder +from inse.models.openalex.funder_ids import FunderIds +from inse.models.openalex.funders_list_response import FundersListResponse +from inse.models.openalex.get_changefile200_response import GetChangefile200Response +from inse.models.openalex.get_changefile200_response_meta import GetChangefile200ResponseMeta +from inse.models.openalex.get_changefile200_response_results_inner import GetChangefile200ResponseResultsInner +from inse.models.openalex.get_changefile200_response_results_inner_formats import GetChangefile200ResponseResultsInnerFormats +from inse.models.openalex.get_changefile200_response_results_inner_formats_jsonl import GetChangefile200ResponseResultsInnerFormatsJsonl +from inse.models.openalex.get_changefile200_response_results_inner_formats_parquet import GetChangefile200ResponseResultsInnerFormatsParquet +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.institution import Institution +from inse.models.openalex.institution_geo import InstitutionGeo +from inse.models.openalex.institution_ids import InstitutionIds +from inse.models.openalex.institution_type import InstitutionType +from inse.models.openalex.institution_types_list_response import InstitutionTypesListResponse +from inse.models.openalex.institutions_list_response import InstitutionsListResponse +from inse.models.openalex.keyword import Keyword +from inse.models.openalex.keywords_list_response import KeywordsListResponse +from inse.models.openalex.language import Language +from inse.models.openalex.languages_list_response import LanguagesListResponse +from inse.models.openalex.license import License +from inse.models.openalex.licenses_list_response import LicensesListResponse +from inse.models.openalex.list_changefiles200_response import ListChangefiles200Response +from inse.models.openalex.list_changefiles200_response_meta import ListChangefiles200ResponseMeta +from inse.models.openalex.list_changefiles200_response_results_inner import ListChangefiles200ResponseResultsInner +from inse.models.openalex.location import Location +from inse.models.openalex.meta import Meta +from inse.models.openalex.model_field import ModelField +from inse.models.openalex.open_access import OpenAccess +from inse.models.openalex.publisher import Publisher +from inse.models.openalex.publisher_ids import PublisherIds +from inse.models.openalex.publisher_parent_publisher import PublisherParentPublisher +from inse.models.openalex.publishers_list_response import PublishersListResponse +from inse.models.openalex.rate_limit_response import RateLimitResponse +from inse.models.openalex.rate_limit_response_rate_limit import RateLimitResponseRateLimit +from inse.models.openalex.rate_limit_response_rate_limit_endpoint_costs_usd import RateLimitResponseRateLimitEndpointCostsUsd +from inse.models.openalex.sdg import Sdg +from inse.models.openalex.sdg_ids import SdgIds +from inse.models.openalex.sdgs_list_response import SdgsListResponse +from inse.models.openalex.source import Source +from inse.models.openalex.source_ids import SourceIds +from inse.models.openalex.source_type import SourceType +from inse.models.openalex.source_types_list_response import SourceTypesListResponse +from inse.models.openalex.sources_list_response import SourcesListResponse +from inse.models.openalex.subfield import Subfield +from inse.models.openalex.subfield_domain import SubfieldDomain +from inse.models.openalex.subfield_field import SubfieldField +from inse.models.openalex.subfields_list_response import SubfieldsListResponse +from inse.models.openalex.text_classification_response import TextClassificationResponse +from inse.models.openalex.text_classification_response_meta import TextClassificationResponseMeta +from inse.models.openalex.topic import Topic +from inse.models.openalex.topic_domain import TopicDomain +from inse.models.openalex.topic_field import TopicField +from inse.models.openalex.topic_ids import TopicIds +from inse.models.openalex.topic_subfield import TopicSubfield +from inse.models.openalex.topics_list_response import TopicsListResponse +from inse.models.openalex.work import Work +from inse.models.openalex.work_biblio import WorkBiblio +from inse.models.openalex.work_citation_normalized_percentile import WorkCitationNormalizedPercentile +from inse.models.openalex.work_cited_by_percentile_year import WorkCitedByPercentileYear +from inse.models.openalex.work_counts_by_year_inner import WorkCountsByYearInner +from inse.models.openalex.work_has_content import WorkHasContent +from inse.models.openalex.work_ids import WorkIds +from inse.models.openalex.work_keyword import WorkKeyword +from inse.models.openalex.work_mesh_inner import WorkMeshInner +from inse.models.openalex.work_sustainable_development_goals_inner import WorkSustainableDevelopmentGoalsInner +from inse.models.openalex.work_topic import WorkTopic +from inse.models.openalex.work_topic_domain import WorkTopicDomain +from inse.models.openalex.work_topic_field import WorkTopicField +from inse.models.openalex.work_topic_subfield import WorkTopicSubfield +from inse.models.openalex.work_type import WorkType +from inse.models.openalex.work_types_list_response import WorkTypesListResponse +from inse.models.openalex.works_list_response import WorksListResponse +from inse.models.openalex.work_page import WorkPage + +from inse.models.openalex.lsf_person import LsfPerson diff --git a/service/src/main/inse/models/author.py b/service/src/main/inse/models/openalex/author.py similarity index 94% rename from service/src/main/inse/models/author.py rename to service/src/main/inse/models/openalex/author.py index daf271e8..f318c85b 100644 --- a/service/src/main/inse/models/author.py +++ b/service/src/main/inse/models/openalex/author.py @@ -21,13 +21,13 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author_affiliations_inner import AuthorAffiliationsInner -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.author_ids import AuthorIds -from inse.models.author_parsed_longest_name import AuthorParsedLongestName -from inse.models.author_summary_stats import AuthorSummaryStats -from inse.models.work_topic import WorkTopic -from inse.models.dehydrated_institution import DehydratedInstitution +from inse.models.openalex.author_affiliations_inner import AuthorAffiliationsInner +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.author_ids import AuthorIds +from inse.models.openalex.author_parsed_longest_name import AuthorParsedLongestName +from inse.models.openalex.author_summary_stats import AuthorSummaryStats +from inse.models.openalex.work_topic import WorkTopic +from inse.models.openalex.dehydrated_institution import DehydratedInstitution from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/author_affiliations_inner.py b/service/src/main/inse/models/openalex/author_affiliations_inner.py similarity index 97% rename from service/src/main/inse/models/author_affiliations_inner.py rename to service/src/main/inse/models/openalex/author_affiliations_inner.py index 289e91e5..33985031 100644 --- a/service/src/main/inse/models/author_affiliations_inner.py +++ b/service/src/main/inse/models/openalex/author_affiliations_inner.py @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt from typing import Any, ClassVar, Dict, List, Optional -from inse.models.dehydrated_institution import DehydratedInstitution +from inse.models.openalex.dehydrated_institution import DehydratedInstitution from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/author_counts_by_year_inner.py b/service/src/main/inse/models/openalex/author_counts_by_year_inner.py similarity index 100% rename from service/src/main/inse/models/author_counts_by_year_inner.py rename to service/src/main/inse/models/openalex/author_counts_by_year_inner.py diff --git a/service/src/main/inse/models/author_ids.py b/service/src/main/inse/models/openalex/author_ids.py similarity index 100% rename from service/src/main/inse/models/author_ids.py rename to service/src/main/inse/models/openalex/author_ids.py diff --git a/service/src/main/inse/models/author_parsed_longest_name.py b/service/src/main/inse/models/openalex/author_parsed_longest_name.py similarity index 100% rename from service/src/main/inse/models/author_parsed_longest_name.py rename to service/src/main/inse/models/openalex/author_parsed_longest_name.py diff --git a/service/src/main/inse/models/author_summary_stats.py b/service/src/main/inse/models/openalex/author_summary_stats.py similarity index 100% rename from service/src/main/inse/models/author_summary_stats.py rename to service/src/main/inse/models/openalex/author_summary_stats.py diff --git a/service/src/main/inse/models/author_topics_inner.py b/service/src/main/inse/models/openalex/author_topics_inner.py similarity index 100% rename from service/src/main/inse/models/author_topics_inner.py rename to service/src/main/inse/models/openalex/author_topics_inner.py diff --git a/service/src/main/inse/models/authors_list_response.py b/service/src/main/inse/models/openalex/authors_list_response.py similarity index 96% rename from service/src/main/inse/models/authors_list_response.py rename to service/src/main/inse/models/openalex/authors_list_response.py index 263fc762..8a266d1e 100644 --- a/service/src/main/inse/models/authors_list_response.py +++ b/service/src/main/inse/models/openalex/authors_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author import Author -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta +from inse.models.openalex.author import Author +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/authorship.py b/service/src/main/inse/models/openalex/authorship.py similarity index 97% rename from service/src/main/inse/models/authorship.py rename to service/src/main/inse/models/openalex/authorship.py index ec3fcd6b..5f112d23 100644 --- a/service/src/main/inse/models/authorship.py +++ b/service/src/main/inse/models/openalex/authorship.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from inse.models.dehydrated_author import DehydratedAuthor -from inse.models.dehydrated_institution import DehydratedInstitution +from inse.models.openalex.dehydrated_author import DehydratedAuthor +from inse.models.openalex.dehydrated_institution import DehydratedInstitution from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/autocomplete_response.py b/service/src/main/inse/models/openalex/autocomplete_response.py similarity index 94% rename from service/src/main/inse/models/autocomplete_response.py rename to service/src/main/inse/models/openalex/autocomplete_response.py index fc5f3d61..953a05a3 100644 --- a/service/src/main/inse/models/autocomplete_response.py +++ b/service/src/main/inse/models/openalex/autocomplete_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.autocomplete_response_meta import AutocompleteResponseMeta -from inse.models.autocomplete_response_results_inner import AutocompleteResponseResultsInner +from inse.models.openalex.autocomplete_response_meta import AutocompleteResponseMeta +from inse.models.openalex.autocomplete_response_results_inner import AutocompleteResponseResultsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/autocomplete_response_meta.py b/service/src/main/inse/models/openalex/autocomplete_response_meta.py similarity index 100% rename from service/src/main/inse/models/autocomplete_response_meta.py rename to service/src/main/inse/models/openalex/autocomplete_response_meta.py diff --git a/service/src/main/inse/models/autocomplete_response_results_inner.py b/service/src/main/inse/models/openalex/autocomplete_response_results_inner.py similarity index 100% rename from service/src/main/inse/models/autocomplete_response_results_inner.py rename to service/src/main/inse/models/openalex/autocomplete_response_results_inner.py diff --git a/service/src/main/inse/models/award.py b/service/src/main/inse/models/openalex/award.py similarity index 100% rename from service/src/main/inse/models/award.py rename to service/src/main/inse/models/openalex/award.py diff --git a/service/src/main/inse/models/award_full.py b/service/src/main/inse/models/openalex/award_full.py similarity index 99% rename from service/src/main/inse/models/award_full.py rename to service/src/main/inse/models/openalex/award_full.py index b9362b8e..06a86912 100644 --- a/service/src/main/inse/models/award_full.py +++ b/service/src/main/inse/models/openalex/award_full.py @@ -21,7 +21,7 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from inse.models.award_full_funder import AwardFullFunder +from inse.models.openalex.award_full_funder import AwardFullFunder from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/award_full_funder.py b/service/src/main/inse/models/openalex/award_full_funder.py similarity index 100% rename from service/src/main/inse/models/award_full_funder.py rename to service/src/main/inse/models/openalex/award_full_funder.py diff --git a/service/src/main/inse/models/awards_list_response.py b/service/src/main/inse/models/openalex/awards_list_response.py similarity index 97% rename from service/src/main/inse/models/awards_list_response.py rename to service/src/main/inse/models/openalex/awards_list_response.py index f2a3b207..c28e4f3b 100644 --- a/service/src/main/inse/models/awards_list_response.py +++ b/service/src/main/inse/models/openalex/awards_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.award_full import AwardFull -from inse.models.meta import Meta +from inse.models.openalex.award_full import AwardFull +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/concept.py b/service/src/main/inse/models/openalex/concept.py similarity index 99% rename from service/src/main/inse/models/concept.py rename to service/src/main/inse/models/openalex/concept.py index caff472a..063f7b5a 100644 --- a/service/src/main/inse/models/concept.py +++ b/service/src/main/inse/models/openalex/concept.py @@ -21,7 +21,7 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.concept_ids import ConceptIds +from inse.models.openalex.concept_ids import ConceptIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/concept_ids.py b/service/src/main/inse/models/openalex/concept_ids.py similarity index 100% rename from service/src/main/inse/models/concept_ids.py rename to service/src/main/inse/models/openalex/concept_ids.py diff --git a/service/src/main/inse/models/concepts_list_response.py b/service/src/main/inse/models/openalex/concepts_list_response.py similarity index 97% rename from service/src/main/inse/models/concepts_list_response.py rename to service/src/main/inse/models/openalex/concepts_list_response.py index 7607e403..4425cd6f 100644 --- a/service/src/main/inse/models/concepts_list_response.py +++ b/service/src/main/inse/models/openalex/concepts_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.concept import Concept -from inse.models.meta import Meta +from inse.models.openalex.concept import Concept +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/continent.py b/service/src/main/inse/models/openalex/continent.py similarity index 97% rename from service/src/main/inse/models/continent.py rename to service/src/main/inse/models/openalex/continent.py index 9b9299a5..e8fbe4d2 100644 --- a/service/src/main/inse/models/continent.py +++ b/service/src/main/inse/models/openalex/continent.py @@ -21,8 +21,8 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.continent_ids import ContinentIds -from inse.models.domain_fields_inner import DomainFieldsInner +from inse.models.openalex.continent_ids import ContinentIds +from inse.models.openalex.domain_fields_inner import DomainFieldsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/continent_ids.py b/service/src/main/inse/models/openalex/continent_ids.py similarity index 100% rename from service/src/main/inse/models/continent_ids.py rename to service/src/main/inse/models/openalex/continent_ids.py diff --git a/service/src/main/inse/models/continents_list_response.py b/service/src/main/inse/models/openalex/continents_list_response.py similarity index 97% rename from service/src/main/inse/models/continents_list_response.py rename to service/src/main/inse/models/openalex/continents_list_response.py index efe0e1ab..ceeb4e68 100644 --- a/service/src/main/inse/models/continents_list_response.py +++ b/service/src/main/inse/models/openalex/continents_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.continent import Continent -from inse.models.meta import Meta +from inse.models.openalex.continent import Continent +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/countries_list_response.py b/service/src/main/inse/models/openalex/countries_list_response.py similarity index 97% rename from service/src/main/inse/models/countries_list_response.py rename to service/src/main/inse/models/openalex/countries_list_response.py index 0979819b..ac26b32e 100644 --- a/service/src/main/inse/models/countries_list_response.py +++ b/service/src/main/inse/models/openalex/countries_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.country import Country -from inse.models.meta import Meta +from inse.models.openalex.country import Country +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/country.py b/service/src/main/inse/models/openalex/country.py similarity index 97% rename from service/src/main/inse/models/country.py rename to service/src/main/inse/models/openalex/country.py index 6fc8bc2d..4d051a60 100644 --- a/service/src/main/inse/models/country.py +++ b/service/src/main/inse/models/openalex/country.py @@ -21,8 +21,8 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.country_continent import CountryContinent -from inse.models.country_ids import CountryIds +from inse.models.openalex.country_continent import CountryContinent +from inse.models.openalex.country_ids import CountryIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/country_continent.py b/service/src/main/inse/models/openalex/country_continent.py similarity index 100% rename from service/src/main/inse/models/country_continent.py rename to service/src/main/inse/models/openalex/country_continent.py diff --git a/service/src/main/inse/models/country_ids.py b/service/src/main/inse/models/openalex/country_ids.py similarity index 100% rename from service/src/main/inse/models/country_ids.py rename to service/src/main/inse/models/openalex/country_ids.py diff --git a/service/src/main/inse/models/dehydrated_author.py b/service/src/main/inse/models/openalex/dehydrated_author.py similarity index 100% rename from service/src/main/inse/models/dehydrated_author.py rename to service/src/main/inse/models/openalex/dehydrated_author.py diff --git a/service/src/main/inse/models/dehydrated_funder.py b/service/src/main/inse/models/openalex/dehydrated_funder.py similarity index 100% rename from service/src/main/inse/models/dehydrated_funder.py rename to service/src/main/inse/models/openalex/dehydrated_funder.py diff --git a/service/src/main/inse/models/dehydrated_institution.py b/service/src/main/inse/models/openalex/dehydrated_institution.py similarity index 100% rename from service/src/main/inse/models/dehydrated_institution.py rename to service/src/main/inse/models/openalex/dehydrated_institution.py diff --git a/service/src/main/inse/models/dehydrated_source.py b/service/src/main/inse/models/openalex/dehydrated_source.py similarity index 100% rename from service/src/main/inse/models/dehydrated_source.py rename to service/src/main/inse/models/openalex/dehydrated_source.py diff --git a/service/src/main/inse/models/domain.py b/service/src/main/inse/models/openalex/domain.py similarity index 97% rename from service/src/main/inse/models/domain.py rename to service/src/main/inse/models/openalex/domain.py index ca17c260..16cec7ff 100644 --- a/service/src/main/inse/models/domain.py +++ b/service/src/main/inse/models/openalex/domain.py @@ -21,8 +21,8 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.domain_fields_inner import DomainFieldsInner -from inse.models.domain_ids import DomainIds +from inse.models.openalex.domain_fields_inner import DomainFieldsInner +from inse.models.openalex.domain_ids import DomainIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/domain_fields_inner.py b/service/src/main/inse/models/openalex/domain_fields_inner.py similarity index 100% rename from service/src/main/inse/models/domain_fields_inner.py rename to service/src/main/inse/models/openalex/domain_fields_inner.py diff --git a/service/src/main/inse/models/domain_ids.py b/service/src/main/inse/models/openalex/domain_ids.py similarity index 100% rename from service/src/main/inse/models/domain_ids.py rename to service/src/main/inse/models/openalex/domain_ids.py diff --git a/service/src/main/inse/models/domains_list_response.py b/service/src/main/inse/models/openalex/domains_list_response.py similarity index 97% rename from service/src/main/inse/models/domains_list_response.py rename to service/src/main/inse/models/openalex/domains_list_response.py index 6c06770b..3ea8e07c 100644 --- a/service/src/main/inse/models/domains_list_response.py +++ b/service/src/main/inse/models/openalex/domains_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.domain import Domain -from inse.models.meta import Meta +from inse.models.openalex.domain import Domain +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/error.py b/service/src/main/inse/models/openalex/error.py similarity index 100% rename from service/src/main/inse/models/error.py rename to service/src/main/inse/models/openalex/error.py diff --git a/service/src/main/inse/models/fields_list_response.py b/service/src/main/inse/models/openalex/fields_list_response.py similarity index 97% rename from service/src/main/inse/models/fields_list_response.py rename to service/src/main/inse/models/openalex/fields_list_response.py index 0fd847e4..cc02907e 100644 --- a/service/src/main/inse/models/fields_list_response.py +++ b/service/src/main/inse/models/openalex/fields_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.meta import Meta -from inse.models.model_field import ModelField +from inse.models.openalex.meta import Meta +from inse.models.openalex.model_field import ModelField from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/funder.py b/service/src/main/inse/models/openalex/funder.py similarity index 97% rename from service/src/main/inse/models/funder.py rename to service/src/main/inse/models/openalex/funder.py index e717a36b..ef860bf1 100644 --- a/service/src/main/inse/models/funder.py +++ b/service/src/main/inse/models/openalex/funder.py @@ -21,8 +21,8 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.funder_ids import FunderIds +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.funder_ids import FunderIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/funder_ids.py b/service/src/main/inse/models/openalex/funder_ids.py similarity index 100% rename from service/src/main/inse/models/funder_ids.py rename to service/src/main/inse/models/openalex/funder_ids.py diff --git a/service/src/main/inse/models/funders_list_response.py b/service/src/main/inse/models/openalex/funders_list_response.py similarity index 96% rename from service/src/main/inse/models/funders_list_response.py rename to service/src/main/inse/models/openalex/funders_list_response.py index b93e6f29..c856665c 100644 --- a/service/src/main/inse/models/funders_list_response.py +++ b/service/src/main/inse/models/openalex/funders_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.funder import Funder -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta +from inse.models.openalex.funder import Funder +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/get_changefile200_response.py b/service/src/main/inse/models/openalex/get_changefile200_response.py similarity index 94% rename from service/src/main/inse/models/get_changefile200_response.py rename to service/src/main/inse/models/openalex/get_changefile200_response.py index bedd8aec..cd801766 100644 --- a/service/src/main/inse/models/get_changefile200_response.py +++ b/service/src/main/inse/models/openalex/get_changefile200_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.get_changefile200_response_meta import GetChangefile200ResponseMeta -from inse.models.get_changefile200_response_results_inner import GetChangefile200ResponseResultsInner +from inse.models.openalex.get_changefile200_response_meta import GetChangefile200ResponseMeta +from inse.models.openalex.get_changefile200_response_results_inner import GetChangefile200ResponseResultsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/get_changefile200_response_meta.py b/service/src/main/inse/models/openalex/get_changefile200_response_meta.py similarity index 100% rename from service/src/main/inse/models/get_changefile200_response_meta.py rename to service/src/main/inse/models/openalex/get_changefile200_response_meta.py diff --git a/service/src/main/inse/models/get_changefile200_response_results_inner.py b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner.py similarity index 96% rename from service/src/main/inse/models/get_changefile200_response_results_inner.py rename to service/src/main/inse/models/openalex/get_changefile200_response_results_inner.py index b58fd49f..39639cf2 100644 --- a/service/src/main/inse/models/get_changefile200_response_results_inner.py +++ b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner.py @@ -20,7 +20,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.get_changefile200_response_results_inner_formats import GetChangefile200ResponseResultsInnerFormats +from inse.models.openalex.get_changefile200_response_results_inner_formats import GetChangefile200ResponseResultsInnerFormats from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/get_changefile200_response_results_inner_formats.py b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats.py similarity index 92% rename from service/src/main/inse/models/get_changefile200_response_results_inner_formats.py rename to service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats.py index 7f05dc40..a78c2bac 100644 --- a/service/src/main/inse/models/get_changefile200_response_results_inner_formats.py +++ b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.get_changefile200_response_results_inner_formats_jsonl import GetChangefile200ResponseResultsInnerFormatsJsonl -from inse.models.get_changefile200_response_results_inner_formats_parquet import GetChangefile200ResponseResultsInnerFormatsParquet +from inse.models.openalex.get_changefile200_response_results_inner_formats_jsonl import GetChangefile200ResponseResultsInnerFormatsJsonl +from inse.models.openalex.get_changefile200_response_results_inner_formats_parquet import GetChangefile200ResponseResultsInnerFormatsParquet from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/get_changefile200_response_results_inner_formats_jsonl.py b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats_jsonl.py similarity index 100% rename from service/src/main/inse/models/get_changefile200_response_results_inner_formats_jsonl.py rename to service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats_jsonl.py diff --git a/service/src/main/inse/models/get_changefile200_response_results_inner_formats_parquet.py b/service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats_parquet.py similarity index 100% rename from service/src/main/inse/models/get_changefile200_response_results_inner_formats_parquet.py rename to service/src/main/inse/models/openalex/get_changefile200_response_results_inner_formats_parquet.py diff --git a/service/src/main/inse/models/group_by_result.py b/service/src/main/inse/models/openalex/group_by_result.py similarity index 100% rename from service/src/main/inse/models/group_by_result.py rename to service/src/main/inse/models/openalex/group_by_result.py diff --git a/service/src/main/inse/models/institution.py b/service/src/main/inse/models/openalex/institution.py similarity index 95% rename from service/src/main/inse/models/institution.py rename to service/src/main/inse/models/openalex/institution.py index 5e22bc1b..1d1062b5 100644 --- a/service/src/main/inse/models/institution.py +++ b/service/src/main/inse/models/openalex/institution.py @@ -21,10 +21,10 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.author_summary_stats import AuthorSummaryStats -from inse.models.institution_geo import InstitutionGeo -from inse.models.institution_ids import InstitutionIds +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.author_summary_stats import AuthorSummaryStats +from inse.models.openalex.institution_geo import InstitutionGeo +from inse.models.openalex.institution_ids import InstitutionIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -33,7 +33,7 @@ class Institution(BaseModel): """ A university, research organization, or other affiliation """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The OpenAlex ID for this institution.") + id: Optional[StrictStr] = Field(default=None, description="The OpenAlex ID for this institution.", json_schema_extra={"examples": ["https://openalex.org/I27837315"]}) ror: Optional[StrictStr] = Field(default=None, description="The ROR ID for this institution. This is the Canonical External ID for institutions.") display_name: Optional[StrictStr] = Field(default=None, description="The primary name of the institution.") country_code: Optional[StrictStr] = Field(default=None, description="ISO two-letter country code where this institution is located.") diff --git a/service/src/main/inse/models/institution_geo.py b/service/src/main/inse/models/openalex/institution_geo.py similarity index 100% rename from service/src/main/inse/models/institution_geo.py rename to service/src/main/inse/models/openalex/institution_geo.py diff --git a/service/src/main/inse/models/institution_ids.py b/service/src/main/inse/models/openalex/institution_ids.py similarity index 100% rename from service/src/main/inse/models/institution_ids.py rename to service/src/main/inse/models/openalex/institution_ids.py diff --git a/service/src/main/inse/models/institution_type.py b/service/src/main/inse/models/openalex/institution_type.py similarity index 100% rename from service/src/main/inse/models/institution_type.py rename to service/src/main/inse/models/openalex/institution_type.py diff --git a/service/src/main/inse/models/institution_types_list_response.py b/service/src/main/inse/models/openalex/institution_types_list_response.py similarity index 96% rename from service/src/main/inse/models/institution_types_list_response.py rename to service/src/main/inse/models/openalex/institution_types_list_response.py index d94fb4c8..c06b2e4b 100644 --- a/service/src/main/inse/models/institution_types_list_response.py +++ b/service/src/main/inse/models/openalex/institution_types_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.institution_type import InstitutionType -from inse.models.meta import Meta +from inse.models.openalex.institution_type import InstitutionType +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/institutions_list_response.py b/service/src/main/inse/models/openalex/institutions_list_response.py similarity index 96% rename from service/src/main/inse/models/institutions_list_response.py rename to service/src/main/inse/models/openalex/institutions_list_response.py index 164954e2..f3313a74 100644 --- a/service/src/main/inse/models/institutions_list_response.py +++ b/service/src/main/inse/models/openalex/institutions_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.institution import Institution -from inse.models.meta import Meta +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.institution import Institution +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/keyword.py b/service/src/main/inse/models/openalex/keyword.py similarity index 100% rename from service/src/main/inse/models/keyword.py rename to service/src/main/inse/models/openalex/keyword.py diff --git a/service/src/main/inse/models/keywords_list_response.py b/service/src/main/inse/models/openalex/keywords_list_response.py similarity index 96% rename from service/src/main/inse/models/keywords_list_response.py rename to service/src/main/inse/models/openalex/keywords_list_response.py index 7fe1430a..ef7676a2 100644 --- a/service/src/main/inse/models/keywords_list_response.py +++ b/service/src/main/inse/models/openalex/keywords_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.keyword import Keyword -from inse.models.meta import Meta +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.keyword import Keyword +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/language.py b/service/src/main/inse/models/openalex/language.py similarity index 100% rename from service/src/main/inse/models/language.py rename to service/src/main/inse/models/openalex/language.py diff --git a/service/src/main/inse/models/languages_list_response.py b/service/src/main/inse/models/openalex/languages_list_response.py similarity index 97% rename from service/src/main/inse/models/languages_list_response.py rename to service/src/main/inse/models/openalex/languages_list_response.py index 5b859c16..6c4cc2c1 100644 --- a/service/src/main/inse/models/languages_list_response.py +++ b/service/src/main/inse/models/openalex/languages_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.language import Language -from inse.models.meta import Meta +from inse.models.openalex.language import Language +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/license.py b/service/src/main/inse/models/openalex/license.py similarity index 100% rename from service/src/main/inse/models/license.py rename to service/src/main/inse/models/openalex/license.py diff --git a/service/src/main/inse/models/licenses_list_response.py b/service/src/main/inse/models/openalex/licenses_list_response.py similarity index 97% rename from service/src/main/inse/models/licenses_list_response.py rename to service/src/main/inse/models/openalex/licenses_list_response.py index 78e2e79b..d94b15c0 100644 --- a/service/src/main/inse/models/licenses_list_response.py +++ b/service/src/main/inse/models/openalex/licenses_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.license import License -from inse.models.meta import Meta +from inse.models.openalex.license import License +from inse.models.openalex.meta import Meta from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/list_changefiles200_response.py b/service/src/main/inse/models/openalex/list_changefiles200_response.py similarity index 94% rename from service/src/main/inse/models/list_changefiles200_response.py rename to service/src/main/inse/models/openalex/list_changefiles200_response.py index 80c6633c..a183d821 100644 --- a/service/src/main/inse/models/list_changefiles200_response.py +++ b/service/src/main/inse/models/openalex/list_changefiles200_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.list_changefiles200_response_meta import ListChangefiles200ResponseMeta -from inse.models.list_changefiles200_response_results_inner import ListChangefiles200ResponseResultsInner +from inse.models.openalex.list_changefiles200_response_meta import ListChangefiles200ResponseMeta +from inse.models.openalex.list_changefiles200_response_results_inner import ListChangefiles200ResponseResultsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/list_changefiles200_response_meta.py b/service/src/main/inse/models/openalex/list_changefiles200_response_meta.py similarity index 100% rename from service/src/main/inse/models/list_changefiles200_response_meta.py rename to service/src/main/inse/models/openalex/list_changefiles200_response_meta.py diff --git a/service/src/main/inse/models/list_changefiles200_response_results_inner.py b/service/src/main/inse/models/openalex/list_changefiles200_response_results_inner.py similarity index 100% rename from service/src/main/inse/models/list_changefiles200_response_results_inner.py rename to service/src/main/inse/models/openalex/list_changefiles200_response_results_inner.py diff --git a/service/src/main/inse/models/location.py b/service/src/main/inse/models/openalex/location.py similarity index 98% rename from service/src/main/inse/models/location.py rename to service/src/main/inse/models/openalex/location.py index 01a51fd3..a2b88732 100644 --- a/service/src/main/inse/models/location.py +++ b/service/src/main/inse/models/openalex/location.py @@ -20,7 +20,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from inse.models.dehydrated_source import DehydratedSource +from inse.models.openalex.dehydrated_source import DehydratedSource from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/openalex/lsf_person.py b/service/src/main/inse/models/openalex/lsf_person.py new file mode 100644 index 00000000..2820d56c --- /dev/null +++ b/service/src/main/inse/models/openalex/lsf_person.py @@ -0,0 +1,72 @@ +from typing import List, Optional + +from pydantic import BaseModel, Field, StrictStr + + +class Function(BaseModel): + facility: StrictStr = Field(description="The facility of the function.") + function: StrictStr = Field(description="The name of the function.") + + +class LsfPerson(BaseModel): + lsf_id: StrictStr = Field(description="The LSF ID of the person.") + name: StrictStr = Field(description="The name of the person.") + firstname: StrictStr = Field(description="The first name of the person.") + surname: StrictStr = Field(description="The last name of the person.") + title: Optional[StrictStr] = Field( + default=None, description="The title of the person." + ) + location: Optional[StrictStr] = Field( + default=None, description="The location of the person." + ) + room: Optional[StrictStr] = Field( + default=None, description="The room of the person." + ) + telefon: Optional[StrictStr] = Field( + default=None, description="The telephone number of the person." + ) + telefax: Optional[StrictStr] = Field( + default=None, description="The telefax number of the person." + ) + mail: Optional[StrictStr] = Field( + default=None, description="The email address of the person." + ) + website: Optional[StrictStr] = Field( + default=None, description="The website of the person." + ) + affiliation_university: Optional[StrictStr] = Field( + default=None, description="The university affiliation of the person." + ) + affiliation_faculty: Optional[StrictStr] = Field( + default=None, description="The faculty affiliation of the person." + ) + affiliation_institute: Optional[StrictStr] = Field( + default=None, description="The institute affiliation of the person." + ) + affiliation_chair: Optional[StrictStr] = Field( + default=None, description="The chair affiliation of the person." + ) + functions: List[Function] = Field(description="The functions of the person.") + + @classmethod + def from_dict(cls, data: dict) -> "LsfPerson": + functions_data = data.get("functions", []) + functions = [Function(**func) for func in functions_data] + return cls( + lsf_id=data.get("lsf_id", ""), + name=data.get("name", ""), + firstname=data.get("firstname", ""), + surname=data.get("surname", ""), + title=data.get("title"), + location=data.get("location"), + room=data.get("room"), + telefon=data.get("telefon"), + telefax=data.get("telefax"), + mail=data.get("mail"), + website=data.get("website"), + affiliation_university=data.get("affiliation_university"), + affiliation_faculty=data.get("affiliation_faculty"), + affiliation_institute=data.get("affiliation_institute"), + affiliation_chair=data.get("affiliation_chair"), + functions=functions, + ) diff --git a/service/src/main/inse/models/meta.py b/service/src/main/inse/models/openalex/meta.py similarity index 100% rename from service/src/main/inse/models/meta.py rename to service/src/main/inse/models/openalex/meta.py diff --git a/service/src/main/inse/models/model_field.py b/service/src/main/inse/models/openalex/model_field.py similarity index 97% rename from service/src/main/inse/models/model_field.py rename to service/src/main/inse/models/openalex/model_field.py index c6fb8a0f..ce3c8afc 100644 --- a/service/src/main/inse/models/model_field.py +++ b/service/src/main/inse/models/openalex/model_field.py @@ -21,9 +21,9 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.domain_fields_inner import DomainFieldsInner -from inse.models.domain_ids import DomainIds -from inse.models.work_topic_domain import WorkTopicDomain +from inse.models.openalex.domain_fields_inner import DomainFieldsInner +from inse.models.openalex.domain_ids import DomainIds +from inse.models.openalex.work_topic_domain import WorkTopicDomain from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/open_access.py b/service/src/main/inse/models/openalex/open_access.py similarity index 100% rename from service/src/main/inse/models/open_access.py rename to service/src/main/inse/models/openalex/open_access.py diff --git a/service/src/main/inse/models/publisher.py b/service/src/main/inse/models/openalex/publisher.py similarity index 96% rename from service/src/main/inse/models/publisher.py rename to service/src/main/inse/models/openalex/publisher.py index 68885d35..57e477c8 100644 --- a/service/src/main/inse/models/publisher.py +++ b/service/src/main/inse/models/openalex/publisher.py @@ -21,9 +21,9 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.publisher_ids import PublisherIds -from inse.models.publisher_parent_publisher import PublisherParentPublisher +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.publisher_ids import PublisherIds +from inse.models.openalex.publisher_parent_publisher import PublisherParentPublisher from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/publisher_ids.py b/service/src/main/inse/models/openalex/publisher_ids.py similarity index 100% rename from service/src/main/inse/models/publisher_ids.py rename to service/src/main/inse/models/openalex/publisher_ids.py diff --git a/service/src/main/inse/models/publisher_parent_publisher.py b/service/src/main/inse/models/openalex/publisher_parent_publisher.py similarity index 100% rename from service/src/main/inse/models/publisher_parent_publisher.py rename to service/src/main/inse/models/openalex/publisher_parent_publisher.py diff --git a/service/src/main/inse/models/publishers_list_response.py b/service/src/main/inse/models/openalex/publishers_list_response.py similarity index 96% rename from service/src/main/inse/models/publishers_list_response.py rename to service/src/main/inse/models/openalex/publishers_list_response.py index 5b35bc39..1dc91eab 100644 --- a/service/src/main/inse/models/publishers_list_response.py +++ b/service/src/main/inse/models/openalex/publishers_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta -from inse.models.publisher import Publisher +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta +from inse.models.openalex.publisher import Publisher from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/rate_limit_response.py b/service/src/main/inse/models/openalex/rate_limit_response.py similarity index 97% rename from service/src/main/inse/models/rate_limit_response.py rename to service/src/main/inse/models/openalex/rate_limit_response.py index 50be4eb1..2508594b 100644 --- a/service/src/main/inse/models/rate_limit_response.py +++ b/service/src/main/inse/models/openalex/rate_limit_response.py @@ -20,7 +20,7 @@ import json from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.rate_limit_response_rate_limit import RateLimitResponseRateLimit +from inse.models.openalex.rate_limit_response_rate_limit import RateLimitResponseRateLimit from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/rate_limit_response_rate_limit.py b/service/src/main/inse/models/openalex/rate_limit_response_rate_limit.py similarity index 97% rename from service/src/main/inse/models/rate_limit_response_rate_limit.py rename to service/src/main/inse/models/openalex/rate_limit_response_rate_limit.py index 6263afbd..324aee1d 100644 --- a/service/src/main/inse/models/rate_limit_response_rate_limit.py +++ b/service/src/main/inse/models/openalex/rate_limit_response_rate_limit.py @@ -21,7 +21,7 @@ import json from datetime import datetime from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union -from inse.models.rate_limit_response_rate_limit_endpoint_costs_usd import RateLimitResponseRateLimitEndpointCostsUsd +from inse.models.openalex.rate_limit_response_rate_limit_endpoint_costs_usd import RateLimitResponseRateLimitEndpointCostsUsd from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/rate_limit_response_rate_limit_endpoint_costs_usd.py b/service/src/main/inse/models/openalex/rate_limit_response_rate_limit_endpoint_costs_usd.py similarity index 100% rename from service/src/main/inse/models/rate_limit_response_rate_limit_endpoint_costs_usd.py rename to service/src/main/inse/models/openalex/rate_limit_response_rate_limit_endpoint_costs_usd.py diff --git a/service/src/main/inse/models/sdg.py b/service/src/main/inse/models/openalex/sdg.py similarity index 98% rename from service/src/main/inse/models/sdg.py rename to service/src/main/inse/models/openalex/sdg.py index c69fc388..64180e96 100644 --- a/service/src/main/inse/models/sdg.py +++ b/service/src/main/inse/models/openalex/sdg.py @@ -21,7 +21,7 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.sdg_ids import SdgIds +from inse.models.openalex.sdg_ids import SdgIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/sdg_ids.py b/service/src/main/inse/models/openalex/sdg_ids.py similarity index 100% rename from service/src/main/inse/models/sdg_ids.py rename to service/src/main/inse/models/openalex/sdg_ids.py diff --git a/service/src/main/inse/models/sdgs_list_response.py b/service/src/main/inse/models/openalex/sdgs_list_response.py similarity index 97% rename from service/src/main/inse/models/sdgs_list_response.py rename to service/src/main/inse/models/openalex/sdgs_list_response.py index 5d8d4631..f2b680b2 100644 --- a/service/src/main/inse/models/sdgs_list_response.py +++ b/service/src/main/inse/models/openalex/sdgs_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.meta import Meta -from inse.models.sdg import Sdg +from inse.models.openalex.meta import Meta +from inse.models.openalex.sdg import Sdg from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/source.py b/service/src/main/inse/models/openalex/source.py similarity index 97% rename from service/src/main/inse/models/source.py rename to service/src/main/inse/models/openalex/source.py index 8d89286d..bdfefdf3 100644 --- a/service/src/main/inse/models/source.py +++ b/service/src/main/inse/models/openalex/source.py @@ -21,9 +21,9 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from inse.models.author_counts_by_year_inner import AuthorCountsByYearInner -from inse.models.author_summary_stats import AuthorSummaryStats -from inse.models.source_ids import SourceIds +from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner +from inse.models.openalex.author_summary_stats import AuthorSummaryStats +from inse.models.openalex.source_ids import SourceIds from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/source_ids.py b/service/src/main/inse/models/openalex/source_ids.py similarity index 100% rename from service/src/main/inse/models/source_ids.py rename to service/src/main/inse/models/openalex/source_ids.py diff --git a/service/src/main/inse/models/source_type.py b/service/src/main/inse/models/openalex/source_type.py similarity index 100% rename from service/src/main/inse/models/source_type.py rename to service/src/main/inse/models/openalex/source_type.py diff --git a/service/src/main/inse/models/source_types_list_response.py b/service/src/main/inse/models/openalex/source_types_list_response.py similarity index 97% rename from service/src/main/inse/models/source_types_list_response.py rename to service/src/main/inse/models/openalex/source_types_list_response.py index 95fe9419..9f2f552c 100644 --- a/service/src/main/inse/models/source_types_list_response.py +++ b/service/src/main/inse/models/openalex/source_types_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.meta import Meta -from inse.models.source_type import SourceType +from inse.models.openalex.meta import Meta +from inse.models.openalex.source_type import SourceType from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/sources_list_response.py b/service/src/main/inse/models/openalex/sources_list_response.py similarity index 96% rename from service/src/main/inse/models/sources_list_response.py rename to service/src/main/inse/models/openalex/sources_list_response.py index c90c9c9f..a9d1710e 100644 --- a/service/src/main/inse/models/sources_list_response.py +++ b/service/src/main/inse/models/openalex/sources_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta -from inse.models.source import Source +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta +from inse.models.openalex.source import Source from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/subfield.py b/service/src/main/inse/models/openalex/subfield.py similarity index 96% rename from service/src/main/inse/models/subfield.py rename to service/src/main/inse/models/openalex/subfield.py index b5976edb..b4edd67c 100644 --- a/service/src/main/inse/models/subfield.py +++ b/service/src/main/inse/models/openalex/subfield.py @@ -21,10 +21,10 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.domain_fields_inner import DomainFieldsInner -from inse.models.domain_ids import DomainIds -from inse.models.subfield_domain import SubfieldDomain -from inse.models.subfield_field import SubfieldField +from inse.models.openalex.domain_fields_inner import DomainFieldsInner +from inse.models.openalex.domain_ids import DomainIds +from inse.models.openalex.subfield_domain import SubfieldDomain +from inse.models.openalex.subfield_field import SubfieldField from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/subfield_domain.py b/service/src/main/inse/models/openalex/subfield_domain.py similarity index 100% rename from service/src/main/inse/models/subfield_domain.py rename to service/src/main/inse/models/openalex/subfield_domain.py diff --git a/service/src/main/inse/models/subfield_field.py b/service/src/main/inse/models/openalex/subfield_field.py similarity index 100% rename from service/src/main/inse/models/subfield_field.py rename to service/src/main/inse/models/openalex/subfield_field.py diff --git a/service/src/main/inse/models/subfields_list_response.py b/service/src/main/inse/models/openalex/subfields_list_response.py similarity index 97% rename from service/src/main/inse/models/subfields_list_response.py rename to service/src/main/inse/models/openalex/subfields_list_response.py index 73b66906..d3721a4d 100644 --- a/service/src/main/inse/models/subfields_list_response.py +++ b/service/src/main/inse/models/openalex/subfields_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.meta import Meta -from inse.models.subfield import Subfield +from inse.models.openalex.meta import Meta +from inse.models.openalex.subfield import Subfield from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/text_classification_response.py b/service/src/main/inse/models/openalex/text_classification_response.py similarity index 95% rename from service/src/main/inse/models/text_classification_response.py rename to service/src/main/inse/models/openalex/text_classification_response.py index ea08d0df..e72b2ba6 100644 --- a/service/src/main/inse/models/text_classification_response.py +++ b/service/src/main/inse/models/openalex/text_classification_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.text_classification_response_meta import TextClassificationResponseMeta -from inse.models.work_topic import WorkTopic +from inse.models.openalex.text_classification_response_meta import TextClassificationResponseMeta +from inse.models.openalex.work_topic import WorkTopic from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/text_classification_response_meta.py b/service/src/main/inse/models/openalex/text_classification_response_meta.py similarity index 100% rename from service/src/main/inse/models/text_classification_response_meta.py rename to service/src/main/inse/models/openalex/text_classification_response_meta.py diff --git a/service/src/main/inse/models/topic.py b/service/src/main/inse/models/openalex/topic.py similarity index 95% rename from service/src/main/inse/models/topic.py rename to service/src/main/inse/models/openalex/topic.py index b26c2e76..da547b58 100644 --- a/service/src/main/inse/models/topic.py +++ b/service/src/main/inse/models/openalex/topic.py @@ -21,10 +21,10 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from inse.models.topic_domain import TopicDomain -from inse.models.topic_field import TopicField -from inse.models.topic_ids import TopicIds -from inse.models.topic_subfield import TopicSubfield +from inse.models.openalex.topic_domain import TopicDomain +from inse.models.openalex.topic_field import TopicField +from inse.models.openalex.topic_ids import TopicIds +from inse.models.openalex.topic_subfield import TopicSubfield from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/openalex/topic_count.py b/service/src/main/inse/models/openalex/topic_count.py new file mode 100644 index 00000000..8d6be897 --- /dev/null +++ b/service/src/main/inse/models/openalex/topic_count.py @@ -0,0 +1,46 @@ +from typing import Optional + +from pydantic import BaseModel, Field + + +class TopicCount(BaseModel): + id: Optional[str] = Field(default=None, description="The topic id.") + name: str = Field(description="The topic display name.") + count: int = Field(default=0, description="The number of occurrences.") + description: Optional[str] = Field(default=None, description="The topic description.") + subfield_id: Optional[str] = Field( + default=None, + description="The topic subfield id.", + ) + subfield_name: Optional[str] = Field( + default=None, + description="The topic subfield display name.", + ) + subfield_description: Optional[str] = Field( + default=None, + description="The topic subfield description.", + ) + field_id: Optional[str] = Field( + default=None, + description="The topic field id.", + ) + field_name: Optional[str] = Field( + default=None, + description="The topic field display name.", + ) + field_description: Optional[str] = Field( + default=None, + description="The topic field description.", + ) + domain_id: Optional[str] = Field( + default=None, + description="The topic domain id.", + ) + domain_name: Optional[str] = Field( + default=None, + description="The topic domain display name.", + ) + domain_description: Optional[str] = Field( + default=None, + description="The topic domain description.", + ) diff --git a/service/src/main/inse/models/topic_domain.py b/service/src/main/inse/models/openalex/topic_domain.py similarity index 100% rename from service/src/main/inse/models/topic_domain.py rename to service/src/main/inse/models/openalex/topic_domain.py diff --git a/service/src/main/inse/models/topic_field.py b/service/src/main/inse/models/openalex/topic_field.py similarity index 100% rename from service/src/main/inse/models/topic_field.py rename to service/src/main/inse/models/openalex/topic_field.py diff --git a/service/src/main/inse/models/topic_ids.py b/service/src/main/inse/models/openalex/topic_ids.py similarity index 100% rename from service/src/main/inse/models/topic_ids.py rename to service/src/main/inse/models/openalex/topic_ids.py diff --git a/service/src/main/inse/models/topic_subfield.py b/service/src/main/inse/models/openalex/topic_subfield.py similarity index 100% rename from service/src/main/inse/models/topic_subfield.py rename to service/src/main/inse/models/openalex/topic_subfield.py diff --git a/service/src/main/inse/models/openalex/topics_by_time.py b/service/src/main/inse/models/openalex/topics_by_time.py new file mode 100644 index 00000000..e02863bb --- /dev/null +++ b/service/src/main/inse/models/openalex/topics_by_time.py @@ -0,0 +1,25 @@ +from typing import List + +from pydantic import BaseModel, Field + +from inse.models.openalex.topics_by_year import TopicsByYear + + +class TopicsByTime(BaseModel): + elements: List[TopicsByYear] = Field( + default_factory=list, + description="Topics grouped by year.", + ) + total: int = Field(default=0, description="The number of years.") + is_limited: bool = Field( + default=False, + description="True if the timeline contains only a limited subset of the author's publications.", + ) + used_publications: int = Field( + default=0, + description="The number of publications used to build the timeline.", + ) + total_publications: int = Field( + default=0, + description="The total number of publications found for this author.", + ) \ No newline at end of file diff --git a/service/src/main/inse/models/topics_by_year.py b/service/src/main/inse/models/openalex/topics_by_year.py similarity index 89% rename from service/src/main/inse/models/topics_by_year.py rename to service/src/main/inse/models/openalex/topics_by_year.py index 91efe7c6..48fd0f6e 100644 --- a/service/src/main/inse/models/topics_by_year.py +++ b/service/src/main/inse/models/openalex/topics_by_year.py @@ -2,7 +2,7 @@ from typing import List from pydantic import BaseModel, Field -from inse.models.topic_count import TopicCount +from inse.models.openalex.topic_count import TopicCount class TopicsByYear(BaseModel): diff --git a/service/src/main/inse/models/topics_list_response.py b/service/src/main/inse/models/openalex/topics_list_response.py similarity index 96% rename from service/src/main/inse/models/topics_list_response.py rename to service/src/main/inse/models/openalex/topics_list_response.py index 5cd3d5bf..7ea968cc 100644 --- a/service/src/main/inse/models/topics_list_response.py +++ b/service/src/main/inse/models/openalex/topics_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta -from inse.models.topic import Topic +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta +from inse.models.openalex.topic import Topic from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/openalex/ude_organization.py b/service/src/main/inse/models/openalex/ude_organization.py new file mode 100644 index 00000000..33b3ddcb --- /dev/null +++ b/service/src/main/inse/models/openalex/ude_organization.py @@ -0,0 +1,105 @@ +from typing import List, Optional, Union + +from pydantic import BaseModel, Field, StrictStr + + +class UdeStaff(BaseModel): + research_interests: Union[List[StrictStr], StrictStr] = Field( + description="Research interests of the staff member" + ) + keywords: List[StrictStr] = Field( + description="Keywords associated with the staff member" + ) + telefon: StrictStr = Field(description="Phone number of the staff member") + name: StrictStr = Field(description="Name of the staff member") + links: List[StrictStr] = Field(description="Links associated with the staff member") + email: StrictStr = Field(description="Email address of the staff member") + + @classmethod + def from_dict(cls, data: dict) -> "UdeStaff": + return cls( + research_interests=data.get("research_interests", ""), + keywords=data.get("keywords", []), + telefon=data.get("telefon", ""), + name=data.get("name", ""), + links=data.get("links", []), + email=data.get("email", ""), + ) + + +class UdeProject(BaseModel): + project_type: StrictStr = Field(description="Type of the project") + names: StrictStr = Field(description="Names associated with the project") + keywords: List[StrictStr] = Field( + description="Keywords associated with the project" + ) + topic: StrictStr = Field(description="Topic of the project") + links: List[StrictStr] = Field(description="Links associated with the project") + title: StrictStr = Field(description="Title of the project") + + @classmethod + def from_dict(cls, data: dict) -> "UdeProject": + return cls( + project_type=data.get("project_type", ""), + names=data.get("names", ""), + keywords=data.get("keywords", []), + topic=data.get("topic", ""), + links=data.get("links", []), + title=data.get("title", ""), + ) + + +class UdeNews(BaseModel): + date: Optional[StrictStr] = Field(description="Date of the news") + keywords: List[StrictStr] = Field(description="Keywords associated with the news") + topic: StrictStr = Field(description="Topic of the news") + links: List[StrictStr] = Field(description="Links associated with the news") + title: StrictStr = Field(description="Title of the news") + + @classmethod + def from_dict(cls, data: dict) -> "UdeNews": + return cls( + date=data.get("date"), + keywords=data.get("keywords", []), + topic=data.get("topic", ""), + links=data.get("links", []), + title=data.get("title", ""), + ) + + +class UdeKeyword(BaseModel): + value: StrictStr = Field(description="Value of the keyword") + score: float = Field(description="Relevance score of the keyword") + + @classmethod + def from_dict(cls, data: dict) -> "UdeKeyword": + return cls( + value=data.get("value", ""), + score=data.get("score", 0.0), + ) + + +class UdeOrganization(BaseModel): + uri: StrictStr = Field(description="URI of the organization") + staff: List[UdeStaff] = Field( + description="List of staff members in the organization" + ) + projects: List[UdeProject] = Field( + description="List of projects associated with the organization" + ) + news: List[UdeNews] = Field( + description="List of news items associated with the organization" + ) + keywords: List[UdeKeyword] = Field( + description="List of keywords associated with the organization" + ) + + @classmethod + def from_dict(cls, data: dict) -> "UdeOrganization": + return cls( + uri=data.get("uri", ""), + staff=[UdeStaff.from_dict(s) for s in data.get("staff", [])], + projects=[UdeProject.from_dict(p) for p in data.get("projects", [])], + news=[UdeNews.from_dict(n) for n in data.get("news", [])], + keywords=[UdeKeyword.from_dict(k) for k in data.get("keywords", [])], + ) diff --git a/service/src/main/inse/models/work.py b/service/src/main/inse/models/openalex/work.py similarity index 94% rename from service/src/main/inse/models/work.py rename to service/src/main/inse/models/openalex/work.py index a116b540..4661f664 100644 --- a/service/src/main/inse/models/work.py +++ b/service/src/main/inse/models/openalex/work.py @@ -21,21 +21,21 @@ import json from datetime import date, datetime from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from inse.models.authorship import Authorship -from inse.models.award import Award -from inse.models.dehydrated_funder import DehydratedFunder -from inse.models.location import Location -from inse.models.open_access import OpenAccess -from inse.models.work_biblio import WorkBiblio -from inse.models.work_citation_normalized_percentile import WorkCitationNormalizedPercentile -from inse.models.work_cited_by_percentile_year import WorkCitedByPercentileYear -from inse.models.work_counts_by_year_inner import WorkCountsByYearInner -from inse.models.work_has_content import WorkHasContent -from inse.models.work_ids import WorkIds -from inse.models.work_keyword import WorkKeyword -from inse.models.work_mesh_inner import WorkMeshInner -from inse.models.work_sustainable_development_goals_inner import WorkSustainableDevelopmentGoalsInner -from inse.models.work_topic import WorkTopic +from inse.models.openalex.authorship import Authorship +from inse.models.openalex.award import Award +from inse.models.openalex.dehydrated_funder import DehydratedFunder +from inse.models.openalex.location import Location +from inse.models.openalex.open_access import OpenAccess +from inse.models.openalex.work_biblio import WorkBiblio +from inse.models.openalex.work_citation_normalized_percentile import WorkCitationNormalizedPercentile +from inse.models.openalex.work_cited_by_percentile_year import WorkCitedByPercentileYear +from inse.models.openalex.work_counts_by_year_inner import WorkCountsByYearInner +from inse.models.openalex.work_has_content import WorkHasContent +from inse.models.openalex.work_ids import WorkIds +from inse.models.openalex.work_keyword import WorkKeyword +from inse.models.openalex.work_mesh_inner import WorkMeshInner +from inse.models.openalex.work_sustainable_development_goals_inner import WorkSustainableDevelopmentGoalsInner +from inse.models.openalex.work_topic import WorkTopic from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/work_biblio.py b/service/src/main/inse/models/openalex/work_biblio.py similarity index 100% rename from service/src/main/inse/models/work_biblio.py rename to service/src/main/inse/models/openalex/work_biblio.py diff --git a/service/src/main/inse/models/work_citation_normalized_percentile.py b/service/src/main/inse/models/openalex/work_citation_normalized_percentile.py similarity index 100% rename from service/src/main/inse/models/work_citation_normalized_percentile.py rename to service/src/main/inse/models/openalex/work_citation_normalized_percentile.py diff --git a/service/src/main/inse/models/work_cited_by_percentile_year.py b/service/src/main/inse/models/openalex/work_cited_by_percentile_year.py similarity index 100% rename from service/src/main/inse/models/work_cited_by_percentile_year.py rename to service/src/main/inse/models/openalex/work_cited_by_percentile_year.py diff --git a/service/src/main/inse/models/work_counts_by_year_inner.py b/service/src/main/inse/models/openalex/work_counts_by_year_inner.py similarity index 100% rename from service/src/main/inse/models/work_counts_by_year_inner.py rename to service/src/main/inse/models/openalex/work_counts_by_year_inner.py diff --git a/service/src/main/inse/models/work_has_content.py b/service/src/main/inse/models/openalex/work_has_content.py similarity index 100% rename from service/src/main/inse/models/work_has_content.py rename to service/src/main/inse/models/openalex/work_has_content.py diff --git a/service/src/main/inse/models/work_ids.py b/service/src/main/inse/models/openalex/work_ids.py similarity index 100% rename from service/src/main/inse/models/work_ids.py rename to service/src/main/inse/models/openalex/work_ids.py diff --git a/service/src/main/inse/models/work_keyword.py b/service/src/main/inse/models/openalex/work_keyword.py similarity index 100% rename from service/src/main/inse/models/work_keyword.py rename to service/src/main/inse/models/openalex/work_keyword.py diff --git a/service/src/main/inse/models/work_mesh_inner.py b/service/src/main/inse/models/openalex/work_mesh_inner.py similarity index 100% rename from service/src/main/inse/models/work_mesh_inner.py rename to service/src/main/inse/models/openalex/work_mesh_inner.py diff --git a/service/src/main/inse/models/work_page.py b/service/src/main/inse/models/openalex/work_page.py similarity index 91% rename from service/src/main/inse/models/work_page.py rename to service/src/main/inse/models/openalex/work_page.py index 6cd51282..f9b3b6f7 100644 --- a/service/src/main/inse/models/work_page.py +++ b/service/src/main/inse/models/openalex/work_page.py @@ -2,7 +2,7 @@ from typing import List from pydantic import BaseModel, Field -from inse.models.work import Work +from inse.models.openalex.work import Work class WorkPage(BaseModel): diff --git a/service/src/main/inse/models/work_sustainable_development_goals_inner.py b/service/src/main/inse/models/openalex/work_sustainable_development_goals_inner.py similarity index 100% rename from service/src/main/inse/models/work_sustainable_development_goals_inner.py rename to service/src/main/inse/models/openalex/work_sustainable_development_goals_inner.py diff --git a/service/src/main/inse/models/work_topic.py b/service/src/main/inse/models/openalex/work_topic.py similarity index 95% rename from service/src/main/inse/models/work_topic.py rename to service/src/main/inse/models/openalex/work_topic.py index ac9a6c3d..c4c6fce6 100644 --- a/service/src/main/inse/models/work_topic.py +++ b/service/src/main/inse/models/openalex/work_topic.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union -from inse.models.work_topic_domain import WorkTopicDomain -from inse.models.work_topic_field import WorkTopicField -from inse.models.work_topic_subfield import WorkTopicSubfield +from inse.models.openalex.work_topic_domain import WorkTopicDomain +from inse.models.openalex.work_topic_field import WorkTopicField +from inse.models.openalex.work_topic_subfield import WorkTopicSubfield from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/work_topic_domain.py b/service/src/main/inse/models/openalex/work_topic_domain.py similarity index 100% rename from service/src/main/inse/models/work_topic_domain.py rename to service/src/main/inse/models/openalex/work_topic_domain.py diff --git a/service/src/main/inse/models/work_topic_field.py b/service/src/main/inse/models/openalex/work_topic_field.py similarity index 100% rename from service/src/main/inse/models/work_topic_field.py rename to service/src/main/inse/models/openalex/work_topic_field.py diff --git a/service/src/main/inse/models/work_topic_subfield.py b/service/src/main/inse/models/openalex/work_topic_subfield.py similarity index 100% rename from service/src/main/inse/models/work_topic_subfield.py rename to service/src/main/inse/models/openalex/work_topic_subfield.py diff --git a/service/src/main/inse/models/work_type.py b/service/src/main/inse/models/openalex/work_type.py similarity index 100% rename from service/src/main/inse/models/work_type.py rename to service/src/main/inse/models/openalex/work_type.py diff --git a/service/src/main/inse/models/work_types_list_response.py b/service/src/main/inse/models/openalex/work_types_list_response.py similarity index 97% rename from service/src/main/inse/models/work_types_list_response.py rename to service/src/main/inse/models/openalex/work_types_list_response.py index bdd7e251..5acec728 100644 --- a/service/src/main/inse/models/work_types_list_response.py +++ b/service/src/main/inse/models/openalex/work_types_list_response.py @@ -20,8 +20,8 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.meta import Meta -from inse.models.work_type import WorkType +from inse.models.openalex.meta import Meta +from inse.models.openalex.work_type import WorkType from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/works_list_response.py b/service/src/main/inse/models/openalex/works_list_response.py similarity index 96% rename from service/src/main/inse/models/works_list_response.py rename to service/src/main/inse/models/openalex/works_list_response.py index 3c2af748..c73cb975 100644 --- a/service/src/main/inse/models/works_list_response.py +++ b/service/src/main/inse/models/openalex/works_list_response.py @@ -20,9 +20,9 @@ import json from pydantic import BaseModel, ConfigDict from typing import Any, ClassVar, Dict, List, Optional -from inse.models.group_by_result import GroupByResult -from inse.models.meta import Meta -from inse.models.work import Work +from inse.models.openalex.group_by_result import GroupByResult +from inse.models.openalex.meta import Meta +from inse.models.openalex.work import Work from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/patents_epo/epo_document.py b/service/src/main/inse/models/patents_epo/epo_document.py new file mode 100644 index 00000000..53975fdc --- /dev/null +++ b/service/src/main/inse/models/patents_epo/epo_document.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + EPO Index Backend Models + + Pydantic models for the Elasticsearch \"epo_index_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.patents_epo.inventor_nested import InventorNested +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EpoDocument(BaseModel): + """ + Main document model for the epo_index_1.0 index. + """ # noqa: E501 + abstract: Optional[StrictStr] = None + abstract_lang: Optional[StrictStr] = None + action: Optional[StrictStr] = None + applicants: Optional[StrictStr] = None + applicants_adr: Optional[StrictStr] = None + applicants_name: Optional[StrictStr] = None + applicants_name_text: Optional[StrictStr] = None + application_filing_date: Optional[StrictStr] = None + application_number: Optional[StrictStr] = None + claims: Optional[StrictStr] = None + claims_de: Optional[StrictStr] = None + claims_en: Optional[StrictStr] = None + claims_fr: Optional[StrictStr] = None + var_class: Optional[StrictStr] = Field(default=None, alias="class") + classification_value: Optional[StrictStr] = None + country: Optional[StrictStr] = None + cpc: Optional[StrictStr] = None + cpc_text: Optional[StrictStr] = None + data1: Optional[StrictStr] = None + data2: Optional[StrictStr] = None + date_of_despatch_of_1st_exam_report: Optional[StrictStr] = None + date_of_patent_maintained_as_amended: Optional[StrictStr] = None + date_of_request_for_examination: Optional[StrictStr] = None + date_of_resumption_of_proceedings: Optional[StrictStr] = None + date_of_suspension_interruption: Optional[StrictStr] = None + date_publication: Optional[StrictInt] = None + date_publication_year: Optional[StrictInt] = None + description_header: Optional[StrictStr] = None + description_lang: Optional[StrictStr] = None + description_paragraph: Optional[StrictStr] = None + description_text: Optional[StrictStr] = None + doc_number: Optional[StrictStr] = None + extended_states: Optional[StrictStr] = None + extended_states_text: Optional[StrictStr] = None + indicates_the_type_of_suspension_or_interruption: Optional[StrictStr] = None + inventors: Optional[StrictStr] = None + inventors_adr: Optional[StrictStr] = None + inventors_name: Optional[StrictStr] = None + inventors_name_nested: Optional[List[InventorNested]] = None + inventors_name_text: Optional[StrictStr] = None + ipc: Optional[StrictStr] = None + ipc_text: Optional[StrictStr] = None + ipc_text_without: Optional[StrictStr] = None + ipc_without: Optional[StrictStr] = None + keywords_and_descriptors: Optional[StrictStr] = None + kind: Optional[StrictStr] = None + level: Optional[StrictStr] = None + linked_indexing_code: Optional[StrictStr] = None + main_group: Optional[StrictStr] = None + non_obligatory_suppl_class: Optional[StrictStr] = None + office: Optional[StrictStr] = None + position: Optional[StrictStr] = None + representatives: Optional[StrictStr] = None + representatives_adr: Optional[StrictStr] = None + representatives_name: Optional[StrictStr] = None + representatives_name_text: Optional[StrictStr] = None + request_for_conversion_to_natl_appl_country: Optional[StrictStr] = None + request_for_conversion_to_natl_appl_date: Optional[StrictStr] = None + section: Optional[StrictStr] = None + srep_abs_approval: Optional[StrictStr] = None + srep_abstract: Optional[StrictStr] = None + srep_date_produced: Optional[StrictStr] = None + srep_established: Optional[StrictStr] = None + srep_file_reference_id: Optional[StrictStr] = None + srep_invention_title: Optional[StrictStr] = None + srep_invention_title_approval: Optional[StrictStr] = None + srep_lang: Optional[StrictStr] = None + srep_office: Optional[StrictStr] = None + srep_protest_fees: Optional[StrictStr] = None + srep_status: Optional[StrictStr] = None + srep_type: Optional[StrictStr] = None + srep_unity_of_invention: Optional[StrictStr] = None + srep_unity_of_invention_fee_1: Optional[StrictStr] = None + srep_unity_of_invention_fee_2: Optional[StrictStr] = None + srep_unity_of_invention_fee_3: Optional[StrictStr] = None + srep_unity_of_invention_fee_4: Optional[StrictStr] = None + states: Optional[StrictStr] = None + states_text: Optional[StrictStr] = None + sub_group: Optional[StrictStr] = None + subclass: Optional[StrictStr] = None + title_de: Optional[StrictStr] = None + title_en: Optional[StrictStr] = None + title_fr: Optional[StrictStr] = None + unlinked_indexing_code: Optional[StrictStr] = None + version: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["abstract", "abstract_lang", "action", "applicants", "applicants_adr", "applicants_name", "applicants_name_text", "application_filing_date", "application_number", "claims", "claims_de", "claims_en", "claims_fr", "class", "classification_value", "country", "cpc", "cpc_text", "data1", "data2", "date_of_despatch_of_1st_exam_report", "date_of_patent_maintained_as_amended", "date_of_request_for_examination", "date_of_resumption_of_proceedings", "date_of_suspension_interruption", "date_publication", "date_publication_year", "description_header", "description_lang", "description_paragraph", "description_text", "doc_number", "extended_states", "extended_states_text", "indicates_the_type_of_suspension_or_interruption", "inventors", "inventors_adr", "inventors_name", "inventors_name_nested", "inventors_name_text", "ipc", "ipc_text", "ipc_text_without", "ipc_without", "keywords_and_descriptors", "kind", "level", "linked_indexing_code", "main_group", "non_obligatory_suppl_class", "office", "position", "representatives", "representatives_adr", "representatives_name", "representatives_name_text", "request_for_conversion_to_natl_appl_country", "request_for_conversion_to_natl_appl_date", "section", "srep_abs_approval", "srep_abstract", "srep_date_produced", "srep_established", "srep_file_reference_id", "srep_invention_title", "srep_invention_title_approval", "srep_lang", "srep_office", "srep_protest_fees", "srep_status", "srep_type", "srep_unity_of_invention", "srep_unity_of_invention_fee_1", "srep_unity_of_invention_fee_2", "srep_unity_of_invention_fee_3", "srep_unity_of_invention_fee_4", "states", "states_text", "sub_group", "subclass", "title_de", "title_en", "title_fr", "unlinked_indexing_code", "version"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EpoDocument from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in inventors_name_nested (list) + _items = [] + if self.inventors_name_nested: + for _item_inventors_name_nested in self.inventors_name_nested: + if _item_inventors_name_nested: + _items.append(_item_inventors_name_nested.to_dict()) + _dict['inventors_name_nested'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EpoDocument from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "abstract": obj.get("abstract"), + "abstract_lang": obj.get("abstract_lang"), + "action": obj.get("action"), + "applicants": obj.get("applicants"), + "applicants_adr": obj.get("applicants_adr"), + "applicants_name": obj.get("applicants_name"), + "applicants_name_text": obj.get("applicants_name_text"), + "application_filing_date": obj.get("application_filing_date"), + "application_number": obj.get("application_number"), + "claims": obj.get("claims"), + "claims_de": obj.get("claims_de"), + "claims_en": obj.get("claims_en"), + "claims_fr": obj.get("claims_fr"), + "class": obj.get("class"), + "classification_value": obj.get("classification_value"), + "country": obj.get("country"), + "cpc": obj.get("cpc"), + "cpc_text": obj.get("cpc_text"), + "data1": obj.get("data1"), + "data2": obj.get("data2"), + "date_of_despatch_of_1st_exam_report": obj.get("date_of_despatch_of_1st_exam_report"), + "date_of_patent_maintained_as_amended": obj.get("date_of_patent_maintained_as_amended"), + "date_of_request_for_examination": obj.get("date_of_request_for_examination"), + "date_of_resumption_of_proceedings": obj.get("date_of_resumption_of_proceedings"), + "date_of_suspension_interruption": obj.get("date_of_suspension_interruption"), + "date_publication": obj.get("date_publication"), + "date_publication_year": obj.get("date_publication_year"), + "description_header": obj.get("description_header"), + "description_lang": obj.get("description_lang"), + "description_paragraph": obj.get("description_paragraph"), + "description_text": obj.get("description_text"), + "doc_number": obj.get("doc_number"), + "extended_states": obj.get("extended_states"), + "extended_states_text": obj.get("extended_states_text"), + "indicates_the_type_of_suspension_or_interruption": obj.get("indicates_the_type_of_suspension_or_interruption"), + "inventors": obj.get("inventors"), + "inventors_adr": obj.get("inventors_adr"), + "inventors_name": obj.get("inventors_name"), + "inventors_name_nested": [InventorNested.from_dict(_item) for _item in obj["inventors_name_nested"]] if obj.get("inventors_name_nested") is not None else None, + "inventors_name_text": obj.get("inventors_name_text"), + "ipc": obj.get("ipc"), + "ipc_text": obj.get("ipc_text"), + "ipc_text_without": obj.get("ipc_text_without"), + "ipc_without": obj.get("ipc_without"), + "keywords_and_descriptors": obj.get("keywords_and_descriptors"), + "kind": obj.get("kind"), + "level": obj.get("level"), + "linked_indexing_code": obj.get("linked_indexing_code"), + "main_group": obj.get("main_group"), + "non_obligatory_suppl_class": obj.get("non_obligatory_suppl_class"), + "office": obj.get("office"), + "position": obj.get("position"), + "representatives": obj.get("representatives"), + "representatives_adr": obj.get("representatives_adr"), + "representatives_name": obj.get("representatives_name"), + "representatives_name_text": obj.get("representatives_name_text"), + "request_for_conversion_to_natl_appl_country": obj.get("request_for_conversion_to_natl_appl_country"), + "request_for_conversion_to_natl_appl_date": obj.get("request_for_conversion_to_natl_appl_date"), + "section": obj.get("section"), + "srep_abs_approval": obj.get("srep_abs_approval"), + "srep_abstract": obj.get("srep_abstract"), + "srep_date_produced": obj.get("srep_date_produced"), + "srep_established": obj.get("srep_established"), + "srep_file_reference_id": obj.get("srep_file_reference_id"), + "srep_invention_title": obj.get("srep_invention_title"), + "srep_invention_title_approval": obj.get("srep_invention_title_approval"), + "srep_lang": obj.get("srep_lang"), + "srep_office": obj.get("srep_office"), + "srep_protest_fees": obj.get("srep_protest_fees"), + "srep_status": obj.get("srep_status"), + "srep_type": obj.get("srep_type"), + "srep_unity_of_invention": obj.get("srep_unity_of_invention"), + "srep_unity_of_invention_fee_1": obj.get("srep_unity_of_invention_fee_1"), + "srep_unity_of_invention_fee_2": obj.get("srep_unity_of_invention_fee_2"), + "srep_unity_of_invention_fee_3": obj.get("srep_unity_of_invention_fee_3"), + "srep_unity_of_invention_fee_4": obj.get("srep_unity_of_invention_fee_4"), + "states": obj.get("states"), + "states_text": obj.get("states_text"), + "sub_group": obj.get("sub_group"), + "subclass": obj.get("subclass"), + "title_de": obj.get("title_de"), + "title_en": obj.get("title_en"), + "title_fr": obj.get("title_fr"), + "unlinked_indexing_code": obj.get("unlinked_indexing_code"), + "version": obj.get("version") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_epo/inventor_nested.py b/service/src/main/inse/models/patents_epo/inventor_nested.py new file mode 100644 index 00000000..4ff818cb --- /dev/null +++ b/service/src/main/inse/models/patents_epo/inventor_nested.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + EPO Index Backend Models + + Pydantic models for the Elasticsearch \"epo_index_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InventorNested(BaseModel): + """ + Nested inventor name object. + """ # noqa: E501 + inventor: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["inventor"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InventorNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InventorNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inventor": obj.get("inventor") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/agent_nested.py b/service/src/main/inse/models/patents_uspto/agent_nested.py new file mode 100644 index 00000000..d2ed80f9 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/agent_nested.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AgentNested(BaseModel): + """ + Nested object for patent agents. + """ # noqa: E501 + inventor: Optional[StrictStr] = None + name: Optional[StrictStr] = None + org: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["inventor", "name", "org"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "inventor": obj.get("inventor"), + "name": obj.get("name"), + "org": obj.get("org") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/applicant_nested.py b/service/src/main/inse/models/patents_uspto/applicant_nested.py new file mode 100644 index 00000000..5910b390 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/applicant_nested.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ApplicantNested(BaseModel): + """ + Nested object for patent applicants. + """ # noqa: E501 + address: Optional[StrictStr] = None + inventor: Optional[StrictStr] = None + name: Optional[StrictStr] = None + org: Optional[StrictStr] = None + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "inventor", "name", "org", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApplicantNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApplicantNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "inventor": obj.get("inventor"), + "name": obj.get("name"), + "org": obj.get("org"), + "type": obj.get("type") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/assistant_examiner_nested.py b/service/src/main/inse/models/patents_uspto/assistant_examiner_nested.py new file mode 100644 index 00000000..ffde6099 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/assistant_examiner_nested.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssistantExaminerNested(BaseModel): + """ + Nested object for assistant examiners. + """ # noqa: E501 + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssistantExaminerNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssistantExaminerNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/citation_object.py b/service/src/main/inse/models/patents_uspto/citation_object.py new file mode 100644 index 00000000..80d0e75f --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/citation_object.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CitationObject(BaseModel): + """ + Object structure for patent citations. + """ # noqa: E501 + country: Optional[StrictStr] = None + var_date: Optional[StrictStr] = Field(default=None, alias="date") + doc_number: Optional[StrictStr] = None + kind: Optional[StrictStr] = None + main_classification: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["country", "date", "doc_number", "kind", "main_classification", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CitationObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CitationObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "date": obj.get("date"), + "doc_number": obj.get("doc_number"), + "kind": obj.get("kind"), + "main_classification": obj.get("main_classification"), + "name": obj.get("name") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/inventor_nested.py b/service/src/main/inse/models/patents_uspto/inventor_nested.py new file mode 100644 index 00000000..accdeb7b --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/inventor_nested.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class InventorNested(BaseModel): + """ + Nested object for inventors. + """ # noqa: E501 + address: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of InventorNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of InventorNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "name": obj.get("name") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/primary_examiner_nested.py b/service/src/main/inse/models/patents_uspto/primary_examiner_nested.py new file mode 100644 index 00000000..2361488e --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/primary_examiner_nested.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PrimaryExaminerNested(BaseModel): + """ + Nested object for primary examiners. + """ # noqa: E501 + department: Optional[StrictStr] = None + inventor: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["department", "inventor", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PrimaryExaminerNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PrimaryExaminerNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "department": obj.get("department"), + "inventor": obj.get("inventor"), + "name": obj.get("name") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/priority_claim_nested.py b/service/src/main/inse/models/patents_uspto/priority_claim_nested.py new file mode 100644 index 00000000..0685ba08 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/priority_claim_nested.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PriorityClaimNested(BaseModel): + """ + Nested object for priority claims. + """ # noqa: E501 + country: Optional[StrictStr] = None + var_date: Optional[StrictStr] = Field(default=None, alias="date") + inventor: Optional[StrictStr] = None + number: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["country", "date", "inventor", "number"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PriorityClaimNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PriorityClaimNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "country": obj.get("country"), + "date": obj.get("date"), + "inventor": obj.get("inventor"), + "number": obj.get("number") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/related_documents_object.py b/service/src/main/inse/models/patents_uspto/related_documents_object.py new file mode 100644 index 00000000..0df5d267 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/related_documents_object.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RelatedDocumentsObject(BaseModel): + """ + Object structure for related parent and child documents. + """ # noqa: E501 + child_country: Optional[StrictStr] = None + child_date: Optional[StrictStr] = None + child_doc_number: Optional[StrictStr] = None + parent_country: Optional[StrictStr] = None + parent_date: Optional[StrictStr] = None + parent_doc_number: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["child_country", "child_date", "child_doc_number", "parent_country", "parent_date", "parent_doc_number"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelatedDocumentsObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelatedDocumentsObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "child_country": obj.get("child_country"), + "child_date": obj.get("child_date"), + "child_doc_number": obj.get("child_doc_number"), + "parent_country": obj.get("parent_country"), + "parent_date": obj.get("parent_date"), + "parent_doc_number": obj.get("parent_doc_number") + }) + return _obj + + diff --git a/service/src/main/inse/models/patents_uspto/uspto_patent.py b/service/src/main/inse/models/patents_uspto/uspto_patent.py new file mode 100644 index 00000000..179d5b55 --- /dev/null +++ b/service/src/main/inse/models/patents_uspto/uspto_patent.py @@ -0,0 +1,358 @@ +# coding: utf-8 + +""" + USPTO Patents Index Backend Models + + Pydantic models for the Elasticsearch \"uspto_patents_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.patents_uspto.agent_nested import AgentNested +from inse.models.patents_uspto.applicant_nested import ApplicantNested +from inse.models.patents_uspto.assistant_examiner_nested import AssistantExaminerNested +from inse.models.patents_uspto.citation_object import CitationObject +from inse.models.patents_uspto.inventor_nested import InventorNested +from inse.models.patents_uspto.primary_examiner_nested import PrimaryExaminerNested +from inse.models.patents_uspto.priority_claim_nested import PriorityClaimNested +from inse.models.patents_uspto.related_documents_object import RelatedDocumentsObject +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UsptoPatent(BaseModel): + """ + Main document model for the uspto_patents_1.0 index. + """ # noqa: E501 + abstract: Optional[StrictStr] = None + agents: Optional[List[AgentNested]] = None + agents_names: Optional[StrictStr] = None + agents_names_text: Optional[StrictStr] = None + agents_orgs: Optional[StrictStr] = None + agents_orgs_text: Optional[StrictStr] = None + applicants: Optional[List[ApplicantNested]] = None + applicants_addresses: Optional[StrictStr] = None + applicants_addresses_text: Optional[StrictStr] = None + applicants_names: Optional[StrictStr] = None + applicants_names_text: Optional[StrictStr] = None + applicants_orgs: Optional[StrictStr] = None + applicants_orgs_text: Optional[StrictStr] = None + application_country: Optional[StrictStr] = None + application_date: Optional[StrictInt] = None + application_number: Optional[StrictStr] = None + application_type: Optional[StrictStr] = None + assignees: Optional[StrictStr] = None + assignees_addresses: Optional[StrictStr] = None + assignees_addresses_text: Optional[StrictStr] = None + assignees_orgs: Optional[StrictStr] = None + assignees_orgs_text: Optional[StrictStr] = None + assignees_text: Optional[StrictStr] = None + assistant_examiners: Optional[List[AssistantExaminerNested]] = None + assistant_examiners_departments: Optional[StrictStr] = None + assistant_examiners_departments_text: Optional[StrictStr] = None + assistant_examiners_names: Optional[StrictStr] = None + assistant_examiners_names_text: Optional[StrictStr] = None + citations: Optional[CitationObject] = None + citations_names: Optional[StrictStr] = None + citations_names_text: Optional[StrictStr] = None + claims: Optional[StrictStr] = None + claims_text: Optional[StrictStr] = None + country: Optional[StrictStr] = None + cpc: Optional[StrictStr] = None + cpc_action: Optional[StrictStr] = None + cpc_class: Optional[StrictStr] = None + cpc_classification_value: Optional[StrictStr] = None + cpc_data1: Optional[StrictStr] = None + cpc_data2: Optional[StrictStr] = None + cpc_main_group: Optional[StrictStr] = None + cpc_office: Optional[StrictStr] = None + cpc_position: Optional[StrictStr] = None + cpc_scheme: Optional[StrictStr] = None + cpc_section: Optional[StrictStr] = None + cpc_subclass: Optional[StrictStr] = None + cpc_subgroup: Optional[StrictStr] = None + cpc_text: Optional[StrictStr] = None + cpc_text_without: Optional[StrictStr] = None + cpc_version: Optional[StrictStr] = None + date_produced: Optional[StrictInt] = Field(default=None, alias="date-produced") + date_publ: Optional[StrictInt] = Field(default=None, alias="date-publ") + description_header: Optional[StrictStr] = None + description_paragraph: Optional[StrictStr] = None + description_text: Optional[StrictStr] = None + disclaimer: Optional[StrictStr] = None + dtd_version: Optional[StrictStr] = Field(default=None, alias="dtd-version") + field_of_clasification_cpc: Optional[StrictStr] = None + field_of_clasification_cpc_text: Optional[StrictStr] = None + field_of_clasification_cpc_text_without: Optional[StrictStr] = None + field_of_clasification_uspc: Optional[StrictStr] = None + field_of_clasification_uspc_text: Optional[StrictStr] = None + field_of_clasification_uspc_text_without: Optional[StrictStr] = None + file: Optional[StrictStr] = None + further_classifications: Optional[StrictStr] = None + id: Optional[StrictStr] = None + inventors: Optional[List[InventorNested]] = None + inventors_addresses: Optional[StrictStr] = None + inventors_addresses_text: Optional[StrictStr] = None + inventors_names: Optional[StrictStr] = None + inventors_names_text: Optional[StrictStr] = None + ipcr: Optional[StrictStr] = None + ipcr_action: Optional[StrictStr] = None + ipcr_class: Optional[StrictStr] = None + ipcr_classification_value: Optional[StrictStr] = None + ipcr_data1: Optional[StrictStr] = None + ipcr_data2: Optional[StrictStr] = None + ipcr_level: Optional[StrictStr] = None + ipcr_main_group: Optional[StrictStr] = None + ipcr_office: Optional[StrictStr] = None + ipcr_position: Optional[StrictStr] = None + ipcr_section: Optional[StrictStr] = None + ipcr_subclass: Optional[StrictStr] = None + ipcr_subgroup: Optional[StrictStr] = None + ipcr_text: Optional[StrictStr] = None + ipcr_text_without: Optional[StrictStr] = None + ipcr_version: Optional[StrictStr] = None + lang: Optional[StrictStr] = None + length_of_grant: Optional[StrictInt] = None + loc: Optional[StrictStr] = None + number_of_claims: Optional[StrictInt] = None + primary_examiners: Optional[List[PrimaryExaminerNested]] = None + primary_examiners_departments: Optional[StrictStr] = None + primary_examiners_departments_text: Optional[StrictStr] = None + primary_examiners_names: Optional[StrictStr] = None + primary_examiners_names_text: Optional[StrictStr] = None + priority_claims: Optional[List[PriorityClaimNested]] = None + publication_country: Optional[StrictStr] = None + publication_date: Optional[StrictInt] = None + publication_kind: Optional[StrictStr] = None + publication_number: Optional[StrictStr] = None + publication_year: Optional[StrictInt] = None + related_documents: Optional[RelatedDocumentsObject] = None + series_code: Optional[StrictStr] = None + status: Optional[StrictStr] = None + term_extension: Optional[StrictInt] = None + title: Optional[StrictStr] = None + uspc: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["abstract", "agents", "agents_names", "agents_names_text", "agents_orgs", "agents_orgs_text", "applicants", "applicants_addresses", "applicants_addresses_text", "applicants_names", "applicants_names_text", "applicants_orgs", "applicants_orgs_text", "application_country", "application_date", "application_number", "application_type", "assignees", "assignees_addresses", "assignees_addresses_text", "assignees_orgs", "assignees_orgs_text", "assignees_text", "assistant_examiners", "assistant_examiners_departments", "assistant_examiners_departments_text", "assistant_examiners_names", "assistant_examiners_names_text", "citations", "citations_names", "citations_names_text", "claims", "claims_text", "country", "cpc", "cpc_action", "cpc_class", "cpc_classification_value", "cpc_data1", "cpc_data2", "cpc_main_group", "cpc_office", "cpc_position", "cpc_scheme", "cpc_section", "cpc_subclass", "cpc_subgroup", "cpc_text", "cpc_text_without", "cpc_version", "date-produced", "date-publ", "description_header", "description_paragraph", "description_text", "disclaimer", "dtd-version", "field_of_clasification_cpc", "field_of_clasification_cpc_text", "field_of_clasification_cpc_text_without", "field_of_clasification_uspc", "field_of_clasification_uspc_text", "field_of_clasification_uspc_text_without", "file", "further_classifications", "id", "inventors", "inventors_addresses", "inventors_addresses_text", "inventors_names", "inventors_names_text", "ipcr", "ipcr_action", "ipcr_class", "ipcr_classification_value", "ipcr_data1", "ipcr_data2", "ipcr_level", "ipcr_main_group", "ipcr_office", "ipcr_position", "ipcr_section", "ipcr_subclass", "ipcr_subgroup", "ipcr_text", "ipcr_text_without", "ipcr_version", "lang", "length_of_grant", "loc", "number_of_claims", "primary_examiners", "primary_examiners_departments", "primary_examiners_departments_text", "primary_examiners_names", "primary_examiners_names_text", "priority_claims", "publication_country", "publication_date", "publication_kind", "publication_number", "publication_year", "related_documents", "series_code", "status", "term_extension", "title", "uspc"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UsptoPatent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item_agents in self.agents: + if _item_agents: + _items.append(_item_agents.to_dict()) + _dict['agents'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in applicants (list) + _items = [] + if self.applicants: + for _item_applicants in self.applicants: + if _item_applicants: + _items.append(_item_applicants.to_dict()) + _dict['applicants'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in assistant_examiners (list) + _items = [] + if self.assistant_examiners: + for _item_assistant_examiners in self.assistant_examiners: + if _item_assistant_examiners: + _items.append(_item_assistant_examiners.to_dict()) + _dict['assistant_examiners'] = _items + # override the default output from pydantic by calling `to_dict()` of citations + if self.citations: + _dict['citations'] = self.citations.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in inventors (list) + _items = [] + if self.inventors: + for _item_inventors in self.inventors: + if _item_inventors: + _items.append(_item_inventors.to_dict()) + _dict['inventors'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in primary_examiners (list) + _items = [] + if self.primary_examiners: + for _item_primary_examiners in self.primary_examiners: + if _item_primary_examiners: + _items.append(_item_primary_examiners.to_dict()) + _dict['primary_examiners'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in priority_claims (list) + _items = [] + if self.priority_claims: + for _item_priority_claims in self.priority_claims: + if _item_priority_claims: + _items.append(_item_priority_claims.to_dict()) + _dict['priority_claims'] = _items + # override the default output from pydantic by calling `to_dict()` of related_documents + if self.related_documents: + _dict['related_documents'] = self.related_documents.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UsptoPatent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "abstract": obj.get("abstract"), + "agents": [AgentNested.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None, + "agents_names": obj.get("agents_names"), + "agents_names_text": obj.get("agents_names_text"), + "agents_orgs": obj.get("agents_orgs"), + "agents_orgs_text": obj.get("agents_orgs_text"), + "applicants": [ApplicantNested.from_dict(_item) for _item in obj["applicants"]] if obj.get("applicants") is not None else None, + "applicants_addresses": obj.get("applicants_addresses"), + "applicants_addresses_text": obj.get("applicants_addresses_text"), + "applicants_names": obj.get("applicants_names"), + "applicants_names_text": obj.get("applicants_names_text"), + "applicants_orgs": obj.get("applicants_orgs"), + "applicants_orgs_text": obj.get("applicants_orgs_text"), + "application_country": obj.get("application_country"), + "application_date": obj.get("application_date"), + "application_number": obj.get("application_number"), + "application_type": obj.get("application_type"), + "assignees": obj.get("assignees"), + "assignees_addresses": obj.get("assignees_addresses"), + "assignees_addresses_text": obj.get("assignees_addresses_text"), + "assignees_orgs": obj.get("assignees_orgs"), + "assignees_orgs_text": obj.get("assignees_orgs_text"), + "assignees_text": obj.get("assignees_text"), + "assistant_examiners": [AssistantExaminerNested.from_dict(_item) for _item in obj["assistant_examiners"]] if obj.get("assistant_examiners") is not None else None, + "assistant_examiners_departments": obj.get("assistant_examiners_departments"), + "assistant_examiners_departments_text": obj.get("assistant_examiners_departments_text"), + "assistant_examiners_names": obj.get("assistant_examiners_names"), + "assistant_examiners_names_text": obj.get("assistant_examiners_names_text"), + "citations": CitationObject.from_dict(obj["citations"]) if obj.get("citations") is not None else None, + "citations_names": obj.get("citations_names"), + "citations_names_text": obj.get("citations_names_text"), + "claims": obj.get("claims"), + "claims_text": obj.get("claims_text"), + "country": obj.get("country"), + "cpc": obj.get("cpc"), + "cpc_action": obj.get("cpc_action"), + "cpc_class": obj.get("cpc_class"), + "cpc_classification_value": obj.get("cpc_classification_value"), + "cpc_data1": obj.get("cpc_data1"), + "cpc_data2": obj.get("cpc_data2"), + "cpc_main_group": obj.get("cpc_main_group"), + "cpc_office": obj.get("cpc_office"), + "cpc_position": obj.get("cpc_position"), + "cpc_scheme": obj.get("cpc_scheme"), + "cpc_section": obj.get("cpc_section"), + "cpc_subclass": obj.get("cpc_subclass"), + "cpc_subgroup": obj.get("cpc_subgroup"), + "cpc_text": obj.get("cpc_text"), + "cpc_text_without": obj.get("cpc_text_without"), + "cpc_version": obj.get("cpc_version"), + "date-produced": obj.get("date-produced"), + "date-publ": obj.get("date-publ"), + "description_header": obj.get("description_header"), + "description_paragraph": obj.get("description_paragraph"), + "description_text": obj.get("description_text"), + "disclaimer": obj.get("disclaimer"), + "dtd-version": obj.get("dtd-version"), + "field_of_clasification_cpc": obj.get("field_of_clasification_cpc"), + "field_of_clasification_cpc_text": obj.get("field_of_clasification_cpc_text"), + "field_of_clasification_cpc_text_without": obj.get("field_of_clasification_cpc_text_without"), + "field_of_clasification_uspc": obj.get("field_of_clasification_uspc"), + "field_of_clasification_uspc_text": obj.get("field_of_clasification_uspc_text"), + "field_of_clasification_uspc_text_without": obj.get("field_of_clasification_uspc_text_without"), + "file": obj.get("file"), + "further_classifications": obj.get("further_classifications"), + "id": obj.get("id"), + "inventors": [InventorNested.from_dict(_item) for _item in obj["inventors"]] if obj.get("inventors") is not None else None, + "inventors_addresses": obj.get("inventors_addresses"), + "inventors_addresses_text": obj.get("inventors_addresses_text"), + "inventors_names": obj.get("inventors_names"), + "inventors_names_text": obj.get("inventors_names_text"), + "ipcr": obj.get("ipcr"), + "ipcr_action": obj.get("ipcr_action"), + "ipcr_class": obj.get("ipcr_class"), + "ipcr_classification_value": obj.get("ipcr_classification_value"), + "ipcr_data1": obj.get("ipcr_data1"), + "ipcr_data2": obj.get("ipcr_data2"), + "ipcr_level": obj.get("ipcr_level"), + "ipcr_main_group": obj.get("ipcr_main_group"), + "ipcr_office": obj.get("ipcr_office"), + "ipcr_position": obj.get("ipcr_position"), + "ipcr_section": obj.get("ipcr_section"), + "ipcr_subclass": obj.get("ipcr_subclass"), + "ipcr_subgroup": obj.get("ipcr_subgroup"), + "ipcr_text": obj.get("ipcr_text"), + "ipcr_text_without": obj.get("ipcr_text_without"), + "ipcr_version": obj.get("ipcr_version"), + "lang": obj.get("lang"), + "length_of_grant": obj.get("length_of_grant"), + "loc": obj.get("loc"), + "number_of_claims": obj.get("number_of_claims"), + "primary_examiners": [PrimaryExaminerNested.from_dict(_item) for _item in obj["primary_examiners"]] if obj.get("primary_examiners") is not None else None, + "primary_examiners_departments": obj.get("primary_examiners_departments"), + "primary_examiners_departments_text": obj.get("primary_examiners_departments_text"), + "primary_examiners_names": obj.get("primary_examiners_names"), + "primary_examiners_names_text": obj.get("primary_examiners_names_text"), + "priority_claims": [PriorityClaimNested.from_dict(_item) for _item in obj["priority_claims"]] if obj.get("priority_claims") is not None else None, + "publication_country": obj.get("publication_country"), + "publication_date": obj.get("publication_date"), + "publication_kind": obj.get("publication_kind"), + "publication_number": obj.get("publication_number"), + "publication_year": obj.get("publication_year"), + "related_documents": RelatedDocumentsObject.from_dict(obj["related_documents"]) if obj.get("related_documents") is not None else None, + "series_code": obj.get("series_code"), + "status": obj.get("status"), + "term_extension": obj.get("term_extension"), + "title": obj.get("title"), + "uspc": obj.get("uspc") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_bund/arb.py b/service/src/main/inse/models/projects_bund/arb.py new file mode 100644 index 00000000..3535b484 --- /dev/null +++ b/service/src/main/inse/models/projects_bund/arb.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Projects Bund Index Backend Models + + Pydantic models for the Elasticsearch \"projects_bund\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Arb(BaseModel): + """ + Nested Arb object. + """ # noqa: E501 + einh: Optional[StrictStr] = Field(default=None, alias="-Einh") + __properties: ClassVar[List[str]] = ["-Einh"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Arb from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Arb from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "-Einh": obj.get("-Einh") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_bund/project_bund.py b/service/src/main/inse/models/projects_bund/project_bund.py new file mode 100644 index 00000000..65ab7ae8 --- /dev/null +++ b/service/src/main/inse/models/projects_bund/project_bund.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + Projects Bund Index Backend Models + + Pydantic models for the Elasticsearch \"projects_bund\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.projects_bund.arb import Arb +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProjectBund(BaseModel): + """ + Main document model for the projects_bund index. + """ # noqa: E501 + arb: Optional[Arb] = Field(default=None, alias="Arb") + ausfhrende_stelle: Optional[StrictStr] = Field(default=None, alias="Ausführende Stelle") + bundesland: Optional[StrictStr] = Field(default=None, alias="Bundesland") + frderart: Optional[StrictStr] = Field(default=None, alias="Förderart") + frderkennzeichen: Optional[StrictStr] = Field(default=None, alias="Förderkennzeichen") + frderprofil: Optional[StrictStr] = Field(default=None, alias="Förderprofil") + frdersumme: Optional[StrictStr] = Field(default=None, alias="Fördersumme") + gemeindekennziffer: Optional[StrictStr] = Field(default=None, alias="Gemeindekennziffer") + klartext_leistungsplansystematik: Optional[StrictStr] = Field(default=None, alias="Klartext Leistungsplansystematik") + laufzeit: Optional[StrictStr] = Field(default=None, alias="Laufzeit") + leistungsplansystematik: Optional[StrictStr] = Field(default=None, alias="Leistungsplansystematik") + leistungsplansystematik_fullname: Optional[StrictStr] = Field(default=None, alias="Leistungsplansystematik_fullname") + ort: Optional[StrictStr] = Field(default=None, alias="Ort") + pt_fullname: Optional[StrictStr] = Field(default=None, alias="PT_fullname") + projekttrger: Optional[StrictStr] = Field(default=None, alias="Projektträger") + publikationsdatum: Optional[StrictStr] = Field(default=None, alias="Publikationsdatum") + referat: Optional[StrictStr] = Field(default=None, alias="Referat") + ressort: Optional[StrictStr] = Field(default=None, alias="Ressort") + ressort_fullname: Optional[StrictStr] = Field(default=None, alias="Ressort_fullname") + staat: Optional[StrictStr] = Field(default=None, alias="Staat") + stadt_gemeinde: Optional[StrictStr] = Field(default=None, alias="Stadt/Gemeinde") + thema: Optional[StrictStr] = Field(default=None, alias="Thema") + verbundprojekt: Optional[StrictStr] = Field(default=None, alias="Verbundprojekt") + zuwendungsempfnger: Optional[StrictStr] = Field(default=None, alias="Zuwendungsempfänger") + datum: Optional[StrictStr] = None + funding_end: Optional[date] = Field(default=None, description="Expected format is dd.MM.yyyy based on ES mapping.") + funding_start: Optional[date] = Field(default=None, description="Expected format is dd.MM.yyyy based on ES mapping.") + new: Optional[StrictStr] = None + unix_timestamp: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["Arb", "Ausführende Stelle", "Bundesland", "Förderart", "Förderkennzeichen", "Förderprofil", "Fördersumme", "Gemeindekennziffer", "Klartext Leistungsplansystematik", "Laufzeit", "Leistungsplansystematik", "Leistungsplansystematik_fullname", "Ort", "PT_fullname", "Projektträger", "Publikationsdatum", "Referat", "Ressort", "Ressort_fullname", "Staat", "Stadt/Gemeinde", "Thema", "Verbundprojekt", "Zuwendungsempfänger", "datum", "funding_end", "funding_start", "new", "unix_timestamp"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectBund from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of arb + if self.arb: + _dict['Arb'] = self.arb.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectBund from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "Arb": Arb.from_dict(obj["Arb"]) if obj.get("Arb") is not None else None, + "Ausführende Stelle": obj.get("Ausführende Stelle"), + "Bundesland": obj.get("Bundesland"), + "Förderart": obj.get("Förderart"), + "Förderkennzeichen": obj.get("Förderkennzeichen"), + "Förderprofil": obj.get("Förderprofil"), + "Fördersumme": obj.get("Fördersumme"), + "Gemeindekennziffer": obj.get("Gemeindekennziffer"), + "Klartext Leistungsplansystematik": obj.get("Klartext Leistungsplansystematik"), + "Laufzeit": obj.get("Laufzeit"), + "Leistungsplansystematik": obj.get("Leistungsplansystematik"), + "Leistungsplansystematik_fullname": obj.get("Leistungsplansystematik_fullname"), + "Ort": obj.get("Ort"), + "PT_fullname": obj.get("PT_fullname"), + "Projektträger": obj.get("Projektträger"), + "Publikationsdatum": obj.get("Publikationsdatum"), + "Referat": obj.get("Referat"), + "Ressort": obj.get("Ressort"), + "Ressort_fullname": obj.get("Ressort_fullname"), + "Staat": obj.get("Staat"), + "Stadt/Gemeinde": obj.get("Stadt/Gemeinde"), + "Thema": obj.get("Thema"), + "Verbundprojekt": obj.get("Verbundprojekt"), + "Zuwendungsempfänger": obj.get("Zuwendungsempfänger"), + "datum": obj.get("datum"), + "funding_end": obj.get("funding_end"), + "funding_start": obj.get("funding_start"), + "new": obj.get("new"), + "unix_timestamp": obj.get("unix_timestamp") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_dfg/auslaend.py b/service/src/main/inse/models/projects_dfg/auslaend.py new file mode 100644 index 00000000..85b261b3 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg/auslaend.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Projects DFG All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_dfg_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Auslaend(BaseModel): + """ + Nested object for international co-applicants. + """ # noqa: E501 + mitantragstellerin: Optional[StrictStr] = Field(default=None, alias=" Mitantragstellerin") + mitantragstellerinnen: Optional[StrictStr] = Field(default=None, alias=" Mitantragstellerinnen") + mitantragstellerinnen___auslndische_mitantragsteller: Optional[StrictStr] = Field(default=None, alias=" Mitantragstellerinnen / ausländische Mitantragsteller") + __properties: ClassVar[List[str]] = [" Mitantragstellerin", " Mitantragstellerinnen", " Mitantragstellerinnen / ausländische Mitantragsteller"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Auslaend from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Auslaend from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + " Mitantragstellerin": obj.get(" Mitantragstellerin"), + " Mitantragstellerinnen": obj.get(" Mitantragstellerinnen"), + " Mitantragstellerinnen / ausländische Mitantragsteller": obj.get(" Mitantragstellerinnen / ausländische Mitantragsteller") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_dfg/project_dfg.py b/service/src/main/inse/models/projects_dfg/project_dfg.py new file mode 100644 index 00000000..6295f004 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg/project_dfg.py @@ -0,0 +1,252 @@ +# coding: utf-8 + +""" + Projects DFG All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_dfg_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.projects_dfg.auslaend import Auslaend +from inse.models.projects_dfg.stellvertr import Stellvertr +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProjectDfg(BaseModel): + """ + Main document model for the projects_dfg_all index. + """ # noqa: E501 + antragstellende_institution: Optional[StrictStr] = Field(default=None, alias="Antragstellende Institution") + antragsteller: Optional[StrictStr] = Field(default=None, alias="Antragsteller") + antragstellerin: Optional[StrictStr] = Field(default=None, alias="Antragstellerin") + antragstellerinnen: Optional[StrictStr] = Field(default=None, alias="Antragstellerinnen") + antragstellerinnen___antragsteller: Optional[StrictStr] = Field(default=None, alias="Antragstellerinnen / Antragsteller") + anwendungspartner: Optional[StrictStr] = Field(default=None, alias="Anwendungspartner") + beteiligte_einrichtung: Optional[StrictStr] = Field(default=None, alias="Beteiligte Einrichtung") + beteiligte_hochschule: Optional[StrictStr] = Field(default=None, alias="Beteiligte Hochschule") + beteiligte_institution: Optional[StrictStr] = Field(default=None, alias="Beteiligte Institution") + beteiligte_person: Optional[StrictStr] = Field(default=None, alias="Beteiligte Person") + beteiligte_personen: Optional[StrictStr] = Field(default=None, alias="Beteiligte Personen") + co_sprecher: Optional[StrictStr] = Field(default=None, alias="Co-Sprecher") + co_sprecherinnen___co_sprecher: Optional[StrictStr] = Field(default=None, alias="Co-Sprecherinnen / Co-Sprecher") + dfg_verfahren: Optional[StrictStr] = Field(default=None, alias="DFG-Verfahren") + ehemalige_antragsteller: Optional[StrictStr] = Field(default=None, alias="Ehemalige Antragsteller") + ehemalige_antragstellerin: Optional[StrictStr] = Field(default=None, alias="Ehemalige Antragstellerin") + ehemalige_antragstellerinnen: Optional[StrictStr] = Field(default=None, alias="Ehemalige Antragstellerinnen") + ehemalige_antragstellerinnen___ehemalige_antragsteller: Optional[StrictStr] = Field(default=None, alias="Ehemalige Antragstellerinnen / Ehemalige Antragsteller") + ehemaliger_antragsteller: Optional[StrictStr] = Field(default=None, alias="Ehemaliger Antragsteller") + fachliche_zuordnung: Optional[StrictStr] = Field(default=None, alias="Fachliche Zuordnung") + frderung: Optional[StrictStr] = Field(default=None, alias="Förderung") + gastgeber: Optional[StrictStr] = Field(default=None, alias="Gastgeber") + gastgeberin: Optional[StrictStr] = Field(default=None, alias="Gastgeberin") + gastgeberinnen: Optional[StrictStr] = Field(default=None, alias="Gastgeberinnen") + gastgeberinnen___gastgeber: Optional[StrictStr] = Field(default=None, alias="Gastgeberinnen / Gastgeber") + gertegruppe: Optional[StrictStr] = Field(default=None, alias="Gerätegruppe") + grogerte: Optional[StrictStr] = Field(default=None, alias="Großgeräte") + igk_partnerinstitution: Optional[StrictStr] = Field(default=None, alias="IGK-Partnerinstitution") + internationaler_bezug: Optional[StrictStr] = Field(default=None, alias="Internationaler Bezug") + kooperationspartner: Optional[StrictStr] = Field(default=None, alias="Kooperationspartner") + kooperationspartnerin: Optional[StrictStr] = Field(default=None, alias="Kooperationspartnerin") + kooperationspartnerinnen: Optional[StrictStr] = Field(default=None, alias="Kooperationspartnerinnen") + kooperationspartnerinnen___kooperationspartner: Optional[StrictStr] = Field(default=None, alias="Kooperationspartnerinnen / Kooperationspartner") + leiter: Optional[StrictStr] = Field(default=None, alias="Leiter") + leiterin: Optional[StrictStr] = Field(default=None, alias="Leiterin") + leiterinnen: Optional[StrictStr] = Field(default=None, alias="Leiterinnen") + leiterinnen___leiter: Optional[StrictStr] = Field(default=None, alias="Leiterinnen / Leiter") + mitantragstellende_institution: Optional[StrictStr] = Field(default=None, alias="Mitantragstellende Institution") + mitantragsteller: Optional[StrictStr] = Field(default=None, alias="Mitantragsteller") + mitantragstellerin: Optional[StrictStr] = Field(default=None, alias="Mitantragstellerin") + mitantragstellerinnen: Optional[StrictStr] = Field(default=None, alias="Mitantragstellerinnen") + mitantragstellerinnen___mitantragsteller: Optional[StrictStr] = Field(default=None, alias="Mitantragstellerinnen / Mitantragsteller") + mitverantwortlich: Optional[StrictStr] = Field(default=None, alias="Mitverantwortlich") + mitverantwortlich_e: Optional[StrictStr] = Field(default=None, alias="Mitverantwortlich(e)") + mitverantwortliche: Optional[StrictStr] = Field(default=None, alias="Mitverantwortliche") + partnerorganisation: Optional[StrictStr] = Field(default=None, alias="Partnerorganisation") + projektkennung: Optional[StrictStr] = Field(default=None, alias="Projektkennung") + sprecher: Optional[StrictStr] = Field(default=None, alias="Sprecher") + sprecher__igk_partner: Optional[StrictStr] = Field(default=None, alias="Sprecher (IGK-Partner)") + sprecherin: Optional[StrictStr] = Field(default=None, alias="Sprecherin") + sprecherin__igk_partner: Optional[StrictStr] = Field(default=None, alias="Sprecherin (IGK-Partner)") + sprecherinnen: Optional[StrictStr] = Field(default=None, alias="Sprecherinnen") + sprecherinnen__igk_partner___sprecher__igk_partner: Optional[StrictStr] = Field(default=None, alias="Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)") + sprecherinnen___sprecher: Optional[StrictStr] = Field(default=None, alias="Sprecherinnen / Sprecher") + teilprojekt_zu: Optional[StrictStr] = Field(default=None, alias="Teilprojekt zu") + teilprojektleiter: Optional[StrictStr] = Field(default=None, alias="Teilprojektleiter") + teilprojektleiterin: Optional[StrictStr] = Field(default=None, alias="Teilprojektleiterin") + teilprojektleiterinnen: Optional[StrictStr] = Field(default=None, alias="Teilprojektleiterinnen") + teilprojektleiterinnen___teilprojektleiter: Optional[StrictStr] = Field(default=None, alias="Teilprojektleiterinnen / Teilprojektleiter") + unternehmen: Optional[StrictStr] = Field(default=None, alias="Unternehmen") + webseite: Optional[StrictStr] = Field(default=None, alias="Webseite") + auslnd: Optional[Auslaend] = Field(default=None, alias="ausländ") + auslndische_mitantragsteller: Optional[StrictStr] = Field(default=None, alias="ausländische Mitantragsteller") + auslndischer_mitantragsteller: Optional[StrictStr] = Field(default=None, alias="ausländischer Mitantragsteller") + beteiligte_wissenschaftler: Optional[StrictStr] = Field(default=None, alias="beteiligte Wissenschaftler") + beteiligte_wissenschaftlerin: Optional[StrictStr] = Field(default=None, alias="beteiligte Wissenschaftlerin") + beteiligte_wissenschaftlerinnen: Optional[StrictStr] = Field(default=None, alias="beteiligte Wissenschaftlerinnen") + beteiligte_wissenschaftlerinnen___beteiligte_wissenschaftler: Optional[StrictStr] = Field(default=None, alias="beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler") + beteiligter_wissenschaftler: Optional[StrictStr] = Field(default=None, alias="beteiligter Wissenschaftler") + description: Optional[StrictStr] = None + funding_end: Optional[StrictStr] = None + funding_start: Optional[StrictStr] = None + id: Optional[StrictStr] = None + link: Optional[StrictStr] = None + path: Optional[StrictStr] = None + person_creater_address: Optional[StrictStr] = None + person_creater_name: Optional[StrictStr] = None + stellvertr: Optional[Stellvertr] = None + title: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["Antragstellende Institution", "Antragsteller", "Antragstellerin", "Antragstellerinnen", "Antragstellerinnen / Antragsteller", "Anwendungspartner", "Beteiligte Einrichtung", "Beteiligte Hochschule", "Beteiligte Institution", "Beteiligte Person", "Beteiligte Personen", "Co-Sprecher", "Co-Sprecherinnen / Co-Sprecher", "DFG-Verfahren", "Ehemalige Antragsteller", "Ehemalige Antragstellerin", "Ehemalige Antragstellerinnen", "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", "Ehemaliger Antragsteller", "Fachliche Zuordnung", "Förderung", "Gastgeber", "Gastgeberin", "Gastgeberinnen", "Gastgeberinnen / Gastgeber", "Gerätegruppe", "Großgeräte", "IGK-Partnerinstitution", "Internationaler Bezug", "Kooperationspartner", "Kooperationspartnerin", "Kooperationspartnerinnen", "Kooperationspartnerinnen / Kooperationspartner", "Leiter", "Leiterin", "Leiterinnen", "Leiterinnen / Leiter", "Mitantragstellende Institution", "Mitantragsteller", "Mitantragstellerin", "Mitantragstellerinnen", "Mitantragstellerinnen / Mitantragsteller", "Mitverantwortlich", "Mitverantwortlich(e)", "Mitverantwortliche", "Partnerorganisation", "Projektkennung", "Sprecher", "Sprecher (IGK-Partner)", "Sprecherin", "Sprecherin (IGK-Partner)", "Sprecherinnen", "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", "Sprecherinnen / Sprecher", "Teilprojekt zu", "Teilprojektleiter", "Teilprojektleiterin", "Teilprojektleiterinnen", "Teilprojektleiterinnen / Teilprojektleiter", "Unternehmen", "Webseite", "ausländ", "ausländische Mitantragsteller", "ausländischer Mitantragsteller", "beteiligte Wissenschaftler", "beteiligte Wissenschaftlerin", "beteiligte Wissenschaftlerinnen", "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", "beteiligter Wissenschaftler", "description", "funding_end", "funding_start", "id", "link", "path", "person_creater_address", "person_creater_name", "stellvertr", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectDfg from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of auslnd + if self.auslnd: + _dict['ausländ'] = self.auslnd.to_dict() + # override the default output from pydantic by calling `to_dict()` of stellvertr + if self.stellvertr: + _dict['stellvertr'] = self.stellvertr.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectDfg from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "Antragstellende Institution": obj.get("Antragstellende Institution"), + "Antragsteller": obj.get("Antragsteller"), + "Antragstellerin": obj.get("Antragstellerin"), + "Antragstellerinnen": obj.get("Antragstellerinnen"), + "Antragstellerinnen / Antragsteller": obj.get("Antragstellerinnen / Antragsteller"), + "Anwendungspartner": obj.get("Anwendungspartner"), + "Beteiligte Einrichtung": obj.get("Beteiligte Einrichtung"), + "Beteiligte Hochschule": obj.get("Beteiligte Hochschule"), + "Beteiligte Institution": obj.get("Beteiligte Institution"), + "Beteiligte Person": obj.get("Beteiligte Person"), + "Beteiligte Personen": obj.get("Beteiligte Personen"), + "Co-Sprecher": obj.get("Co-Sprecher"), + "Co-Sprecherinnen / Co-Sprecher": obj.get("Co-Sprecherinnen / Co-Sprecher"), + "DFG-Verfahren": obj.get("DFG-Verfahren"), + "Ehemalige Antragsteller": obj.get("Ehemalige Antragsteller"), + "Ehemalige Antragstellerin": obj.get("Ehemalige Antragstellerin"), + "Ehemalige Antragstellerinnen": obj.get("Ehemalige Antragstellerinnen"), + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller": obj.get("Ehemalige Antragstellerinnen / Ehemalige Antragsteller"), + "Ehemaliger Antragsteller": obj.get("Ehemaliger Antragsteller"), + "Fachliche Zuordnung": obj.get("Fachliche Zuordnung"), + "Förderung": obj.get("Förderung"), + "Gastgeber": obj.get("Gastgeber"), + "Gastgeberin": obj.get("Gastgeberin"), + "Gastgeberinnen": obj.get("Gastgeberinnen"), + "Gastgeberinnen / Gastgeber": obj.get("Gastgeberinnen / Gastgeber"), + "Gerätegruppe": obj.get("Gerätegruppe"), + "Großgeräte": obj.get("Großgeräte"), + "IGK-Partnerinstitution": obj.get("IGK-Partnerinstitution"), + "Internationaler Bezug": obj.get("Internationaler Bezug"), + "Kooperationspartner": obj.get("Kooperationspartner"), + "Kooperationspartnerin": obj.get("Kooperationspartnerin"), + "Kooperationspartnerinnen": obj.get("Kooperationspartnerinnen"), + "Kooperationspartnerinnen / Kooperationspartner": obj.get("Kooperationspartnerinnen / Kooperationspartner"), + "Leiter": obj.get("Leiter"), + "Leiterin": obj.get("Leiterin"), + "Leiterinnen": obj.get("Leiterinnen"), + "Leiterinnen / Leiter": obj.get("Leiterinnen / Leiter"), + "Mitantragstellende Institution": obj.get("Mitantragstellende Institution"), + "Mitantragsteller": obj.get("Mitantragsteller"), + "Mitantragstellerin": obj.get("Mitantragstellerin"), + "Mitantragstellerinnen": obj.get("Mitantragstellerinnen"), + "Mitantragstellerinnen / Mitantragsteller": obj.get("Mitantragstellerinnen / Mitantragsteller"), + "Mitverantwortlich": obj.get("Mitverantwortlich"), + "Mitverantwortlich(e)": obj.get("Mitverantwortlich(e)"), + "Mitverantwortliche": obj.get("Mitverantwortliche"), + "Partnerorganisation": obj.get("Partnerorganisation"), + "Projektkennung": obj.get("Projektkennung"), + "Sprecher": obj.get("Sprecher"), + "Sprecher (IGK-Partner)": obj.get("Sprecher (IGK-Partner)"), + "Sprecherin": obj.get("Sprecherin"), + "Sprecherin (IGK-Partner)": obj.get("Sprecherin (IGK-Partner)"), + "Sprecherinnen": obj.get("Sprecherinnen"), + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)": obj.get("Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)"), + "Sprecherinnen / Sprecher": obj.get("Sprecherinnen / Sprecher"), + "Teilprojekt zu": obj.get("Teilprojekt zu"), + "Teilprojektleiter": obj.get("Teilprojektleiter"), + "Teilprojektleiterin": obj.get("Teilprojektleiterin"), + "Teilprojektleiterinnen": obj.get("Teilprojektleiterinnen"), + "Teilprojektleiterinnen / Teilprojektleiter": obj.get("Teilprojektleiterinnen / Teilprojektleiter"), + "Unternehmen": obj.get("Unternehmen"), + "Webseite": obj.get("Webseite"), + "ausländ": Auslaend.from_dict(obj["ausländ"]) if obj.get("ausländ") is not None else None, + "ausländische Mitantragsteller": obj.get("ausländische Mitantragsteller"), + "ausländischer Mitantragsteller": obj.get("ausländischer Mitantragsteller"), + "beteiligte Wissenschaftler": obj.get("beteiligte Wissenschaftler"), + "beteiligte Wissenschaftlerin": obj.get("beteiligte Wissenschaftlerin"), + "beteiligte Wissenschaftlerinnen": obj.get("beteiligte Wissenschaftlerinnen"), + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler": obj.get("beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler"), + "beteiligter Wissenschaftler": obj.get("beteiligter Wissenschaftler"), + "description": obj.get("description"), + "funding_end": obj.get("funding_end"), + "funding_start": obj.get("funding_start"), + "id": obj.get("id"), + "link": obj.get("link"), + "path": obj.get("path"), + "person_creater_address": obj.get("person_creater_address"), + "person_creater_name": obj.get("person_creater_name"), + "stellvertr": Stellvertr.from_dict(obj["stellvertr"]) if obj.get("stellvertr") is not None else None, + "title": obj.get("title") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_dfg/stellvertr.py b/service/src/main/inse/models/projects_dfg/stellvertr.py new file mode 100644 index 00000000..641d6c33 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg/stellvertr.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Projects DFG All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_dfg_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.projects_dfg.stellvertr_sprecherinnen import StellvertrSprecherinnen +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Stellvertr(BaseModel): + """ + Nested object for deputy speakers. + """ # noqa: E501 + sprecher: Optional[StrictStr] = Field(default=None, alias=" Sprecher") + sprecherin: Optional[StrictStr] = Field(default=None, alias=" Sprecherin") + sprecherinnen___stellvertr: Optional[StellvertrSprecherinnen] = Field(default=None, alias=" Sprecherinnen / stellvertr") + __properties: ClassVar[List[str]] = [" Sprecher", " Sprecherin", " Sprecherinnen / stellvertr"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Stellvertr from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of sprecherinnen___stellvertr + if self.sprecherinnen___stellvertr: + _dict[' Sprecherinnen / stellvertr'] = self.sprecherinnen___stellvertr.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Stellvertr from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + " Sprecher": obj.get(" Sprecher"), + " Sprecherin": obj.get(" Sprecherin"), + " Sprecherinnen / stellvertr": StellvertrSprecherinnen.from_dict(obj[" Sprecherinnen / stellvertr"]) if obj.get(" Sprecherinnen / stellvertr") is not None else None + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_dfg/stellvertr_sprecherinnen.py b/service/src/main/inse/models/projects_dfg/stellvertr_sprecherinnen.py new file mode 100644 index 00000000..6e072ff9 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg/stellvertr_sprecherinnen.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Projects DFG All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_dfg_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class StellvertrSprecherinnen(BaseModel): + """ + Deeply nested object within stellvertr. + """ # noqa: E501 + sprecher: Optional[StrictStr] = Field(default=None, alias=" Sprecher") + __properties: ClassVar[List[str]] = [" Sprecher"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StellvertrSprecherinnen from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StellvertrSprecherinnen from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + " Sprecher": obj.get(" Sprecher") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/category_nested.py b/service/src/main/inse/models/projects_eu/category_nested.py new file mode 100644 index 00000000..3bf4c794 --- /dev/null +++ b/service/src/main/inse/models/projects_eu/category_nested.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.projects_eu.display_code_splitted_nested import DisplayCodeSplittedNested +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CategoryNested(BaseModel): + """ + First-level nested object for categories. + """ # noqa: E501 + category: Optional[StrictStr] = None + code: Optional[StrictStr] = None + display_code: Optional[StrictStr] = Field(default=None, alias="displayCode") + display_code_splitted: Optional[StrictStr] = Field(default=None, alias="displayCode_splitted") + display_code_splitted_nested: Optional[List[DisplayCodeSplittedNested]] = Field(default=None, alias="displayCode_splitted_nested") + __properties: ClassVar[List[str]] = ["category", "code", "displayCode", "displayCode_splitted", "displayCode_splitted_nested"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CategoryNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in display_code_splitted_nested (list) + _items = [] + if self.display_code_splitted_nested: + for _item_display_code_splitted_nested in self.display_code_splitted_nested: + if _item_display_code_splitted_nested: + _items.append(_item_display_code_splitted_nested.to_dict()) + _dict['displayCode_splitted_nested'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CategoryNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "code": obj.get("code"), + "displayCode": obj.get("displayCode"), + "displayCode_splitted": obj.get("displayCode_splitted"), + "displayCode_splitted_nested": [DisplayCodeSplittedNested.from_dict(_item) for _item in obj["displayCode_splitted_nested"]] if obj.get("displayCode_splitted_nested") is not None else None + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/display_code_splitted_nested.py b/service/src/main/inse/models/projects_eu/display_code_splitted_nested.py new file mode 100644 index 00000000..d5b2c829 --- /dev/null +++ b/service/src/main/inse/models/projects_eu/display_code_splitted_nested.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class DisplayCodeSplittedNested(BaseModel): + """ + Second-level nested object inside categories. + """ # noqa: E501 + single_display_code: Optional[StrictStr] = Field(default=None, alias="singleDisplayCode") + __properties: ClassVar[List[str]] = ["singleDisplayCode"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DisplayCodeSplittedNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DisplayCodeSplittedNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "singleDisplayCode": obj.get("singleDisplayCode") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/keyword_nested.py b/service/src/main/inse/models/projects_eu/keyword_nested.py new file mode 100644 index 00000000..9b83f2f6 --- /dev/null +++ b/service/src/main/inse/models/projects_eu/keyword_nested.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class KeywordNested(BaseModel): + """ + Nested object for individual keywords. + """ # noqa: E501 + keyword: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["keyword"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of KeywordNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of KeywordNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "keyword": obj.get("keyword") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/organization_nested.py b/service/src/main/inse/models/projects_eu/organization_nested.py new file mode 100644 index 00000000..3c87569b --- /dev/null +++ b/service/src/main/inse/models/projects_eu/organization_nested.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrganizationNested(BaseModel): + """ + Nested object for project organizations. + """ # noqa: E501 + ec_contribution: Optional[StrictStr] = Field(default=None, alias="ecContribution") + id: Optional[StrictStr] = None + name: Optional[StrictStr] = None + net_ec_contribution: Optional[StrictStr] = Field(default=None, alias="netEcContribution") + total_cost: Optional[StrictStr] = Field(default=None, alias="totalCost") + type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["ecContribution", "id", "name", "netEcContribution", "totalCost", "type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ecContribution": obj.get("ecContribution"), + "id": obj.get("id"), + "name": obj.get("name"), + "netEcContribution": obj.get("netEcContribution"), + "totalCost": obj.get("totalCost"), + "type": obj.get("type") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/programme_nested.py b/service/src/main/inse/models/projects_eu/programme_nested.py new file mode 100644 index 00000000..07cdd49f --- /dev/null +++ b/service/src/main/inse/models/projects_eu/programme_nested.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProgrammeNested(BaseModel): + """ + Nested object for related programmes. + """ # noqa: E501 + code: Optional[StrictStr] = None + id: Optional[StrictStr] = None + programme: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["code", "id", "programme"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProgrammeNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProgrammeNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "id": obj.get("id"), + "programme": obj.get("programme") + }) + return _obj + + diff --git a/service/src/main/inse/models/projects_eu/project_eu.py b/service/src/main/inse/models/projects_eu/project_eu.py new file mode 100644 index 00000000..c332409d --- /dev/null +++ b/service/src/main/inse/models/projects_eu/project_eu.py @@ -0,0 +1,160 @@ +# coding: utf-8 + +""" + Projects EU All Index Backend Models + + Pydantic models for the Elasticsearch \"projects_eu_all\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.projects_eu.category_nested import CategoryNested +from inse.models.projects_eu.keyword_nested import KeywordNested +from inse.models.projects_eu.organization_nested import OrganizationNested +from inse.models.projects_eu.programme_nested import ProgrammeNested +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProjectEu(BaseModel): + """ + Main document model for the projects_eu_all index. + """ # noqa: E501 + acronym: Optional[StrictStr] = None + categories_nested: Optional[List[CategoryNested]] = None + doc_number: Optional[StrictStr] = None + doi: Optional[StrictStr] = None + ec_max_contribution: Optional[StrictStr] = Field(default=None, alias="ecMaxContribution") + end_date: Optional[StrictStr] = Field(default=None, alias="endDate") + funding_end: Optional[StrictStr] = None + funding_start: Optional[StrictStr] = None + id: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + keywords_nested: Optional[List[KeywordNested]] = None + link: Optional[StrictStr] = None + objective: Optional[StrictStr] = None + organization_nested: Optional[List[OrganizationNested]] = None + programme_nested: Optional[List[ProgrammeNested]] = None + source: Optional[StrictStr] = None + start_date: Optional[StrictStr] = Field(default=None, alias="startDate") + status: Optional[StrictStr] = None + teaser: Optional[StrictStr] = None + title: Optional[StrictStr] = None + total_cost: Optional[StrictStr] = Field(default=None, alias="totalCost") + __properties: ClassVar[List[str]] = ["acronym", "categories_nested", "doc_number", "doi", "ecMaxContribution", "endDate", "funding_end", "funding_start", "id", "keywords", "keywords_nested", "link", "objective", "organization_nested", "programme_nested", "source", "startDate", "status", "teaser", "title", "totalCost"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectEu from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in categories_nested (list) + _items = [] + if self.categories_nested: + for _item_categories_nested in self.categories_nested: + if _item_categories_nested: + _items.append(_item_categories_nested.to_dict()) + _dict['categories_nested'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in keywords_nested (list) + _items = [] + if self.keywords_nested: + for _item_keywords_nested in self.keywords_nested: + if _item_keywords_nested: + _items.append(_item_keywords_nested.to_dict()) + _dict['keywords_nested'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in organization_nested (list) + _items = [] + if self.organization_nested: + for _item_organization_nested in self.organization_nested: + if _item_organization_nested: + _items.append(_item_organization_nested.to_dict()) + _dict['organization_nested'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in programme_nested (list) + _items = [] + if self.programme_nested: + for _item_programme_nested in self.programme_nested: + if _item_programme_nested: + _items.append(_item_programme_nested.to_dict()) + _dict['programme_nested'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectEu from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "acronym": obj.get("acronym"), + "categories_nested": [CategoryNested.from_dict(_item) for _item in obj["categories_nested"]] if obj.get("categories_nested") is not None else None, + "doc_number": obj.get("doc_number"), + "doi": obj.get("doi"), + "ecMaxContribution": obj.get("ecMaxContribution"), + "endDate": obj.get("endDate"), + "funding_end": obj.get("funding_end"), + "funding_start": obj.get("funding_start"), + "id": obj.get("id"), + "keywords": obj.get("keywords"), + "keywords_nested": [KeywordNested.from_dict(_item) for _item in obj["keywords_nested"]] if obj.get("keywords_nested") is not None else None, + "link": obj.get("link"), + "objective": obj.get("objective"), + "organization_nested": [OrganizationNested.from_dict(_item) for _item in obj["organization_nested"]] if obj.get("organization_nested") is not None else None, + "programme_nested": [ProgrammeNested.from_dict(_item) for _item in obj["programme_nested"]] if obj.get("programme_nested") is not None else None, + "source": obj.get("source"), + "startDate": obj.get("startDate"), + "status": obj.get("status"), + "teaser": obj.get("teaser"), + "title": obj.get("title"), + "totalCost": obj.get("totalCost") + }) + return _obj + + diff --git a/service/src/main/inse/models/topic_count.py b/service/src/main/inse/models/topic_count.py deleted file mode 100644 index fa4a2fcf..00000000 --- a/service/src/main/inse/models/topic_count.py +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Optional - -from pydantic import BaseModel, Field - - -class TopicCount(BaseModel): - id: Optional[str] = Field(default=None, description="The topic id.") - name: str = Field(description="The topic display name.") - count: int = Field(default=0, description="The number of occurrences.") diff --git a/service/src/main/inse/models/topics_by_time.py b/service/src/main/inse/models/topics_by_time.py deleted file mode 100644 index 4b495e5a..00000000 --- a/service/src/main/inse/models/topics_by_time.py +++ /dev/null @@ -1,10 +0,0 @@ -from typing import List - -from pydantic import BaseModel, Field - -from inse.models.topics_by_year import TopicsByYear - - -class TopicsByTime(BaseModel): - elements: List[TopicsByYear] = Field(default_factory=list, description="Topics grouped by year.") - total: int = Field(default=0, description="The number of years.") diff --git a/service/src/main/inse/models/ude_organizations/keyword_object.py b/service/src/main/inse/models/ude_organizations/keyword_object.py new file mode 100644 index 00000000..f5584e02 --- /dev/null +++ b/service/src/main/inse/models/ude_organizations/keyword_object.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UDE Organization Content Index Backend Models + + Pydantic models for the Elasticsearch \"ude_organization_content_august_2025\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class KeywordObject(BaseModel): + """ + Object structure for keywords and their assigned scores. + """ # noqa: E501 + score: Optional[Union[StrictFloat, StrictInt]] = None + value: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["score", "value"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of KeywordObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of KeywordObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "value": obj.get("value") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_organizations/news_object.py b/service/src/main/inse/models/ude_organizations/news_object.py new file mode 100644 index 00000000..4348bf4b --- /dev/null +++ b/service/src/main/inse/models/ude_organizations/news_object.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + UDE Organization Content Index Backend Models + + Pydantic models for the Elasticsearch \"ude_organization_content_august_2025\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class NewsObject(BaseModel): + """ + Object structure for related news content. + """ # noqa: E501 + var_date: Optional[StrictStr] = Field(default=None, alias="date") + keywords: Optional[StrictStr] = None + links: Optional[StrictStr] = None + source: Optional[StrictStr] = None + title: Optional[StrictStr] = None + topic: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["date", "keywords", "links", "source", "title", "topic"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NewsObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NewsObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "keywords": obj.get("keywords"), + "links": obj.get("links"), + "source": obj.get("source"), + "title": obj.get("title"), + "topic": obj.get("topic") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_organizations/project_object.py b/service/src/main/inse/models/ude_organizations/project_object.py new file mode 100644 index 00000000..dc0e9514 --- /dev/null +++ b/service/src/main/inse/models/ude_organizations/project_object.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + UDE Organization Content Index Backend Models + + Pydantic models for the Elasticsearch \"ude_organization_content_august_2025\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ProjectObject(BaseModel): + """ + Object structure for related projects. + """ # noqa: E501 + keywords: Optional[StrictStr] = None + links: Optional[StrictStr] = None + names: Optional[StrictStr] = None + project_type: Optional[StrictStr] = None + title: Optional[StrictStr] = None + topic: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["keywords", "links", "names", "project_type", "title", "topic"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProjectObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProjectObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "keywords": obj.get("keywords"), + "links": obj.get("links"), + "names": obj.get("names"), + "project_type": obj.get("project_type"), + "title": obj.get("title"), + "topic": obj.get("topic") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_organizations/staff_object.py b/service/src/main/inse/models/ude_organizations/staff_object.py new file mode 100644 index 00000000..b6629a2e --- /dev/null +++ b/service/src/main/inse/models/ude_organizations/staff_object.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + UDE Organization Content Index Backend Models + + Pydantic models for the Elasticsearch \"ude_organization_content_august_2025\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class StaffObject(BaseModel): + """ + Object structure for related staff members. + """ # noqa: E501 + email: Optional[StrictStr] = None + keywords: Optional[StrictStr] = None + links: Optional[StrictStr] = None + name: Optional[StrictStr] = None + research_interests: Optional[StrictStr] = None + source: Optional[StrictStr] = None + telefon: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["email", "keywords", "links", "name", "research_interests", "source", "telefon"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StaffObject from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StaffObject from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "keywords": obj.get("keywords"), + "links": obj.get("links"), + "name": obj.get("name"), + "research_interests": obj.get("research_interests"), + "source": obj.get("source"), + "telefon": obj.get("telefon") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_organizations/ude_organization_content.py b/service/src/main/inse/models/ude_organizations/ude_organization_content.py new file mode 100644 index 00000000..879ec30f --- /dev/null +++ b/service/src/main/inse/models/ude_organizations/ude_organization_content.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + UDE Organization Content Index Backend Models + + Pydantic models for the Elasticsearch \"ude_organization_content_august_2025\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.ude_organizations.keyword_object import KeywordObject +from inse.models.ude_organizations.news_object import NewsObject +from inse.models.ude_organizations.project_object import ProjectObject +from inse.models.ude_organizations.staff_object import StaffObject +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UdeOrganizationContent(BaseModel): + """ + Main document model for the ude_organization_content_august_2025 index. + """ # noqa: E501 + keywords: Optional[KeywordObject] = None + news: Optional[NewsObject] = None + projects: Optional[ProjectObject] = None + staff: Optional[StaffObject] = None + uri: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["keywords", "news", "projects", "staff", "uri"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UdeOrganizationContent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of keywords + if self.keywords: + _dict['keywords'] = self.keywords.to_dict() + # override the default output from pydantic by calling `to_dict()` of news + if self.news: + _dict['news'] = self.news.to_dict() + # override the default output from pydantic by calling `to_dict()` of projects + if self.projects: + _dict['projects'] = self.projects.to_dict() + # override the default output from pydantic by calling `to_dict()` of staff + if self.staff: + _dict['staff'] = self.staff.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UdeOrganizationContent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "keywords": KeywordObject.from_dict(obj["keywords"]) if obj.get("keywords") is not None else None, + "news": NewsObject.from_dict(obj["news"]) if obj.get("news") is not None else None, + "projects": ProjectObject.from_dict(obj["projects"]) if obj.get("projects") is not None else None, + "staff": StaffObject.from_dict(obj["staff"]) if obj.get("staff") is not None else None, + "uri": obj.get("uri") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_persons/function_nested.py b/service/src/main/inse/models/ude_persons/function_nested.py new file mode 100644 index 00000000..97e618be --- /dev/null +++ b/service/src/main/inse/models/ude_persons/function_nested.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + UDE Persons Index Backend Models + + Pydantic models for the Elasticsearch \"ude_persons_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FunctionNested(BaseModel): + """ + Nested object for a person's functions and facilities. + """ # noqa: E501 + facility: Optional[StrictStr] = None + function: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["facility", "function"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FunctionNested from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FunctionNested from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "facility": obj.get("facility"), + "function": obj.get("function") + }) + return _obj + + diff --git a/service/src/main/inse/models/ude_persons/ude_person.py b/service/src/main/inse/models/ude_persons/ude_person.py new file mode 100644 index 00000000..80c08da0 --- /dev/null +++ b/service/src/main/inse/models/ude_persons/ude_person.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + UDE Persons Index Backend Models + + Pydantic models for the Elasticsearch \"ude_persons_1.0\" index. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from inse.models.ude_persons.function_nested import FunctionNested +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UdePerson(BaseModel): + """ + Main document model for the ude_persons_1.0 index. + """ # noqa: E501 + affiliation_chair: Optional[StrictStr] = None + affiliation_faculty: Optional[StrictStr] = None + affiliation_institute: Optional[StrictStr] = None + affiliation_university: Optional[StrictStr] = None + firstname: Optional[StrictStr] = None + functions: Optional[List[FunctionNested]] = None + location: Optional[StrictStr] = None + lsf_id: Optional[StrictStr] = None + mail: Optional[StrictStr] = None + name: Optional[StrictStr] = None + room: Optional[StrictStr] = None + surname: Optional[StrictStr] = None + telefax: Optional[StrictStr] = None + telefon: Optional[StrictStr] = None + title: Optional[StrictStr] = None + web: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["affiliation_chair", "affiliation_faculty", "affiliation_institute", "affiliation_university", "firstname", "functions", "location", "lsf_id", "mail", "name", "room", "surname", "telefax", "telefon", "title", "web"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UdePerson from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in functions (list) + _items = [] + if self.functions: + for _item_functions in self.functions: + if _item_functions: + _items.append(_item_functions.to_dict()) + _dict['functions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UdePerson from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "affiliation_chair": obj.get("affiliation_chair"), + "affiliation_faculty": obj.get("affiliation_faculty"), + "affiliation_institute": obj.get("affiliation_institute"), + "affiliation_university": obj.get("affiliation_university"), + "firstname": obj.get("firstname"), + "functions": [FunctionNested.from_dict(_item) for _item in obj["functions"]] if obj.get("functions") is not None else None, + "location": obj.get("location"), + "lsf_id": obj.get("lsf_id"), + "mail": obj.get("mail"), + "name": obj.get("name"), + "room": obj.get("room"), + "surname": obj.get("surname"), + "telefax": obj.get("telefax"), + "telefon": obj.get("telefon"), + "title": obj.get("title"), + "web": obj.get("web") + }) + return _obj + + diff --git a/service/src/main/inse/news/__init__.py b/service/src/main/inse/news/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/service/src/main/inse/news/logic.py b/service/src/main/inse/news/logic.py new file mode 100644 index 00000000..b02aafd2 --- /dev/null +++ b/service/src/main/inse/news/logic.py @@ -0,0 +1,274 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Business logic for the "aktuell" news index on the INSE cluster. +""" + +import logging + +from fastapi import HTTPException +from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR + +from ..integrations import elasticsearch +from ..persons.logic import find_ude_author_by_name, get_author_name_by_id +from .model import MentionedPerson, NewsArticle, NewsArticleDetail, NewsPage + +logger = logging.getLogger(__name__) + + +def get_news_page(page: int, page_size: int, sort_order: str = "desc") -> NewsPage: + offset = (page - 1) * page_size + + response = _run_search( + query={"match_all": {}}, + source=["date", "maintitle", "author", "url"], + size=page_size, + offset=offset, + sort=[{"date_full": sort_order}], + ) + + return _build_page(response, page, page_size) + + +def search_news(query_text: str, page: int, page_size: int) -> NewsPage: + offset = (page - 1) * page_size + + highlight = { + "fields": {"full_content": {"fragment_size": 200, "number_of_fragments": 1}}, + "pre_tags": [""], + "post_tags": [""], + "encoder": "html", + } + + response = _run_search( + query={"match": {"full_content": query_text}}, + source=["date", "maintitle", "author", "url"], + size=page_size, + offset=offset, + sort=None, + highlight=highlight, + ) + + return _build_page(response, page, page_size) + +def get_news_by_author( + author_id: str, + page: int = 1, + page_size: int = 10, + sort_order: str = "desc", + query_text: str | None = None, +) -> NewsPage: + + author_name = get_author_name_by_id(author_id) + if not author_name: + return _empty_page(page, page_size) + + news_ids = _find_news_ids_for_author(author_name) + if not news_ids: + return _empty_page(page, page_size) + + es_query = {"bool": {"filter": [{"ids": {"values": news_ids}}]}} + if query_text: + es_query["bool"]["must"] = [ + {"multi_match": {"query": query_text, "fields": ["maintitle", "author"]}} + ] + + offset = (page - 1) * page_size + response = _run_search( + query=es_query, + source=["date", "maintitle", "author", "url"], + size=page_size, + offset=offset, + sort=[{"date_full": sort_order}], + ) + + return _build_page(response, page, page_size) + + +def _find_news_ids_for_author(author_name: str) -> list: + + try: + response = elasticsearch.search( + index="aktuell_postproc", + query={"term": {"authors.keyword": author_name}}, + source=["news_id"], + size=1000, + cluster="inse", + ) + except Exception: + logger.exception(f"Postproc-search: Finding news IDs for author '{author_name}' failed.") + return [] + + news_ids = [] + for hit in response.get("hits", {}).get("hits", []): + news_id = hit.get("_source", {}).get("news_id") + if news_id: + news_ids.append(news_id) + + return news_ids + + +def _empty_page(page: int = 1, page_size: int = 0) -> NewsPage: + return NewsPage(total=0, page=page, page_size=page_size, results=[]) + + +def get_news_by_id(news_id: str) -> NewsArticleDetail: + try: + response = elasticsearch.get( + index="aktuell", + doc_id=news_id, + source=["date", "maintitle", "author", "url", "full_content"], + cluster="inse", + ) + except Exception as exc: + logger.exception("Abruf des News-Artikels fehlgeschlagen.") + raise HTTPException( + status_code=HTTP_500_INTERNAL_SERVER_ERROR, + detail="Etwas ist schiefgelaufen.", + ) from exc + + source = response.get("_source", {}) + + relevant, authors = _get_postproc_labels(news_id) + + return NewsArticleDetail( + id=response.get("_id"), + date=source.get("date"), + maintitle=source.get("maintitle"), + author=source.get("author"), + url=source.get("url"), + full_content=source.get("full_content"), + relevant=relevant, + authors=_build_mentioned_persons(authors), + ) + + +def _build_mentioned_persons(author_names: list) -> list: + + ude_persons = [] + other_persons = [] + + for name in author_names: + match = find_ude_author_by_name(name) + if match: + ude_persons.append( + MentionedPerson(name=name, is_ude=True, person_id=match["id"]) + ) + else: + other_persons.append(MentionedPerson(name=name)) + + return ude_persons + other_persons + + +def _get_postproc_labels(news_id: str) -> tuple[bool | None, list]: + try: + response = elasticsearch.search( + index="aktuell_postproc", + query={"term": {"news_id.keyword": news_id}}, + source=["relevant", "authors"], + size=1, + cluster="inse", + ) + except Exception: + logger.exception(f"Postproc-Lookup for {news_id} failed.") + return None, [] + + hits = response.get("hits", {}).get("hits", []) + if not hits: + return None, [] + + postproc_source = hits[0].get("_source", {}) + relevant = bool(postproc_source.get("relevant", 0)) + authors = postproc_source.get("authors") or [] + + return relevant, authors + + +def _run_search(query: dict, source: list, size: int, offset: int, sort, highlight: dict = None) -> dict: + try: + return elasticsearch.search( + index="aktuell", + query=query, + source=source, + size=size, + offset=offset, + sort=sort, + track_total_hits=True, + highlight=highlight, + cluster="inse", + ) + except Exception as exc: + logger.exception("Elasticsearch-Anfrage an Index 'aktuell' fehlgeschlagen.") + raise HTTPException( + status_code=HTTP_500_INTERNAL_SERVER_ERROR, + detail="Etwas ist schiefgelaufen.", + ) from exc + + +def _build_page(response: dict, page: int, page_size: int) -> NewsPage: + hits_section = response.get("hits", {}) + total = hits_section.get("total", {}).get("value", 0) + hits = hits_section.get("hits", []) + + news_ids = [] + for hit in hits: + news_id = hit.get("_id") + if news_id: + news_ids.append(news_id) + + relevance_map = _get_relevance_map(news_ids) + + articles = [] + for hit in hits: + article = _parse_hit(hit) + article.relevant = relevance_map.get(article.id) + articles.append(article) + + return NewsPage( + total=total, + page=page, + page_size=page_size, + results=articles, + ) + + +def _get_relevance_map(news_ids: list) -> dict: + if not news_ids: + return {} + + try: + response = elasticsearch.search( + index="aktuell_postproc", + query={"terms": {"news_id.keyword": news_ids}}, + source=["news_id", "relevant"], + size=len(news_ids), + cluster="inse", + ) + except Exception: + logger.exception("Postproc-Relevanz-Lookup fehlgeschlagen.") + return {} + + relevance_map = {} + for hit in response.get("hits", {}).get("hits", []): + postproc_source = hit.get("_source", {}) + news_id = postproc_source.get("news_id") + if news_id is not None: + relevance_map[news_id] = bool(postproc_source.get("relevant", 0)) + + return relevance_map + + +def _parse_hit(hit: dict) -> NewsArticle: + source = hit.get("_source", {}) + + fragments = hit.get("highlight", {}).get("full_content") + snippet = fragments[0] if fragments else None + + return NewsArticle( + id=hit.get("_id"), + date=source.get("date"), + maintitle=source.get("maintitle"), + author=source.get("author"), + url=source.get("url"), + snippet=snippet, + ) diff --git a/service/src/main/inse/news/model.py b/service/src/main/inse/news/model.py new file mode 100644 index 00000000..723e9b49 --- /dev/null +++ b/service/src/main/inse/news/model.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from typing import List, Optional + +from pydantic import BaseModel + + +class NewsArticle(BaseModel): + id: str + date: Optional[str] = None + maintitle: Optional[str] = None + author: Optional[str] = None + url: Optional[str] = None + relevant: Optional[bool] = None + snippet: Optional[str] = None + + +class MentionedPerson(BaseModel): + name: str + is_ude: bool = False + person_id: Optional[str] = None + + +class NewsArticleDetail(NewsArticle): + full_content: Optional[str] = None + relevant: Optional[bool] = None + authors: List[MentionedPerson] = [] + + +class NewsPage(BaseModel): + total: int + page: int + page_size: int + results: List[NewsArticle] diff --git a/service/src/main/inse/news/service.py b/service/src/main/inse/news/service.py new file mode 100644 index 00000000..5bb5dc03 --- /dev/null +++ b/service/src/main/inse/news/service.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +REST API for the "aktuell" news index. +""" + +from typing import Annotated + +from fastapi import APIRouter +from fastapi import Path +from fastapi import Query + +from inse.tags import Tags +from . import logic +from .model import NewsArticleDetail, NewsPage + +router = APIRouter(prefix="/api/news", tags=[Tags.NEWS]) + + +@router.get( + "", + operation_id="listNews", + response_model=NewsPage, + response_model_exclude_none=True, + summary="Returns a page of news articles, newest first.", + tags=[Tags.NEWS], +) +def list_news( + page: Annotated[ + int, Query(description="Page number (1-based).", ge=1) + ] = 1, + page_size: Annotated[ + int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100) + ] = 10, + sort_order: Annotated[ + str, Query(alias="sortOrder", description="Sort order: 'desc' (newest first) or 'asc' (oldest first).", pattern="^(asc|desc)$") + ] = "desc", +): + return logic.get_news_page(page, page_size, sort_order) + + +@router.get( + "/search", + operation_id="searchNews", + response_model=NewsPage, + response_model_exclude_none=True, + summary="Searches news articles by full text (full_content).", + tags=[Tags.NEWS], +) +def search_news( + query: Annotated[ + str, Query(description="Search term, matched against the full text (full_content).", min_length=1) + ], + page: Annotated[ + int, Query(description="Page number (1-based).", ge=1) + ] = 1, + page_size: Annotated[ + int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100) + ] = 10, +): + return logic.search_news(query, page, page_size) + + +@router.get( + "/by-author", + operation_id="getNewsByAuthor", + response_model=NewsPage, + response_model_exclude_none=True, + summary="Returns news articles in which the given person is mentioned.", + tags=[Tags.NEWS], +) +def get_news_by_author( + author_id: Annotated[ + str, Query(alias="authorId", description="OpenAlex author id, e.g. A5034365278.") + ], + page: Annotated[ + int, Query(description="Page number (1-based).", ge=1) + ] = 1, + page_size: Annotated[ + int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100) + ] = 10, + sort_order: Annotated[ + str, Query(alias="sortOrder", description="Sort order: 'desc' (newest first) or 'asc' (oldest first).", pattern="^(asc|desc)$") + ] = "desc", + query: Annotated[ + str | None, Query(description="Optional search term, matched against title/author.") + ] = None, +): + return logic.get_news_by_author(author_id, page, page_size, sort_order, query) + + +@router.get( + "/{news_id}", + operation_id="getNewsById", + response_model=NewsArticleDetail, + response_model_exclude_none=True, + summary="Returns a single news article including its full content.", + tags=[Tags.NEWS], +) +def get_news_by_id( + news_id: Annotated[ + str, Path(description="The unique id of the news article (Elasticsearch _id).") + ], +): + return logic.get_news_by_id(news_id) diff --git a/service/src/main/inse/patents/__init__.py b/service/src/main/inse/patents/__init__.py new file mode 100644 index 00000000..d10d63ca --- /dev/null +++ b/service/src/main/inse/patents/__init__.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Patents domain package. +""" diff --git a/service/src/main/inse/patents/elastic_search_client.py b/service/src/main/inse/patents/elastic_search_client.py new file mode 100644 index 00000000..64d5865e --- /dev/null +++ b/service/src/main/inse/patents/elastic_search_client.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + HTTP client for patent searches in EPO and USPTO Elasticsearch indices. +""" +from typing import Any + +import httpx + +from .. import config +from .name_matching import search_name_variants + +EPO_INDEX = "epo_index_1.0" +USPTO_INDEX = "uspto_patents_3.0" + +DEFAULT_SEARCH_SIZE = 100 + + +def _match_name_field(field: str, name: str) -> dict[str, Any]: + """Match a name field, including transliterated variants (Müller/Mueller).""" + variants = search_name_variants(name) + if len(variants) <= 1: + return {"match": {field: variants[0] if variants else name}} + return { + "bool": { + "should": [{"match": {field: variant}} for variant in variants], + "minimum_should_match": 1, + } + } + + +class MissingApiKeyError(Exception): + pass + + +class PatentSearchClient: + def __init__( + self, + base_url: str | None = None, + api_key: str | None = None, + timeout: float = 30.0, + transport: httpx.AsyncBaseTransport | None = None, + ): + self.base_url = (base_url or config.settings.patent_elasticsearch_url).rstrip("/") + self.api_key = api_key if api_key is not None else config.settings.patent_elasticsearch_api_key + self.timeout = timeout + self.transport = transport + + def _headers(self) -> dict[str, str]: + if not self.api_key: + raise MissingApiKeyError("Patent Elasticsearch API key is not configured.") + return { + "Authorization": f"ApiKey {self.api_key}", + "Content-Type": "application/json", + } + + def epo_query_by_inventor( + self, + last_name: str, + first_name: str | None = None, + size: int = DEFAULT_SEARCH_SIZE, + ) -> dict[str, Any]: + """Search EPO index: first AND last name in the SAME inventor entry.""" + if first_name: + query = { + "nested": { + "path": "inventors_name_nested", + "query": { + "bool": { + "must": [ + _match_name_field("inventors_name_nested.inventor", last_name), + _match_name_field("inventors_name_nested.inventor", first_name), + ] + } + }, + } + } + else: + query = { + "nested": { + "path": "inventors_name_nested", + "query": _match_name_field("inventors_name_nested.inventor", last_name), + } + } + + return { + "size": size, + "track_total_hits": True, + "sort": [ + {"_score": {"order": "desc"}}, + {"date_publication": {"order": "desc", "missing": "_last"}}, + "_doc", + ], + "_source": [ + "doc_number", + "country", + "kind", + "date_publication", + "date_publication_year", + "title_en", + "title_de", + "abstract", + "inventors_name", + "applicants_name", + "ipc", + "ipc_text", + ], + "query": query, + } + + def uspto_query_by_inventor( + self, + last_name: str, + first_name: str | None = None, + size: int = DEFAULT_SEARCH_SIZE, + ) -> dict[str, Any]: + """Search USPTO index: first AND last name in the SAME inventor entry.""" + if first_name: + query = { + "nested": { + "path": "inventors", + "query": { + "bool": { + "must": [ + _match_name_field("inventors.name", last_name), + _match_name_field("inventors.name", first_name), + ] + } + }, + } + } + else: + query = { + "nested": { + "path": "inventors", + "query": _match_name_field("inventors.name", last_name), + } + } + + return { + "size": size, + "track_total_hits": True, + "sort": [ + {"_score": {"order": "desc"}}, + {"publication_date": {"order": "desc", "missing": "_last"}}, + "_doc", + ], + "_source": [ + "publication_number", + "country", + "publication_date", + "publication_year", + "title", + "abstract", + "inventors_names", + "inventors_names_text", + "assignees_orgs", + "ipcr", + "ipcr_text", + ], + "query": query, + } + + async def search_epo(self, payload: dict[str, Any]) -> dict[str, Any]: + return await self._search(EPO_INDEX, payload) + + async def search_uspto(self, payload: dict[str, Any]) -> dict[str, Any]: + return await self._search(USPTO_INDEX, payload) + + async def _search(self, index: str, payload: dict[str, Any]) -> dict[str, Any]: + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.post( + f"/{index}/_search", + headers=self._headers(), + json=payload, + ) + response.raise_for_status() + return response.json() diff --git a/service/src/main/inse/patents/logic.py b/service/src/main/inse/patents/logic.py new file mode 100644 index 00000000..7e82cc31 --- /dev/null +++ b/service/src/main/inse/patents/logic.py @@ -0,0 +1,156 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Business logic for patent matching by author name. +""" +import logging + +import httpx +from fastapi import HTTPException +from starlette.status import HTTP_502_BAD_GATEWAY +from starlette.status import HTTP_503_SERVICE_UNAVAILABLE + +from ..persons import logic as person_logic +from ..models.openalex.author import Author +from . import model +from .elastic_search_client import MissingApiKeyError +from .elastic_search_client import PatentSearchClient +from .name_matching import name_matches + +logger = logging.getLogger(__name__) + + +async def get_patents_by_author_id( + author_id: str, + client: PatentSearchClient | None = None, +) -> model.PatentsByAuthorResponse: + search_client = client or PatentSearchClient() + + author = _get_author(author_id) + if not author: + return model.PatentsByAuthorResponse( + author_id=author_id, + author_name=None, + patent_count=0, + patents=[], + ) + + author_name = author.display_name + last_name = _extract_last_name(author_name) + first_name = _extract_first_name(author_name) + + if not last_name: + return model.PatentsByAuthorResponse( + author_id=author_id, + author_name=author_name, + patent_count=0, + patents=[], + ) + + try: + epo_data, uspto_data = await _search_both_indices( + search_client, last_name, first_name + ) + except MissingApiKeyError as exc: + raise HTTPException(status_code=HTTP_503_SERVICE_UNAVAILABLE, + detail="Patent search is not configured.") from exc + except httpx.HTTPError as exc: + raise HTTPException(status_code=HTTP_502_BAD_GATEWAY, + detail="Patent search request failed.") from exc + + all_patents = _parse_epo_hits(epo_data) + _parse_uspto_hits(uspto_data) + + if first_name and last_name: + all_patents = _filter_patents_by_name(all_patents, first_name, last_name) + + return model.PatentsByAuthorResponse( + author_id=author_id, + author_name=author_name, + patent_count=len(all_patents), + patents=all_patents, + ) + + +async def _search_both_indices(client, last_name, first_name): + import asyncio + epo_result, uspto_result = await asyncio.gather( + client.search_epo(client.epo_query_by_inventor(last_name, first_name)), + client.search_uspto(client.uspto_query_by_inventor(last_name, first_name)), + ) + return epo_result, uspto_result + + +def _parse_epo_hits(data: dict) -> list[model.PatentEntry]: + patents = [] + for hit in data.get("hits", {}).get("hits", []): + src = hit.get("_source", {}) + inventors = src.get("inventors_name") or [] + applicants = src.get("applicants_name") or [] + ipc = src.get("ipc") or [] + patents.append(model.PatentEntry( + patent_id=f"EP{src.get('doc_number', hit.get('_id', ''))}", + source="EPO", + title=src.get("title_en") or src.get("title_de"), + abstract=src.get("abstract"), + publication_date=str(src.get("date_publication")) if src.get("date_publication") else None, + publication_year=str(src.get("date_publication_year")) if src.get("date_publication_year") else None, + inventors=inventors if isinstance(inventors, list) else [inventors], + assignees=applicants if isinstance(applicants, list) else [applicants], + ipc=ipc if isinstance(ipc, list) else [ipc], + country=src.get("country", "EP"), + )) + return patents + + +def _parse_uspto_hits(data: dict) -> list[model.PatentEntry]: + patents = [] + for hit in data.get("hits", {}).get("hits", []): + src = hit.get("_source", {}) + inventors = src.get("inventors_names") or [] + assignees = src.get("assignees_orgs") or [] + ipc = src.get("ipcr") or [] + patents.append(model.PatentEntry( + patent_id=f"US{src.get('publication_number', hit.get('_id', ''))}", + source="USPTO", + title=src.get("title"), + abstract=src.get("abstract"), + publication_date=str(src.get("publication_date")) if src.get("publication_date") else None, + publication_year=str(src.get("publication_year")) if src.get("publication_year") else None, + inventors=inventors if isinstance(inventors, list) else [inventors], + assignees=assignees if isinstance(assignees, list) else [assignees], + ipc=ipc if isinstance(ipc, list) else [ipc], + country=src.get("country", "US"), + )) + return patents + + +def _filter_patents_by_name( + patents: list[model.PatentEntry], + first_name: str, + last_name: str, +) -> list[model.PatentEntry]: + """Keep patents where at least one inventor matches the author name.""" + return [ + patent for patent in patents + if any(name_matches(inventor, first_name, last_name) for inventor in patent.inventors) + ] + + +def _get_author(author_id: str) -> Author | None: + short_id = author_id.replace("https://openalex.org/", "") + result = person_logic.search_persons(author_id=short_id) + return result.results[0] if result.results else None + + +def _extract_last_name(name: str | None) -> str | None: + if not name: + return None + parts = name.strip().split() + return parts[-1] if parts else None + + +def _extract_first_name(name: str | None) -> str | None: + if not name: + return None + parts = name.strip().split() + return parts[0] if len(parts) > 1 else None \ No newline at end of file diff --git a/service/src/main/inse/patents/model.py b/service/src/main/inse/patents/model.py new file mode 100644 index 00000000..31ebc18c --- /dev/null +++ b/service/src/main/inse/patents/model.py @@ -0,0 +1,20 @@ +from pydantic import BaseModel, Field + + +class PatentEntry(BaseModel): + patent_id: str + source: str # "EPO" or "USPTO" + title: str | None = None + abstract: str | None = None + publication_date: str | None = None + publication_year: str | None = None + inventors: list[str] = Field(default_factory=list) + assignees: list[str] = Field(default_factory=list) + ipc: list[str] = Field(default_factory=list) + country: str | None = None + +class PatentsByAuthorResponse(BaseModel): + author_id: str + author_name: str | None = None + patent_count: int + patents: list[PatentEntry] diff --git a/service/src/main/inse/patents/name_matching.py b/service/src/main/inse/patents/name_matching.py new file mode 100644 index 00000000..659b295c --- /dev/null +++ b/service/src/main/inse/patents/name_matching.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Name normalization and matching for patent inventor lookup. + + Handles umlauts, diacritics, and common Latin transliterations so that + e.g. 'Müller' matches 'Mueller' and 'Muller'. +""" +import re +import unicodedata + +# Characters that NFKD does not map to ASCII-friendly forms. +_CHAR_REPLACEMENTS: dict[str, str] = { + "ß": "ss", + "ẞ": "ss", + "æ": "ae", + "Æ": "ae", + "œ": "oe", + "Œ": "oe", + "ø": "o", + "Ø": "o", + "đ": "d", + "Đ": "d", + "ð": "d", + "Ð": "d", + "þ": "th", + "Þ": "th", + "ł": "l", + "Ł": "l", + "ı": "i", + "ſ": "s", +} + +# German patent transliterations: ae/oe/ue often stand in for ä/ö/ü. +_DIGRAPH_COLLAPSES: tuple[tuple[str, str], ...] = ( + ("ae", "a"), + ("oe", "o"), + ("ue", "u"), +) + +# Common ASCII spellings in patent records for umlaut-derived vowels. +_PATENT_VOWEL_EXPANSIONS: tuple[tuple[str, str], ...] = ( + (r"u([lmnrt])", r"ue\1"), + (r"o([lmnrt])", r"oe\1"), + (r"a([lmnrt])", r"ae\1"), +) + + +def normalize_name_part(value: str | None) -> str: + """ + Normalize a single name token for comparison. + + Steps: transliteration map -> NFKD -> strip diacritics -> lowercase + -> remove apostrophes/punctuation -> collapse whitespace. + """ + if not value: + return "" + + text = value.strip() + for src, dst in _CHAR_REPLACEMENTS.items(): + text = text.replace(src, dst) + + text = unicodedata.normalize("NFKD", text) + text = "".join(c for c in text if not unicodedata.combining(c)) + text = text.lower() + text = re.sub(r"[''`´]", "", text) + text = re.sub(r"[^\w\s-]", "", text) + text = re.sub(r"\s+", " ", text).strip() + return text + + +def name_token_variants(value: str | None) -> set[str]: + """ + Return equivalent forms of a name token. + + Includes the normalized base plus German digraph collapses + (Mueller -> muller) and hyphen Relaxed forms (Jean-Pierre -> jean pierre). + """ + base = normalize_name_part(value) + if not base: + return set() + + variants = {base} + + for src, dst in _DIGRAPH_COLLAPSES: + if src in base: + variants.add(base.replace(src, dst)) + + if "-" in base: + variants.add(base.replace("-", "")) + variants.add(base.replace("-", " ")) + + return {v for v in variants if v} + + +def _patent_transliteration_expansions(normalized: str) -> set[str]: + """ + ASCII spellings used in patent records (e.g. Müller indexed as Mueller). + + Used for Elasticsearch recall only; post-filter applies stricter matching. + """ + expanded = {normalized} + for pattern, repl in _PATENT_VOWEL_EXPANSIONS: + if re.search(pattern, normalized): + expanded.add(re.sub(pattern, repl, normalized)) + return expanded + + +def tokens_equal( + left: str | None, + right: str | None, + *, + allow_initial: bool = True, +) -> bool: + """True when two name tokens are equivalent after normalization.""" + left_variants = name_token_variants(left) + right_variants = name_token_variants(right) + if not left_variants or not right_variants: + return False + if left_variants & right_variants: + return True + + if not allow_initial: + return False + + return _initial_tokens_match(left, right) + + +def _initial_letter(token: str | None) -> str | None: + normalized = normalize_name_part(token) + if len(normalized) == 1 and normalized.isalpha(): + return normalized + return None + + +def _initial_tokens_match(left: str | None, right: str | None) -> bool: + """True when one token is a single-letter initial matching the other token.""" + left_initial = _initial_letter(left) + right_initial = _initial_letter(right) + left_full = normalize_name_part(left) + right_full = normalize_name_part(right) + + if left_initial and right_full and len(right_full) > 1: + return right_full.startswith(left_initial) + if right_initial and left_full and len(left_full) > 1: + return left_full.startswith(right_initial) + if left_initial and right_initial: + return left_initial == right_initial + return False + + +def _inventor_first_token(inventor_name: str) -> str: + if "," in inventor_name: + _, first_part = [p.strip() for p in inventor_name.split(",", 1)] + return first_part.split()[0] if first_part else "" + parts = inventor_name.split() + return parts[0] if parts else "" + + +def first_name_match_kind( + inventor_name: str, + first_name: str, + last_name: str, +) -> str: + """ + Match quality for the inventor first name: 'full', 'initial', or 'none'. + """ + if not name_matches(inventor_name, first_name, last_name): + return "none" + + inventor_first = _inventor_first_token(inventor_name) + if tokens_equal(inventor_first, first_name, allow_initial=False): + return "full" + return "initial" + + +def search_name_variants(value: str | None) -> list[str]: + """ + Distinct search strings for Elasticsearch, preserving original casing + where useful but including normalized and transliterated forms. + """ + if not value or not value.strip(): + return [] + + seen: set[str] = set() + ordered: list[str] = [] + + def _add(candidate: str) -> None: + key = candidate.casefold() + if candidate.strip() and key not in seen: + seen.add(key) + ordered.append(candidate.strip()) + + _add(value.strip()) + + normalized = normalize_name_part(value) + if normalized: + _add(normalized.title()) + + for variant in name_token_variants(value): + _add(variant.title()) + + for variant in _patent_transliteration_expansions(normalized): + _add(variant.title()) + + if normalized and len(normalized) > 1: + _add(normalized[0].upper()) + + return ordered + + +def name_matches(inventor_name: str, first_name: str, last_name: str) -> bool: + """ + True when an inventor entry matches first_name + last_name. + + Supports: + - USPTO: 'Christian Weber', 'Christian Hans Weber' + - EPO: 'Weber, Christian', 'Weber, Christian Hans' + """ + if not inventor_name or not last_name: + return False + + name = inventor_name.strip() + + if "," in name: + last_part, first_part = [p.strip() for p in name.split(",", 1)] + first_token = first_part.split()[0] if first_part else "" + return ( + tokens_equal(last_part, last_name, allow_initial=False) + and bool(first_name) + and tokens_equal(first_token, first_name) + ) + + parts = name.split() + if len(parts) < 2: + return False + + return ( + tokens_equal(parts[-1], last_name, allow_initial=False) + and bool(first_name) + and tokens_equal(parts[0], first_name) + ) diff --git a/service/src/main/inse/patents/service.py b/service/src/main/inse/patents/service.py new file mode 100644 index 00000000..53a27446 --- /dev/null +++ b/service/src/main/inse/patents/service.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + REST API for patent matching by author. +""" +from fastapi import APIRouter +from . import logic +from . import model + +router = APIRouter(prefix="/api/inse-service/authors", tags=["Patents"]) + + +@router.get( + "/{author_id}/patents", + operation_id="getPatentsByAuthor", + response_model=model.PatentsByAuthorResponse, + summary="Get patents matched to an author by name.", +) +async def get_patents_by_author(author_id: str): + return await logic.get_patents_by_author_id(author_id) diff --git a/service/src/main/inse/patents/test_elastic_search_client.py b/service/src/main/inse/patents/test_elastic_search_client.py new file mode 100644 index 00000000..08729ea6 --- /dev/null +++ b/service/src/main/inse/patents/test_elastic_search_client.py @@ -0,0 +1,49 @@ +import httpx +import pytest + +from inse.patents.elastic_search_client import ( + DEFAULT_SEARCH_SIZE, + EPO_INDEX, + PatentSearchClient, + USPTO_INDEX, +) + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +def test_epo_query_uses_nested_search_and_name_variants(): + client = PatentSearchClient(api_key="test-key") + payload = client.epo_query_by_inventor("Müller", "Christian") + + assert payload["size"] == DEFAULT_SEARCH_SIZE + assert payload["sort"][0] == {"_score": {"order": "desc"}} + nested = payload["query"]["nested"] + assert nested["path"] == "inventors_name_nested" + must = nested["query"]["bool"]["must"] + assert len(must) == 2 + assert "should" in must[0]["bool"] + + +def test_uspto_index_is_3_0(): + assert USPTO_INDEX == "uspto_patents_3.0" + assert EPO_INDEX == "epo_index_1.0" + + +@pytest.mark.anyio +async def test_search_epo_posts_to_correct_index(): + requests: list[str] = [] + + def handler(request: httpx.Request) -> httpx.Response: + requests.append(request.url.path) + return httpx.Response(200, json={"hits": {"hits": []}}) + + transport = httpx.MockTransport(handler) + client = PatentSearchClient(api_key="test-key", transport=transport) + + await client.search_epo(client.epo_query_by_inventor("Weber", "Christian")) + + assert len(requests) == 1 + assert requests[0].endswith(f"/{EPO_INDEX}/_search") diff --git a/service/src/main/inse/patents/test_name_matching.py b/service/src/main/inse/patents/test_name_matching.py new file mode 100644 index 00000000..cc93465d --- /dev/null +++ b/service/src/main/inse/patents/test_name_matching.py @@ -0,0 +1,123 @@ +import pytest + +from inse.patents.name_matching import ( + first_name_match_kind, + name_matches, + name_token_variants, + normalize_name_part, + search_name_variants, + tokens_equal, +) + + +@pytest.mark.parametrize( + ("left", "right"), + [ + ("Müller", "Mueller"), + ("Müller", "Muller"), + ("Schöning", "Schoening"), + ("François", "Francois"), + ("José", "Jose"), + ("García", "Garcia"), + ("Bräun", "Braun"), + ("Straß", "Strass"), + ("Grøn", "Gron"), + ("Małgorzata", "Malgorzata"), + ("Øystein", "Oystein"), + ], +) +def test_tokens_equal_transliteration(left: str, right: str) -> None: + assert tokens_equal(left, right) + + +@pytest.mark.parametrize( + ("left", "right"), + [ + ("Christian", "Marc"), + ("Weber", "Wagner"), + ("Müller", "Meier"), + ], +) +def test_tokens_equal_rejects_different_names(left: str, right: str) -> None: + assert not tokens_equal(left, right) + + +def test_hyphenated_first_name() -> None: + assert tokens_equal("Jean-Pierre", "Jean Pierre") + assert tokens_equal("Jean-Pierre", "JeanPierre") + + +@pytest.mark.parametrize( + ("inventor", "first", "last", "expected"), + [ + ("Christian Weber", "Christian", "Weber", True), + ("Weber, Christian", "Christian", "Weber", True), + ("Marc Christian Weber", "Christian", "Weber", False), + ("Müller, Hans", "Hans", "Müller", True), + ("Mueller, Hans", "Hans", "Müller", True), + ("Hans Mueller", "Hans", "Müller", True), + ("Weber, Christian Hans", "Christian", "Weber", True), + ("Schoening, Klaus", "Klaus", "Schöning", True), + ], +) +def test_name_matches(inventor: str, first: str, last: str, expected: bool) -> None: + assert name_matches(inventor, first, last) is expected + + +def test_normalize_name_part_strips_diacritics() -> None: + assert normalize_name_part("François") == "francois" + assert normalize_name_part(" O'Brien ") == "obrien" + + +def test_search_name_variants_includes_transliterations() -> None: + variants = search_name_variants("Müller") + folded = {v.casefold() for v in variants} + assert "müller" in folded or "Müller".casefold() in folded + assert "mueller" in folded + assert "muller" in folded + + +def test_name_token_variants_mueller() -> None: + variants = name_token_variants("Mueller") + assert "mueller" in variants + assert "muller" in variants + + +@pytest.mark.parametrize( + ("left", "right"), + [ + ("C", "Christian"), + ("C.", "Christian"), + ("Christian", "C"), + ], +) +def test_tokens_equal_initials(left: str, right: str) -> None: + assert tokens_equal(left, right) + + +def test_tokens_equal_initials_not_for_last_names_by_default() -> None: + assert not tokens_equal("W", "Weber", allow_initial=False) + + +@pytest.mark.parametrize( + ("inventor", "first", "last", "expected"), + [ + ("C. Weber", "Christian", "Weber", True), + ("Weber, C.", "Christian", "Weber", True), + ("Weber, C", "Christian", "Weber", True), + ], +) +def test_name_matches_initials(inventor: str, first: str, last: str, expected: bool) -> None: + assert name_matches(inventor, first, last) is expected + + +def test_first_name_match_kind() -> None: + assert first_name_match_kind("Christian Weber", "Christian", "Weber") == "full" + assert first_name_match_kind("C. Weber", "Christian", "Weber") == "initial" + assert first_name_match_kind("Marc Christian Weber", "Christian", "Weber") == "none" + + +def test_search_name_variants_includes_initial() -> None: + variants = search_name_variants("Christian") + assert "C" in variants + diff --git a/service/src/main/inse/persons/__init__.py b/service/src/main/inse/persons/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/service/src/main/inse/persons/logic.py b/service/src/main/inse/persons/logic.py new file mode 100644 index 00000000..8c5238f9 --- /dev/null +++ b/service/src/main/inse/persons/logic.py @@ -0,0 +1,764 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Business logic for persons / authors. +""" + +import json +import logging +import time +from datetime import datetime +from typing import Optional, Callable, Any, List +from elasticsearch import ApiError, NotFoundError +import hashlib +import httpx +from fastapi import HTTPException + +from inse.model import ESIndex +from .. import config +from .. import util +from ..integrations import llm +from inse.models.openalex.author import Author +from inse.models.openalex.authors_list_response import AuthorsListResponse +from inse import util +from inse.integrations import elasticsearch +from inse.models.openalex.meta import Meta +from inse.persons.query_builder import build_authors_search_rescored +from inse.persons.model import ( + CustomAuthor, + CustomAuthorsListResponse, + PersonSearchRequest, + CareerMetrics, +) + +logger = logging.getLogger(__name__) +INDEX_NAME = "openalex-authors" +UDE_INSTITUTION_ID = "https://openalex.org/I62318514" # Universität Duisburg-Essen + +def find_ude_author_by_name(display_name: str) -> Optional[dict]: + query = { + "_source": ["display_name"], + "query": { + "bool": { + "must": [ + { + "match_phrase": { + "display_name": display_name + } + }, + { + "nested": { + "path": "affiliations", + "query": { + "term": { + "affiliations.institution.id": UDE_INSTITUTION_ID + } + }, + } + }, + ] + } + }, + "size": 10, + } + + try: + data = elasticsearch.search(index=INDEX_NAME, body=query) + except Exception: + logger.exception(f"UDE-Lookup für '{display_name}' fehlgeschlagen.") + return None + + hits = data.get("hits", {}).get("hits", []) + + display_name = display_name.strip().lower() + exact_matches = [] + + for hit in hits: + hit_display_name = hit.get("_source", {}).get("display_name", "") + if hit_display_name.strip().lower() == display_name: + exact_matches.append(hit) + + if not exact_matches: + return None + + hit = exact_matches[0] + + return { + "id": hit.get("_id"), + "display_name": hit.get("_source", {}).get("display_name"), + } + + +def get_author_name_by_id(author_id: str) -> Optional[str]: + try: + query = { + "_source": ["id", "display_name"], + "query": { + "term": {"id": {"value": f"https://openalex.org/{author_id.upper()}"}} + }, + "size": 1, + } + + data = elasticsearch.search(index=INDEX_NAME, body=query) + hits = data.get("hits", {}).get("hits", []) + if not hits: + return None + return hits[0].get("_source", {}).get("display_name") + except Exception as e: + logger.exception(f"Error fetching author name for id {author_id}: {str(e)}") + return None + + +def search_persons( + author_id: Optional[str] = None, + query: Optional[str] = None, +) -> AuthorsListResponse: + if author_id: + query_ = { + "query_string": { + "default_field": "_id", + "query": author_id, + } + } + + elif query: + query_ = { + "query_string": { + "default_field": "display_name", + "query": query, + } + } + else: + return AuthorsListResponse(results=[], meta=Meta(count=0)) + + data = elasticsearch.search(index=ESIndex.OPENALEX_AUTHORS, query=query_) + + authors = [] + for hit in data.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + source_copy = dict(source) + source_copy["id"] = source_copy.get("id") or hit.get("_id", "") + + # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) + ids = source_copy.get("ids") + if isinstance(ids, dict): + 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) + if author: + authors.append(author) + + return AuthorsListResponse(results=authors, meta=Meta(count=len(authors))) + + +def _fetch_author_display_name(author_id: str) -> Optional[str]: + + query = { + "query_string": { + "default_field": "_id", + "query": author_id, + } + } + + response = elasticsearch.search( + index=INDEX_NAME, + query=query, + source=["display_name"], + ) + + hits = response.get("hits", {}).get("hits", []) + + if not hits: + return None + + return hits[0].get("_source", {}).get("display_name") + + +def _fetch_works_and_topics(author_id: str) -> tuple[list, list]: + + WORK_SOURCE_FIELDS = [ + "title", + "display_name", + "abstract", + "cited_by_count", + "primary_topic", + ] + + author_url = f"https://openalex.org/{author_id.strip()}" + + authorship_query = { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": [{"term": {"authorships.author.id": author_url}}], + } + }, + } + } + + body = { + "size": 100, + "sort": [{"cited_by_count": {"order": "desc"}}], + "_source": WORK_SOURCE_FIELDS, + "query": authorship_query, + "aggs": { + "primary_topics": { + "terms": {"field": "primary_topic.id", "size": 5}, + "aggs": { + "topic_name": { + "top_hits": { + "size": 1, + "_source": ["primary_topic.display_name"], + } + } + }, + } + }, + } + + response = elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=body, + ) + + works = [] + for hit in response.get("hits", {}).get("hits", []): + works.append(hit.get("_source", {})) + + topics = [] + buckets = ( + response.get("aggregations", {}).get("primary_topics", {}).get("buckets", []) + ) + for bucket in buckets: + topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", []) + display_name = None + if topic_hits: + primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {}) + display_name = primary_topic.get("display_name") + topics.append( + { + "id": bucket.get("key"), + "display_name": display_name, + "count": bucket.get("doc_count"), + } + ) + + return works, topics + + +def _get_publication_years_for_author(author_id: str) -> list[int]: + author_url = f"https://openalex.org/{author_id.strip()}" + + body = { + "size": 0, + "query": { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": [ + {"term": {"authorships.author.id": author_url}}, + ], + }, + }, + }, + }, + "aggs": { + "publication_years": { + "terms": { + "field": "publication_year", + "size": 1000, + }, + }, + }, + } + + response = elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=body, + ) + + buckets = ( + response.get("aggregations", {}).get("publication_years", {}).get("buckets", []) + ) + + publication_years: list[int] = [] + + for bucket in buckets: + year = bucket.get("key") + count = bucket.get("doc_count", 0) + + if isinstance(year, int): + publication_years.extend([year] * count) + + return publication_years + + +def _classify_career_stage(active_years: int) -> str: + if active_years <= 0: + return "unknown" + + if active_years <= 4: + return "Early" + + if active_years <= 9: + return "Emerging" + + if active_years <= 14: + return "Established" + + return "Senior" + + +def _compute_career_metrics(publication_years: list[int]) -> CareerMetrics: + current_year = datetime.now().year + + if not publication_years: + return CareerMetrics() + + sorted_years = sorted(publication_years) + unique_years = sorted(set(publication_years)) + + first_year = sorted_years[0] + last_year = sorted_years[-1] + + publication_count = len(sorted_years) + active_years = len(unique_years) + career_stage = _classify_career_stage(active_years) + career_age = last_year - first_year + career_span = last_year - first_year + 1 + + publications_per_active_year = ( + publication_count / active_years if active_years > 0 else None + ) + + publications_per_career_year = ( + publication_count / career_span if career_span > 0 else None + ) + + years_since_last_publication = current_year - last_year + has_suspicious_publication_years = first_year < 1970 or career_span > 60 + + return CareerMetrics( + first_publication_year=first_year, + last_publication_year=last_year, + career_age=career_age, + career_span=career_span, + career_stage=career_stage, + active_years=active_years, + publication_count=publication_count, + publications_per_active_year=publications_per_active_year, + publications_per_career_year=publications_per_career_year, + years_since_last_publication=years_since_last_publication, + has_suspicious_publication_years=has_suspicious_publication_years, + ) + + +def get_career_metrics_for_author(author_id: str) -> CareerMetrics: + publication_years = _get_publication_years_for_author(author_id) + return _compute_career_metrics(publication_years) + + +def _build_papers(works: list) -> list: + + papers = [] + for work in works: + name = work.get("title") or work.get("display_name") + abstract = work.get("abstract") + papers.append( + { + "name": name, + "abstract": abstract, + "stats": { + "cited_by_count": work.get("cited_by_count"), + }, + } + ) + return papers + + +def get_data_for_bio(author_id: str) -> Optional[dict]: + + display_name = _fetch_author_display_name(author_id) + if display_name is None: + return None + + works, top_topics = _fetch_works_and_topics(author_id) + papers = _build_papers(works) + + author_data = { + "display_name": display_name, + "topics": top_topics, + "papers": papers, + } + return author_data + + +def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> str: + start_time = time.time() + author_data = get_data_for_bio(author_id) + if author_data is None: + return "No person found." + + person_json = json.dumps(author_data, ensure_ascii=False) + + system_prompt = """\ + Beschreibe in zwei Sätzen das Hauptforschungsfeld des Autors. Formuliere dabei allgemeinverständlich, sodass auch Personen ohne Fachwissen einen Einblick in die Forschung gewinnen. Nenne keine konkreten Publikationen oder Einzelwerke, sondern konzentriere dich auf die übergeordneten Forschungsinteressen und Themen. Verzichte auf bloße Aufzählungen und verbinde die Informationen zu einem flüssigen Text. + Beschreibe anschließend in ein bis zwei Sätzen die wirtschaftliche Relevanz der Forschung anhand von Anwendungen, Technologien oder Branchen, die davon profitieren könnten. + Verwende insgesamt maximal 100 bis 120 Wörter. Formuliere die Antwort so, dass sie ohne weitere Anpassungen direkt als Kurzbiografie verwendet werden kann. Verwende keine Superlative oder übertriebene Formulierungen, sondern bleibe sachlich und informativ. Gebe den Text als One-Liner zurück, ohne Zeilenumbrüche oder Aufzählungen. Verwende keine Gedankenstriche (– oder —) zur Gliederung von Sätzen. Formuliere stattdessen mit Kommas, Klammern oder zwei getrennten Sätzen. + """ + + user_prompt = f"Daten zur Person:\n{person_json}" + + bio = llm.call( + system_prompt=system_prompt, + user_prompt=user_prompt, + temperature=0.8, + top_p=0.95, + ) + + elapsed_time = time.time() - start_time + logger.info( + f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds" + ) + + return bio + + +def get_person_by_id( + author_id: str, include: Optional[str] = None +) -> CustomAuthorsListResponse: + source = include.split(",") if include else None + + try: + hit = elasticsearch.get( + index="openalex-authors", + doc_id=author_id, + source=source, + ) + except NotFoundError: + raise HTTPException( + status_code=404, detail=f"Person with id {author_id} not found" + ) + except ApiError as e: + raise HTTPException(status_code=500, detail=f"Elasticsearch error: {str(e)}") + + author = util.get_persons_data(hit) + start_time = time.time() + career_metrics = get_career_metrics_for_author(author_id) + elapsed_time = time.time() - start_time + + logger.info( + f"Career metrics calculation for author {author_id} took {elapsed_time:.2f} seconds" + ) + + custom_author = CustomAuthor( + **author.model_dump(), + career_metrics=career_metrics, + ) + + return CustomAuthorsListResponse(results=[custom_author]) + + +def search_persons_by_name( + author_name: str, + limit: Optional[int] = 10, + page_offset: Optional[int] = 0, + include: Optional[str] = None, +) -> AuthorsListResponse: + if not author_name: + raise HTTPException(status_code=400, detail="name must be provided") + search_query = { + "bool": { + "should": [ + {"match_phrase": {"display_name": {"query": author_name, "boost": 5}}}, + { + "match_phrase_prefix": { + "display_name": {"query": author_name, "boost": 3} + } + }, + # { + # "match": { + # "display_name": { + # "query": author_name, + # "fuzziness": 1 + # } + # } + # } + ], + "minimum_should_match": 1, + } + } + try: + response = elasticsearch.search( + index="openalex-authors", + query=search_query, + offset=page_offset, + source=include.split(",") if include else True, + size=limit, + track_total_hits=True, + ) + + except Exception as e: + raise HTTPException( + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" + ) + total_count = response.get("hits", {}).get("total", {}).get("value", 0) + hits = response.get("hits", {}).get("hits", []) + + persons = [util.get_persons_data(hit) for hit in hits] + + return AuthorsListResponse( + results=persons, meta=Meta(count=total_count, page=page_offset) + ) + + +def search_persons_autocomplete( + author_name: str, limit: Optional[int] = 5, include: Optional[str] = None +) -> AuthorsListResponse: + if not author_name: + raise HTTPException(status_code=400, detail="name must be provided") + search_query = { + "function_score": { + "query": { + "wildcard": { + "display_name.keyword": { + "value": author_name + "*", + "case_insensitive": True, + } + } + }, + "functions": [ + { + "script_score": { + "script": { + "lang": "painless", + "source": "String name = doc['display_name.keyword'].value.toLowerCase(); String[] parts = name.splitOnToken(' '); Set unique = new HashSet(); for (String p : parts) { unique.add(p); } return unique.size() > 1 ? 1.0 : 0.3;", + } + } + } + ], + "boost_mode": "multiply", + } + } + collapse = {"field": "display_name.keyword"} + body = { + "size": limit, + "query": search_query, + "_source": include.split(",") if include else True, + "sort": [{"works_count": {"order": "desc"}}], + "collapse": collapse, + } + try: + response = elasticsearch.search(index="openalex-authors", body=body) + except Exception as e: + raise HTTPException( + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" + ) + + hits = response.get("hits", {}).get("hits", []) + + persons = [] + for hit in hits: + fields = hit.get("fields", {}) + source = hit.get("_source", {}) + source_copy = dict(source) + source_copy["id"] = hit.get("_id", "") or source_copy.get("id") + + # Resilient sanitization of IDs to protect against model regeneration type conflicts (#Generated) + ids = source_copy.get("ids") + if isinstance(ids, dict): + 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(): + source_copy[key] = value + author = Author.from_dict(source_copy) + persons.append(author) + + return AuthorsListResponse(results=persons) + + +def search_persons_by_institution( + institution_name: str, + limit: Optional[int] = 10, + page_offset: Optional[int] = 0, + include: Optional[str] = None, +) -> AuthorsListResponse: + + if not institution_name: + raise HTTPException(status_code=400, detail="institution_name must be provided") + + search_query = { + "nested": { + "path": "last_known_institutions", + "query": { + "bool": { + "must": [ + { + "match_phrase": { + "last_known_institutions.display_name": institution_name + } + } + ] + } + }, + } + } + try: + response = elasticsearch.search( + index="openalex-authors", + query=search_query, + source=include.split(",") if include else True, + size=limit, + offset=page_offset, + sort=[{"works_count": {"order": "desc"}}], + track_total_hits=True, + ) + + except Exception as e: + raise HTTPException( + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" + ) + total_count = response.get("hits", {}).get("total", {}).get("value", 0) + hits = response.get("hits", {}).get("hits", []) + persons = [util.get_persons_data(hit) for hit in hits] + return AuthorsListResponse( + results=persons, meta=Meta(count=total_count, page=page_offset) + ) + + +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 "" + # Not implemented yet + h = int(hashlib.md5(author_id.encode("utf-8")).hexdigest(), 16) + + # Experimental suitability rating + 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 (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 = {} + 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) + 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, + sort_by: Optional[str] = None, + sort_order: Optional[str] = None, + topics: Optional[List[str]] = None, + page: int = 1, + page_size: int = 10, + include: Optional[set[str]] = None, + strict: Optional[bool] = False, + filter_mode: Optional[str] = "from", + filter_year: Optional[int] = None, +) -> CustomAuthorsListResponse: + try: + query_body = build_authors_search_rescored( + query=query, + institution_name=institution_name, + sort_by=sort_by, + sort_order=sort_order, + topics=topics, + page=page, + page_size=page_size, + include=include, + strict=strict, + track_total_hits=True, + filter_mode=filter_mode, + filter_year=filter_year, + ) + response_dict = elasticsearch.search( + index=INDEX_NAME, + body=query_body, + ) + except httpx.HTTPStatusError as e: + if e.response.status_code == 404: + logger.warning(f"Elasticsearch index '{INDEX_NAME}' not found.") + return CustomAuthorsListResponse( + results=[], meta=Meta(count=0, page=page, per_page=page_size) + ) + elif e.response.status_code == 400: + logger.error(f"Elasticsearch request error: {str(e)}") + raise HTTPException( + status_code=400, detail=f"Elasticsearch request error: {str(e)}" + ) + else: + logger.error(f"Elasticsearch API error: {str(e)}") + raise HTTPException( + status_code=500, detail=f"Elasticsearch API error: {str(e)}" + ) + except httpx.RequestError as e: + logger.error(f"Elasticsearch connection/request error: {str(e)}") + raise HTTPException( + status_code=500, detail=f"Elasticsearch connection/request error: {str(e)}" + ) + except Exception as e: + logger.error(f"Elasticsearch search failed: {str(e)}") + raise HTTPException( + status_code=500, detail=f"Elasticsearch search failed: {str(e)}" + ) + total_count = response_dict.get("hits", {}).get("total", {}).get("value", 0) + hits = response_dict.get("hits", {}).get("hits", []) + total_count = response_dict.get("hits", {}).get("total", {}).get("value", 0) + + include_career_metrics = include is None or "career_metrics" in include + results = [] + for hit in hits: + raw_data = util.get_persons_data(hit) + custom_author = _enrich_author_data(raw_data) + if custom_author: + if include_career_metrics: + start_time = time.time() + custom_author.career_metrics = get_career_metrics_for_author( + custom_author.id + ) + elapsed_time = time.time() - start_time + logger.info( + f"Career metrics calculation for author {custom_author.id} took " + f"{elapsed_time:.2f} seconds" + ) + 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/persons/model.py b/service/src/main/inse/persons/model.py new file mode 100644 index 00000000..300ec2d9 --- /dev/null +++ b/service/src/main/inse/persons/model.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Data models for persons / authors. +""" + +from pydantic import BaseModel +from pydantic import Field +from typing import List, Optional +from inse.models.openalex.author import Author +from inse.models.openalex.meta import Meta +from inse.models.openalex.authors_list_response import AuthorsListResponse + +from inse.models.openalex.group_by_result import GroupByResult + +class CareerMetrics(BaseModel): + first_publication_year: Optional[int] = Field( + default=None, description="First publication year of the author." + ) + last_publication_year: Optional[int] = Field( + default=None, description="Last publication year of the author." + ) + career_age: Optional[int] = Field( + default=None, description="Difference between last and first publication year." + ) + career_span: Optional[int] = Field( + default=None, description="Inclusive span from first to last publication year." + ) + career_stage: Optional[str] = Field( + default=None, + description="Threshold-based career stage derived from active publication years.", + ) + active_years: int = Field( + default=0, description="Number of distinct years with at least one publication." + ) + publication_count: int = Field( + default=0, description="Number of publications used for career metrics." + ) + publications_per_active_year: Optional[float] = Field( + default=None, description="Average publications per active publication year." + ) + publications_per_career_year: Optional[float] = Field( + default=None, description="Average publications per year over the full career span." + ) + years_since_last_publication: Optional[int] = Field( + default=None, description="Years since the last publication." + ) + has_suspicious_publication_years: bool = Field( + default=False, description="True if publication years look suspicious." + ) + + +class CustomAuthor(Author): + relevance_rating: Optional[str] = Field( + default=None, description="The relevance suitability rating." + ) + career_metrics: Optional[CareerMetrics] = Field( + default=None, description="Publication-history-based career metrics." + ) + + +class CustomAuthorsListResponse(AuthorsListResponse): + placeholder: Optional[CustomAuthor] = Field( + default=None, description="A placeholder field for generation." + ) + results: Optional[List[CustomAuthor]] = None + meta: Optional[Meta] = None + group_by: Optional[List[GroupByResult]] = None + + +class PersonBio(BaseModel): + bio: str = Field(description="The generated biography.") + + +class PersonFilters(BaseModel): + institution: Optional[str] = None + cited_by_count: Optional[int] = None + # more filters + + +class PersonSearchRequest(BaseModel): + name: Optional[str] = None + filters: PersonFilters = PersonFilters() + include: Optional[str] = None + limit: Optional[int] = 10 + page_offset: Optional[int] = 0 diff --git a/service/src/main/inse/persons/query_builder.py b/service/src/main/inse/persons/query_builder.py new file mode 100644 index 00000000..7431558d --- /dev/null +++ b/service/src/main/inse/persons/query_builder.py @@ -0,0 +1,544 @@ +# -*- coding: utf-8 -*- +from typing import List, Optional, Set, Any +import json +# def build_authors_search( +# using: Any = None, +# index: Optional[str] = None, +# query: Optional[str] = None, +# institution_name: Optional[str] = None, +# sort_by: Optional[str] = None, +# sort_order: Optional[str] = None, +# topics: Optional[List[str]] = None, +# page: int = 1, +# page_size: int = 10, +# include: Optional[Set[str]] = None, +# strict: Optional[bool] = False, +# track_total_hits: Optional[bool] = False, +# filter_mode: Optional[str] = "from", +# filter_year: Optional[int] = None, +# ) -> dict: +# """ +# Builds an Elasticsearch search request query body for authors as a dictionary. +# """ +# # 1. Build Query Clauses +# query_clause = None +# if query: +# query_clause = { +# "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 +# } +# } + +# # 2. Build Filters +# filter_clauses = [] + +# # Filter against false entries (nested ((Works > 2 AND Year > 2020) OR has last_known_institution)) +# filter_clauses.append({ +# "bool": { +# "should": [ +# { +# "bool": { +# "filter": [ +# { +# "range": { "works_count": { "gt": 2 } } +# }, +# { +# "nested": { +# "path": "counts_by_year", +# "query": { +# "range": { "counts_by_year.year": { "gt": 2020 } } # hardcoded for now +# } +# } +# } +# ] +# } +# }, +# { +# "nested": { +# "path": "last_known_institutions", +# "query": { +# "exists": { +# "field": "last_known_institutions.id" +# } +# } +# } +# } + +# ], +# "minimum_should_match": 1 +# } +# }) +# # Institution filter with optional year-based filtering +# if institution_name: +# if filter_year is not None: +# target_year = filter_year +# mode = filter_mode or "from" +# else: +# from datetime import datetime +# current_year = datetime.now().year +# target_year = current_year - 1 +# mode = "from" + +# range_query = {"gte": target_year} +# if mode == "in": +# range_query["lte"] = target_year + +# if strict: +# filter_clauses.append({ +# "nested": { +# "path": "affiliations", +# "query": { +# "bool": { +# "filter": [ +# { +# "match_phrase": { +# "affiliations.institution.display_name": institution_name +# } +# }, +# { +# "range": { +# "affiliations.years": range_query +# } +# } +# ] +# } +# } +# } +# }) +# else: +# filter_clauses.append({ +# "bool": { +# "filter": [ +# { +# "nested": { +# "path": "last_known_institutions", +# "query": { +# "match_phrase": { +# "last_known_institutions.display_name": institution_name +# } +# } +# } +# }, +# { +# "nested": { +# "path": "affiliations", +# "query": { +# "bool": { +# "filter": [ +# { +# "match_phrase": { +# "affiliations.institution.display_name": institution_name +# } +# }, +# { +# "range": { +# "affiliations.years": range_query +# } +# } +# ] +# } +# } +# } +# } +# ] +# } +# }) + +# if topics: +# for t in topics: +# if t: +# filter_clauses.append({ +# "nested": { +# "path": "topics", +# "query": { +# "match_phrase": { +# "topics.display_name": t +# } +# } +# } +# }) + +# # Combine query and filters +# body = {} +# if query_clause: +# if filter_clauses: +# body["query"] = { +# "bool": { +# "must": [query_clause], +# "filter": filter_clauses +# } +# } +# else: +# body["query"] = query_clause +# else: +# if filter_clauses: +# body["query"] = { +# "bool": { +# "filter": filter_clauses +# } +# } +# else: +# body["query"] = { +# "match_all": {} +# } + +# # 3. Source Filtering +# if include: +# body["_source"] = list(include) +# else: +# body["_source"] = True + +# # 4. Pagination +# es_size = page_size +# es_from = (page - 1) * page_size +# body["from"] = es_from +# body["size"] = es_size +# body["track_total_hits"] = track_total_hits + +# # 5. Sorting +# if sort_by and sort_order: +# body["sort"] = [ +# {sort_by: {"order": sort_order}}, +# ] +# return body + + +def build_authors_search_rescored( + using: Any = None, + index: Optional[str] = None, + query: Optional[str] = None, + institution_name: Optional[str] = None, + sort_by: Optional[str] = None, + sort_order: Optional[str] = None, + topics: Optional[List[str]] = None, + page: int = 1, + page_size: int = 10, + include: Optional[Set[str]] = None, + strict: Optional[bool] = False, + track_total_hits: Optional[bool] = False, + filter_mode: Optional[str] = "from", + filter_year: Optional[int] = None, + name_quality_boost = True, + h_index_boost = True, + citations_boost =True, + works_boost = True, + _2yr_mean_citedness_boost = True, +) -> dict: + """ + Builds an Elasticsearch search request query body for authors as a dictionary. + """ + # 1. Build Query Clauses + query_clause = None + if query: + query_clause = { + "bool": { + "should": [ + { + "match_phrase": { + "display_name": { + "query": query, + "boost": 5 + } + } + }, + { + "match_phrase_prefix": { + "display_name": { + "query": query, + "boost": 3 + } + } + }, + { + "match": { + "display_name": { + "query": query + } + } + } + ], + "minimum_should_match": 1 + } + } + + # 2. Build Filters + filter_clauses = [] + + # Filter against false entries (nested ((Works > 2 AND Year > 2020) OR has last_known_institution)) + filter_clauses.append({ + "bool": { + "should": [ + { + "bool": { + "filter": [ + { + "range": { "works_count": { "gt": 2 } } + }, + { + "nested": { + "path": "counts_by_year", + "query": { + "range": { "counts_by_year.year": { "gt": 2020 } } # hardcoded for now + } + } + } + ] + } + }, + { + "nested": { + "path": "last_known_institutions", + "query": { + "exists": { + "field": "last_known_institutions.id" + } + } + } + } + + ], + "minimum_should_match": 1 + } + }) + # Institution filter with optional year-based filtering + if institution_name: + if filter_year is not None: + target_year = filter_year + mode = filter_mode or "from" + else: + from datetime import datetime + current_year = datetime.now().year + target_year = current_year - 1 + mode = "from" + + range_query = {"gte": target_year} + if mode == "in": + range_query["lte"] = target_year + + if strict: + filter_clauses.append({ + "nested": { + "path": "affiliations", + "query": { + "bool": { + "filter": [ + { + "match_phrase": { + "affiliations.institution.display_name": institution_name + } + }, + { + "range": { + "affiliations.years": range_query + } + } + ] + } + } + } + }) + else: + filter_clauses.append({ + "bool": { + "filter": [ + { + "nested": { + "path": "last_known_institutions", + "query": { + "match_phrase": { + "last_known_institutions.display_name": institution_name + } + } + } + }, + { + "nested": { + "path": "affiliations", + "query": { + "bool": { + "filter": [ + { + "match_phrase": { + "affiliations.institution.display_name": institution_name + } + }, + { + "range": { + "affiliations.years": range_query + } + } + ] + } + } + } + } + ] + } + }) + + if topics: + for t in topics: + if t: + filter_clauses.append({ + "nested": { + "path": "topics", + "query": { + "match_phrase": { + "topics.display_name": t + } + } + } + }) + functions = [] + if not sort_by: + + # if (name_quality_boost): # Name quality boost, boost names which are not "Value Value" + # name_boost_query={ + # "script_score": { + # "script": { + # "lang": "painless", + # "source": "String name = doc['display_name.keyword'].value.toLowerCase(); String[] parts = name.splitOnToken(' ');Set unique = new HashSet();for (String p : parts) { unique.add(p); }return unique.size() > 1 ? 1.0 : 0.3;" + # } + # } + # } + # functions.append(name_boost_query) + if (h_index_boost): # h_index boost + h_index_boost_query={ + "script_score": { + "script": { + "lang": "painless", + "source": "if (!doc.containsKey('summary_stats.h_index') || doc['summary_stats.h_index'].empty) return 1.0;double h = doc['summary_stats.h_index'].value;return 1.0 + Math.log1p(h) / 5.0;" + } + } + } + functions.append(h_index_boost_query) + if (citations_boost): # cited_by_count boost + cited_by_count_boost_query = { + "script_score": { + "script": { + "lang": "painless", + "source": "if (!doc.containsKey('cited_by_count') || doc['cited_by_count'].empty) return 1.0;double citations = doc['cited_by_count'].value;return 1.0 + Math.log1p(citations) / 10.0;" + } + } + } + functions.append(cited_by_count_boost_query) + + if (works_boost): # works_count boost + works_count_boost_query = { + "script_score": { + "script": { + "lang": "painless", + "source": "if (!doc.containsKey('works_count') || doc['works_count'].empty) return 1.0;double works = doc['works_count'].value;return 1.0 + Math.log1p(works) / 8.0;" + } + } + } + functions.append(works_count_boost_query) + # Combine query and filters + body = {} + + if functions: + inner_query = None + if query_clause: + if filter_clauses: + inner_query = { + "bool": { + "must": [query_clause], + "filter": filter_clauses + } + } + else: + inner_query = query_clause + # if query not null then multiply with name matching + body["query"] = { + "function_score": { + "query": inner_query, + "functions": functions, + "score_mode": "multiply", + "boost_mode": "multiply" + } + } + else: + if filter_clauses: + inner_query = { + "bool": { + "filter": filter_clauses + } + } + else: + inner_query = {"match_all": {}} + # if the query is null, replace the scoring completely + body["query"] = { + "function_score": { + "query": inner_query, + "functions": functions, + "score_mode": "multiply", + "boost_mode": "replace" + } + } + else: + if query_clause: + if filter_clauses: + body["query"] = { + "bool": { + "must": [query_clause], + "filter": filter_clauses + } + } + else: + body["query"] = query_clause + else: + if filter_clauses: + body["query"] = { + "bool": { + "filter": filter_clauses + } + } + else: + body["query"] = {"match_all": {}} + + # 3. Source Filtering + if include: + body["_source"] = list(include) + else: + body["_source"] = True + + # 4. Pagination + es_size = page_size + es_from = (page - 1) * page_size + body["from"] = es_from + body["size"] = es_size + body["track_total_hits"] = track_total_hits + + # 5. Sorting + if sort_by and sort_order: + body["sort"] = [ + {sort_by: {"order": sort_order}}, + ] + return body + diff --git a/service/src/main/inse/persons/service.py b/service/src/main/inse/persons/service.py new file mode 100644 index 00000000..a1e08f62 --- /dev/null +++ b/service/src/main/inse/persons/service.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +REST API for persons / authors. +""" + +from typing import Annotated, Optional + +from fastapi import APIRouter +from fastapi import Path +from fastapi import Query +from typing import List +from . import logic +from . import model +from inse.models.openalex.authors_list_response import AuthorsListResponse + + +router = APIRouter( + prefix="/api/inse-service", + tags=["Persons"], + responses={404: {"description": "Not found"}}, +) + + +@router.get( + "/persons/search", + operation_id="searchPersons", + response_model=AuthorsListResponse, + summary="Searches for persons by ID or name.", + response_model_exclude_none=True, +) +def search_persons( + author_id: Annotated[ + str, Query(description="OpenAlex author ID (e.g., A5093075883)") + ] = None, + query: Annotated[ + str, Query(description="Search query (e.g., Arman AND Arzani)") + ] = None, + include: Annotated[ + Optional[str], + Query( + description=( + "Comma-separated include tags: topics_full, topic_share, summary_stats, ids, " + "last_known_institutions, sources, counts_by_year, works_api_url, dates, " + "cited_by_count_boost" + ), + 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.search_persons(author_id, query) + + +@router.get( + "/persons/bio", + operation_id="generatePersonBio", + response_model=model.PersonBio, + summary="Generates a bio for a person by author ID.", +) +def generate_person_bio( + author_id: Annotated[ + str, Query(description="OpenAlex author ID (e.g., A5093075883)") + ], + include: Annotated[ + Optional[str], + Query( + description=("Comma-separated list to 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 + ) + bio = logic.generate_person_bio(author_id, include_set) + return model.PersonBio(bio=bio) + +@router.get( + "/person/{id}", + operation_id="getPersonByID", + response_model=model.CustomAuthorsListResponse, + summary="Searches for person by ID.", + tags=["Persons"], +) +def get_person_by_id( + id: Annotated[ + str, Path(description="OpenAlex author ID", examples=["A5093075883"]) + ], + include: Annotated[ + Optional[str], + Query( + description=( + "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " + "last_known_institutions, ..." + ), + example="topics_full,topic_share", + ), + ] = None, +): + return logic.get_person_by_id(author_id=id, include=include) + + +@router.get( + "/persons/searchByName", + operation_id="searchPersonsByName", + response_model=AuthorsListResponse, + summary="Searches for person by name.", + tags=["Persons"], +) +def search_persons_by_name( + author_name: Annotated[str, Query(description="Authors name (e.g., Arman Arzani)")], + include: Annotated[ + Optional[str], + Query( + description=( + "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " + "last_known_institutions, ..." + ), + example="topics_full,topic_share", + ), + ], + limit:Annotated[Optional[int], Query(description=("Limit of search page results"),example ="2")]= None, + page_offset : Annotated[Optional[int], Query(description=("Offset of the result page"),example="2")] = None, +): + return logic.search_persons_by_name(author_name=author_name, include=include,page_offset=page_offset,limit=limit) + +@router.get( + '/persons/autocomplete', + operation_id='searchPersonsAutocomplete', + response_model=AuthorsListResponse, + summary='Searches for person by name.', + tags=[ 'Persons' ]) +def search_persons_autocomplete( + author_name: Annotated[str, Query(description="Authors name (e.g., Arman Arzani)")], + include : Annotated[Optional[str], Query( + description=( + "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " + "last_known_institutions, ..." + ), + example="topics_full,topic_share" + )]): + return logic.search_persons_autocomplete(author_name=author_name,include=include) + + +@router.get( + "/persons/searchByInstitution", + operation_id="searchPersonsByInstitution", + response_model=AuthorsListResponse, + summary="Searches for persons by institution name.", + tags=["Persons"], +) +def search_persons_by_institution( + institution_name: Annotated[ + str, Query(description="Institution name (e.g., MIT, Oxford University)") + ], + include: Annotated[ + Optional[str], + Query( + description=( + "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " + "last_known_institutions, ..." + ), + example="topics_full,topic_share", + ), + ], + limit:Annotated[Optional[int], Query(description=("Limit of search page results"),example ="2")]= None, + page_offset : Annotated[Optional[int], Query(description=("Offset of the result page"),example="2")] = None, +): + return logic.search_persons_by_institution(institution_name, include=include,page_offset=page_offset,limit=limit) + +@router.get( + "/persons/search-list", + operation_id="searchPersonsList", + response_model=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, + sort_by: Annotated[ + Optional[str], Query(alias="sortBy", description="Value to sort by") + ] = None, + sort_order: Annotated[ + Optional[str], Query(alias="sortOrder", description="asc or desc?") + ] = 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, + strict: Annotated[ + Optional[bool], Query(description="Strict institution search by target year") + ] = False, + filter_mode: Annotated[ + Optional[str], Query(alias="filterMode", description="Filter mode: 'in' or 'from'") + ] = "from", + filter_year: Annotated[ + Optional[int], Query(alias="filterYear", description="Filter year") + ] = 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, + sort_by=sort_by, + sort_order=sort_order, + topics=topic, + page=page, + page_size=page_size, + include=include_set, + strict=strict, + filter_mode=filter_mode, + filter_year=filter_year, + ) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py new file mode 100644 index 00000000..d0957d4d --- /dev/null +++ b/service/src/main/inse/projects/model.py @@ -0,0 +1,316 @@ +from datetime import date +import datetime +from enum import StrEnum +from typing import List, Optional + +from pydantic import BaseModel, Field, field_validator + +from inse.models.bund_project import BundProject +from inse.models.eu_project import EuProject +from inse.models.cordis_eu_project import CordisEuProject +from inse.model import ESIndex + + +class ProjectType(StrEnum): + BUND = "bund" + EU = "eu" + DFG = "dfg" + + def to_es_index(self) -> ESIndex: + mapping = { + self.BUND: ESIndex.PROJECTS_BUND_V1, + self.EU: ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + self.DFG: ESIndex.PROJECTS_DFG_ALL, + } + index = mapping.get(self) + if index is None: + raise ValueError(f"Unsupported project type: {self}") + return index + + +class ProjectsSortBy(StrEnum): + TITLE = "title" + FUNDING_START = "funding_start" + FUNDING_END = "funding_end" + FUNDING_AMOUNT = "funding_amount" + + def to_cordis_eu_project_sort_field(self) -> str: + mapping = { + self.TITLE: "title.keyword", + self.FUNDING_START: "startDate", + self.FUNDING_END: "endDate", + self.FUNDING_AMOUNT: "ecMaxContribution", + } + return mapping.get(self, "title.keyword") + + def to_bund_project_sort_field(self) -> str: + mapping = { + self.TITLE: "Thema.keyword", + self.FUNDING_START: "funding_start", + self.FUNDING_END: "funding_end", + self.FUNDING_AMOUNT: "Fördersumme", + } + return mapping.get(self, "Thema.keyword") + + +class SortDirection(StrEnum): + ASC = "asc" + DESC = "desc" + + +class Page(BaseModel): + page: int = Field(default=0, description="The current page number.") + size: int = Field(default=20, description="The requested page size.") + total: int = Field(default=0, description="The total number of items.") + + +class BundProjectPage(Page): + elements: List[BundProject] = Field( + default_factory=list, description="The bund projects on this page." + ) + + +class BundProjectList(BaseModel): + elements: List[BundProject] = Field( + default_factory=list, description="All bund projects." + ) + total: int = Field(default=0, description="The total number of bund projects.") + + +class EuProjectPage(Page): + elements: List[EuProject] = Field( + default_factory=list, description="The EU projects on this page." + ) + + +class DfgProjectSummary(BaseModel): + id: str = Field(description="The unique identifier of the DFG project.") + link: Optional[str] = Field( + default=None, description="The link to the DFG project details." + ) + title: Optional[str] = Field( + default=None, description="The title of the DFG project." + ) + professional_classification: Optional[str] = Field( + default=None, description="The professional classification of the DFG project." + ) + funding_start: Optional[str] = Field( + default=None, description="The funding start date of the DFG project." + ) + funding_end: Optional[str] = Field( + default=None, description="The funding end date of the DFG project." + ) + names: List[str] = Field( + default_factory=list, + description="The names of the researchers involved in the DFG project.", + ) + + @classmethod + def from_hit(cls, hit: dict) -> "DfgProjectSummary": + source = hit.get("_source", {}) + fields = hit.get("fields", {}) + + return cls( + id=hit.get("_id", ""), + link=source.get("link"), + title=source.get("title"), + professional_classification=source.get("Fachliche Zuordnung"), + funding_start=source.get("funding_start"), + funding_end=source.get("funding_end"), + names=fields.get("all_found_names", []), + ) + + +class DfgProjectPage(Page): + elements: List[DfgProjectSummary] = Field( + default_factory=list, description="The DFG projects on this page." + ) + + +class InstitutionFunderSummary(BaseModel): + type: ProjectType = Field( + description="The type of funding data (e.g., 'bund', 'eu', 'dfg')." + ) + funding_per_year: dict = Field( + default_factory=dict, + description="A dictionary mapping years to total funding amounts for that year.", + ) + annual_average_over_period: float = Field( + default=0.0, + description="The average annual funding over the continuous period covered by the data.", + ) + + +class ProjectsFilteringProperties(BaseModel): + project_type: ProjectType = Field(description="The type of projects to filter by.") + page: int = Field(description="The page number for pagination.") + size: int = Field(description="The page size for pagination.") + raw_oa_institution_id: Optional[str] = Field( + default=None, description="The raw OA institution ID to filter by." + ) + query: Optional[str] = Field( + default=None, description="The query string to filter projects by." + ) + sort_by: ProjectsSortBy = Field( + default=ProjectsSortBy.TITLE, description="The field to sort by." + ) + sort_direction: SortDirection = Field( + default=SortDirection.ASC, description="The sort direction (asc or desc)." + ) + + +class CordisEuProjectPage(Page): + elements: List[CordisEuProject] = Field( + default_factory=list, description="The CORDIS EU projects on this page." + ) + + +class FundingProject(BaseModel): + type: ProjectType = Field( + description="The type of the project.", + examples=[ProjectType.BUND, ProjectType.EU, ProjectType.DFG], + ) + id: str = Field(description="The unique identifier of the project.") + title: Optional[str] = Field(default=None, description="The title of the project.") + acronym: Optional[str] = Field( + default=None, description="The acronym of the project (if available)." + ) + start_date: Optional[date] = Field( + default=None, description="The funding start date of the project." + ) + end_date: Optional[date] = Field( + default=None, description="The funding end date of the project." + ) + funding_amount: Optional[float] = Field( + default=None, description="The total funding amount for the project." + ) + + @field_validator("start_date", "end_date", mode="before") + @classmethod + def parse_all_date_formats(cls, value): + if isinstance(value, str): + value = value.strip() + + if len(value) == 4 and value.isdigit(): + return f"{value}-01-01" + + if "." in value: + return datetime.datetime.strptime(value, "%d.%m.%Y").date() + + return value + + return value + + @classmethod + def from_cordis_projects_hit(cls, hit: dict) -> "FundingProject": + if not hit.get("_index", "").startswith("cordis_eu_") and not hit.get( + "_index", "" + ).endswith("_projects"): + raise ValueError( + "The provided hit does not belong to an index starting with 'cordis_eu_' and ending with '_projects'." + ) + + source = hit.get("_source", {}) + return cls( + type=ProjectType.EU, + id=hit.get("_id", ""), + title=source.get("title"), + start_date=source.get("startDate"), + end_date=source.get("endDate"), + funding_amount=source.get("ecMaxContribution"), + ) + + @classmethod + def from_bund_projects_hit(cls, hit: dict) -> "FundingProject": + if hit.get("_index") != "projects_bund_v1": + raise ValueError( + "The provided hit does not belong to the 'projects_bund_v1' index." + ) + + source = hit.get("_source", {}) + return cls( + type=ProjectType.BUND, + id=source.get("Förderkennzeichen", ""), + title=source.get("Thema"), + start_date=source.get("funding_start"), + end_date=source.get("funding_end"), + funding_amount=source.get("Fördersumme"), + ) + + @classmethod + def from_dfg_projects_hit(cls, hit: dict) -> "FundingProject": + if hit.get("_index") != "projects_dfg_all": + raise ValueError( + "The provided hit does not belong to the 'projects_dfg_all' index." + ) + + source = hit.get("_source", {}) + return cls( + type=ProjectType.DFG, + id=hit.get("_id", ""), + title=source.get("title"), + start_date=source.get("funding_start"), + end_date=source.get("funding_end"), + acronym=source.get("acronym"), + ) + + +class FundingProjectPage(Page): + elements: List[FundingProject] = Field( + default_factory=list, description="The funding projects on this page." + ) + + +class EuOrganizationShort(BaseModel): + project_id: str = Field(description="The unique identifier of the project.") + organization_id: str = Field( + description="The unique identifier of the organization." + ) + ec_contribution: Optional[float] = Field( + default=None, + description="The EC contribution amount for the organization in the project.", + ) + + +class EuProjectShort(BaseModel): + id: str = Field(description="The unique identifier of the EU project.") + title: Optional[str] = Field( + default=None, description="The title of the EU project." + ) + start_date: Optional[date] = Field( + default=None, description="The funding start date of the EU project." + ) + end_date: Optional[date] = Field( + default=None, description="The funding end date of the EU project." + ) + acronym: Optional[str] = Field( + default=None, description="The acronym of the EU project." + ) + + +class EuOrganizationProjectSummary(BaseModel): + organization_id: str = Field( + description="The unique identifier of the organization." + ) + project_id: str = Field(description="The unique identifier of the project.") + title: Optional[str] = Field(default=None, description="The title of the project.") + start_date: Optional[date] = Field( + default=None, description="The funding start date of the project." + ) + end_date: Optional[date] = Field( + default=None, description="The funding end date of the project." + ) + acronym: Optional[str] = Field( + default=None, description="The acronym of the project." + ) + ec_contribution: Optional[float] = Field( + default=None, + description="The EC contribution amount for the organization in the project.", + ) + + +class EuOrganizationProjectSummaryPage(Page): + elements: List[EuOrganizationProjectSummary] = Field( + default_factory=list, + description="The organization project summaries on this page.", + ) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py new file mode 100644 index 00000000..a53c2f1f --- /dev/null +++ b/service/src/main/inse/projects/projects_search_client.py @@ -0,0 +1,917 @@ +import json +import logging +from typing import Any, Dict, List, Optional, Set, Tuple + +import httpx + +from inse.config import get_settings +from inse.models.bund_project import BundProject +from inse.projects.model import ( + BundProjectPage, + CordisEuProjectPage, + DfgProjectPage, + DfgProjectSummary, + EuOrganizationProjectSummary, + EuOrganizationProjectSummaryPage, + EuOrganizationShort, + EuProjectShort, + FundingProject, + FundingProjectPage, + ProjectType, + ProjectsFilteringProperties, + ProjectsSortBy, + SortDirection, +) + +from inse.models.dfg_project_details import DfgProjectDetails +from inse.models.bund_project_details import BundProjectDetails +from inse.models.cordis_eu_project import CordisEuProject +from inse.integrations import elasticsearch +from inse.model import ESCluster, ESIndex + + +settings = get_settings() + +logger = logging.getLogger(__name__) + +logger.setLevel(settings.logging_level) + +DFG_PERSON_FIELDS: List[str] = [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher", +] + +# BUND + + +def search_bund_projects( + filter_properties: ProjectsFilteringProperties, + institution_names: List[str] = [], +) -> BundProjectPage: + """Searches for Bund projects based on the provided filtering properties and institution names. + + Args: + filter_properties (ProjectsFilteringProperties): The properties to filter the projects by. + institution_names (List[str], optional): The names of the institutions to filter by. Defaults to []. + + Returns: + BundProjectPage: The page of Bund projects that match the filtering criteria. + """ + + must_clauses: List[Dict[str, Any]] = [] + if len(institution_names) > 0: + must_clauses.append( + { + "bool": { + "should": [ + { + "match": { + "Zuwendungsempfänger": { + "query": name, + "operator": "and", + } + } + } + for name in institution_names + ], + "minimum_should_match": 1, + } + } + ) + + if filter_properties.query is not None and filter_properties.query.strip() != "": + must_clauses.append( + { + "match_phrase_prefix": { + "Thema": { + "query": filter_properties.query, + "max_expansions": 50, + } + } + } + ) + + query: Optional[Dict[str, Any]] = None + if must_clauses: + query = {"bool": {"must": must_clauses}} + + sort = [ + { + filter_properties.sort_by.to_bund_project_sort_field(): { + "order": filter_properties.sort_direction.value + } + } + ] + + response = elasticsearch.search( + index=ESIndex.PROJECTS_BUND_V1, + query=query, + sort=sort, + size=filter_properties.size, + offset=filter_properties.page * filter_properties.size, + ) + + return _complete_response_to_bund_project_page( + response=response, page=filter_properties.page, size=filter_properties.size + ) + + +def _complete_response_to_bund_project_page( + response: Dict[str, Any], page: int, size: int +) -> BundProjectPage: + """Converts the raw Elasticsearch response into a BundProjectPage object. + + Args: + response (Dict[str, Any]): The raw Elasticsearch response. + page (int): The page number. + size (int): The number of items per page. + + Returns: + BundProjectPage: The converted BundProjectPage object. + """ + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + BundProject.model_validate(hit["_source"]) for hit in hits_block.get("hits", []) + ] + return BundProjectPage(elements=elements, total=total_hits, page=page, size=size) + + +def get_bund_project_by_id(project_id: str) -> Optional[BundProjectDetails]: + """Fetches the details of a single Bund project based on its project ID. + + Args: + project_id (str): The ID of the project to fetch. + + Returns: + Optional[BundProjectDetails]: The details of the project if found, otherwise None. + """ + query = {"term": {"Förderkennzeichen.keyword": {"value": project_id}}} + + response = elasticsearch.search( + index=ESIndex.PROJECTS_BUND_V1, + query=query, + size=1, + ) + + hits = response.get("hits", {}).get("hits", []) + if hits: + hit = hits[0] + details = BundProjectDetails.from_elastic_hit(hit=hit) + return details + return None + + +# EU + + +def get_eu_organization_project_contributions( + organization_names: List[str], + projects_filtering_properties: ProjectsFilteringProperties, +) -> EuOrganizationProjectSummaryPage: + """Fetches the contributions of EU organizations to projects based on the provided organization names and filtering properties, and returns a paginated summary of the projects. + + Args: + organization_names (List[str]): The list of organization names to fetch contributions for. + projects_filtering_properties (ProjectsFilteringProperties): The filtering properties for the projects. + + Returns: + EuOrganizationProjectSummaryPage: The paginated summary of the projects. + """ + # Pagination depending on sorting criteria + # For FUNDING_AMOUNT before on the organization project contributions + # For the rest after the contributions are known on the real projects + + organization_project_contributions = get_eu_organization_contributions( + organization_names=organization_names, + ) + + total_projects, projects = get_eu_organization_projects( + project_contributions=list(organization_project_contributions.values()), + projects_filtering_properties=projects_filtering_properties, + ) + + elements: List[EuOrganizationProjectSummary] = _merge_project_data( + projects=projects, contributions=organization_project_contributions + ) + + if projects_filtering_properties.sort_by == ProjectsSortBy.FUNDING_AMOUNT: + elements.sort( + key=lambda x: x.ec_contribution or 0, + reverse=projects_filtering_properties.sort_direction == SortDirection.DESC, + ) + start = projects_filtering_properties.page * projects_filtering_properties.size + end = start + projects_filtering_properties.size + elements = elements[start:end] + + return EuOrganizationProjectSummaryPage( + elements=elements, + total=total_projects, + page=projects_filtering_properties.page, + size=projects_filtering_properties.size, + ) + + +def get_eu_organization_contributions( + organization_names: List[str], +) -> Dict[str, EuOrganizationShort]: + """Fetches the contributions of EU organizations to projects based on the provided organization names. + + Args: + organization_names (List[str]): The list of organization names to fetch contributions for. + + Returns: + Dict[str, EuOrganizationShort]: A dictionary mapping project IDs to their corresponding organization contributions. + """ + + source = ["projectID", "organisationID", "ecContribution"] + + query = { + "terms": { + "name.keyword": [ + name.upper() for name in organization_names if name.strip() + ], + } + } + + response = elasticsearch.search( + index=ESIndex.CORDIS_EU_ORGANIZATIONS_WILDCARD, + cluster=ESCluster.INSE, + source=source, + size=10000, + query=query, + ) + + logger.debug( + f"Received organization project contributions response: {json.dumps(response, indent=2)}" + ) + + organization_project_contributions = _process_organization_project_contributions( + response + ) + + logger.debug( + f"Found organization project contributions for organization names {organization_names}: {organization_project_contributions}" + ) + + return organization_project_contributions + + +def _process_organization_project_contributions( + response: Dict[str, Any], +) -> Dict[str, EuOrganizationShort]: + """Processes the raw Elasticsearch response to extract the contributions of EU organizations to projects. + + Args: + response (Dict[str, Any]): The raw Elasticsearch response. + + Returns: + Dict[str, EuOrganizationShort]: A dictionary mapping project IDs to their corresponding organization contributions. + """ + hits_block = response.get("hits", {}) + project_contributions: Dict[str, EuOrganizationShort] = {} + for hit in hits_block.get("hits", []): + source = hit.get("_source", {}) + project_id = source.get("projectID") + organization_id = source.get("organisationID") + ec_contribution = source.get("ecContribution") + if project_id and organization_id: + project_contributions[project_id] = EuOrganizationShort( + project_id=project_id, + organization_id=organization_id, + ec_contribution=ec_contribution, + ) + return project_contributions + + +def get_eu_organization_projects( + project_contributions: List[EuOrganizationShort], + projects_filtering_properties: ProjectsFilteringProperties, +) -> Tuple[int, Dict[str, EuProjectShort]]: + """Fetches the projects associated with the given list of organization contributions, applying the specified filtering properties. + + Args: + project_contributions (List[EuOrganizationShort]): The list of organization contributions to fetch projects for. + projects_filtering_properties (ProjectsFilteringProperties): The filtering properties to apply to the project search. + + Returns: + Tuple[int, Dict[str, EuProjectShort]]: A tuple containing the total number of projects and a dictionary mapping project IDs to their corresponding project details. + """ + project_ids = [contribution.project_id for contribution in project_contributions] + + source = ["id", "title", "startDate", "endDate", "acronym"] + + query = { + "terms": { + "id": project_ids, + } + } + + if ( + projects_filtering_properties.query + and projects_filtering_properties.query.strip() + ): + query = { + "bool": { + "must": [ + { + "match_phrase_prefix": { + "title": { + "query": projects_filtering_properties.query, + "max_expansions": 50, + } + } + } + ], + "filter": query, + } + } + + # Project contributions have been filtered before based on ecContribution + if projects_filtering_properties.sort_by == ProjectsSortBy.FUNDING_AMOUNT: + response = elasticsearch.search( + index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + cluster=ESCluster.INSE, + source=source, + query=query, + size=10000, + ) + else: + response = elasticsearch.search( + index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + cluster=ESCluster.INSE, + source=source, + query=query, + size=projects_filtering_properties.size, + offset=projects_filtering_properties.page + * projects_filtering_properties.size, + sort=[ + { + projects_filtering_properties.sort_by.to_cordis_eu_project_sort_field(): { + "order": projects_filtering_properties.sort_direction + } + } + ], + ) + + return _process_projects_response(response) + + +def _process_projects_response( + response: Dict[str, Any], +) -> Tuple[int, Dict[str, EuProjectShort]]: + """Processes the raw Elasticsearch response to extract the project details and total count. + + Args: + response (Dict[str, Any]): The raw Elasticsearch response. + + Returns: + Tuple[int, Dict[str, EuProjectShort]]: A tuple containing the total number of projects and a dictionary mapping project IDs to their corresponding project details. + """ + hits_block = response.get("hits", {}) + total = hits_block.get("total", {}).get("value", 0) + projects: Dict[str, EuProjectShort] = {} + for hit in hits_block.get("hits", []): + source = hit.get("_source", {}) + project_id = source.get("id") + title = source.get("title") + start_date = source.get("startDate") + end_date = source.get("endDate") + acronym = source.get("acronym") + if not project_id: + continue + projects[project_id] = EuProjectShort( + id=project_id, + title=title, + start_date=start_date, + end_date=end_date, + acronym=acronym, + ) + + return total, projects + + +def _merge_project_data( + projects: Dict[str, EuProjectShort], contributions: Dict[str, EuOrganizationShort] +) -> List[EuOrganizationProjectSummary]: + """Merges the project details with the organization contributions to create a list of EuOrganizationProjectSummary objects. + + Args: + projects (Dict[str, EuProjectShort]): The dictionary of project details. + contributions (Dict[str, EuOrganizationShort]): The dictionary of organization contributions. + + Returns: + List[EuOrganizationProjectSummary]: The list of merged project-summary objects. + """ + merged_data = [] + for project_id, project_info in projects.items(): + contribution_info = contributions.get(project_id) + if contribution_info: + merged_entry = EuOrganizationProjectSummary( + project_id=project_id, + title=project_info.title, + start_date=project_info.start_date, + end_date=project_info.end_date, + acronym=project_info.acronym, + organization_id=contribution_info.organization_id, + ec_contribution=contribution_info.ec_contribution, + ) + merged_data.append(merged_entry) + return merged_data + + +def _get_raw_doi(doi: str) -> str: + """Extracts the raw DOI from a given DOI string, removing any URL prefixes if present. + + Args: + doi (str): The DOI string to process. + + Returns: + str: The raw DOI string. + """ + if doi.startswith("https://doi.org/"): + return doi[len("https://doi.org/") :] + elif doi.startswith("http://dx.doi.org/"): + return doi[len("http://dx.doi.org/") :] + else: + return doi + + +def get_cordis_eu_publications_by_dois(dois: List[str]): + """Retrieves Cordis EU publications associated with the given list of DOIs. + + Args: + dois (List[str]): The list of DOIs for which to retrieve publications. + + Returns: + _type_: The retrieved publications. + """ + raw_dois = [_get_raw_doi(doi) for doi in dois] + query = {"bool": {"filter": [{"terms": {"qaProcessedDoi": raw_dois}}]}} + + response = elasticsearch.search( + query=query, + index=ESIndex.CORDIS_EU_PUBLICATIONS_WILDCARD, + cluster=ESCluster.INSE, + ) + + logger.debug(f"Received publications response: {json.dumps(response, indent=2)}") + + return response + + +def get_cordis_eu_project_ids_by_dois(dois: List[str]) -> List[str]: + """Retrieves the project IDs of Cordis EU projects associated with the given list of DOIs. + + Args: + dois (List[str]): The list of DOIs for which to retrieve project IDs. + + Returns: + List[str]: The list of project IDs. + """ + response = get_cordis_eu_publications_by_dois(dois=dois) + hits_block = response.get("hits", {}) + project_ids = set() + for hit in hits_block.get("hits", []): + source = hit.get("_source", {}) + project_id = source.get("projectID") + if project_id: + project_ids.add(project_id) + return list(project_ids) + + +def get_cordis_eu_projects_by_project_ids( + project_ids: List[str], +) -> CordisEuProjectPage: + query = {"bool": {"filter": [{"terms": {"id": project_ids}}]}} + + response = elasticsearch.search( + query=query, + index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD, + cluster=ESCluster.INSE, + ) + + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + CordisEuProject.model_validate(hit["_source"]) + for hit in hits_block.get("hits", []) + ] + return CordisEuProjectPage( + elements=elements, total=total_hits, page=0, size=len(elements) + ) + + +# DFG + + +def search_dfg_projects( + page: int, + size: int, + names: Optional[List[str]] = None, + topic: Optional[str] = None, + sort_by: str = "id", + sort_direction: str = "asc", +) -> DfgProjectPage: + """Searches for DFG projects based on the provided filtering and sorting criteria. + + Args: + page (int): The page number. + size (int): The number of items per page. + names (Optional[List[str]], optional): The list of names to search for. Defaults to None. + topic (Optional[str], optional): The topic to search for. Defaults to None. + sort_by (str, optional): The field to sort by. Defaults to "id". + sort_direction (str, optional): The direction to sort. Defaults to "asc". + + Returns: + DfgProjectPage: The search results. + """ + from_ = page * size + + painless_fields_string = ", ".join([f"'{f}.keyword'" for f in DFG_PERSON_FIELDS]) + + body: Dict[str, Any] = { + "size": size, + "from": from_, + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung", + ], + "query": {}, + "script_fields": { + "all_found_names": { + "script": { + "lang": "painless", + "source": ( + f"def names = new HashSet(); " + f"def fields = [{painless_fields_string}]; " + f"for (field in fields) {{ " + f" if (doc.containsKey(field) && !doc[field].empty) {{ " + f" for (value in doc[field]) {{ " + f" if (value.contains(';')) {{ " + f" def splitNames = value.splitOnToken(';'); " + f" for (sn in splitNames) {{ names.add(sn.trim()); }} " + f" }} else {{ " + f" names.add(value.trim()); " + f" }} " + f" }} " + f" }} " + f"}} " + f"return new ArrayList(names);" + ), + } + } + }, + } + + must_clauses: List[Dict[str, Any]] = [] + filter_clauses: List[Dict[str, Any]] = [] + + if topic is not None and topic.strip() != "": + must_clauses.append( + { + "match_phrase_prefix": { + "title": { + "query": topic, + "max_expansions": 100, + } + } + } + ) + + if names: + name_should_clauses = [] + script_conditions = [] + + for full_name in names: + name_parts = full_name.strip().split() + if not name_parts: + continue + + match_musts = [] + for part in name_parts: + match_musts.append( + {"multi_match": {"query": part, "fields": DFG_PERSON_FIELDS}} + ) + + name_should_clauses.append({"bool": {"must": match_musts}}) + + script_parts = [ + f"singlePerson.contains('{part.lower()}')" for part in name_parts + ] + script_conditions.append(f"({' && '.join(script_parts)})") + + if name_should_clauses: + must_clauses.append( + {"bool": {"should": name_should_clauses, "minimum_should_match": 1}} + ) + + combined_script_condition = " || ".join(script_conditions) + painless_source = ( + f"def fields = [{painless_fields_string}]; " + f"for (field in fields) {{ " + f" if (doc.containsKey(field) && !doc[field].empty) {{ " + f" for (value in doc[field]) {{ " + f" if (value.contains(';')) {{ " + f" def splitValues = value.splitOnToken(';'); " + f" for (singlePersonRaw in splitValues) {{ " + f" def singlePerson = singlePersonRaw.toLowerCase(); " + f" if ({combined_script_condition}) {{ return true; }} " + f" }} " + f" }} else {{ " + f" def singlePerson = value.toLowerCase(); " + f" if ({combined_script_condition}) {{ return true; }} " + f" }} " + f" }} " + f" }} " + f"}} " + f"return false;" + ) + + filter_clauses.append( + {"script": {"script": {"lang": "painless", "source": painless_source}}} + ) + + if must_clauses or filter_clauses: + body["query"] = {"bool": {}} + if must_clauses: + body["query"]["bool"]["must"] = must_clauses + if filter_clauses: + body["query"]["bool"]["filter"] = filter_clauses + else: + body["query"] = {"match_all": {}} + + sort_by = sort_by.strip().lower() + sort_direction = sort_direction.strip().lower() + if sort_direction not in ["asc", "desc"]: + sort_direction = "asc" + logger.debug(f"Sorting DFG projects by {sort_by} with direction {sort_direction}") + + if sort_by in ["topic", "title"]: + logger.debug(f"Sorting DFG projects by title with direction {sort_direction}") + sort_config = {"title.keyword": {"order": sort_direction}} + elif sort_by == "funding_start": + logger.debug( + f"Sorting DFG projects by funding_start with direction {sort_direction}" + ) + sort_config = {"funding_start.keyword": {"order": sort_direction}} + elif sort_by == "funding_end": + logger.debug( + f"Sorting DFG projects by funding_end with direction {sort_direction}" + ) + sort_config = {"funding_end.keyword": {"order": sort_direction}} + elif sort_by == "professional_classification": + logger.debug( + f"Sorting DFG projects by Fachliche Zuordnung with direction {sort_direction}" + ) + sort_config = {"Fachliche Zuordnung.keyword": {"order": sort_direction}} + else: + logger.debug(f"Sorting DFG projects by id with direction {sort_direction}") + sort_config = {"id.keyword": {"order": sort_direction}} + + body["sort"] = [sort_config] + + response = elasticsearch.search( + index=ESIndex.PROJECTS_DFG_ALL, + body=body, + ) + return _complete_response_to_dfg_project_page(response, page, size) + + +def _complete_response_to_dfg_project_page( + response: dict, page: int, size: int +) -> DfgProjectPage: + """Converts the raw Elasticsearch response into a DfgProjectPage object. + + Args: + response (dict): The raw Elasticsearch response. + page (int): The page number. + size (int): The number of items per page. + + Returns: + DfgProjectPage: The converted project page object. + """ + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [DfgProjectSummary.from_hit(hit) for hit in hits_block.get("hits", [])] + return DfgProjectPage(elements=elements, total=total_hits, page=page, size=size) + + +def get_dfg_project_by_id(project_id: str) -> Optional[DfgProjectDetails]: + """Fetches the details of a single DFG project based on its project ID. + + Args: + project_id (str): The project ID to fetch. + + Returns: + Optional[DfgProjectDetails]: The project details or None if not found. + """ + query = {"ids": {"values": [project_id]}} + + response = elasticsearch.search( + index=ESIndex.PROJECTS_DFG_ALL, + query=query, + size=1, + ) + hits = response.get("hits", {}).get("hits", []) + + if hits: + hit = hits[0] + details = DfgProjectDetails.from_elastic_hit(hit=hit) + return details + return None + + +# All + + +def search_all_projects( + projects_filtering_properties: ProjectsFilteringProperties, + selected_project_types: Optional[Set[ProjectType]] = None, +) -> FundingProjectPage: + """Searches for projects across all project types based on the provided filtering properties and selected project types. + + Args: + projects_filtering_properties (ProjectsFilteringProperties): The filtering properties for the search. + selected_project_types (Optional[Set[ProjectType]], optional): The set of project types to include in the search. Defaults to None -> includes all project types. + + Raises: + ValueError: If the sorting property is not supported across all project types. + + Returns: + FundingProjectPage: The converted project page object. + """ + sort_by = projects_filtering_properties.sort_by + if sort_by != ProjectsSortBy.TITLE: + raise ValueError( + "Currently only sorting by title is supported across all project types." + ) + + sort_direction = projects_filtering_properties.sort_direction + sort = [ + { + "title.keyword": { + "order": sort_direction, + "missing": "_last", + "unmapped_type": "keyword", + } + }, + { + "Thema.keyword": { + "order": sort_direction, + "missing": "_last", + "unmapped_type": "keyword", + } + }, + ] + + query = None + + if ( + projects_filtering_properties.query + and projects_filtering_properties.query.strip() != "" + ): + title_query = projects_filtering_properties.query.strip() + wildcard_title = f"*{title_query}*" + query = { + "bool": { + "should": [ + { + "wildcard": { + "title.keyword": { + "value": wildcard_title, + "case_insensitive": True, + } + } + }, + { + "wildcard": { + "Thema.keyword": { + "value": wildcard_title, + "case_insensitive": True, + } + } + }, + ], + "minimum_should_match": 1, + } + } + + if not selected_project_types: + selected_project_types = {ProjectType.BUND, ProjectType.EU, ProjectType.DFG} + index = [project_type.to_es_index() for project_type in selected_project_types] + size = projects_filtering_properties.size + page = projects_filtering_properties.page + offset = page * size + response = elasticsearch.search( + index=index, + size=size, + offset=offset, + query=query, + sort=sort, + ) + return _response_to_funding_project_page(response=response, page=page, size=size) + + +def _response_to_funding_project_page( + response: Dict[str, Any], page: int, size: int +) -> FundingProjectPage: + """Converts the raw Elasticsearch response into a FundingProjectPage object. + + Args: + response (Dict[str, Any]): The raw Elasticsearch response. + page (int): The current page number. + size (int): The number of projects per page. + + Returns: + FundingProjectPage: The converted project page object. + """ + hits = response.get("hits", {}).get("hits", []) + projects = [_hit_to_funding_project(hit=hit) for hit in hits] + total = response.get("hits", {}).get("total", {}).get("value", 0) + return FundingProjectPage(elements=projects, total=total, page=page, size=size) + + +def _hit_to_funding_project(hit: Dict[str, Any]) -> FundingProject: + """Converts a single Elasticsearch hit into a FundingProject object based on the index it belongs to. + + Args: + hit (Dict[str, Any]): The Elasticsearch hit to convert. + + Raises: + ValueError: If the hit does not belong to a recognized project index. + + Returns: + FundingProject: The converted funding project object. + """ + if hit.get("_index", "").startswith("cordis_eu_") and hit.get( + "_index", "" + ).endswith("_projects"): + return FundingProject.from_cordis_projects_hit(hit=hit) + elif hit.get("_index") == ESIndex.PROJECTS_BUND_V1.value: + return FundingProject.from_bund_projects_hit(hit=hit) + elif hit.get("_index") == ESIndex.PROJECTS_DFG_ALL.value: + return FundingProject.from_dfg_projects_hit(hit=hit) + else: + raise ValueError( + "The provided hit does not belong to a recognized project index." + ) diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py new file mode 100644 index 00000000..509f5d8b --- /dev/null +++ b/service/src/main/inse/projects/router.py @@ -0,0 +1,303 @@ +from functools import lru_cache +import logging +from typing import Annotated, Optional, Set + +from fastapi import APIRouter, Body, Depends, Path, Query, status + +from inse.projects.model import ( + BundProjectPage, + CordisEuProjectPage, + DfgProjectPage, + EuOrganizationProjectSummaryPage, + FundingProjectPage, + InstitutionFunderSummary, + ProjectType, + ProjectsFilteringProperties, + ProjectsSortBy, + SortDirection, +) +from inse.models.dfg_project_details import DfgProjectDetails +from inse.models.bund_project_details import BundProjectDetails +from inse.tags import Tags +from inse.projects import service as projects_service + +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) +from inse.institutions.router import get_institutions_search_client + +logger = logging.getLogger(__name__) + +router = APIRouter(prefix="/api/projects", tags=[Tags.PROJECTS]) + + +@router.get( + "/author/{raw_oa_author_id}/eu", + summary="Get EU projects for an author.", + description="Returns a list of EU projects associated with the specified author ID.", + operation_id="getEuProjectsForAuthor", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": CordisEuProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Author not found"}, + }, + response_model_by_alias=False, +) +def get_eu_projects_for_author( + raw_oa_author_id: Annotated[str, Path(description="The author ID to filter by.")], +) -> CordisEuProjectPage: + logger.debug( + f"Received request to get EU projects for author_id={raw_oa_author_id}" + ) + return projects_service.search_cordis_eu_projects_for_author_id( + raw_oa_author_id=raw_oa_author_id, + ) + + +@router.post( + "/institution/bund/search", + summary="Get bund projects.", + description="Returns a page of bund projects based on the provided pagination parameters and optional institution filter.", + operation_id="searchBundProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": BundProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def search_bund_projects( + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + filtering_properties: Annotated[ + ProjectsFilteringProperties, + Body(description="The filtering properties for the projects search."), + ], +) -> BundProjectPage: + return projects_service.search_bund_projects( + institutions_search_client=institutions_search_client, + filtering_properties=filtering_properties, + ) + + +@router.get( + "/dfg/{id}", + summary="Get a single DFG project.", + description="Returns a single DFG project based on its ID.", + operation_id="getSingleDfgProject", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": DfgProjectDetails, + }, + status.HTTP_404_NOT_FOUND: {"description": "Project not found"}, + }, + response_model_by_alias=False, +) +def get_single_dfg_project( + id: Annotated[str, Path(description="The ID of the DFG project to retrieve.")], +) -> DfgProjectDetails: + logger.debug(f"Received request to get single DFG project for id={id}") + return projects_service.get_single_dfg_project( + project_id=id, + ) + + +@router.get( + "/bund/{id}", + summary="Get a single BUND project.", + description="Returns a single BUND project based on its ID.", + operation_id="getSingleBundProject", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": BundProjectDetails, + }, + status.HTTP_404_NOT_FOUND: {"description": "Project not found"}, + }, + response_model_by_alias=False, +) +def get_single_bund_project( + id: Annotated[str, Path(description="The ID of the BUND project to retrieve.")], +) -> BundProjectDetails: + logger.debug(f"Received request to get single BUND project for id={id}") + return projects_service.get_single_bund_project( + project_id=id, + ) + + +@router.get( + "/institution/bund/funding-over-time", + summary="Get funding over time for bund projects.", + description="Returns the funding over time for bund projects associated with the specified institution.", + operation_id="getInstitutionBundProjectsFundingOverTime", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": InstitutionFunderSummary, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +def get_institution_bund_projects_funding_over_time( + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + raw_oa_institution_id: Annotated[ + str, Query(description="The institution ID to filter by.") + ], +) -> InstitutionFunderSummary: + return projects_service.get_institution_bund_projects_funding_over_time( + institutions_search_client=institutions_search_client, + raw_oa_institution_id=raw_oa_institution_id, + ) + + +@router.post( + "/institution/eu/search", + summary="Get EU projects.", + description="Returns a page of EU projects based on the provided pagination parameters and optional institution filter.", + operation_id="searchCordisEuProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": EuOrganizationProjectSummaryPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def search_cordis_eu_projects( + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + projects_filtering_properties: Annotated[ + ProjectsFilteringProperties, + Body(description="The filtering properties for the projects search."), + ], +) -> EuOrganizationProjectSummaryPage: + return projects_service.search_cordis_eu_projects( + institutions_search_client=institutions_search_client, + projects_filtering_properties=projects_filtering_properties, + ) + + +@router.get( + "/institution/eu/funding-over-time", + summary="Get funding over time for EU projects.", + description="Returns the funding over time for EU projects associated with the specified institution.", + operation_id="getInstitutionCordisEuProjectsFundingOverTime", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": InstitutionFunderSummary, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def get_institution_cordis_eu_projects_funding_over_time( + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + raw_oa_institution_id: Annotated[ + str, Query(description="The institution ID to filter by.") + ], +) -> InstitutionFunderSummary: + return await projects_service.get_institution_cordis_eu_projects_funding_over_time( + institutions_search_client=institutions_search_client, + raw_oa_institution_id=raw_oa_institution_id, + ) + + +@router.get( + "/person/dfg/search", + summary="Get DFG projects.", + description="Returns a page of DFG projects based on the provided pagination parameters and optional institution filter.", + operation_id="getDfgProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": DfgProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def get_dfg_projects( + author_id: Annotated[str, Query(description="The author ID to filter by.")], + topic: Annotated[ + Optional[str], Query(description="The topic to filter by.") + ] = None, + page: Annotated[int, Query(description="The page number.", ge=0)] = 0, + size: Annotated[int, Query(description="The page size.", ge=1)] = 20, + sort_by: Annotated[str, Query(description="The field to sort by.")] = "topic", + sort_direction: Annotated[ + str, Query(description="The sort direction (asc or desc).") + ] = "asc", +) -> DfgProjectPage: + logger.debug( + "Received request to get DFG projects for author_id=%s, topic=%s, page=%d, size=%d, sort_by=%s, sort_direction=%s", + author_id, + topic, + page, + size, + sort_by, + sort_direction, + ) + return await projects_service.get_dfg_projects_by_author_id( + author_id=author_id, + topic=topic, + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + +@router.get( + "/search", + summary="Search projects across all funders.", + description="Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter.", + operation_id="searchProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": FundingProjectPage, + }, + }, + response_model_by_alias=False, +) +def search_projects( + page: Annotated[int, Query(description="The page number.", ge=0)] = 0, + size: Annotated[int, Query(description="The page size.", ge=1)] = 10, + selected_project_types: Annotated[ + Optional[Set[ProjectType]], + Query( + description="The set of project types to filter by (e.g., 'bund', 'eu', 'dfg'). If not provided, projects of all types will be included." + ), + ] = None, + title: Annotated[ + Optional[str], Query(description="The title to filter by.") + ] = None, + sort_by: Annotated[ + ProjectsSortBy, Query(description="The field to sort by.") + ] = ProjectsSortBy.TITLE, + sort_direction: Annotated[ + SortDirection, Query(description="The sort direction (asc or desc).") + ] = SortDirection.ASC, +) -> FundingProjectPage: + return projects_service.search_all_projects( + page=page, + size=size, + selected_project_types=selected_project_types, + title=title, + sort_by=sort_by, + sort_direction=sort_direction, + ) diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py new file mode 100644 index 00000000..75c72e0e --- /dev/null +++ b/service/src/main/inse/projects/service.py @@ -0,0 +1,349 @@ +import datetime +import logging +from typing import Any, Dict, List, Optional, Set + +from inse.projects import projects_search_client +from inse.projects.projects_search_client import ( + get_eu_organization_project_contributions, +) +from inse.projects.model import ( + BundProjectPage, + CordisEuProjectPage, + DfgProjectPage, + EuOrganizationProjectSummaryPage, + FundingProjectPage, + InstitutionFunderSummary, + ProjectType, + ProjectsFilteringProperties, + ProjectsSortBy, + SortDirection, +) +from inse.models.dfg_project_details import DfgProjectDetails +from inse.models.bund_project_details import BundProjectDetails +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) +from inse.exceptions import NotFoundException +from inse.persons.logic import get_author_name_by_id +from inse.works.logic import get_publication_dois_of_author + + +logger = logging.getLogger(__name__) + + +def search_all_projects( + page: int, + size: int, + sort_by: ProjectsSortBy, + sort_direction: SortDirection, + selected_project_types: Optional[Set[ProjectType]] = None, + title: Optional[str] = None, +) -> FundingProjectPage: + return projects_search_client.search_all_projects( + projects_filtering_properties=ProjectsFilteringProperties( + project_type=ProjectType.EU, # placeholder, shall be ignored in search_all_projects + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + query=title, + ), + selected_project_types=selected_project_types, + ) + + +def search_bund_projects( + institutions_search_client: InstitutionsSearchClient, + filtering_properties: ProjectsFilteringProperties, +) -> BundProjectPage: + if filtering_properties.project_type != "bund": + raise ValueError( + f"Invalid project type: {filtering_properties.project_type}. Expected 'bund'." + ) + + logger.debug( + f"search_bund_projects called with filtering_properties: {filtering_properties}" + ) + + return get_bund_projects_by_institution_id( + institutions_search_client=institutions_search_client, + filtering_properties=filtering_properties, + ) + + +def get_bund_projects_by_institution_id( + institutions_search_client: InstitutionsSearchClient, + filtering_properties: ProjectsFilteringProperties, +) -> BundProjectPage: + if filtering_properties.raw_oa_institution_id is None: + raise ValueError("raw_oa_institution_id must be provided") + + logger.info( + f"Fetching bund projects for institution_id={filtering_properties.raw_oa_institution_id}, page={filtering_properties.page}, size={filtering_properties.size}" + ) + institution_aliases = ( + institutions_search_client.get_institution_aliases_by_oa_institution_id( + filtering_properties.raw_oa_institution_id + ) + ) + logger.debug( + f"get_bund_projects_by_institution_id: Found institution aliases for institution_id={filtering_properties.raw_oa_institution_id}: {institution_aliases}" + ) + response = projects_search_client.search_bund_projects( + institution_names=institution_aliases, + filter_properties=filtering_properties, + ) + logger.debug(f"get_bund_projects_by_institution_id response: {response}") + return response + + +def search_cordis_eu_projects( + institutions_search_client: InstitutionsSearchClient, + projects_filtering_properties: ProjectsFilteringProperties, +) -> EuOrganizationProjectSummaryPage: + if projects_filtering_properties.project_type != "eu": + raise ValueError( + f"Invalid project type: {projects_filtering_properties.project_type}. Expected 'eu'." + ) + + return get_cordis_eu_projects_by_institution_id( + institutions_search_client=institutions_search_client, + projects_filtering_properties=projects_filtering_properties, + ) + + +def get_cordis_eu_projects_by_institution_id( + institutions_search_client: InstitutionsSearchClient, + projects_filtering_properties: ProjectsFilteringProperties, +) -> EuOrganizationProjectSummaryPage: + if not projects_filtering_properties.raw_oa_institution_id: + raise ValueError( + "raw_oa_institution_id must be provided to fetch CORDIS EU projects by institution ID" + ) + + logger.info( + f"Fetching CORDIS EU projects for institution_id={projects_filtering_properties.raw_oa_institution_id}, page={projects_filtering_properties.page}, size={projects_filtering_properties.size}" + ) + institution_aliases = ( + institutions_search_client.get_institution_aliases_by_oa_institution_id( + projects_filtering_properties.raw_oa_institution_id + ) + ) + logger.debug( + f"Found institution aliases for institution_id={projects_filtering_properties.raw_oa_institution_id}: {institution_aliases}" + ) + + page = get_eu_organization_project_contributions( + organization_names=institution_aliases, + projects_filtering_properties=projects_filtering_properties, + ) + + logger.debug(f"get_cordis_eu_projects_by_institution_id response: {page}") + + return page + + +async def get_dfg_projects_by_author_id( + author_id: str, + topic: Optional[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", +) -> DfgProjectPage: + logger.debug( + f"Fetching DFG projects for author_id={author_id}, topic={topic}, page={page}, size={size}, sort_by={sort_by}, sort_direction={sort_direction}" + ) + name = get_author_name_by_id(author_id) + if not name: + logger.debug(f"No author name found for author_id={author_id}") + raise NotFoundException( + f"Display name for author with id {author_id} not found" + ) + logger.debug(f"Found author name for author_id={author_id}: {name}") + + response = projects_search_client.search_dfg_projects( + page=page, + size=size, + names=[name], + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + return response + + +async def get_institution_cordis_eu_projects_funding_over_time( + institutions_search_client: InstitutionsSearchClient, + raw_oa_institution_id: str, +) -> InstitutionFunderSummary: + institution_aliases = ( + institutions_search_client.get_institution_aliases_by_oa_institution_id( + raw_oa_institution_id + ) + ) + page = get_eu_organization_project_contributions( + organization_names=institution_aliases, + projects_filtering_properties=ProjectsFilteringProperties( + project_type=ProjectType.EU, + page=0, + size=10000, + ), + ) + + return _calculate_funding_over_time( + project_type=ProjectType.EU, + projects=page.elements, + funding_start_attr="start_date", + funding_end_attr="end_date", + funding_amount_attr="ec_contribution", + ) + + +def get_institution_bund_projects_funding_over_time( + institutions_search_client: InstitutionsSearchClient, + raw_oa_institution_id: str, +) -> InstitutionFunderSummary: + logger.info( + f"Fetching funding over time for institution_id={raw_oa_institution_id}" + ) + institution_aliases = ( + institutions_search_client.get_institution_aliases_by_oa_institution_id( + raw_oa_institution_id + ) + ) + logger.debug( + f"Found institution aliases for institution_id={raw_oa_institution_id}: {institution_aliases}" + ) + response = projects_search_client.search_bund_projects( + filter_properties=ProjectsFilteringProperties( + project_type=ProjectType.BUND, + page=0, + size=10000, + ), + institution_names=institution_aliases, + ) + + return _calculate_funding_over_time( + project_type=ProjectType.BUND, + projects=response.elements, + funding_start_attr="funding_start", + funding_end_attr="funding_end", + funding_amount_attr="grant_amount", + ) + + +def _calculate_funding_over_time( + project_type: ProjectType, + projects: List[Any], + funding_start_attr: str, + funding_end_attr: str, + funding_amount_attr: str, +) -> InstitutionFunderSummary: + funding_per_year: Dict[int, float] = {} + + for project in projects: + funding_start = getattr(project, funding_start_attr) + funding_end = getattr(project, funding_end_attr) + funding_amount = getattr(project, funding_amount_attr) + if not funding_start or not funding_end or not funding_amount: + continue + + if hasattr(funding_start, "date"): + funding_start = funding_start.date() + if hasattr(funding_end, "date"): + funding_end = funding_end.date() + + delta = (funding_end - funding_start).days + 1 + if delta <= 0: + continue + + amount_per_day = funding_amount / delta + start_year = funding_start.year + end_year = funding_end.year + + for year in range(start_year, end_year + 1): + if year == start_year: + year_start = funding_start + else: + year_start = datetime.date(year, 1, 1) + + if year == end_year: + year_end = funding_end + else: + year_end = datetime.date(year, 12, 31) + + days_in_year = (year_end - year_start).days + 1 + proportional_share = days_in_year * amount_per_day + + funding_per_year[year] = ( + funding_per_year.get(year, 0.0) + proportional_share + ) + + sorted_funding_per_year: Dict[int, float] = {} + + if funding_per_year: + min_year = min(funding_per_year.keys()) + max_year = max(funding_per_year.keys()) + + for year in range(min_year, max_year + 1): + sorted_funding_per_year[year] = funding_per_year.get(year, 0.0) + + total_sum = sum(sorted_funding_per_year.values()) + annual_average_over_period = total_sum / len(sorted_funding_per_year) + else: + annual_average_over_period = 0.0 + + return InstitutionFunderSummary( + type=project_type, + funding_per_year=sorted_funding_per_year, + annual_average_over_period=annual_average_over_period, + ) + + +def get_single_dfg_project( + project_id: str, +) -> DfgProjectDetails: + logger.debug(f"Fetching single DFG project for id={project_id}") + + project = projects_search_client.get_dfg_project_by_id(project_id) + if not project: + raise NotFoundException(f"DFG project with id {project_id} not found") + return project + + +def get_single_bund_project( + project_id: str, +) -> BundProjectDetails: + logger.debug(f"Fetching single BUND project for id={project_id}") + + project = projects_search_client.get_bund_project_by_id(project_id) + if not project: + raise NotFoundException(f"BUND project with id {project_id} not found") + return project + + +def search_cordis_eu_projects_for_author_id( + raw_oa_author_id: str, +) -> CordisEuProjectPage: + + # Direct search not possible -> multi stage search + # 1. Exisiting author has publications with DOIs + # 2. CORDIS EU projects have associated publications with DOIs + # 3. Matching DOIs of author publications with DOIs of CORDIS EU project publications -> projects with associated publications of the author + + dois = get_publication_dois_of_author(raw_oa_author_id=raw_oa_author_id) + + logger.debug(f"Found DOIs for author_id={raw_oa_author_id}: {dois}") + + project_ids = projects_search_client.get_cordis_eu_project_ids_by_dois(dois=dois) + + logger.debug( + f"Found project IDs {project_ids} for author_id={raw_oa_author_id} and dois={dois}" + ) + + funding_project_page = projects_search_client.get_cordis_eu_projects_by_project_ids( + project_ids=project_ids + ) + + return funding_project_page diff --git a/service/src/main/inse/search/__init__.py b/service/src/main/inse/search/__init__.py deleted file mode 100644 index 40a96afc..00000000 --- a/service/src/main/inse/search/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# -*- coding: utf-8 -*- diff --git a/service/src/main/inse/search/logic.py b/service/src/main/inse/search/logic.py deleted file mode 100644 index 536efb1b..00000000 --- a/service/src/main/inse/search/logic.py +++ /dev/null @@ -1,134 +0,0 @@ -# -*- coding: utf-8 -*- -import logging -import hashlib -from typing import List, Optional -import httpx -from fastapi import HTTPException -from inse.search.query_builder import build_authors_search - -from inse import util -from inse.integrations import elasticsearch as es_integration -from inse.models.author import Author -from inse.models.meta import Meta -from inse.search.model import CustomAuthor, CustomAuthorsListResponse - -logger = logging.getLogger(__name__) -INDEX_NAME = "openalex-authors" - -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 "" - - h = int(hashlib.md5(author_id.encode('utf-8')).hexdigest(), 16) - - - # Experimental suitability rating - 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 (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) - 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, - strict: Optional[bool] = False, -) -> CustomAuthorsListResponse: - try: - query_body = build_authors_search( - query=query, - institution_name=institution_name, - topics=topics, - page=page, - page_size=page_size, - include=include, - strict=strict, - ) - response_dict = es_integration.search( - index=INDEX_NAME, - body=query_body, - ) - except httpx.HTTPStatusError as e: - if e.response.status_code == 404: - logger.warning(f"Elasticsearch index '{INDEX_NAME}' not found.") - return CustomAuthorsListResponse( - results=[], - meta=Meta( - count=0, - page=page, - per_page=page_size - ) - ) - elif e.response.status_code == 400: - logger.error(f"Elasticsearch request error: {str(e)}") - raise HTTPException( - status_code=400, detail=f"Elasticsearch request error: {str(e)}" - ) - else: - logger.error(f"Elasticsearch API error: {str(e)}") - raise HTTPException( - status_code=500, detail=f"Elasticsearch API error: {str(e)}" - ) - except httpx.RequestError as e: - logger.error(f"Elasticsearch connection/request error: {str(e)}") - raise HTTPException( - status_code=500, detail=f"Elasticsearch connection/request error: {str(e)}" - ) - 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_dict.get("hits", {}).get("hits", []) - total_count = response_dict.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 deleted file mode 100644 index 6d04a644..00000000 --- a/service/src/main/inse/search/model.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- 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/query_builder.py b/service/src/main/inse/search/query_builder.py deleted file mode 100644 index e882abcd..00000000 --- a/service/src/main/inse/search/query_builder.py +++ /dev/null @@ -1,154 +0,0 @@ -# -*- coding: utf-8 -*- -from typing import List, Optional, Set, Any - -def build_authors_search( - using: Any = None, - index: Optional[str] = None, - 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, - strict: Optional[bool] = False, -) -> dict: - """ - Builds an Elasticsearch search request query body for authors as a dictionary. - """ - # 1. Build Query Clauses - query_clause = None - if query: - query_clause = { - "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 - } - } - - # 2. Build Filters - filter_clauses = [] - if institution_name: - if strict: - from datetime import datetime - current_year = datetime.now().year - target_year = current_year - 1 - - filter_clauses.append({ - "nested": { - "path": "affiliations", - "query": { - "bool": { - "filter": [ - { - "match_phrase": { - "affiliations.institution.display_name": institution_name - } - }, - { - "range": { - "affiliations.years": { - "gte": target_year - } - } - } - ] - } - } - } - }) - else: - 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 - } - } - } - }) - - # Combine query and filters - body = {} - if query_clause: - if filter_clauses: - body["query"] = { - "bool": { - "must": [query_clause], - "filter": filter_clauses - } - } - else: - body["query"] = query_clause - else: - if filter_clauses: - body["query"] = { - "bool": { - "filter": filter_clauses - } - } - else: - body["query"] = { - "match_all": {} - } - - # 3. Source Filtering - if include: - body["_source"] = list(include) - else: - body["_source"] = True - - # 4. Pagination - es_size = page_size - es_from = (page - 1) * page_size - body["from"] = es_from - body["size"] = es_size - - # 5. Sorting - if not query: - body["sort"] = [ - {"cited_by_count": {"order": "desc"}}, - {"works_count": {"order": "desc"}} - ] - - return body - diff --git a/service/src/main/inse/search/service.py b/service/src/main/inse/search/service.py deleted file mode 100644 index 8d6227ce..00000000 --- a/service/src/main/inse/search/service.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- 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, - strict: Annotated[ - Optional[bool], Query(description="Strict institution search by target year") - ] = False, -): - 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, - strict=strict, - ) diff --git a/service/src/main/inse/service.py b/service/src/main/inse/service.py index 108dcd3a..6e3dadc5 100644 --- a/service/src/main/inse/service.py +++ b/service/src/main/inse/service.py @@ -27,12 +27,8 @@ from . import schema from . import database from . import security from . import util -from .works import service as works_service -from .funders import service as funders_service -from inse.models.authors_list_response import AuthorsListResponse - logger = logging.getLogger(__name__) @@ -46,8 +42,6 @@ router = APIRouter( responses={404: {"description": "Not found"}}, ) -router.include_router(funders_service.router) - # @app.get("/", include_in_schema=False) # async def show_api(): # return RedirectResponse("api") @@ -215,141 +209,12 @@ def count_topic_hierarchy( ): return logic.count_topic_hierarchy(topic_names) - -### persons - - @router.get( - "/persons/search", - operation_id="searchPersons", - response_model=AuthorsListResponse, - summary="Searches for persons by ID or name.", - response_model_exclude_none=True, - tags=["Persons"], + "/topics/hierarchy", + operation_id="getTopicHierarchy", + response_model=dict, + summary="Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics).", + tags=["Topics"], ) -def search_persons( - author_id: Annotated[ - Optional[str], Query(description="OpenAlex author ID (e.g., A5093075883)") - ] = None, - query: Annotated[ - Optional[str], Query(description="Search query (e.g., Arman AND Arzani)") - ] = None, - include: Annotated[ - Optional[str], - Query( - description=( - "Comma-separated include tags: topics_full, topic_share, summary_stats, ids, " - "last_known_institutions, sources, counts_by_year, works_api_url, dates, " - "cited_by_count_boost" - ), - 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.search_persons(author_id, query, include_set) - - -@router.get( - "/persons/bio", - operation_id="generatePersonBio", - response_model=model.PersonBio, - summary="Generates a bio for a person by author ID.", - tags=["Persons"], -) -def generate_person_bio( - author_id: Annotated[ - str, Query(description="OpenAlex author ID (e.g., A5093075883)") - ], - include: Annotated[ - Optional[str], - Query( - description=("Comma-separated list to 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 - ) - bio = logic.generate_person_bio(author_id, include_set) - return model.PersonBio(bio=bio) - - -@router.get( - "/person/{id}", - operation_id="getPersonByID", - response_model=AuthorsListResponse, - summary="Searches for person by ID.", - tags=["Persons"], -) -def get_person_by_id( - id: Annotated[ - str, Path(description="OpenAlex author ID", examples=["A5093075883"]) - ], - include: Annotated[ - Optional[str], - Query( - description=( - "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " - "last_known_institutions, ..." - ), - example="topics_full,topic_share", - ), - ], -): - return logic.get_person_by_id(author_id=id, include=include) - - -@router.get( - "/persons/searchByName", - operation_id="searchPersonsByName", - response_model=AuthorsListResponse, - summary="Searches for person by name.", - tags=["Persons"], -) -def search_persons_by_name( - author_name: Annotated[str, Query(description="Authors name (e.g., Arman Arzani)")], - include: Annotated[ - Optional[str], - Query( - description=( - "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " - "last_known_institutions, ..." - ), - example="topics_full,topic_share", - ), - ], -): - return logic.search_persons_by_name(author_name=author_name, include=include) - - -@router.get( - "/persons/searchByInstitution", - operation_id="searchPersonsByInstitution", - response_model=AuthorsListResponse, - summary="Searches for persons by institution name.", - tags=["Persons"], -) -def search_persons_by_institution( - institution_name: Annotated[ - str, Query(description="Institution name (e.g., MIT, Oxford University)") - ], - include: Annotated[ - Optional[str], - Query( - description=( - "Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, " - "last_known_institutions, ..." - ), - example="topics_full,topic_share", - ), - ], -): - return logic.search_persons_by_institution(institution_name, include=include) +def get_topic_hierarchy(): + return logic.get_topic_hierarchy() diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 219152ad..bd0b79c0 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -4,4 +4,8 @@ from enum import Enum class Tags(Enum): PERSON = "Person" PERSON_NETWORK = "Person Network" - WORKS = "Works" \ No newline at end of file + INSTITUTIONS = "Institutions" + TOPICS = "Topics" + WORKS = "Works" + NEWS = "News" + PROJECTS = "Projects" diff --git a/service/src/main/inse/topics/__init__.py b/service/src/main/inse/topics/__init__.py new file mode 100644 index 00000000..6909a227 --- /dev/null +++ b/service/src/main/inse/topics/__init__.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +OpenAlex topics module. +""" diff --git a/service/src/main/inse/topics/logic.py b/service/src/main/inse/topics/logic.py new file mode 100644 index 00000000..244f70c8 --- /dev/null +++ b/service/src/main/inse/topics/logic.py @@ -0,0 +1,396 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Business logic for OpenAlex topics. +""" +import logging +from copy import deepcopy +from typing import Any + +import httpx +from fastapi import HTTPException +from pydantic import ValidationError +from starlette.status import HTTP_400_BAD_REQUEST +from starlette.status import HTTP_502_BAD_GATEWAY + +from inse.models.openalex.autocomplete_response import AutocompleteResponse +from inse.models.openalex.autocomplete_response_meta import AutocompleteResponseMeta +from inse.models.openalex.autocomplete_response_results_inner import ( + AutocompleteResponseResultsInner, +) +from inse.models.openalex.topics_list_response import TopicsListResponse +from .search_client import OpenAlexTopicsClient + +logger = logging.getLogger(__name__) + + +async def list_topics( + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + client: OpenAlexTopicsClient | None = None, +) -> TopicsListResponse: + if sample is not None and (sort or page not in (None, 1)): + raise HTTPException( + status_code=HTTP_400_BAD_REQUEST, + detail="sample cannot be combined with sort or page.", + ) + + openalex_client = client or OpenAlexTopicsClient() + + try: + data = await openalex_client.list_topics( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ) + except httpx.HTTPStatusError as exc: + status_code = exc.response.status_code + detail = "OpenAlex topics request failed." + try: + error_body = exc.response.json() + detail = error_body.get("message") or error_body.get("error") or detail + except ValueError: + if exc.response.text: + detail = exc.response.text + raise HTTPException(status_code=status_code, detail=detail) from exc + except httpx.HTTPError as exc: + logger.exception("OpenAlex topics request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex topics request failed.", + ) from exc + + try: + normalized_data = _normalize_topics_response(data) + return TopicsListResponse.from_dict(normalized_data) or TopicsListResponse() + except ValidationError as exc: + logger.exception("OpenAlex topics response could not be parsed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex topics response could not be parsed.", + ) from exc + + +async def autocomplete_topics( + *, + query: str, + domain_id: str | None = None, + field_id: str | None = None, + subfield_id: str | None = None, + limit: int = 10, + client: OpenAlexTopicsClient | None = None, +) -> AutocompleteResponse: + filters = [] + if domain_id: + filters.append(f"domain.id:{domain_id}") + if field_id: + filters.append(f"field.id:{field_id}") + if subfield_id: + filters.append(f"subfield.id:{subfield_id}") + + response = await list_topics( + search=query, + filter=",".join(filters) if filters else None, + sort="works_count:desc", + per_page=limit, + page=1, + select=( + "id,display_name,description,keywords,subfield,field,domain," + "works_count,cited_by_count,ids" + ), + client=client, + ) + + results = [] + for topic in response.results or []: + if not topic.id or not topic.display_name: + continue + + hint_parts = [] + if topic.var_field and topic.var_field.display_name: + hint_parts.append(topic.var_field.display_name) + if topic.subfield and topic.subfield.display_name: + hint_parts.append(topic.subfield.display_name) + if topic.domain and topic.domain.display_name: + hint_parts.append(topic.domain.display_name) + + results.append( + AutocompleteResponseResultsInner( + id=topic.id, + display_name=topic.display_name, + hint=" · ".join(hint_parts) if hint_parts else topic.description, + cited_by_count=topic.cited_by_count, + works_count=topic.works_count, + entity_type="topic", + external_id=topic.ids.openalex if topic.ids else None, + ) + ) + + return AutocompleteResponse( + meta=AutocompleteResponseMeta( + count=response.meta.count if response.meta else len(results), + db_response_time_ms=( + response.meta.db_response_time_ms if response.meta else None + ), + ), + results=results, + ) + + +def _normalize_topics_response(data: dict[str, Any]) -> dict[str, Any]: + normalized = deepcopy(data) + + meta = normalized.get("meta") + if isinstance(meta, dict): + for field in ["count", "db_response_time_ms", "page", "per_page", "groups_count"]: + meta[field] = _int_or_none(meta.get(field)) + meta["next_cursor"] = _str_or_none(meta.get("next_cursor")) + meta["cost_usd"] = _number_or_none(meta.get("cost_usd")) + + for topic in normalized.get("results") or []: + if not isinstance(topic, dict): + continue + + for field in ["id", "display_name", "description", "works_api_url"]: + topic[field] = _str_or_none(topic.get(field)) + topic["keywords"] = _str_list_or_none(topic.get("keywords")) + topic["works_count"] = _int_or_none(topic.get("works_count")) + topic["cited_by_count"] = _int_or_none(topic.get("cited_by_count")) + topic["created_date"] = _date_str_or_none(topic.get("created_date")) + topic["updated_date"] = _datetime_str_or_none(topic.get("updated_date")) + + for relation_field in ["subfield", "field", "domain"]: + relation = topic.get(relation_field) + if not isinstance(relation, dict): + continue + relation["id"] = _str_or_none(relation.get("id")) + relation["display_name"] = _str_or_none(relation.get("display_name")) + + ids = topic.get("ids") + if isinstance(ids, dict): + for field in ["openalex", "wikipedia"]: + ids[field] = _str_or_none(ids.get(field)) + + for group in normalized.get("group_by") or []: + if not isinstance(group, dict): + continue + + group["key"] = _str_or_none(group.get("key")) + group["key_display_name"] = _str_or_none(group.get("key_display_name")) + group["count"] = _int_or_none(group.get("count")) + + return normalized + + +def _str_or_none(value: Any) -> str | None: + if value is None: + return None + if isinstance(value, bool): + return str(value).lower() + return str(value) + + +def _str_list_or_none(value: Any) -> list[str] | None: + if value is None: + return None + if not isinstance(value, list): + return None + return [_str_or_none(item) for item in value if item is not None] + + +def _int_or_none(value: Any) -> int | None: + if value is None or isinstance(value, bool): + return None + if isinstance(value, int): + return value + if isinstance(value, float): + return int(value) + if isinstance(value, str): + try: + return int(float(value)) + except ValueError: + return None + return None + + +def _number_or_none(value: Any) -> int | float | None: + if value is None or isinstance(value, bool): + return None + if isinstance(value, (int, float)): + return value + if isinstance(value, str): + try: + number = float(value) + except ValueError: + return None + return int(number) if number.is_integer() else number + return None + + +def _date_str_or_none(value: Any) -> str | None: + text = _str_or_none(value) + if not text: + return None + return text[:10] + + +def _datetime_str_or_none(value: Any) -> str | None: + text = _str_or_none(value) + if not text: + return None + if len(text) == 10: + return f"{text}T00:00:00Z" + return text + +# Configuration for vector search similarity thresholds and boosts +SIMILARITY_THRESHOLD = 0.8 # intfloat/multilingual-e5-base uses cosine similarity between 0.7 - 1 +BOOST_LEXICAL = 1.0 +# higher values for semantic weights, because cosine similarity is between 0 and 1 +BOOST_DISPLAY_NAME_VECTOR = 30.0 +BOOST_KEYWORD_VECTORS = 25.0 + +# Approximate Nearest Neighbor (ANN) => higher values = slower but more accurate (nested Keyword vectors require more) +K = 500 +NUM_CANDIDATES = 500 + +async def vector_search_topics( + *, + query: str, + limit: int = 25, + search_type: str = "hybrid", +) -> TopicsListResponse: + """ + Perform a semantic similarity search on the topicvectors index. + """ + try: + from inse.integrations import elasticsearch + from inse.util import get_model + + except Exception as exc: + logger.exception("Failed to load elasticsearch integration.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Failed to load elasticsearch integration: {exc}" + ) + + # 1. Vectorize query + try: + model = get_model() + query_vector = model.encode(query).tolist() + except Exception as exc: + logger.exception("Failed to encode query text.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Failed to encode query text: {exc}" + ) + + # 2. Query Elasticsearch using standard Bool Should hybrid search + should_clauses = [] + + # Lexical multi_match search (only in hybrid mode) + if search_type == "hybrid": + should_clauses.append({ + "multi_match": { + "query": query, + "fields": [ + "display_name^3", + "keywords^2" + ], + "boost": BOOST_LEXICAL + } + }) + + # Semantic KNN clauses + should_clauses.extend([ + { + "knn": { + "field": "display_name_vector", + "query_vector": query_vector, + "similarity": SIMILARITY_THRESHOLD, + "boost": BOOST_DISPLAY_NAME_VECTOR, + "k": K, + "num_candidates": NUM_CANDIDATES + } + }, + { + "nested": { + "path": "keyword_vectors", + "query": { + "knn": { + "field": "keyword_vectors.vector", + "query_vector": query_vector, + "similarity": SIMILARITY_THRESHOLD, + "k": K, + "num_candidates": NUM_CANDIDATES + } + }, + "score_mode": "max", + "boost": BOOST_KEYWORD_VECTORS + } + } + ]) + + body = { + "query": { + "bool": { + "should": should_clauses + } + }, + "_source": { + "excludes": ["display_name_vector", "keyword_vectors", "works_api_url", "updated_date", "created_date", "_index" ] # remove unrequired fields + }, + "size": limit + } + + try: + raw_results = elasticsearch.search( + index="topicvectors", + body=body, + cluster="nes" + ) + except Exception as exc: + logger.exception("Elasticsearch vector search failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail=f"Elasticsearch vector search failed: {exc}" + ) + + # 3. Format result + hits = raw_results.get("hits", {}).get("hits", []) + + total = len(hits) + results = [hit.get("_source", {}) for hit in hits] + + data = { + "meta": { + "count": total, + "page": 1, + "per_page": limit + }, + "results": results + } + + try: + normalized_data = _normalize_topics_response(data) + return TopicsListResponse.from_dict(normalized_data) or TopicsListResponse() + except ValidationError as exc: + logger.exception("Vector search response could not be parsed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="Vector search response could not be parsed.", + ) from exc + diff --git a/service/src/main/inse/topics/search_client.py b/service/src/main/inse/topics/search_client.py new file mode 100644 index 00000000..7c70afa0 --- /dev/null +++ b/service/src/main/inse/topics/search_client.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +HTTP client for OpenAlex topics. +""" +from typing import Any + +import httpx + +from .. import config + + +class OpenAlexTopicsClient: + def __init__( + self, + base_url: str | None = None, + api_key: str | None = None, + timeout: float | None = None, + transport: httpx.AsyncBaseTransport | None = None, + ): + self.base_url = (base_url or config.settings.openalex_api_base_url).rstrip("/") + self.api_key = api_key if api_key is not None else config.settings.openalex_api_key + self.timeout = ( + timeout + if timeout is not None + else config.settings.openalex_api_timeout_seconds + ) + self.transport = transport + + def list_topics_params( + self, + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + ) -> dict[str, Any]: + params: dict[str, Any] = {"per_page": per_page} + + if search: + params["search"] = search + if filter: + params["filter"] = filter + if sort: + params["sort"] = sort + if group_by: + params["group_by"] = group_by + if cursor: + params["cursor"] = cursor + elif page is not None: + params["page"] = page + if sample is not None: + params["sample"] = sample + if select: + params["select"] = select + if self.api_key: + params["api_key"] = self.api_key + + return params + + async def list_topics( + self, + *, + search: str | None = None, + filter: str | None = None, + sort: str | None = None, + group_by: str | None = None, + per_page: int = 25, + page: int | None = 1, + cursor: str | None = None, + sample: int | None = None, + select: str | None = None, + ) -> dict[str, Any]: + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.get( + "/topics", + params=self.list_topics_params( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ), + ) + response.raise_for_status() + return response.json() diff --git a/service/src/main/inse/topics/service.py b/service/src/main/inse/topics/service.py new file mode 100644 index 00000000..50c69fbc --- /dev/null +++ b/service/src/main/inse/topics/service.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +REST API for OpenAlex topics. +""" +from typing import Annotated + +from fastapi import APIRouter +from fastapi import Query + +from inse.models.openalex.autocomplete_response import AutocompleteResponse +from inse.models.openalex.topics_list_response import TopicsListResponse +from inse.tags import Tags +from . import logic + + +router = APIRouter(prefix="/api/topics", tags=[Tags.TOPICS]) + + +@router.get( + "/autocomplete", + operation_id="autocompleteTopics", + response_model=AutocompleteResponse, + response_model_exclude_none=True, + summary="Returns topic options for autocomplete inputs.", +) +async def autocomplete_topics( + query: Annotated[ + str, + Query(description="Topic search text, for example 'machine learning'.", min_length=1), + ], + domain_id: Annotated[ + str | None, + Query(alias="domainId", description="Optional OpenAlex domain id filter."), + ] = None, + field_id: Annotated[ + str | None, + Query(alias="fieldId", description="Optional OpenAlex field id filter."), + ] = None, + subfield_id: Annotated[ + str | None, + Query(alias="subfieldId", description="Optional OpenAlex subfield id filter."), + ] = None, + limit: Annotated[ + int, + Query(description="Maximum number of autocomplete options.", ge=1, le=25), + ] = 10, +): + return await logic.autocomplete_topics( + query=query, + domain_id=domain_id, + field_id=field_id, + subfield_id=subfield_id, + limit=limit, + ) + + +@router.get( + "", + operation_id="listTopics", + response_model=TopicsListResponse, + response_model_exclude_none=True, + summary="Returns a list of OpenAlex topics.", +) +async def list_topics( + search: Annotated[ + str | None, + Query(description="Full-text search, for example 'machine learning'."), + ] = None, + filter: Annotated[ + str | None, + Query(description="OpenAlex filter, for example 'domain.id:1,works_count:>1000'."), + ] = None, + sort: Annotated[ + str | None, + Query(description="Sort field, for example 'works_count:desc'."), + ] = "works_count:desc", + group_by: Annotated[ + str | None, + Query(description="OpenAlex group_by field, for example 'domain.id'."), + ] = None, + per_page: Annotated[ + int, + Query(description="Results per page.", ge=1, le=100), + ] = 25, + page: Annotated[ + int | None, + Query(description="Page number. Use cursor for deep pagination.", ge=1), + ] = 1, + cursor: Annotated[ + str | None, + Query(description="Cursor pagination token. Use '*' to start."), + ] = None, + sample: Annotated[ + int | None, + Query(description="Random sample size. Cannot be combined with sort or page.", ge=1, le=10000), + ] = None, + select: Annotated[ + str | None, + Query(description="Comma-separated fields to return."), + ] = None, +): + return await logic.list_topics( + search=search, + filter=filter, + sort=sort, + group_by=group_by, + per_page=per_page, + page=page, + cursor=cursor, + sample=sample, + select=select, + ) + + +@router.get( + "/vector-search", + operation_id="vectorSearchTopics", + response_model=TopicsListResponse, + response_model_exclude_none=True, + summary="Semantic / vector search for topics using a keyword/sentence.", +) +async def vector_search_topics( + query: Annotated[ + str, + Query(description="Word or sentence to search by similarity.", min_length=1), + ], + limit: Annotated[ + int, + Query(description="Maximum number of topics to return.", ge=1, le=100), + ] = 25, + search_type: Annotated[ + str, + Query(alias="searchType", description="Search approach: 'hybrid' or 'semantic'."), + ] = "hybrid", +): + return await logic.vector_search_topics( + query=query, + limit=limit, + search_type=search_type, + ) + diff --git a/service/src/main/inse/topics/test_logic.py b/service/src/main/inse/topics/test_logic.py new file mode 100644 index 00000000..e6f9a3a4 --- /dev/null +++ b/service/src/main/inse/topics/test_logic.py @@ -0,0 +1,195 @@ +import httpx +import pytest +from fastapi import HTTPException + +from inse.topics import logic +from inse.topics.search_client import OpenAlexTopicsClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +@pytest.mark.anyio +async def test_list_topics_maps_openalex_response_to_model(): + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "page": 1, "per_page": 25}, + "results": [ + { + "id": "https://openalex.org/T12419", + "display_name": "Machine learning", + "description": "Methods that learn from data.", + "keywords": ["machine learning", "classification"], + "subfield": { + "id": "https://openalex.org/subfields/1702", + "display_name": "Artificial Intelligence", + }, + "field": { + "id": "https://openalex.org/fields/17", + "display_name": "Computer Science", + }, + "domain": { + "id": "https://openalex.org/domains/4", + "display_name": "Physical Sciences", + }, + "works_count": 123, + "cited_by_count": 456, + "ids": { + "openalex": "https://openalex.org/T12419", + "wikipedia": "https://en.wikipedia.org/wiki/Machine_learning", + }, + "works_api_url": "https://api.openalex.org/works?filter=topics.id:T12419", + "created_date": "2023-12-25", + "updated_date": "2023-11-07T05:31:56Z", + } + ], + "group_by": [ + { + "key": "https://openalex.org/domains/4", + "key_display_name": "Physical Sciences", + "count": 1, + } + ], + }, + ) + + client = OpenAlexTopicsClient( + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await logic.list_topics(search="machine learning", client=client) + + assert result.meta.count == 1 + topic = result.results[0] + assert topic.display_name == "Machine learning" + assert topic.var_field.display_name == "Computer Science" + assert topic.subfield.display_name == "Artificial Intelligence" + assert topic.domain.display_name == "Physical Sciences" + assert topic.ids.openalex == "https://openalex.org/T12419" + assert result.group_by[0].key_display_name == "Physical Sciences" + + +@pytest.mark.anyio +async def test_list_topics_rejects_sample_with_sort(): + with pytest.raises(HTTPException) as exc_info: + await logic.list_topics(sample=10, sort="works_count:desc") + + assert exc_info.value.status_code == 400 + + +@pytest.mark.anyio +async def test_list_topics_accepts_practical_openalex_type_variants(): + def handler(_: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "meta": {"count": "1", "page": "1", "per_page": "25"}, + "results": [ + { + "id": 123, + "display_name": 456, + "description": True, + "keywords": ["topic", 123], + "subfield": {"id": 1, "display_name": 2}, + "field": {"id": 3, "display_name": 4}, + "domain": {"id": 5, "display_name": 6}, + "works_count": "12.0", + "cited_by_count": False, + "ids": {"openalex": 123, "wikipedia": 456}, + "created_date": "2023-12-25T10:11:12Z", + "updated_date": "2023-12-25", + } + ], + "group_by": [{"key": True, "count": "1"}], + }, + ) + + client = OpenAlexTopicsClient( + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await logic.list_topics(client=client) + + topic = result.results[0] + assert topic.id == "123" + assert topic.display_name == "456" + assert topic.description == "true" + assert topic.keywords == ["topic", "123"] + assert topic.works_count == 12 + assert topic.cited_by_count is None + assert topic.var_field.id == "3" + assert topic.domain.display_name == "6" + assert topic.ids.wikipedia == "456" + assert topic.created_date.isoformat() == "2023-12-25" + assert topic.updated_date.isoformat() == "2023-12-25T00:00:00+00:00" + assert result.group_by[0].key == "true" + + +@pytest.mark.anyio +async def test_autocomplete_topics_returns_frontend_options(): + def handler(request: httpx.Request) -> httpx.Response: + assert request.url.params["search"] == "machine learning" + assert request.url.params["filter"] == ( + "domain.id:https://openalex.org/domains/4," + "field.id:https://openalex.org/fields/17," + "subfield.id:https://openalex.org/subfields/1702" + ) + assert request.url.params["sort"] == "works_count:desc" + assert request.url.params["per_page"] == "5" + assert request.url.params["select"] == ( + "id,display_name,description,keywords,subfield,field,domain," + "works_count,cited_by_count,ids" + ) + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "db_response_time_ms": 12}, + "results": [ + { + "id": "https://openalex.org/T12419", + "display_name": "Machine learning", + "description": "Methods that learn from data.", + "field": {"display_name": "Computer Science"}, + "subfield": {"display_name": "Artificial Intelligence"}, + "domain": {"display_name": "Physical Sciences"}, + "works_count": 123, + "cited_by_count": 456, + "ids": {"openalex": "https://openalex.org/T12419"}, + } + ], + }, + ) + + client = OpenAlexTopicsClient( + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await logic.autocomplete_topics( + query="machine learning", + domain_id="https://openalex.org/domains/4", + field_id="https://openalex.org/fields/17", + subfield_id="https://openalex.org/subfields/1702", + limit=5, + client=client, + ) + + assert result.meta.count == 1 + assert result.meta.db_response_time_ms == 12 + assert len(result.results) == 1 + option = result.results[0] + assert option.id == "https://openalex.org/T12419" + assert option.display_name == "Machine learning" + assert option.hint == ( + "Computer Science · Artificial Intelligence · Physical Sciences" + ) + assert option.works_count == 123 + assert option.cited_by_count == 456 + assert option.entity_type == "topic" + assert option.external_id == "https://openalex.org/T12419" diff --git a/service/src/main/inse/topics/test_search_client.py b/service/src/main/inse/topics/test_search_client.py new file mode 100644 index 00000000..69c16a82 --- /dev/null +++ b/service/src/main/inse/topics/test_search_client.py @@ -0,0 +1,75 @@ +import httpx +import pytest + +from inse.topics.search_client import OpenAlexTopicsClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +def test_list_topics_params_include_openalex_query_parameters(): + client = OpenAlexTopicsClient(api_key="test-key") + + params = client.list_topics_params( + search="machine learning", + filter="domain.id:4,works_count:>1000", + sort="works_count:desc", + group_by="domain.id", + per_page=10, + page=2, + select="id,display_name", + ) + + assert params == { + "search": "machine learning", + "filter": "domain.id:4,works_count:>1000", + "sort": "works_count:desc", + "group_by": "domain.id", + "per_page": 10, + "page": 2, + "select": "id,display_name", + "api_key": "test-key", + } + + +def test_list_topics_params_prefers_cursor_over_page(): + client = OpenAlexTopicsClient(api_key="test-key") + + params = client.list_topics_params(cursor="*", page=3) + + assert params["cursor"] == "*" + assert "page" not in params + + +@pytest.mark.anyio +async def test_list_topics_calls_openalex_topics_endpoint(): + def handler(request: httpx.Request) -> httpx.Response: + assert request.method == "GET" + assert request.url.path == "/topics" + assert request.url.params["search"] == "machine learning" + assert request.url.params["api_key"] == "test-key" + return httpx.Response( + 200, + json={ + "meta": {"count": 1, "page": 1, "per_page": 25}, + "results": [ + { + "id": "https://openalex.org/T12419", + "display_name": "Machine learning", + } + ], + }, + ) + + client = OpenAlexTopicsClient( + base_url="https://api.openalex.org", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await client.list_topics(search="machine learning") + + assert result["meta"]["count"] == 1 + assert result["results"][0]["display_name"] == "Machine learning" diff --git a/service/src/main/inse/university_ranking/logic.py b/service/src/main/inse/university_ranking/logic.py new file mode 100644 index 00000000..bd1e58f9 --- /dev/null +++ b/service/src/main/inse/university_ranking/logic.py @@ -0,0 +1,113 @@ +import logging +from typing import List, Dict, Any +from .model import UniversityTopicData, YearlyData, UniversityRanking, ResearchTopic, DashboardMetric, RankingResponse +from inse.integrations import elasticsearch + +logger = logging.getLogger(__name__) + +START_YEAR = 2015 +END_YEAR = 2026 + +async def get_ranking_data(topic: ResearchTopic, metric: DashboardMetric) -> RankingResponse: + """ + Fetches real data from Elasticsearch and computes metrics for the dashboard. + """ + query = { + "bool": { + "must": [ + { + "match_phrase": { + "topics.display_name": topic + } + }, + { + "term": { + "geo.country_code": "DE" + } + } + ] + } + } + + + # Fetch top institutions for the topic by works_count + res = elasticsearch.search( + index="openalex-institutions", + query=query, + size=10, + sort=[{"works_count": "desc"}], + cluster="nes" + ) + + hits = res.get("hits", {}).get("hits", []) + timeseries: List[UniversityTopicData] = [] + + for hit in hits: + source = hit["_source"] + # Map the counts_by_year from ES to our model + # We ensure every year from START_YEAR to END_YEAR is present, defaulting to 0 + es_counts = {c["year"]: c for c in source.get("counts_by_year", [])} + + yearly_data = [] + for year in range(START_YEAR, END_YEAR + 1): + count_item = es_counts.get(year, {}) + yearly_data.append(YearlyData( + year=year, + publications=count_item.get("works_count", 0), + citations=count_item.get("cited_by_count", 0) + )) + + timeseries.append(UniversityTopicData( + university=source.get("display_name", "Unknown"), + topic=topic, + yearly_data=yearly_data + )) + + rankings = _compute_rankings(timeseries, metric) + + return RankingResponse(timeseries=timeseries, rankings=rankings) + +def _compute_rankings(data: List[UniversityTopicData], metric: DashboardMetric) -> List[UniversityRanking]: + """Computes ranking metrics based on the timeseries data.""" + latest_year = END_YEAR + five_years_ago = latest_year - 5 + three_years_ago = latest_year - 3 + + processed: List[Dict[str, Any]] = [] + for item in data: + latest = next((d for d in item.yearly_data if d.year == latest_year), YearlyData(year=latest_year, publications=0, citations=0)) + prev = next((d for d in item.yearly_data if d.year == latest_year - 1), YearlyData(year=latest_year-1, publications=0, citations=0)) + start_range = next((d for d in item.yearly_data if d.year == five_years_ago), YearlyData(year=five_years_ago, publications=0, citations=0)) + mover_range = next((d for d in item.yearly_data if d.year == three_years_ago), YearlyData(year=three_years_ago, publications=0, citations=0)) + + curr_val = getattr(latest, metric) or 0 + prev_val = getattr(prev, metric) or 0 + old_val = getattr(start_range, metric) or 0 + mover_old_val = getattr(mover_range, metric) or 0 + + growth_rate = ((curr_val - old_val) / old_val * 100) if old_val > 0 else 0 + recent_growth = ((curr_val - mover_old_val) / mover_old_val * 100) if mover_old_val > 0 else 0 + + processed.append({ + "university": item.university, + "publications": latest.publications, + "citations": latest.citations, + "growth_rate": growth_rate, + "trend": 'up' if curr_val > prev_val else ('down' if curr_val < prev_val else 'stable'), + "recent_growth": recent_growth, + "sort_val": curr_val + }) + + processed.sort(key=lambda x: x["sort_val"], reverse=True) + # Top movers: top 2 by recent growth + growth_sorted = sorted([p["recent_growth"] for p in processed], reverse=True) + threshold = growth_sorted[1] if len(growth_sorted) > 1 else 0 + + return [ + UniversityRanking( + rank=i + 1, + is_top_mover=p["recent_growth"] >= threshold and p["recent_growth"] > 0, + **{k: v for k, v in p.items() if k != "sort_val" and k != "recent_growth"} + ) + for i, p in enumerate(processed) + ] \ No newline at end of file diff --git a/service/src/main/inse/university_ranking/model.py b/service/src/main/inse/university_ranking/model.py new file mode 100644 index 00000000..1b4b8605 --- /dev/null +++ b/service/src/main/inse/university_ranking/model.py @@ -0,0 +1,30 @@ +from pydantic import BaseModel +from typing import List, Literal + +ResearchTopic = Literal['Artificial Intelligence', 'Quantum Computing', 'Renewable Energy', 'Biotechnology'] +DashboardMetric = Literal['publications', 'citations'] + +class YearlyData(BaseModel): + year: int + publications: int + citations: int + +class UniversityTopicData(BaseModel): + university: str + topic: ResearchTopic + yearly_data: List[YearlyData] + +class UniversityRanking(BaseModel): + rank: int + university: str + publications: int + citations: int + growth_rate: float + trend: Literal['up', 'down', 'stable'] + is_top_mover: bool + +class RankingResponse(BaseModel): + # Raw timeseries data for the ECharts line race + timeseries: List[UniversityTopicData] + # Computed metrics for the ranking table + rankings: List[UniversityRanking] \ No newline at end of file diff --git a/service/src/main/inse/university_ranking/router.py b/service/src/main/inse/university_ranking/router.py new file mode 100644 index 00000000..60c52c9d --- /dev/null +++ b/service/src/main/inse/university_ranking/router.py @@ -0,0 +1,23 @@ +from fastapi import APIRouter, Query +from . import service +from .model import RankingResponse, ResearchTopic, DashboardMetric +from inse.tags import Tags + +router = APIRouter( + prefix="/api/inse-service/university-rankings", + tags=[Tags.INSTITUTIONS] +) + +@router.get( + "", + response_model=RankingResponse, + summary="Returns data for the University Ranking Dashboard." +) +async def get_rankings( + topic: ResearchTopic = Query( + ..., + description="Research topic (e.g., 'Artificial Intelligence')" + ), + metric: DashboardMetric = Query("publications", description="Metric to rank by") +): + return await service.get_university_dashboard_data(topic, metric) \ No newline at end of file diff --git a/service/src/main/inse/university_ranking/service.py b/service/src/main/inse/university_ranking/service.py new file mode 100644 index 00000000..4eac89e6 --- /dev/null +++ b/service/src/main/inse/university_ranking/service.py @@ -0,0 +1,6 @@ +from . import logic +from .model import RankingResponse, ResearchTopic, DashboardMetric + +async def get_university_dashboard_data(topic: ResearchTopic, metric: DashboardMetric) -> RankingResponse: + """Orchestrates data retrieval and computation for the dashboard.""" + return await logic.get_ranking_data(topic, metric) \ No newline at end of file diff --git a/service/src/main/inse/util.py b/service/src/main/inse/util.py index da4fc410..dc47d976 100644 --- a/service/src/main/inse/util.py +++ b/service/src/main/inse/util.py @@ -6,7 +6,7 @@ """ from typing import Optional from typing import TypeVar -from inse.models import Author +from inse.models.openalex import Author from . import model from fastapi import HTTPException from starlette.status import HTTP_404_NOT_FOUND @@ -28,12 +28,34 @@ 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) - return author \ No newline at end of file + return author + +from sentence_transformers import SentenceTransformer +from .config import settings +# Sentence Transformer Model +_model: SentenceTransformer | None = None + +def get_model(): + global _model + if _model is None: + import os + # If SENTENCE_TRANSFORMERS_HOME is not set, check if container-baked /models folder is available + if "SENTENCE_TRANSFORMERS_HOME" not in os.environ: + if os.path.exists("/models"): + os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/models" + os.environ["HF_HUB_OFFLINE"] = "1" + else: + # If it is set to /models, enforce offline mode as it is baked into the image + if os.environ.get("SENTENCE_TRANSFORMERS_HOME") == "/models": + os.environ["HF_HUB_OFFLINE"] = "1" + + model_name = settings.sentence_transformers_model_name + _model = SentenceTransformer(model_name) + return _model \ No newline at end of file diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index a284a919..9d5918cf 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -5,26 +5,50 @@ Business logic for publication works. """ import logging -from typing import List +from time import time +from typing import Any, List import httpx from fastapi import HTTPException from pydantic import ValidationError from starlette.status import HTTP_502_BAD_GATEWAY +from starlette.status import HTTP_404_NOT_FOUND from starlette.status import HTTP_503_SERVICE_UNAVAILABLE -from inse.models.work import Work -from inse.models.work_page import WorkPage -from inse.models.works_list_response import WorksListResponse -from inse.models.meta import Meta -from inse.models.topic_count import TopicCount -from inse.models.topics_by_year import TopicsByYear -from inse.models.topics_by_time import TopicsByTime +from inse import config +from inse.integrations import elasticsearch +from inse.models.openalex.work import Work +from inse.models.openalex.work_page import WorkPage +from inse.models.openalex.works_list_response import WorksListResponse +from inse.models.openalex.meta import Meta +from inse.models.openalex.topic_count import TopicCount +from inse.models.openalex.topics_by_year import TopicsByYear +from inse.models.openalex.topics_by_time import TopicsByTime from .search_client import MissingApiKeyError from .search_client import OpenAlexWorksSearchClient logger = logging.getLogger(__name__) +TOPIC_DETAIL_SOURCE_FIELDS = [ + "id", + "display_name", + "description", + "subfield", + "field", + "domain", +] + +TOPIC_HIERARCHY_DESCRIPTION_INDICES = { + "subfield": "openalex-subfields", + "field": "openalex-fields", + "domain": "openalex-domains", +} + +TOPIC_HIERARCHY_DESCRIPTION_SOURCE_FIELDS = [ + "id", + "description", +] + async def get_author_works( author_id: str, @@ -33,6 +57,8 @@ async def get_author_works( publication_year: list[int] | None = None, work_type: list[str] | None = None, language: list[str] | None = None, + institution_id: list[str] | None = None, + topic_id: list[str] | None = None, client: OpenAlexWorksSearchClient | None = None, ) -> WorkPage: search_client = client or OpenAlexWorksSearchClient() @@ -44,6 +70,8 @@ async def get_author_works( publication_year=publication_year, work_type=work_type, language=language, + institution_id=institution_id, + topic_id=topic_id, ) elements, total = _parse_full_work_search_response(data) @@ -90,16 +118,364 @@ async def get_all_author_works( ) +async def get_primary_topic_counts( + author_id: str, + client: OpenAlexWorksSearchClient | None = None, +) -> List[TopicCount]: + topic_counts = _get_primary_topic_counts_from_es(author_id) + + topic_ids = [item["id"] for item in topic_counts if item["id"]] + details = _get_topic_details(topic_ids) + + result = [] + + for item in topic_counts: + info = details.get(item["id"], {}) + name = info.get("display_name") + if not name: + continue + + result.append( + TopicCount( + id=item["id"], + name=name, + count=item["count"], + description=info.get("description"), + **_topic_hierarchy_fields(info), + ) + ) + + return result + + +def _get_primary_topic_counts_from_es(author_id: str) -> list[dict]: + + indexed_author_id = f"https://openalex.org/{author_id.strip()}" + + body = { + "size": 0, + "query": { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": [ + {"term": {"authorships.author.id": indexed_author_id}}, + ], + }, + }, + }, + }, + "aggs": { + "primary_topics": { + "terms": {"field": "primary_topic.id", "size": 1000}, + }, + }, + } + + try: + response = elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=body, + ) + except httpx.HTTPError as exc: + logger.exception("OpenAlex primary topic aggregation request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search request failed.", + ) from exc + + aggregations = response.get("aggregations", {}) + buckets = aggregations.get("primary_topics", {}).get("buckets", []) + + counts = [] + for bucket in buckets: + counts.append({"id": bucket["key"], "count": bucket["doc_count"]}) + + return counts + + +async def get_work( + work_id: str, + client: OpenAlexWorksSearchClient | None = None, +) -> Work: + search_client = client or OpenAlexWorksSearchClient() + try: + data = await search_client.search_work(work_id) + except MissingApiKeyError as exc: + raise HTTPException( + status_code=HTTP_503_SERVICE_UNAVAILABLE, + detail="OpenAlex works search is not configured.", + ) from exc + except httpx.HTTPError as exc: + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search request failed.", + ) from exc + elements, _ = _parse_full_work_search_response(data) + if not elements: + raise HTTPException( + status_code=HTTP_404_NOT_FOUND, + detail="Publication not found.", + ) + return elements[0] + + +def _get_topic_details(topic_ids: List[str]) -> dict[str, dict]: + if not topic_ids: + return {} + + try: + response = elasticsearch.search( + index="openalex-topics", + query={"terms": {"id": topic_ids}}, + source=TOPIC_DETAIL_SOURCE_FIELDS, + size=len(topic_ids), + ) + except httpx.HTTPError: + logger.exception("Could not load topic details from Elasticsearch.") + return {} + + details = {} + for hit in response.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + topic_id = source.get("id") + if not topic_id: + continue + + details[topic_id] = { + "display_name": source.get("display_name"), + "description": source.get("description"), + "subfield": _extract_topic_hierarchy_item(source, "subfield"), + "field": _extract_topic_hierarchy_item(source, "field"), + "domain": _extract_topic_hierarchy_item(source, "domain"), + } + + _enrich_topic_hierarchy_descriptions(details) + + return details + + +def _extract_topic_hierarchy_item(source: dict, key: str) -> dict[str, str | None]: + hierarchy_item = source.get(key) + + if not isinstance(hierarchy_item, dict): + return {"id": None, "display_name": None, "description": None} + + return { + "id": hierarchy_item.get("id"), + "display_name": hierarchy_item.get("display_name"), + "description": hierarchy_item.get("description"), + } + + +def _enrich_topic_hierarchy_descriptions(details: dict[str, dict]) -> None: + for hierarchy_key, index in TOPIC_HIERARCHY_DESCRIPTION_INDICES.items(): + hierarchy_ids = { + item.get(hierarchy_key, {}).get("id") + for item in details.values() + if item.get(hierarchy_key, {}).get("id") + } + + descriptions = _get_topic_hierarchy_descriptions(index, list(hierarchy_ids)) + + for item in details.values(): + hierarchy_item = item.get(hierarchy_key) or {} + hierarchy_id = hierarchy_item.get("id") + + if hierarchy_id and hierarchy_id in descriptions: + hierarchy_item["description"] = descriptions[hierarchy_id] + + +def _get_topic_hierarchy_descriptions( + index: str, + hierarchy_ids: list[str], +) -> dict[str, str | None]: + if not hierarchy_ids: + return {} + + try: + response = elasticsearch.search( + index=index, + query={"terms": {"id": hierarchy_ids}}, + source=TOPIC_HIERARCHY_DESCRIPTION_SOURCE_FIELDS, + size=len(hierarchy_ids), + ) + except httpx.HTTPError: + logger.exception("Could not load topic hierarchy details from %s.", index) + return {} + + descriptions = {} + for hit in response.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + hierarchy_id = source.get("id") + + if hierarchy_id: + descriptions[hierarchy_id] = source.get("description") + + return descriptions + + +def _topic_hierarchy_fields(topic_details: dict) -> dict[str, str | None]: + subfield = topic_details.get("subfield") or {} + field = topic_details.get("field") or {} + domain = topic_details.get("domain") or {} + + return { + "subfield_id": subfield.get("id"), + "subfield_name": subfield.get("display_name"), + "subfield_description": subfield.get("description"), + "field_id": field.get("id"), + "field_name": field.get("display_name"), + "field_description": field.get("description"), + "domain_id": domain.get("id"), + "domain_name": domain.get("display_name"), + "domain_description": domain.get("description"), + } + + +def _limit_works_by_complete_years( + work_results: list[Work], + target_publications: int, +) -> list[Work]: + works_by_year: dict[int, list[Work]] = {} + + for work in work_results: + if work.publication_year is None: + continue + + year = work.publication_year + + if year not in works_by_year: + works_by_year[year] = [] + + works_by_year[year].append(work) + + selected_works: list[Work] = [] + + for year in sorted(works_by_year.keys(), reverse=True): + selected_works.extend(works_by_year[year]) + + if len(selected_works) >= target_publications: + break + + return selected_works + + +async def _get_limited_author_works_by_complete_years( + author_id: str, + target_publications: int, + client: OpenAlexWorksSearchClient | None = None, +) -> tuple[list[Work], int, bool]: + search_client = client or OpenAlexWorksSearchClient() + page = 1 + size = 100 + total = 0 + fetched_publications = 0 + selected_works: list[Work] = [] + cutoff_year: int | None = None + is_limited = False + + while True: + data = await _search_author_works_data( + search_client, + author_id, + page, + size, + ) + elements, total = _parse_full_work_search_response(data) + + if not elements: + break + + fetched_publications += len(elements) + should_stop = False + + for work in elements: + year = work.publication_year + + if year is None: + if cutoff_year is not None: + should_stop = True + break + + continue + + if cutoff_year is not None and year != cutoff_year: + is_limited = True + should_stop = True + break + + selected_works.append(work) + + if cutoff_year is None and len(selected_works) >= target_publications: + cutoff_year = year + + if should_stop or fetched_publications >= total: + break + + page += 1 + + return selected_works, total, is_limited + + +def _get_total_publication_count(meta: Meta | None, work_results: list[Work]) -> int: + if meta and meta.count is not None: + return meta.count + + return len(work_results) + + async def get_topics_by_time_by_author( author_id: str, max_topics_per_year: int = 3, + target_publications: int = 300, + include_all: bool = False, client: OpenAlexWorksSearchClient | None = None, ) -> TopicsByTime: - works = await get_all_author_works(author_id, client=client) + if client is not None: + return await _get_topics_by_time_by_author_from_work_pages( + author_id, + max_topics_per_year=max_topics_per_year, + target_publications=target_publications, + include_all=include_all, + client=client, + ) + + return _get_topics_by_time_by_author_from_es( + author_id, + max_topics_per_year=max_topics_per_year, + target_publications=target_publications, + include_all=include_all, + ) + + +async def _get_topics_by_time_by_author_from_work_pages( + author_id: str, + max_topics_per_year: int = 3, + target_publications: int = 300, + include_all: bool = False, + client: OpenAlexWorksSearchClient | None = None, +) -> TopicsByTime: + if include_all: + works = await get_all_author_works(author_id, client=client) + work_results = works.results or [] + total_publications = _get_total_publication_count(works.meta, work_results) + is_limited = False + else: + ( + work_results, + total_publications, + is_limited, + ) = await _get_limited_author_works_by_complete_years( + author_id, + target_publications=target_publications, + client=client, + ) years = {} - for work in works.results or []: + for work in work_results: if work.publication_year is None: continue @@ -142,47 +518,369 @@ async def get_topics_by_time_by_author( } years[year]["primary_topics"][primary_topic_name]["count"] += 1 - + + topic_ids = set() + + for year_data in years.values(): + for topic in year_data["topics"].values(): + if topic["id"]: + topic_ids.add(topic["id"]) + + for topic in year_data["primary_topics"].values(): + if topic["id"]: + topic_ids.add(topic["id"]) + + topic_details = _get_topic_details(list(topic_ids)) + elements = [] for year in sorted(years.keys()): topic_items = list(years[year]["topics"].values()) - topic_items.sort(key=lambda item: item["count"], reverse=True) + topic_items.sort(key=lambda item: (-item["count"], item["name"])) topics = [] for topic in topic_items[:max_topics_per_year]: - topics.append(TopicCount( - id=topic["id"], - name=topic["name"], - count=topic["count"], - )) + info = topic_details.get(topic["id"], {}) + + topics.append( + TopicCount( + id=topic["id"], + name=topic["name"], + count=topic["count"], + description=info.get("description"), + **_topic_hierarchy_fields(info), + ) + ) primary_topic_items = list(years[year]["primary_topics"].values()) - primary_topic_items.sort(key=lambda item: item["count"], reverse=True) + primary_topic_items.sort(key=lambda item: (-item["count"], item["name"])) primary_topics = [] for topic in primary_topic_items[:max_topics_per_year]: - primary_topics.append(TopicCount( - id=topic["id"], - name=topic["name"], - count=topic["count"], - )) + info = topic_details.get(topic["id"], {}) - elements.append(TopicsByYear( - year=year, - publication_count=years[year]["publication_count"], - topics=topics, - primary_topics=primary_topics, - )) + primary_topics.append( + TopicCount( + id=topic["id"], + name=topic["name"], + count=topic["count"], + description=info.get("description"), + **_topic_hierarchy_fields(info), + ) + ) + + elements.append( + TopicsByYear( + year=year, + publication_count=years[year]["publication_count"], + topics=topics, + primary_topics=primary_topics, + ) + ) return TopicsByTime( elements=elements, total=len(elements), + is_limited=is_limited, + used_publications=sum(element.publication_count for element in elements), + total_publications=total_publications, ) +def _get_topics_by_time_by_author_from_es( + author_id: str, + max_topics_per_year: int = 3, + target_publications: int = 300, + include_all: bool = False, +) -> TopicsByTime: + year_buckets, total_publications = _get_publication_year_counts_from_es(author_id) + selected_years, is_limited = _select_complete_timeline_years( + year_buckets, + target_publications=target_publications, + include_all=include_all, + ) + + if not selected_years: + return TopicsByTime( + elements=[], + total=0, + is_limited=False, + used_publications=0, + total_publications=total_publications, + ) + + year_topic_buckets = _get_timeline_topic_counts_from_es( + author_id, + years=selected_years, + max_topics_per_year=max_topics_per_year, + ) + topic_ids = _collect_topic_ids_from_year_buckets(year_topic_buckets) + topic_details = _get_topic_details(list(topic_ids)) + + elements = _build_timeline_elements_from_aggregations( + year_topic_buckets, + topic_details=topic_details, + max_topics_per_year=max_topics_per_year, + ) + + return TopicsByTime( + elements=elements, + total=len(elements), + is_limited=is_limited, + used_publications=sum(element.publication_count for element in elements), + total_publications=total_publications, + ) + + +def _get_publication_year_counts_from_es(author_id: str) -> tuple[list[dict], int]: + body = { + "size": 0, + "track_total_hits": True, + "query": _author_works_query(author_id), + "aggs": { + "publication_years": { + "terms": { + "field": "publication_year", + "size": 300, + "order": {"_key": "desc"}, + }, + }, + }, + } + + try: + response = elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=body, + ) + except httpx.HTTPError as exc: + logger.exception("OpenAlex publication year aggregation request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search request failed.", + ) from exc + + return _parse_year_count_buckets(response), _parse_total_hits(response) + + +def _get_timeline_topic_counts_from_es( + author_id: str, + years: list[int], + max_topics_per_year: int, +) -> list[dict]: + body = { + "size": 0, + "query": { + "bool": { + "must": [_author_works_query(author_id)], + "filter": [{"terms": {"publication_year": years}}], + }, + }, + "aggs": { + "by_year": { + "terms": { + "field": "publication_year", + "size": len(years), + "order": {"_key": "asc"}, + }, + "aggs": { + "primary_topics": { + "terms": { + "field": "primary_topic.id", + "size": max_topics_per_year, + "order": [ + {"_count": "desc"}, + {"_key": "asc"}, + ], + }, + }, + "topics_nested": { + "nested": {"path": "topics"}, + "aggs": { + "topics": { + "terms": { + "field": "topics.id", + "size": max_topics_per_year, + "order": [ + {"_count": "desc"}, + {"_key": "asc"}, + ], + }, + "aggs": { + "works": { + "reverse_nested": {}, + }, + }, + }, + }, + }, + }, + }, + }, + } + + try: + response = elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=body, + ) + except httpx.HTTPError as exc: + logger.exception("OpenAlex timeline topic aggregation request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search request failed.", + ) from exc + + return response.get("aggregations", {}).get("by_year", {}).get("buckets", []) + + +def _author_works_query(author_id: str) -> dict[str, Any]: + indexed_author_id = f"https://openalex.org/{author_id.strip()}" + + return { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": [ + {"term": {"authorships.author.id": indexed_author_id}}, + ], + }, + }, + }, + } + + +def _parse_year_count_buckets(response: dict) -> list[dict]: + return ( + response.get("aggregations", {}).get("publication_years", {}).get("buckets", []) + ) + + +def _parse_total_hits(response: dict) -> int: + total = response.get("hits", {}).get("total", 0) + + if isinstance(total, dict): + return total.get("value", 0) + + return total + + +def _select_complete_timeline_years( + year_buckets: list[dict], + target_publications: int, + include_all: bool, +) -> tuple[list[int], bool]: + if include_all: + return [bucket["key"] for bucket in year_buckets], False + + selected_years: list[int] = [] + selected_publications = 0 + + for bucket in year_buckets: + selected_years.append(bucket["key"]) + selected_publications += bucket.get("doc_count", 0) + + if selected_publications >= target_publications: + break + + is_limited = len(selected_years) < len(year_buckets) + + return selected_years, is_limited + + +def _collect_topic_ids_from_year_buckets(year_buckets: list[dict]) -> set[str]: + topic_ids: set[str] = set() + + for year_bucket in year_buckets: + primary_buckets = year_bucket.get("primary_topics", {}).get("buckets", []) + topic_buckets = ( + year_bucket.get("topics_nested", {}).get("topics", {}).get("buckets", []) + ) + + for bucket in primary_buckets + topic_buckets: + topic_id = bucket.get("key") + + if topic_id: + topic_ids.add(topic_id) + + return topic_ids + + +def _build_timeline_elements_from_aggregations( + year_buckets: list[dict], + topic_details: dict[str, dict], + max_topics_per_year: int, +) -> list[TopicsByYear]: + elements: list[TopicsByYear] = [] + + for year_bucket in year_buckets: + year = year_bucket.get("key") + + if year is None: + continue + + topics = _build_topic_counts_from_buckets( + year_bucket.get("topics_nested", {}).get("topics", {}).get("buckets", []), + topic_details=topic_details, + max_topics_per_year=max_topics_per_year, + use_reverse_nested_count=True, + ) + primary_topics = _build_topic_counts_from_buckets( + year_bucket.get("primary_topics", {}).get("buckets", []), + topic_details=topic_details, + max_topics_per_year=max_topics_per_year, + use_reverse_nested_count=False, + ) + + elements.append( + TopicsByYear( + year=year, + publication_count=year_bucket.get("doc_count", 0), + topics=topics, + primary_topics=primary_topics, + ) + ) + + return elements + + +def _build_topic_counts_from_buckets( + buckets: list[dict], + topic_details: dict[str, dict], + max_topics_per_year: int, + use_reverse_nested_count: bool, +) -> list[TopicCount]: + topics: list[TopicCount] = [] + + for bucket in buckets[:max_topics_per_year]: + topic_id = bucket.get("key") + + if not topic_id: + continue + + info = topic_details.get(topic_id, {}) + display_name = info.get("display_name") or topic_id + count = bucket.get("doc_count", 0) + + if use_reverse_nested_count: + count = bucket.get("works", {}).get("doc_count", count) + + topics.append( + TopicCount( + id=topic_id, + name=display_name, + count=count, + description=info.get("description"), + **_topic_hierarchy_fields(info), + ) + ) + + return topics + + async def _search_author_works_data( search_client: OpenAlexWorksSearchClient, author_id: str, @@ -191,6 +889,8 @@ async def _search_author_works_data( publication_year: list[int] | None = None, work_type: list[str] | None = None, language: list[str] | None = None, + institution_id: list[str] | None = None, + topic_id: list[str] | None = None, ) -> dict: try: return await search_client.search_author_works( @@ -200,6 +900,8 @@ async def _search_author_works_data( publication_year=publication_year, work_type=work_type, language=language, + institution_id=institution_id, + topic_id=topic_id, ) except MissingApiKeyError as exc: logger.error("OpenAlex works Elasticsearch API key is not configured.") @@ -231,7 +933,7 @@ def _parse_full_work_search_response(data: dict) -> tuple[list[Work], int]: source_copy["title"] = source_copy["display_name"] elif not source_copy.get("display_name") and source_copy.get("title"): source_copy["display_name"] = source_copy["title"] - + # Resilient sanitization of IDs to protect against model regeneration type conflicts ids = source_copy.get("ids") if isinstance(ids, dict): @@ -259,3 +961,49 @@ def _parse_full_work_search_response(data: dict) -> tuple[list[Work], int]: ) from exc return elements, total + + +def get_publication_dois_of_author( + raw_oa_author_id: str, +) -> List[str]: + query = { + "bool": { + "must": [ + { + "nested": { + "path": "authorships", + "query": { + "term": { + "authorships.author.id": f"https://openalex.org/{raw_oa_author_id.strip().upper()}" + } + }, + } + } + ], + "filter": [{"exists": {"field": "doi"}}], + } + } + + try: + response = elasticsearch.search( + index="openalex-works", + source=["doi"], + size=10000, + query=query, + cluster="nes", + ) + except httpx.HTTPError as exc: + logger.exception("Request for publication DOIs of author failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="Request for publication DOIs of author failed.", + ) from exc + + dois = [] + for hit in response.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + doi = source.get("doi") + if doi: + dois.append(doi) + + return dois diff --git a/service/src/main/inse/works/model.py b/service/src/main/inse/works/model.py index db5baf59..e16d723a 100644 --- a/service/src/main/inse/works/model.py +++ b/service/src/main/inse/works/model.py @@ -8,331 +8,9 @@ from typing import List from typing import Optional from pydantic import BaseModel -from pydantic import ConfigDict from pydantic import Field -from inse.models.work import Work - - -class OpenAlexModel(BaseModel): - model_config = ConfigDict(extra="allow") - - -class Source(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The source id.") - display_name: Optional[str] = Field( - default=None, description="The source display name." - ) - issn_l: Optional[str] = Field(default=None, description="The linking ISSN.") - issn: Optional[List[str]] = Field( - default=None, description="The ISSNs of the source." - ) - is_oa: Optional[bool] = Field( - default=None, description="Whether the source is open access." - ) - is_in_doaj: Optional[bool] = Field( - default=None, description="Whether the source is in DOAJ." - ) - is_core: Optional[bool] = Field( - default=None, description="Whether the source is a core source." - ) - host_organization: Optional[str] = Field( - default=None, description="The host organization id." - ) - host_organization_name: Optional[str] = Field( - default=None, description="The host organization name." - ) - host_organization_lineage: Optional[List[str]] = Field( - default=None, description="The host organization lineage." - ) - type: Optional[str] = Field(default=None, description="The source type.") - - -class Location(OpenAlexModel): - is_oa: Optional[bool] = Field( - default=None, description="Whether this location is open access." - ) - landing_page_url: Optional[str] = Field( - default=None, description="The landing page URL." - ) - pdf_url: Optional[str] = Field(default=None, description="The PDF URL.") - source: Optional[Source] = Field( - default=None, description="The publication source." - ) - license: Optional[str] = Field(default=None, description="The license label.") - license_id: Optional[str] = Field(default=None, description="The license id.") - is_accepted: Optional[bool] = Field( - default=None, description="Whether this manuscript is accepted." - ) - is_published: Optional[bool] = Field( - default=None, description="Whether this manuscript is published." - ) - - -class OpenAccess(OpenAlexModel): - is_oa: Optional[bool] = Field( - default=None, description="Whether the work is open access." - ) - oa_url: Optional[str] = Field(default=None, description="The open access URL.") - any_repository_has_fulltext: Optional[bool] = Field( - default=None, description="Whether a repository has full text." - ) - - -class Author(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The author id.") - display_name: Optional[str] = Field( - default=None, description="The display name of the author." - ) - orcid: Optional[str] = Field( - default=None, description="The optional ORCID of the author." - ) - - -class Institution(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The institution id.") - display_name: Optional[str] = Field( - default=None, description="The institution display name." - ) - ror: Optional[str] = Field(default=None, description="The ROR id.") - country_code: Optional[str] = Field(default=None, description="The country code.") - type: Optional[str] = Field(default=None, description="The institution type.") - lineage: Optional[List[str]] = Field( - default=None, description="The institution lineage." - ) - - -class Authorship(OpenAlexModel): - author: Optional[Author] = Field(default=None, description="The author.") - institutions: List[Institution] = Field( - default_factory=list, description="The author's institutions." - ) - countries: List[str] = Field( - default_factory=list, description="The author's countries." - ) - is_corresponding: Optional[bool] = Field( - default=None, description="Whether this author is corresponding." - ) - raw_author_name: Optional[str] = Field( - default=None, description="The raw author name." - ) - raw_affiliation_strings: List[str] = Field( - default_factory=list, description="The raw affiliation strings." - ) - - -class WorkIds(OpenAlexModel): - openalex: Optional[str] = Field(default=None, description="The OpenAlex id.") - doi: Optional[str] = Field(default=None, description="The DOI.") - mag: Optional[int] = Field(default=None, description="The MAG id.") - pmid: Optional[str] = Field(default=None, description="The PubMed id.") - pmcid: Optional[str] = Field(default=None, description="The PubMed Central id.") - - -class Biblio(OpenAlexModel): - volume: Optional[str] = Field(default=None, description="The volume.") - issue: Optional[str] = Field(default=None, description="The issue.") - first_page: Optional[str] = Field(default=None, description="The first page.") - last_page: Optional[str] = Field(default=None, description="The last page.") - - -class TopicLevel(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The topic level id.") - display_name: Optional[str] = Field( - default=None, description="The topic level display name." - ) - - -class Topic(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The topic id.") - display_name: Optional[str] = Field( - default=None, description="The topic display name." - ) - score: Optional[float] = Field(default=None, description="The topic score.") - subfield: Optional[TopicLevel] = Field( - default=None, description="The topic subfield." - ) - field: Optional[TopicLevel] = Field(default=None, description="The topic field.") - domain: Optional[TopicLevel] = Field(default=None, description="The topic domain.") - - -class Keyword(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The keyword id.") - display_name: Optional[str] = Field( - default=None, description="The keyword display name." - ) - score: Optional[float] = Field(default=None, description="The keyword score.") - - -class Funder(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The funder id.") - display_name: Optional[str] = Field( - default=None, description="The funder display name." - ) - ror: Optional[str] = Field(default=None, description="The ROR id.") - - -class Award(OpenAlexModel): - id: Optional[str] = Field(default=None, description="The award id.") - display_name: Optional[str] = Field( - default=None, description="The award display name." - ) - funder_award_id: Optional[str] = Field( - default=None, description="The funder award id." - ) - funder_id: Optional[str] = Field(default=None, description="The funder id.") - funder_display_name: Optional[str] = Field( - default=None, description="The funder display name." - ) - doi: Optional[str] = Field(default=None, description="The award DOI.") - - -class CitationNormalizedPercentile(OpenAlexModel): - value: Optional[float] = Field( - default=None, description="The normalized citation percentile." - ) - is_in_top_1_percent: Optional[bool] = Field( - default=None, description="Whether the work is in the top 1 percent." - ) - is_in_top_10_percent: Optional[bool] = Field( - default=None, description="Whether the work is in the top 10 percent." - ) - - -class CitedByPercentileYear(OpenAlexModel): - min: Optional[int] = Field(default=None, description="The minimum percentile year.") - max: Optional[int] = Field(default=None, description="The maximum percentile year.") - - -class CountByYear(OpenAlexModel): - year: Optional[int] = Field(default=None, description="The year.") - cited_by_count: int = Field( - default=0, description="The citation count for the year." - ) - - -class SustainableDevelopmentGoal(OpenAlexModel): - id: Optional[str] = Field( - default=None, description="The sustainable development goal id." - ) - display_name: Optional[str] = Field( - default=None, description="The sustainable development goal display name." - ) - score: Optional[float] = Field( - default=None, description="The sustainable development goal score." - ) - - -class Mesh(OpenAlexModel): - descriptor_ui: Optional[str] = Field(default=None, description="The descriptor UI.") - descriptor_name: Optional[str] = Field( - default=None, description="The descriptor name." - ) - qualifier_ui: Optional[str] = Field(default=None, description="The qualifier UI.") - qualifier_name: Optional[str] = Field( - default=None, description="The qualifier name." - ) - is_major_topic: Optional[bool] = Field( - default=None, description="Whether this is a major topic." - ) - - -class HasContent(OpenAlexModel): - pdf: Optional[bool] = Field(default=None, description="Whether PDF content exists.") - grobid_xml: Optional[bool] = Field( - default=None, description="Whether GROBID XML content exists." - ) - - -# class Work(OpenAlexModel): -# id: str = Field(description="The external id of the work.") -# doi: Optional[str] = Field( -# default=None, description="The optional DOI of the work." -# ) -# title: Optional[str] = Field(default=None, description="The title of the work.") -# display_name: Optional[str] = Field( -# default=None, description="The display name of the work." -# ) -# publication_year: Optional[int] = Field( -# default=None, description="The publication year." -# ) -# publication_date: Optional[str] = Field( -# default=None, description="The publication date." -# ) -# type: Optional[str] = Field(default=None, description="The work type.") -# language: Optional[str] = Field(default=None, description="The work language.") -# cited_by_count: int = Field(default=0, description="The number of citations.") -# is_retracted: Optional[bool] = Field( -# default=None, description="Whether the work is retracted." -# ) -# is_paratext: Optional[bool] = Field( -# default=None, description="Whether the work is paratext." -# ) -# primary_location: Optional[Location] = Field( -# default=None, description="The primary location." -# ) -# locations: List[Location] = Field( -# default_factory=list, description="The work locations." -# ) -# best_oa_location: Optional[Location] = Field( -# default=None, description="The best open access location." -# ) -# open_access: Optional[OpenAccess] = Field( -# default=None, description="Open access information." -# ) -# authorships: List[Authorship] = Field( -# default_factory=list, description="The authorships." -# ) -# ids: Optional[WorkIds] = Field(default=None, description="External ids.") -# biblio: Optional[Biblio] = Field( -# default=None, description="Bibliographic information." -# ) -# abstract_inverted_index: dict[str, List[int]] = Field( -# default_factory=dict, description="The inverted abstract index." -# ) -# referenced_works: List[str] = Field( -# default_factory=list, description="Referenced work ids." -# ) -# referenced_works_count: int = Field( -# default=0, description="The number of referenced works." -# ) -# related_works: List[str] = Field( -# default_factory=list, description="Related work ids." -# ) -# topics: List[Topic] = Field(default_factory=list, description="The topics.") -# primary_topic: Optional[Topic] = Field( -# default=None, description="The primary topic." -# ) -# keywords: List[Keyword] = Field(default_factory=list, description="The keywords.") -# funders: List[Funder] = Field(default_factory=list, description="The funders.") -# awards: List[Award] = Field(default_factory=list, description="The awards.") -# fwci: Optional[float] = Field( -# default=None, description="The field weighted citation impact." -# ) -# citation_normalized_percentile: Optional[CitationNormalizedPercentile] = Field( -# default=None, description="The normalized citation percentile." -# ) -# cited_by_percentile_year: Optional[CitedByPercentileYear] = Field( -# default=None, description="The cited by percentile year." -# ) -# counts_by_year: List[CountByYear] = Field( -# default_factory=list, description="Citation counts by year." -# ) -# sustainable_development_goals: List[SustainableDevelopmentGoal] = Field( -# default_factory=list, description="Sustainable development goals." -# ) -# mesh: List[Mesh] = Field(default_factory=list, description="MeSH terms.") -# indexed_in: List[str] = Field( -# default_factory=list, description="Indexes containing the work." -# ) -# has_content: Optional[HasContent] = Field( -# default=None, description="Available content flags." -# ) -# content_url: Optional[str] = Field(default=None, description="The content URL.") -# created_date: Optional[str] = Field(default=None, description="The creation date.") -# updated_date: Optional[str] = Field( -# default=None, description="The last update timestamp." -# ) +from inse.models.openalex.work import Work class WorkSummary(BaseModel): diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py index 8f44a776..fe60c665 100644 --- a/service/src/main/inse/works/search_client.py +++ b/service/src/main/inse/works/search_client.py @@ -26,12 +26,13 @@ class OpenAlexWorksSearchClient: timeout: float | None = None, transport: httpx.AsyncBaseTransport | None = None, ): - self.base_url = (base_url or config.settings.openalex_works_search_base_url).rstrip("/") + self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/") self.index = index or config.settings.openalex_works_search_index - self.api_key = api_key if api_key is not None else config.settings.openalex_works_api_key + self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds self.transport = transport + def author_works_query( self, author_id: str, @@ -40,26 +41,52 @@ class OpenAlexWorksSearchClient: publication_year: list[int] | None = None, work_type: list[str] | None = None, language: list[str] | None = None, + institution_id: list[str] | None = None, + topic_id: list[str] | None = None, ) -> dict[str, Any]: indexed_author_id = f"https://openalex.org/{author_id.strip()}" - filters = self._work_filters(publication_year, work_type, language) + filters = self._work_filters( + publication_year, + work_type, + language, + topic_id, + ) + author_filters: list[dict[str, Any]] = [ + { + "term": { + "authorships.author.id": indexed_author_id, + }, + }, + ] + must_clauses: list[dict[str, Any]] = [ + { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": author_filters, + }, + }, + }, + }, + ] + if institution_id: + must_clauses.append({ + "nested": { + "path": "authorships.institutions", + "query": { + "terms": { + "authorships.institutions.id": institution_id, + }, + }, + }, + }) return { "from": (page - 1) * size, "size": size, "query": { "bool": { - "must": [ - { - "nested": { - "path": "authorships", - "query": { - "term": { - "authorships.author.id": indexed_author_id, - }, - }, - }, - }, - ], + "must": must_clauses, "filter": filters, }, }, @@ -74,6 +101,7 @@ class OpenAlexWorksSearchClient: publication_year: list[int] | None = None, work_type: list[str] | None = None, language: list[str] | None = None, + topic_id: list[str] | None = None, ) -> list[dict[str, Any]]: filters: list[dict[str, Any]] = [] if publication_year: @@ -82,6 +110,21 @@ class OpenAlexWorksSearchClient: filters.append({"terms": {"type": work_type}}) if language: filters.append({"terms": {"language": language}}) + if topic_id: + filters.append({ + "bool": { + "should": [ + { + "nested": { + "path": "topics", + "query": {"terms": {"topics.id": topic_id}}, + }, + }, + {"terms": {"primary_topic.id": topic_id}}, + ], + "minimum_should_match": 1, + }, + }) return filters async def search_author_works( @@ -92,6 +135,8 @@ class OpenAlexWorksSearchClient: publication_year: list[int] | None = None, work_type: list[str] | None = None, language: list[str] | None = None, + institution_id: list[str] | None = None, + topic_id: list[str] | None = None, ) -> dict[str, Any]: if not self.api_key: raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") @@ -111,8 +156,31 @@ class OpenAlexWorksSearchClient: publication_year=publication_year, work_type=work_type, language=language, + institution_id=institution_id, + topic_id=topic_id, ), ) # logging.debug(f"Response: {response.text}") response.raise_for_status() return response.json() + + async def search_work(self, work_id: str) -> dict[str, Any]: + if not self.api_key: + raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") + + indexed_work_id = f"https://openalex.org/{work_id.strip().split('/')[-1]}" + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.post( + f"/{self.index}/_search", + headers={"Authorization": f"ApiKey {self.api_key}"}, + json={ + "size": 1, + "query": {"term": {"id": indexed_work_id}}, + }, + ) + response.raise_for_status() + return response.json() diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py index 476f2b9a..e0d84c57 100644 --- a/service/src/main/inse/works/service.py +++ b/service/src/main/inse/works/service.py @@ -15,9 +15,11 @@ from inse.tags import Tags from .. import security from . import logic -from inse.models.work_page import WorkPage -from inse.models.works_list_response import WorksListResponse -from inse.models.topics_by_time import TopicsByTime +from inse.models.openalex.work_page import WorkPage +from inse.models.openalex.work import Work +from inse.models.openalex.works_list_response import WorksListResponse +from inse.models.openalex.topic_count import TopicCount +from inse.models.openalex.topics_by_time import TopicsByTime router = APIRouter(prefix="/api/works", tags=[Tags.WORKS]) @@ -46,6 +48,14 @@ async def get_author_works( language: Annotated[ list[str] | None, Query(description="Filter by language code. Can be repeated.") ] = None, + institution_id: Annotated[ + list[str] | None, + Query(description="Filter by OpenAlex institution id. Can be repeated."), + ] = None, + topic_id: Annotated[ + list[str] | None, + Query(description="Filter by OpenAlex topic id. Can be repeated."), + ] = None, principal: security.Principal = Depends( security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"]) ), @@ -57,6 +67,8 @@ async def get_author_works( publication_year=publication_year, work_type=work_type, language=language, + institution_id=institution_id, + topic_id=topic_id, ) @@ -71,6 +83,17 @@ async def get_all_author_works( return await logic.get_all_author_works(author_id) +@router.get("/{author_id}/primary-topic-counts", + operation_id="getPrimaryTopicCountsByAuthor", + response_model=list[TopicCount], + summary="Returns work counts per primary topic for an author.") +async def get_primary_topic_counts( + author_id: Annotated[str, Path(description="The author id, for example A5023888391.")], + principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), +): + return await logic.get_primary_topic_counts(author_id) + + @router.get("/{author_id}/topics-by-time", operation_id="getTopicsByTimeByAuthor", response_model=TopicsByTime, @@ -78,9 +101,39 @@ async def get_all_author_works( async def get_topics_by_time_by_author( author_id: Annotated[str, Path(description="The author id, for example A5023888391.")], max_topics_per_year: Annotated[int, Query(description="The maximum number of topics per year.", ge=1, le=20)] = 3, + target_publications: Annotated[ + int, + Query( + description="Target number of publications used for the timeline. Complete years are always included.", + ge=1, + ), + ] = 300, + include_all: Annotated[ + bool, + Query(description="If true, all publications are used for the timeline."), + ] = False, principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), ): return await logic.get_topics_by_time_by_author( author_id, max_topics_per_year=max_topics_per_year, + target_publications=target_publications, + include_all=include_all, ) + + +@router.get( + "/detail/{work_id}", + operation_id="getWork", + response_model=Work, + summary="Returns one publication.", +) +async def get_work( + work_id: Annotated[ + str, Path(description="The OpenAlex work id, for example W2741809807.") + ], + principal: security.Principal = Depends( + security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"]) + ), +): + return await logic.get_work(work_id) diff --git a/service/src/main/inse/works/test_search_client.py b/service/src/main/inse/works/test_search_client.py index 5a376f26..0bfe1a44 100644 --- a/service/src/main/inse/works/test_search_client.py +++ b/service/src/main/inse/works/test_search_client.py @@ -1,3 +1,5 @@ +import json + import httpx import pytest @@ -19,7 +21,9 @@ def test_author_works_query_searches_authorship_author_id(): assert query["size"] == 25 author_query = query["query"]["bool"]["must"][0]["nested"] assert author_query["path"] == "authorships" - assert author_query["query"]["term"]["authorships.author.id"] == "https://openalex.org/A5023888391" + assert author_query["query"]["bool"]["filter"] == [ + {"term": {"authorships.author.id": "https://openalex.org/A5023888391"}}, + ] assert query["query"]["bool"]["filter"] == [] @@ -33,13 +37,191 @@ def test_author_works_query_adds_publication_filters(): publication_year=[2023, 2024], work_type=["article", "book-chapter"], language=["en", "de"], + institution_id=["https://openalex.org/I123"], + topic_id=["https://openalex.org/T12419"], ) assert query["query"]["bool"]["filter"] == [ {"terms": {"publication_year": [2023, 2024]}}, {"terms": {"type": ["article", "book-chapter"]}}, {"terms": {"language": ["en", "de"]}}, + { + "bool": { + "should": [ + { + "nested": { + "path": "topics", + "query": { + "terms": { + "topics.id": ["https://openalex.org/T12419"], + }, + }, + }, + }, + {"terms": {"primary_topic.id": ["https://openalex.org/T12419"]}}, + ], + "minimum_should_match": 1, + }, + }, ] + assert query["query"]["bool"]["must"] == [ + { + "nested": { + "path": "authorships", + "query": { + "bool": { + "filter": [ + { + "term": { + "authorships.author.id": "https://openalex.org/A5023888391" + } + }, + ], + }, + }, + }, + }, + { + "nested": { + "path": "authorships.institutions", + "query": { + "terms": { + "authorships.institutions.id": [ + "https://openalex.org/I123", + ], + }, + }, + }, + }, + ] + + +def test_author_works_query_uses_nested_institution_path(): + client = OpenAlexWorksSearchClient(api_key="test-key") + + query = client.author_works_query( + "A5023888391", + page=1, + size=20, + institution_id=["https://openalex.org/I205640436"], + ) + + assert query["query"]["bool"]["must"][1] == { + "nested": { + "path": "authorships.institutions", + "query": { + "terms": { + "authorships.institutions.id": [ + "https://openalex.org/I205640436", + ], + }, + }, + }, + } + + +def test_author_works_query_adds_topic_filter(): + client = OpenAlexWorksSearchClient(api_key="test-key") + + query = client.author_works_query( + "A5023888391", + page=1, + size=20, + topic_id=["https://openalex.org/T12419"], + ) + + assert query["query"]["bool"]["filter"] == [ + { + "bool": { + "should": [ + { + "nested": { + "path": "topics", + "query": { + "terms": { + "topics.id": ["https://openalex.org/T12419"], + }, + }, + }, + }, + {"terms": {"primary_topic.id": ["https://openalex.org/T12419"]}}, + ], + "minimum_should_match": 1, + }, + }, + ] + + +@pytest.mark.anyio +async def test_search_author_works_passes_institution_filter_to_query(): + def handler(request: httpx.Request) -> httpx.Response: + body = json.loads(request.content) + assert body["query"]["bool"]["must"][1]["nested"]["path"] == ( + "authorships.institutions" + ) + assert body["query"]["bool"]["must"][1]["nested"]["query"]["terms"] == { + "authorships.institutions.id": ["https://openalex.org/I205640436"], + } + return httpx.Response(200, json={"hits": {"total": {"value": 1}, "hits": []}}) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + index="openalex-works", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + await client.search_author_works( + "A5023888391", + page=1, + size=20, + institution_id=["https://openalex.org/I205640436"], + ) + + +@pytest.mark.anyio +async def test_search_author_works_passes_topic_filter_to_query(): + def handler(request: httpx.Request) -> httpx.Response: + body = json.loads(request.content) + assert body["query"]["bool"]["filter"] == [ + { + "bool": { + "should": [ + { + "nested": { + "path": "topics", + "query": { + "terms": { + "topics.id": ["https://openalex.org/T12419"], + }, + }, + }, + }, + { + "terms": { + "primary_topic.id": ["https://openalex.org/T12419"], + }, + }, + ], + "minimum_should_match": 1, + }, + }, + ] + return httpx.Response(200, json={"hits": {"total": {"value": 1}, "hits": []}}) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + index="openalex-works", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + await client.search_author_works( + "A5023888391", + page=1, + size=20, + topic_id=["https://openalex.org/T12419"], + ) @pytest.mark.anyio @@ -62,6 +244,26 @@ async def test_search_author_works_calls_elasticsearch_index_with_api_key(): assert result == {"hits": {"total": {"value": 0}, "hits": []}} +@pytest.mark.anyio +async def test_search_work_filters_by_work_id(): + def handler(request: httpx.Request) -> httpx.Response: + body = json.loads(request.content) + assert body == { + "size": 1, + "query": {"term": {"id": "https://openalex.org/W2741809807"}}, + } + return httpx.Response(200, json={"hits": {"total": {"value": 1}, "hits": []}}) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + index="openalex-works", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + await client.search_work("W2741809807") + + @pytest.mark.anyio async def test_search_author_works_requires_api_key(): client = OpenAlexWorksSearchClient(api_key="") diff --git a/service/src/main/inse/works/test_service.py b/service/src/main/inse/works/test_service.py index c16b033c..e910b8a9 100644 --- a/service/src/main/inse/works/test_service.py +++ b/service/src/main/inse/works/test_service.py @@ -2,11 +2,11 @@ from fastapi.testclient import TestClient from inse import config from inse.works import logic -from inse.models.work import Work -from inse.models.work_page import WorkPage -from inse.models.works_list_response import WorksListResponse -from inse.models.meta import Meta -from inse.models.work_topic import WorkTopic +from inse.models.openalex.work import Work +from inse.models.openalex.work_page import WorkPage +from inse.models.openalex.works_list_response import WorksListResponse +from inse.models.openalex.meta import Meta +from inse.models.openalex.work_topic import WorkTopic from inse.main import app diff --git a/service/src/main/log-config.yaml b/service/src/main/log-config.yaml index 6f53e485..921c7398 100644 --- a/service/src/main/log-config.yaml +++ b/service/src/main/log-config.yaml @@ -31,9 +31,9 @@ loggers: level: INFO handlers: - default - propagate: no + propagate: no root: level: DEBUG handlers: - default - propagate: no \ No newline at end of file + propagate: no diff --git a/service/src/main/webapp/index.html b/service/src/main/webapp/index.html index 0e5e5ce1..5b918545 100644 --- a/service/src/main/webapp/index.html +++ b/service/src/main/webapp/index.html @@ -1,9 +1,9 @@ - - INSE Webapp - - -

INSE Webapp

-

This page is a stub for the webapp that will be replaced.

- - \ No newline at end of file + + INSE Webapp + + +

INSE Webapp

+

This page is a stub for the webapp that will be replaced.

+ + diff --git a/service/uv.lock b/service/uv.lock index 8564595c..d4016c83 100644 --- a/service/uv.lock +++ b/service/uv.lock @@ -1,6 +1,19 @@ version = 1 revision = 3 requires-python = ">=3.12" +resolution-markers = [ + "sys_platform != 'darwin'", + "sys_platform == 'darwin'", +] + +[[package]] +name = "annotated-doc" +version = "0.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, +] [[package]] name = "annotated-types" @@ -209,6 +222,24 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/53/50/b1222562c6d270fea83e9c9075b8e8600b8479150a18e4516a6138b980d1/fastapi-0.115.14-py3-none-any.whl", hash = "sha256:6c0c8bf9420bd58f565e585036d971872472b4f7d3f6c73b698e10cffdefb3ca", size = 95514, upload-time = "2025-06-26T15:29:06.49Z" }, ] +[[package]] +name = "filelock" +version = "3.29.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/91/f5/3557bf28e0f1943e4849154c821533706e6dea010f96fb6aa0b6949037d1/filelock-3.29.3.tar.gz", hash = "sha256:7fc1b3f39cf172fd8203812043c57b8a65aef9969f38b6704f628b881f761a84", size = 61956, upload-time = "2026-06-10T17:37:11.832Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/8f/b61d427c4f49a8bdadc93f4e7e74df8a6df6f77ee6e26bf0df53d3925363/filelock-3.29.3-py3-none-any.whl", hash = "sha256:e58333029cc9b925f39aad59b1d8f0a1ad836af4e60d7217f4a4dba87461261d", size = 42324, upload-time = "2026-06-10T17:37:10.37Z" }, +] + +[[package]] +name = "fsspec" +version = "2026.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d5/8d/1c51c094345df128ca4a990d633fe1a0ff28726c9e6b3c41ba65087bba1d/fsspec-2026.4.0.tar.gz", hash = "sha256:301d8ac70ae90ef3ad05dcf94d6c3754a097f9b5fe4667d2787aa359ec7df7e4", size = 312760, upload-time = "2026-04-29T20:42:38.635Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d5/0c/043d5e551459da400957a1395e0febbf771446ff34291afcbe3d8be2a279/fsspec-2026.4.0-py3-none-any.whl", hash = "sha256:11ef7bb35dab8a394fde6e608221d5cf3e8499401c249bebaeaad760a1a8dec2", size = 203402, upload-time = "2026-04-29T20:42:36.842Z" }, +] + [[package]] name = "greenlet" version = "3.5.1" @@ -273,6 +304,38 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, ] +[[package]] +name = "hf-xet" +version = "1.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4b/2d/57fd21d84d93efb4bd0b962383790e19dd1bc053501b4264c97903b4e83e/hf_xet-1.5.1.tar.gz", hash = "sha256:51ef4500dab3764b41135ee1381a4b62ce56fc54d4c92b719b59e597d6df5bf6", size = 876636, upload-time = "2026-06-08T23:02:53.897Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/64/ee/dd9ba7beae1005e54131b7d45263cc74c8a066d47d354e6d58ae9445a388/hf_xet-1.5.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:dbf48c0d02cf0b2e568944330c60d9120c272dabe013bd892d48e25bc6797577", size = 4069485, upload-time = "2026-06-08T23:02:13.193Z" }, + { url = "https://files.pythonhosted.org/packages/b6/bc/9cae6cfeb4e03070874e73e5c97c66eb90369d3206b6a2b1ef5f96520888/hf_xet-1.5.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e78e4e5192ad2b674c2e1160b651cb9134db974f8ae1835bdfbfb0166b894a43", size = 3838493, upload-time = "2026-06-08T23:02:15.282Z" }, + { url = "https://files.pythonhosted.org/packages/ba/b4/d5c01e0eb6d9f2ca2dacd84d0d1b71e6cfbb2ef3208c968528e010e9b3d7/hf_xet-1.5.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:6f7a04a8ad962422e225bc49fbbac99dc1806764b1f3e54dbd154bffa7593947", size = 4505658, upload-time = "2026-06-08T23:02:17.196Z" }, + { url = "https://files.pythonhosted.org/packages/76/c5/29a7598c0c6383c523dc22186d577f4e04267a626cd95ae60f67c00bfe66/hf_xet-1.5.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:d48199c2bf4f8df0adc55d31d1368b6ec0e4d4f45bc86b08038089c23db0bed8", size = 4292822, upload-time = "2026-06-08T23:02:18.608Z" }, + { url = "https://files.pythonhosted.org/packages/04/9a/dceaf6ca69390126b86ea825fb354b93d01163199070b7bd849225de9468/hf_xet-1.5.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:97f212a88d14bbf573619a74b7fecb238de77d08fc702e54dec6f78276ca3283", size = 4491255, upload-time = "2026-06-08T23:02:20.124Z" }, + { url = "https://files.pythonhosted.org/packages/48/a7/e5a7afaacf6c1791fdbeeac42951fb81c3d2bc482992b115dedcc86d963e/hf_xet-1.5.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:f61e3665892a6c8c5e765395838b8ddf36185da835253d4bc4509a81e49fb342", size = 4711062, upload-time = "2026-06-08T23:02:21.863Z" }, + { url = "https://files.pythonhosted.org/packages/53/49/2802f8433c9742ce281bddc1e65c02c32268ca3098d66828b05e12e45ee2/hf_xet-1.5.1-cp313-cp313t-win_amd64.whl", hash = "sha256:f4ad3ebd4c32dd2b27099d69dc7b2df821e30767e46fb6ee6a0713778243b8ff", size = 4017205, upload-time = "2026-06-08T23:02:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/9e/5a/50c71195b9fb883659f596e7252faf4c18c58e753a9013bdbf9bac5d2250/hf_xet-1.5.1-cp313-cp313t-win_arm64.whl", hash = "sha256:8298485c1e36e7e67cbd01eeb1376619b7af43d4f1ec245caae306f890a8a32d", size = 3845426, upload-time = "2026-06-08T23:02:25.124Z" }, + { url = "https://files.pythonhosted.org/packages/05/24/5e0c28f80371c17d49fed004597d9d132cb75c1f6f53db2cb95f459d2312/hf_xet-1.5.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:3474760d10e3bb6f92ff3f024fcb00c0b3e4001e9b035c7483e49a5dd17aa70f", size = 4069676, upload-time = "2026-06-08T23:02:26.759Z" }, + { url = "https://files.pythonhosted.org/packages/d2/17/261ba565b6a4d960fb478f61fdf919c0be5824645aaf1c319eca660c1611/hf_xet-1.5.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:6762d89b9e3267dfd502b29b2a327b4525f33b17e7b509a78d94e2151a30ce30", size = 3838509, upload-time = "2026-06-08T23:02:28.573Z" }, + { url = "https://files.pythonhosted.org/packages/4e/44/7ffdc2e184b0d41fc0f683ba3936ef669ab63cf242cf36ef50e57d683668/hf_xet-1.5.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:bf67e6ed10260cef62e852789dc91ebb03f382d5bdc4b1dbeb64763ea275e7d6", size = 4505881, upload-time = "2026-06-08T23:02:30.257Z" }, + { url = "https://files.pythonhosted.org/packages/63/b6/788060d5aa4d5e671f1a31bf69624c314eb2d8babab3aa562f9e5d53444e/hf_xet-1.5.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:c6b6cd08ca095058780b50b8ce4d6cbf6787bcf27841705d58a9d32246e3e47a", size = 4292995, upload-time = "2026-06-08T23:02:31.993Z" }, + { url = "https://files.pythonhosted.org/packages/22/93/c5540cbd6b55529b7dc42f6734e88cebee21aefbea34128b66229df56c57/hf_xet-1.5.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e1af0de8ca6f190d4294a28b88023db64a1e2d1d719cab044baf75bec569e7a9", size = 4491570, upload-time = "2026-06-08T23:02:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/03/f3/9d8ceab30f44f36c1679b1b8683054c71a0dadc787dbf07421891742d3ca/hf_xet-1.5.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:4f561cbbb92f80960772059864b7fb07eae879adde1b2e781ec6f86f6ac26c59", size = 4711565, upload-time = "2026-06-08T23:02:35.454Z" }, + { url = "https://files.pythonhosted.org/packages/cd/54/27ed9a5e2cc583b4df82f75a03a4df8dbf55f5a9fa1f47f1fadfb20dbeac/hf_xet-1.5.1-cp314-cp314t-win_amd64.whl", hash = "sha256:e7dbb40617410f432182d918e37c12303fe6700fd6aa6c5964e30a535a4461d6", size = 4017343, upload-time = "2026-06-08T23:02:37.14Z" }, + { url = "https://files.pythonhosted.org/packages/ae/12/ecb2fc8d45e767580e3a37faa97cb895608b614965567efb4f18cff67e27/hf_xet-1.5.1-cp314-cp314t-win_arm64.whl", hash = "sha256:6071d5ccb4d8d2cbd5fea5cc798da4f0ba3f44e25369591c4e89a4987050e61d", size = 3845716, upload-time = "2026-06-08T23:02:39.073Z" }, + { url = "https://files.pythonhosted.org/packages/7a/d8/5e54cf37434759d1f4f2ba9b66077ff9d4c4e1f37b6bd7975da5c40d94ab/hf_xet-1.5.1-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:6abd35c3221eff63836618ddfb954dcf84798603f71d8e33e3ed7b04acfdbe6e", size = 4077794, upload-time = "2026-06-08T23:02:40.656Z" }, + { url = "https://files.pythonhosted.org/packages/35/94/4b2ecfbad8f8b04701a23aefb62f540b9137d058b7e1dbef16a32676f0e9/hf_xet-1.5.1-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:94e761bbd266bf4c03cee73753916062665ce8365aa40ed321f45afcb934b41e", size = 3845354, upload-time = "2026-06-08T23:02:42.702Z" }, + { url = "https://files.pythonhosted.org/packages/de/cc/f99f4bc7295023d7bd9ebbfd51f75cc530ca262c1227666268b8208f4b77/hf_xet-1.5.1-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:892e3a3a3aecc12aded8b93cf4f9cd059282c7de0732f7d55026f3abdf474350", size = 4514864, upload-time = "2026-06-08T23:02:44.497Z" }, + { url = "https://files.pythonhosted.org/packages/cd/6e/21f7e5a2381278bd3b7b7a5a4d90038518bb6308a0c1daf5d9f8268bb178/hf_xet-1.5.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:a93df2039190502835b1db8cd7e178b0b7b889fe9ab51299d5ced26e0dd879a4", size = 4303784, upload-time = "2026-06-08T23:02:46.203Z" }, + { url = "https://files.pythonhosted.org/packages/35/0e/f992bb6927ac1cb30ef74e62268f551f338bc32b2191f7c96a44c6f7283e/hf_xet-1.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:0c97106032ef70467b4f6bc2d0ccc266d7613ee076afc56516c502f87ce1c4a6", size = 4500703, upload-time = "2026-06-08T23:02:47.628Z" }, + { url = "https://files.pythonhosted.org/packages/fb/d1/90a498d05447980b977b1669246eeeeae4cfb0ea3e7a286eaba627f91bf9/hf_xet-1.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:6208adb15d192b90e4c2ad2a27ed864359b2cb0f2494eb6d7c7f3699ac02e2bf", size = 4719498, upload-time = "2026-06-08T23:02:49.268Z" }, + { url = "https://files.pythonhosted.org/packages/6d/b6/20f99cfe97cc663a711f7b33cc21d4793e51968e9a26125b4afcd77315ba/hf_xet-1.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:f7b3002f95d1c13e24bcb4537baa8f0eb3838957067c91bb4959bc004a6435f5", size = 4026419, upload-time = "2026-06-08T23:02:50.829Z" }, + { url = "https://files.pythonhosted.org/packages/f9/fa/77453694888f03e5a8c8852d1514a0894d8e81c622d39edbaf308ea0dcf4/hf_xet-1.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:93d090b57b211133f6c0dab0205ef5cb6d89162979ba75a74845045cc3063b8e", size = 3855178, upload-time = "2026-06-08T23:02:52.452Z" }, +] + [[package]] name = "httpcore" version = "1.0.9" @@ -302,6 +365,27 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0", size = 76395, upload-time = "2024-08-27T12:53:59.653Z" }, ] +[[package]] +name = "huggingface-hub" +version = "1.19.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "filelock" }, + { name = "fsspec" }, + { name = "hf-xet", marker = "platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'" }, + { name = "httpx" }, + { name = "packaging" }, + { name = "pyyaml" }, + { name = "tqdm" }, + { name = "typer" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/88/27/629cfe58c582f92ded066c4a07d1a057ff617118ab7973200f770bd853cb/huggingface_hub-1.19.0.tar.gz", hash = "sha256:fd771622182d40977272a923953ee3b1b13538f9f8a7f5d78398f10af0f1c0bd", size = 824721, upload-time = "2026-06-11T12:33:18.665Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b2/a5/558da89f66464d8d0229ff497e8b8666977de2d8cf48c28a2862ecf1250f/huggingface_hub-1.19.0-py3-none-any.whl", hash = "sha256:1dc72e1f6b4d6df6b30eb72e57d00514ef453d660f04af2b87f0e67267f31ee0", size = 693398, upload-time = "2026-06-11T12:33:16.695Z" }, +] + [[package]] name = "idna" version = "3.16" @@ -320,6 +404,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] +[[package]] +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + [[package]] name = "jiter" version = "0.15.0" @@ -392,6 +488,187 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/8d/302cb2057b7513327b4d575cff6b1d066ee6431a5357fc3f8867cd684406/jiter-0.15.0-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d5d6090cdc1b7c9e780dfb04949a990adb1e301a2fc0bbcee7de4638d33f9a", size = 344469, upload-time = "2026-05-19T10:09:46.864Z" }, ] +[[package]] +name = "joblib" +version = "1.5.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/41/f2/d34e8b3a08a9cc79a50b2208a93dce981fe615b64d5a4d4abee421d898df/joblib-1.5.3.tar.gz", hash = "sha256:8561a3269e6801106863fd0d6d84bb737be9e7631e33aaed3fb9ce5953688da3", size = 331603, upload-time = "2025-12-15T08:41:46.427Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7b/91/984aca2ec129e2757d1e4e3c81c3fcda9d0f85b74670a094cc443d9ee949/joblib-1.5.3-py3-none-any.whl", hash = "sha256:5fc3c5039fc5ca8c0276333a188bbd59d6b7ab37fe6632daa76bc7f9ec18e713", size = 309071, upload-time = "2025-12-15T08:41:44.973Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" }, + { url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" }, + { url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" }, + { url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" }, + { url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" }, + { url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" }, + { url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" }, + { url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" }, + { url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" }, + { url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" }, + { url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" }, + { url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" }, + { url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" }, + { url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" }, + { url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" }, + { url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" }, + { url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" }, + { url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" }, + { url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" }, + { url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" }, + { url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" }, + { url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" }, + { url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" }, + { url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" }, + { url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" }, + { url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" }, + { url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" }, + { url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" }, + { url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" }, + { url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" }, + { url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" }, + { url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" }, + { url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" }, + { url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" }, + { url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" }, + { url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" }, + { url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" }, + { url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" }, + { url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" }, + { url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" }, + { url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" }, + { url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" }, + { url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" }, + { url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" }, + { url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" }, + { url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" }, + { url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" }, + { url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" }, + { url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" }, + { url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" }, + { url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" }, + { url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "mpmath" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/47/dd32fa426cc72114383ac549964eecb20ecfd886d1e5ccf5340b55b02f57/mpmath-1.3.0.tar.gz", hash = "sha256:7a28eb2a9774d00c7bc92411c19a89209d5da7c4c9a9e227be8330a23a25b91f", size = 508106, upload-time = "2023-03-07T16:47:11.061Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/e3/7d92a15f894aa0c9c4b49b8ee9ac9850d6e63b03c9c32c0367a13ae62209/mpmath-1.3.0-py3-none-any.whl", hash = "sha256:a0b2b9fe80bbcd81a6647ff13108738cfb482d481d826cc0e02f5b35e5c88d2c", size = 536198, upload-time = "2023-03-07T16:47:09.197Z" }, +] + +[[package]] +name = "narwhals" +version = "2.22.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/62/3c/c4ef2164a71c1a63d7f1ae411c4082c5fa872405106db60a4b7114989ad7/narwhals-2.22.1.tar.gz", hash = "sha256:d62920805a0a43b7ff8b54b0c0d3142d796f8a9301836ada37e573d6a33cbcd9", size = 647493, upload-time = "2026-06-05T12:34:34.051Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/ca/36339329c4604adbcc99c899b7eb1ce1a555c499b6a6860757dc9bfed36d/narwhals-2.22.1-py3-none-any.whl", hash = "sha256:60567d774edf77db53906f89d9fbd164e66e56d66d388e1e6990f17ac33cfb53", size = 454815, upload-time = "2026-06-05T12:34:32.289Z" }, +] + +[[package]] +name = "networkx" +version = "3.6.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/51/63fe664f3908c97be9d2e4f1158eb633317598cfa6e1fc14af5383f17512/networkx-3.6.1.tar.gz", hash = "sha256:26b7c357accc0c8cde558ad486283728b65b6a95d85ee1cd66bafab4c8168509", size = 2517025, upload-time = "2025-12-08T17:02:39.908Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9e/c9/b2622292ea83fbb4ec318f5b9ab867d0a28ab43c5717bb85b0a5f6b3b0a4/networkx-3.6.1-py3-none-any.whl", hash = "sha256:d47fbf302e7d9cbbb9e2555a0d267983d2aa476bac30e90dfbe5669bd57f3762", size = 2068504, upload-time = "2025-12-08T17:02:38.159Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/95/2a/3d7b5ac8aac24feaf9ad7ed58f45b0bbc06d37e4338ae84c9f2298b570f9/numpy-2.4.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:001fbb8e08d942dd57599e781f2472269ee7f2755fae407b4f67b2f0b17da3f1", size = 16689119, upload-time = "2026-05-18T23:33:54.065Z" }, + { url = "https://files.pythonhosted.org/packages/ea/12/92c4c131527599e8288d6918e888d88726f84d805d784b771f32408aeaef/numpy-2.4.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ebfb099f8dcf083deef3ac1ca4c1503f387cf76296fcb3816b66f5ecb5f54fdb", size = 14699246, upload-time = "2026-05-18T23:33:57.621Z" }, + { url = "https://files.pythonhosted.org/packages/ad/fe/c0a6b7b2ca128a8fb228575147073b660656734b8ebe4d76c8fd748dcc79/numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41", size = 5204410, upload-time = "2026-05-18T23:34:00.302Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d4/9770d14ba719432bb90a421bfd443872ed0f70f7264b64bec12ea363d5fd/numpy-2.4.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698", size = 6551240, upload-time = "2026-05-18T23:34:02.852Z" }, + { url = "https://files.pythonhosted.org/packages/c9/c6/50a46a6205feba2343f1d6d17438107c5dc491ed1c736e6ea68689fd906b/numpy-2.4.6-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f9fb9157b4ce2971008323afe46053787b526ef624fea915b261468a8421a0f", size = 15671012, upload-time = "2026-05-18T23:34:05.485Z" }, + { url = "https://files.pythonhosted.org/packages/99/60/14115e6364fa676c5397c2ad3004e527e9aa487abf5d0706ec81bbd08529/numpy-2.4.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90f9849678c75fe7afa2d348ac842c168b0a4d3d61919687216dfc547976d853", size = 16645538, upload-time = "2026-05-18T23:34:09.265Z" }, + { url = "https://files.pythonhosted.org/packages/ae/c5/693cbe59e57db94d2231fa519ca3978dc9e19da5a8f088588f5c6e947ff2/numpy-2.4.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c1a2af6c6ef86344a6b0db6b97834208bf598db514f2b155042439b62605601a", size = 17020706, upload-time = "2026-05-18T23:34:13.053Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fc/85b7c4eff9b4966ade25c2273cf7e7012e92366c032058653934b37de044/numpy-2.4.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e5805d5a22fd19c8ccff10a9561f9df94436b0545619ea579db2d3c35294bce2", size = 18368541, upload-time = "2026-05-18T23:34:17.024Z" }, + { url = "https://files.pythonhosted.org/packages/f6/81/e1b27545deedce7f4a0b348618c6b62d74e36a4dc9ccd42f3eb2f85eee32/numpy-2.4.6-cp312-cp312-win32.whl", hash = "sha256:e3eeb0aabd6bd5ce64faae67e9935203a6991b4bc2a485a767fbafb2c5125f45", size = 5962825, upload-time = "2026-05-18T23:34:20.3Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ca/feab00bd44aa5fe1ad2c18f08b4d3bb92e26484b0b1d1443897809ed528c/numpy-2.4.6-cp312-cp312-win_amd64.whl", hash = "sha256:d8e8286dd7cea7895157318d1b91cdacac64c479f3cbc8dce548331728484751", size = 12321687, upload-time = "2026-05-18T23:34:23.095Z" }, + { url = "https://files.pythonhosted.org/packages/63/cf/5a6d34850a39d1093558564f77ee8e8e0bee5061151b8f05a55711001ec7/numpy-2.4.6-cp312-cp312-win_arm64.whl", hash = "sha256:4081eb135ac24158bd51cdfbef16f1c64df7063b1143f24731387137c092bec8", size = 10221482, upload-time = "2026-05-18T23:34:25.876Z" }, + { url = "https://files.pythonhosted.org/packages/fb/82/bdab26d7438c6791ca31b7c024ca37c1eab8b726ba236129005cd4a06e45/numpy-2.4.6-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:511dbaf848decaaaf4b4ca48032619fb3138710c4bf7da7617765edad1ef96b0", size = 16684648, upload-time = "2026-05-18T23:34:29.41Z" }, + { url = "https://files.pythonhosted.org/packages/1b/30/a80189bcc7f5e4258b3fbc3968d909d1756f54d023299ecc39ad6fdb9ef8/numpy-2.4.6-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:bf162abab1c1a736333192707cef898e735a5ca00f38f27eeedf44b39d9e85eb", size = 14693902, upload-time = "2026-05-18T23:34:33.013Z" }, + { url = "https://files.pythonhosted.org/packages/97/12/70b5d0d7c15e1ebb8a6a84a8caa1d19e181d84fb58bb6d70aca29099dec1/numpy-2.4.6-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:043191bfa8eab18c776647b62723ac9dddece59743b13f49b2016094129c2b3f", size = 5198992, upload-time = "2026-05-18T23:34:36.132Z" }, + { url = "https://files.pythonhosted.org/packages/ba/8c/ebd2a8f8a83541f8d38cc5667e8c2b69cecfd30da6e45693e8158857d44b/numpy-2.4.6-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:6180d8b35af935aed8ece3a85e0a43f87393ae0ac87c8d2c8bd2c993f7270ef3", size = 6546944, upload-time = "2026-05-18T23:34:38.484Z" }, + { url = "https://files.pythonhosted.org/packages/bb/c5/7b863a97a91671a0338f4253bd3b5a3d3852f0692dae91711c9f4a10e787/numpy-2.4.6-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:72fbe16c6fac95aedf5937fa873445cec2110be35d8a4e9433d7501fd98dae6b", size = 15669392, upload-time = "2026-05-18T23:34:41.257Z" }, + { url = "https://files.pythonhosted.org/packages/a5/9d/3584b9984ca4c047aea75214ce1a4c4c73d849bd71b604264b7f5653f8a8/numpy-2.4.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a7830bab239b79cda9c08c2da014761cafb48da6150e1da17ac06283f43b6089", size = 16633220, upload-time = "2026-05-18T23:34:45.075Z" }, + { url = "https://files.pythonhosted.org/packages/05/ae/7c67fba23bd98caec7c99261f3a16072ade14813486b0282cb29846de832/numpy-2.4.6-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ef4aea96ce4d3b074422cb4f2f64e216bf9e213004bb58ecfdf50ea02ea8eb9a", size = 17020800, upload-time = "2026-05-18T23:34:49.065Z" }, + { url = "https://files.pythonhosted.org/packages/d9/5d/3b6725cb31d983c5e66916f5d36f6d7e5521129e4c4404d64f918292a5b6/numpy-2.4.6-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:dfa20cc6ca228e6b155b11da03825975ce66aea520985dbbddf0f2a5a495c605", size = 18357600, upload-time = "2026-05-18T23:34:52.709Z" }, + { url = "https://files.pythonhosted.org/packages/f7/da/2ccc6c2fe8898dee01d90c75c5f5f914a23daf99e3e0f59516a08760c8b5/numpy-2.4.6-cp313-cp313-win32.whl", hash = "sha256:56b39e5e0622a09a25bf5baf62f4bcf0cb8a41ae6e2819cf49bbc5a74c083f91", size = 5961134, upload-time = "2026-05-18T23:34:55.618Z" }, + { url = "https://files.pythonhosted.org/packages/b5/cd/9cc4dc876fb065d5c220aae4d5e14826b2715331bb7618ce1fb07a679d99/numpy-2.4.6-cp313-cp313-win_amd64.whl", hash = "sha256:c4fc99836233ea196540b17ab0983aff60ed07941751930f5f4d05bc3b3b7359", size = 12318598, upload-time = "2026-05-18T23:34:58.928Z" }, + { url = "https://files.pythonhosted.org/packages/39/1e/c0bcba1f8694116485fe28fd1be698c278fcda4141c5b0e53a2aed8b12a8/numpy-2.4.6-cp313-cp313-win_arm64.whl", hash = "sha256:a7c711e21628b52034bb5ab8d1bce291f752fcc5e92accc615778acee1ff4778", size = 10222272, upload-time = "2026-05-18T23:35:02.167Z" }, + { url = "https://files.pythonhosted.org/packages/63/6d/cc5619247c8f4204e507f5883528372e4ac4bb189e579fb859a12e480b1f/numpy-2.4.6-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:112b06a867b235ef466ed3508ddf0238050df9c727cafb5301ac385b899189a1", size = 14821197, upload-time = "2026-05-18T23:35:05.468Z" }, + { url = "https://files.pythonhosted.org/packages/00/58/f1c39161c87d9e9bed660f1ed4bafc0e403d5ec9650b6dd77aead07d489b/numpy-2.4.6-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:eaf7fa2de5c0be8ae6ff8e9bea2ccd725e980541244521d8d4b5f3354a27babe", size = 5326287, upload-time = "2026-05-18T23:35:08.693Z" }, + { url = "https://files.pythonhosted.org/packages/af/57/3917ab0fd97f271a8694513581b8a36c655f111c446852c302f04ccdb6fc/numpy-2.4.6-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:7265a2f3d436e54ef9f2b52b5c937e6be778781bd97a590319d7348f1c1ca997", size = 6646763, upload-time = "2026-05-18T23:35:11.459Z" }, + { url = "https://files.pythonhosted.org/packages/eb/0f/037e64c494b67581ae18193d770adef354c41f3f2c8ebf865602d949bf8f/numpy-2.4.6-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f74a575920ab21fe304421a3fc28793d82e299cae9eccb37084e9fc7f3617c20", size = 15728070, upload-time = "2026-05-18T23:35:14.79Z" }, + { url = "https://files.pythonhosted.org/packages/21/a6/5d2bae9c9542eb4df16dc9c46dc79c186e9bad53805dfa5399a6023c6db0/numpy-2.4.6-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ede83e07a75dd06bc501566c1eca2afc0d61677c1472ac9ad93fdee6e638a48d", size = 16681752, upload-time = "2026-05-18T23:35:18.836Z" }, + { url = "https://files.pythonhosted.org/packages/92/14/23d1dfb410ae362cd59ce53e936b1513d545eb40db3949ced632e19a459e/numpy-2.4.6-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:68bb27509ac1b9a3443094260f6326150663b06abe40b73a2f81160623da5b67", size = 17086024, upload-time = "2026-05-18T23:35:22.52Z" }, + { url = "https://files.pythonhosted.org/packages/4b/6e/23595a2c642cdf3bc567877064bdd7f91c8b0038a4453cf2daf7248eafe9/numpy-2.4.6-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:a0df0043bdb289bde1f62da130d20df23d58b45429f752bc7a8fc5325a225ecd", size = 18403398, upload-time = "2026-05-18T23:35:26.398Z" }, + { url = "https://files.pythonhosted.org/packages/8a/90/0ac3bc947217e66dec77e7cbc6a1979d1af70b6461b82f620d3bccd5e4c8/numpy-2.4.6-cp313-cp313t-win32.whl", hash = "sha256:29a287e0cf63ff528da061de6b9f64a4618da591ca1046aafc54062e40ca7eab", size = 6084971, upload-time = "2026-05-18T23:35:29.387Z" }, + { url = "https://files.pythonhosted.org/packages/77/71/5673e351671a1d2bd6063b91b44f70c0affea7d1516fa7a6572941ba4aa1/numpy-2.4.6-cp313-cp313t-win_amd64.whl", hash = "sha256:25c692919ac5a01f170a3bfcd62d745b24fd095c353d50812637d6fcab442e75", size = 12458532, upload-time = "2026-05-18T23:35:32.175Z" }, + { url = "https://files.pythonhosted.org/packages/3f/88/19d3503c5046e688f049274b27a3ef3d771152fa80d3ba3d01a3dff61abe/numpy-2.4.6-cp313-cp313t-win_arm64.whl", hash = "sha256:1e978ec1e8bd0e0e4de6bb75de9d30cbb74db6b6a2bb727618613703ca0167dd", size = 10291881, upload-time = "2026-05-18T23:35:35.465Z" }, + { url = "https://files.pythonhosted.org/packages/f8/91/3ab2044d05fd16d343c5ac2e69b127f1b2854040dd20b193257c78028bd3/numpy-2.4.6-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:06ca2f61ec4385a07a6977c55ba998a4466c123642b4a32694d3128fce18c079", size = 16683458, upload-time = "2026-05-18T23:35:38.353Z" }, + { url = "https://files.pythonhosted.org/packages/8e/62/764ce66fa4147ae6d73071a3abf804ffe606f174618697c571acdf26a7c9/numpy-2.4.6-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:38efbc8de75c7a0fc1ac190162d892787f3f47b57cc291231aafee36b80982b7", size = 14704559, upload-time = "2026-05-18T23:35:42.14Z" }, + { url = "https://files.pythonhosted.org/packages/60/61/23f27c172f022e04025b7dc2367f4d63c1a398120607ec896228649a6f48/numpy-2.4.6-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:d581b735e177fdcdce6fed8e7e8880a3fb6ee4e3653a3ac6af01c6f4c03effc5", size = 5209716, upload-time = "2026-05-18T23:35:45.377Z" }, + { url = "https://files.pythonhosted.org/packages/03/71/21cf70dc6ea3e3acb95fc53a265b2fc248b981f0194ceb5b475271b8809d/numpy-2.4.6-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:0a041d3d761dc3c35cc56ce0351506a02bcbc25f7b169f652435141a17db9096", size = 6543947, upload-time = "2026-05-18T23:35:47.926Z" }, + { url = "https://files.pythonhosted.org/packages/d5/91/64288395ee1799bd2e0b04a305dce9666da90c961e1f3fe982a05ee1c036/numpy-2.4.6-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40fdc1ae7125e518ea98e53e69a4ebc27e1fd50510c47b7ea130cf21e5e1d42b", size = 15685197, upload-time = "2026-05-18T23:35:50.863Z" }, + { url = "https://files.pythonhosted.org/packages/f3/eb/ebffaa97dc55502df69584a8f0dcf07f69a3e0b3e2323670a2722db9aa39/numpy-2.4.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a2c306dea656c12c68f51f4cea133cbe78ca7435eb28c735eac1d3ebe73be6e8", size = 16638245, upload-time = "2026-05-18T23:35:54.752Z" }, + { url = "https://files.pythonhosted.org/packages/b8/0b/54f9da33128d7e350fab89c7455902eeae70349ee52bddb448dc4a576f45/numpy-2.4.6-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:33111801a01c12a8a1e3721f0a9232f8cfc8ae2c6b7098167e6f623c6073f402", size = 17036587, upload-time = "2026-05-18T23:35:58.355Z" }, + { url = "https://files.pythonhosted.org/packages/b6/f0/fdebc1052db1cc37c64beb22072d67cd6d1c71adca1299f53dec2b5e20d3/numpy-2.4.6-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:ae506e6902902557576a26ff33eda8695e7ecb3cb36c3b573a0765dee114ebdb", size = 18363226, upload-time = "2026-05-18T23:36:02.845Z" }, + { url = "https://files.pythonhosted.org/packages/aa/b4/298628d98c72b57e57f7165ae6a481a1deaf6f3c28262a6e4c739c275930/numpy-2.4.6-cp314-cp314-win32.whl", hash = "sha256:aaf159caa35993cb1f56fb9b8e4610d35758e7ca005412eb1daa856a78c9c4b1", size = 6010196, upload-time = "2026-05-18T23:36:05.92Z" }, + { url = "https://files.pythonhosted.org/packages/df/ac/46de6dda46478f7942f839e094970be2d4a861e005c4b3bf07c92e291a09/numpy-2.4.6-cp314-cp314-win_amd64.whl", hash = "sha256:b507f5c4c1d508876d1819b6bf9a49d365b96320b5d4993426b33a23ca4b8261", size = 12450334, upload-time = "2026-05-18T23:36:09.107Z" }, + { url = "https://files.pythonhosted.org/packages/78/92/b8b798ac784102c0da830d2257d59358e3d3d90d1e2b3f2575dad976c5cf/numpy-2.4.6-cp314-cp314-win_arm64.whl", hash = "sha256:6f41ae150c4e32db4f3310cdaf64b1593a03dbabe29eec77fc9b50fe64061df6", size = 10495678, upload-time = "2026-05-18T23:36:12.766Z" }, + { url = "https://files.pythonhosted.org/packages/30/34/ec28d1aa8115971537c01469ab2011ee96827930f0a124de1000cc2a7ed7/numpy-2.4.6-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:ece3d2cfe132e7d51f44a832b303895e6f2d499c5e74dfbdb06ee246147a304a", size = 14823672, upload-time = "2026-05-18T23:36:16.473Z" }, + { url = "https://files.pythonhosted.org/packages/16/bd/f6d1fede4e54e8042a7ff97bb495510f3c220f94bcd9e8b228e87c92cc0d/numpy-2.4.6-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:e3e5193ef5a3dc73bceee50f7fdc2c90dbb76c42df8d8fae3d1067a583df579e", size = 5328731, upload-time = "2026-05-18T23:36:19.767Z" }, + { url = "https://files.pythonhosted.org/packages/f4/f0/e105b9e2fd728a9910103884decd6951d9dd73896b914a98d9a231de02ee/numpy-2.4.6-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:17f9ade344e7d9b464a084d69bcf18fc691cb1db67c62ed80820bf4926d78f0e", size = 6649805, upload-time = "2026-05-18T23:36:22.266Z" }, + { url = "https://files.pythonhosted.org/packages/82/dd/1206a7ca6ab15e3f02069707ca96222e202af681bb73756da7527f3cb837/numpy-2.4.6-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cd5ffd25db4e7ba6a375693b3fc0fc1791ec636c17db3720da19bde7180ec43", size = 15730496, upload-time = "2026-05-18T23:36:25.713Z" }, + { url = "https://files.pythonhosted.org/packages/51/e7/38d3ea825dcab85a591734decb2f6c67caa7c8367d374df1a1c3842f9b07/numpy-2.4.6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d92c3819208a60205a12a245c91ad70cb0a85336659b19b834205573ac8456e", size = 16679616, upload-time = "2026-05-18T23:36:29.652Z" }, + { url = "https://files.pythonhosted.org/packages/93/b7/caabfdf53edf663e0b4eb74d7d405d83baef09eb5e83bcd32d601d72b93e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e85b752a1e912b70eaad4fafbd4d1238007ab221de2009b9a2f5ae7461239895", size = 17085145, upload-time = "2026-05-18T23:36:33.449Z" }, + { url = "https://files.pythonhosted.org/packages/f9/45/68d7c33a6bcf3e5aa3bdbd57a367e6f615286dfd6482f97e8ffeb734306e/numpy-2.4.6-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:29cb7f67d10b479ff07c17d33e39f78c07f71c40ef30d63c153d340e96cd3fb4", size = 18403813, upload-time = "2026-05-18T23:36:37.369Z" }, + { url = "https://files.pythonhosted.org/packages/9c/50/0753655aa844c99cd9e018aacf76f130f1bd81d881bb74bc0aef5d73a8ba/numpy-2.4.6-cp314-cp314t-win32.whl", hash = "sha256:260a5d70215b61ab4fadf5c7baacd64821842975eea312125ed3c39a6391b063", size = 6156982, upload-time = "2026-05-18T23:36:40.817Z" }, + { url = "https://files.pythonhosted.org/packages/b2/d4/7c67becf668f973cb490cec3e98dfd799d866f9c989a54d355672cfa0db6/numpy-2.4.6-cp314-cp314t-win_amd64.whl", hash = "sha256:81a1cca95ed5bb92aa8b10dd2cdc9a0d3853a50fad926c28b5d7e8ea54389627", size = 12638908, upload-time = "2026-05-18T23:36:43.996Z" }, + { url = "https://files.pythonhosted.org/packages/43/bb/e1c71a4295b1b1d1393d50dbb4f2a36283c6859d9d3892e84f00ec5a91d5/numpy-2.4.6-cp314-cp314t-win_arm64.whl", hash = "sha256:0c9136e14ed34a9e343a31c533d78a9813a69a3148332bce5e9821cb2f996e66", size = 10565867, upload-time = "2026-05-18T23:36:47.114Z" }, +] + [[package]] name = "openai" version = "2.41.0" @@ -489,6 +766,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/99/ee/24ec87e3a91426497c5a2b9880662d19cfd640342d477334ebc60fc2c276/pydantic_settings-2.2.1-py3-none-any.whl", hash = "sha256:0235391d26db4d2190cb9b31051c4b46882d28a51533f97440867f012d4da091", size = 13150, upload-time = "2024-02-19T19:50:19.747Z" }, ] +[[package]] +name = "pygments" +version = "2.20.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, +] + [[package]] name = "pyjwt" version = "2.8.0" @@ -589,6 +875,251 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" }, ] +[[package]] +name = "regex" +version = "2026.5.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/0e/49aee608ad09480e7fd276898c99ec6192985fa331abe4eb3a986094490b/regex-2026.5.9.tar.gz", hash = "sha256:a8234aa23ec39894bfe4a3f1b85616a7032481964a13ac6fc9f10de4f6fca270", size = 416074, upload-time = "2026-05-09T23:15:19.37Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/9b/6550044bc44e17c84d312c031c2ec42fbdb6a4ec4e29093be3a172d08772/regex-2026.5.9-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:57eeeb05db7979413dec5438f2db21d7ecbba787cde7a711df1a6f6df672aa06", size = 490451, upload-time = "2026-05-09T23:12:34.72Z" }, + { url = "https://files.pythonhosted.org/packages/1e/95/fc7ba4303b5a0f92446a12ee6778ef2c6c799233f5060042a31bf390cfe9/regex-2026.5.9-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:398c521292f4c7fb807001dcd54694d3a1fcafc179a36ad9cc56f98df85930b6", size = 292112, upload-time = "2026-05-09T23:12:36.285Z" }, + { url = "https://files.pythonhosted.org/packages/54/4b/ee27938d1b2c443e89a9a10e00d2d19aa5ee300cd3d61140644e93bb083e/regex-2026.5.9-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f7a7c26137296beba7784de6eba69c6a93a63ccebc385e4962fe67e267a91225", size = 289599, upload-time = "2026-05-09T23:12:38.089Z" }, + { url = "https://files.pythonhosted.org/packages/d8/dd/ba103dc19614e25f3880800ca67ce093d6e21b325d72b8383c7bf906e9fa/regex-2026.5.9-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6441cc660d76107934a09c22167200839a0e89604a6297f78a974e66e931d2c0", size = 796732, upload-time = "2026-05-09T23:12:40.062Z" }, + { url = "https://files.pythonhosted.org/packages/cf/e7/f035b4fd858b050b0080bf302968dc0f59ba34e391872d54936758e6844e/regex-2026.5.9-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:91328f1c23d47595ca3ef0a7557fa129c5a23404b775c770697d2f35b33e0107", size = 865440, upload-time = "2026-05-09T23:12:42.059Z" }, + { url = "https://files.pythonhosted.org/packages/0a/51/8cd301ecc899aea28124357f729f4272f44de7806fc7ca02490bfbe253e8/regex-2026.5.9-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:93a7860539414dddaefba2b40f8771765ae17949d4c7182b876ce429e11a8309", size = 912329, upload-time = "2026-05-09T23:12:44.373Z" }, + { url = "https://files.pythonhosted.org/packages/cc/1e/3fbe2fa1e8cebd62f3bb7d3321cff1640aca2e240b51d9bd624aad949260/regex-2026.5.9-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:dd2810d22146b6d838acc5ec15602cb6b47920aa4e33015df3868eedfd20bab8", size = 801239, upload-time = "2026-05-09T23:12:46.268Z" }, + { url = "https://files.pythonhosted.org/packages/17/2f/6f6008682bf2cf98040a0d3153a8e557b6ab728d7713d045cee4ce544ab8/regex-2026.5.9-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:daff2bdbaf1d23e52fdff7c0b7bc2048b68f978df6a4d107ac981f94caef2e66", size = 777054, upload-time = "2026-05-09T23:12:48.051Z" }, + { url = "https://files.pythonhosted.org/packages/19/2b/eee0d20a6842ba04df4b8847a920b57ef56853f14ef85405473e586b605a/regex-2026.5.9-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4eeb011098fcb77af513dcef521a3dbecbf8849b1e38940759d293b7a93f5026", size = 785098, upload-time = "2026-05-09T23:12:49.851Z" }, + { url = "https://files.pythonhosted.org/packages/4a/98/6fc1e6410feefb92159edaed5041992bfe390e8d26c721865434acbca558/regex-2026.5.9-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:ea9c8ecfa1b73c73b626534d6626e5340d429630943672b8480724f44e84b962", size = 860095, upload-time = "2026-05-09T23:12:51.666Z" }, + { url = "https://files.pythonhosted.org/packages/18/a3/bd855e0f2cb1a978ecf6fa6bb69632dd9c3f6ea3b81cde62fde14c9daec7/regex-2026.5.9-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:cd2846168eb9ee3c513902bc8225409cb1caab31d04728b145171fa1625d9621", size = 765762, upload-time = "2026-05-09T23:12:53.413Z" }, + { url = "https://files.pythonhosted.org/packages/dc/66/0ae8c092e60b14c79d24f8e0b7f0aea5bfbffdcab00b5483d13404d3c3a5/regex-2026.5.9-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:39617fb0cde9c0e6306dc70e3bfc096f3da793219879f7ae7aa341a69fbdcf6d", size = 852100, upload-time = "2026-05-09T23:12:55.256Z" }, + { url = "https://files.pythonhosted.org/packages/21/de/8dfde60fc1b21c946a893ba273403b72617edb261370cb1087099a83f088/regex-2026.5.9-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fd03c4f0e33280d15cae17159b899245d6b7c53d21def19b263b39655061f5ce", size = 789479, upload-time = "2026-05-09T23:12:57.573Z" }, + { url = "https://files.pythonhosted.org/packages/c3/1c/bdcc98f9a4af4fdd166c74941174619ccff4726d3ce32faa8e9a2ecd38dd/regex-2026.5.9-cp312-cp312-win32.whl", hash = "sha256:164eba9b755ea6f244b0d881196fbc1fac09714e9782c9e2732b813142033c8e", size = 266699, upload-time = "2026-05-09T23:12:59.14Z" }, + { url = "https://files.pythonhosted.org/packages/78/87/240d36864f9e48ace85f72e79ced97ceb7f27ce87739a947dcb834b4e6bc/regex-2026.5.9-cp312-cp312-win_amd64.whl", hash = "sha256:86f40a5d6444db30a125c9c9177e6b25dad981cbc37451fd838f145e6edac92e", size = 277783, upload-time = "2026-05-09T23:13:00.789Z" }, + { url = "https://files.pythonhosted.org/packages/4f/b5/7b30f312b0669dff5beebe5b0989dc2d1a312b1a44fab852199c387a5b96/regex-2026.5.9-cp312-cp312-win_arm64.whl", hash = "sha256:96f5f58b54a063d7ea9dca08e1cf57bfe10499c4d579ee672da284f57f5f0070", size = 270513, upload-time = "2026-05-09T23:13:02.426Z" }, + { url = "https://files.pythonhosted.org/packages/aa/da/797e91ecec6f84135da778ddce78c20e0af5d2a15c26f87a81bc3eadb6db/regex-2026.5.9-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:d626b84406444b165fc0ba981604edea39f0588ff1f92baa23fe50799ea9afdb", size = 490303, upload-time = "2026-05-09T23:13:04.382Z" }, + { url = "https://files.pythonhosted.org/packages/44/da/bf30abaaa737b58f4a4b8c4a03659e02fd92092c822e0197ed9e0daab917/regex-2026.5.9-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:d7bdc0ab8f3dd7e1b4f9ab88634e13374669db86bb3c72e8292f07ae313f539f", size = 292019, upload-time = "2026-05-09T23:13:06.022Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e7/d0eaf5713828417b9e5648cf81fa9bacd4961f6ab98c380c2034f8716e35/regex-2026.5.9-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a8820737949116ffff55fe18f9fc644530063ba6ebfcb8314239416e78f1347c", size = 289468, upload-time = "2026-05-09T23:13:08.214Z" }, + { url = "https://files.pythonhosted.org/packages/d3/9b/b3fdd62b003baa1a9b593cd8c8699c9651c2e80cc21a5c715707983c42d7/regex-2026.5.9-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa0fbdbac82cb3e4450d0ccde7d7a35607f4cb2dd9fba4b8b69bfaf8c9fa6aed", size = 796749, upload-time = "2026-05-09T23:13:10.573Z" }, + { url = "https://files.pythonhosted.org/packages/d4/30/66ab84588765f5b4b271a9ca09ef7ce2b87caa95176ec3d2ad65d7bc4902/regex-2026.5.9-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:57e8915c7986aa33d25e4d3629cef711cd2863f2961b10409f0c04cb8b7d9020", size = 865445, upload-time = "2026-05-09T23:13:12.523Z" }, + { url = "https://files.pythonhosted.org/packages/1a/89/f05169e8588aac365f35ffc7f3bc3184f095ef4cfded7cfaa3c7fd5dbd89/regex-2026.5.9-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:508f56a89ba9cb26e4168cbc37dbd60a28d82430a9e18ad1d25fe0883c314ca2", size = 912322, upload-time = "2026-05-09T23:13:14.281Z" }, + { url = "https://files.pythonhosted.org/packages/30/e1/c93444052cf41581f3c884ab3fb5823daf0992f11cd4388d4275ca610558/regex-2026.5.9-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b6d189041f15691cfa2b6c4290448ec221244d225b3f5fe9e7771b34ffcdf6e2", size = 801269, upload-time = "2026-05-09T23:13:16.569Z" }, + { url = "https://files.pythonhosted.org/packages/50/fe/0cf96b882f540e62e8b9956599798203d599c44cf4c77917ca27400ff69b/regex-2026.5.9-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e82db382b44d0111b22601c509c89f64434816c9e0eef9d1989cda8cc6ff1c04", size = 777085, upload-time = "2026-05-09T23:13:18.675Z" }, + { url = "https://files.pythonhosted.org/packages/23/5c/d78d4924e7fc875557b9e9b768423925fdfaac5549d06da7810019a9bd26/regex-2026.5.9-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:2acfb48634f64996b57f90f39afa692ff362162722581921fe92239a59960f3c", size = 785153, upload-time = "2026-05-09T23:13:20.525Z" }, + { url = "https://files.pythonhosted.org/packages/bf/e0/5214774090e7b4524dcea3e3c4aa74141d43043f8beb49c1599db1c8b53a/regex-2026.5.9-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:d29eebfc9525db68cad3c97eedd7f754fa265aa5cd0cf4f863b2421e1b48fc9f", size = 860164, upload-time = "2026-05-09T23:13:22.263Z" }, + { url = "https://files.pythonhosted.org/packages/6e/e1/4a57a83350319b1271f0d7a249b8672513ed928b237a741631270de6caea/regex-2026.5.9-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:debb893095e944091c16e641a6e33c1b0f4cb61ab945ec5afbf53ce7068834d8", size = 765731, upload-time = "2026-05-09T23:13:24.277Z" }, + { url = "https://files.pythonhosted.org/packages/12/f4/499e74a20c156fc75836ee04a72a38d1a063978f600937f9760467beb1b0/regex-2026.5.9-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:d659eee77986549c9ea45b861c7567e44d6287c3dc9a4565478853f7b9fe2ff6", size = 852062, upload-time = "2026-05-09T23:13:26.125Z" }, + { url = "https://files.pythonhosted.org/packages/5b/92/7eebc0d0a01e78629695f342ba17e0deaff8fb45e79cc0d7b98287da6e3e/regex-2026.5.9-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2efa205e6d98b24d1f3ab395c11aa15cdf10935bca283d0285e0499c284fba21", size = 789577, upload-time = "2026-05-09T23:13:27.814Z" }, + { url = "https://files.pythonhosted.org/packages/05/a4/018e71f7d2ad48c1ebe6d3ae0026f9b7cb4802fd15c7cc02fdf724355102/regex-2026.5.9-cp313-cp313-win32.whl", hash = "sha256:f3844f134e834076677dd369976e9f5068679fcb8e50102fdf6b7ac96a3ec127", size = 266691, upload-time = "2026-05-09T23:13:29.549Z" }, + { url = "https://files.pythonhosted.org/packages/e6/1d/861a93719fb9ee7dbfc3761b3797b7a3e112a5d42c6129459d2d741be9b5/regex-2026.5.9-cp313-cp313-win_amd64.whl", hash = "sha256:3527bb4942d2c14552155406cdedd906567456821848aed1cb4933a391bf5eca", size = 277747, upload-time = "2026-05-09T23:13:31.859Z" }, + { url = "https://files.pythonhosted.org/packages/d9/c6/0a2436ae4da1ba76e51cb98943c6838a9a721faa40ebe2dce07694ae34e3/regex-2026.5.9-cp313-cp313-win_arm64.whl", hash = "sha256:56a33f191f17d8c417f99945ebdc1e691d3af9605d86ec68c7e54a57e3e17af6", size = 270500, upload-time = "2026-05-09T23:13:33.525Z" }, + { url = "https://files.pythonhosted.org/packages/e8/e9/d21346f7b60ed58789371358ed66b09d00f832e1bd7c06e55d9da5679882/regex-2026.5.9-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:01f28d868834624c934b8d2e0aa1c8341337e37831f4a012f18a5afcba4cbaf3", size = 494172, upload-time = "2026-05-09T23:13:35.935Z" }, + { url = "https://files.pythonhosted.org/packages/c4/43/fd1177a2032037c681baecdb3422ee4e1424aec4e4f470ef47793d325274/regex-2026.5.9-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:48036f6374aaa79eb3b754ec29c61d1c6b1606749d705a13f8854fa2539671f6", size = 293952, upload-time = "2026-05-09T23:13:38.307Z" }, + { url = "https://files.pythonhosted.org/packages/f2/7d/9fbf919768368d3f8a4f6c692cf2aa61e482b2b81ec6a298ace4cbf02480/regex-2026.5.9-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:b96350aa424e79d4fd6b567b344dcbe2b2d6bfc48dfe7717587e1fa6d43da6ff", size = 292314, upload-time = "2026-05-09T23:13:40.353Z" }, + { url = "https://files.pythonhosted.org/packages/e2/6c/e41bfeecb589716843e7c4df09ba46ff2a42961457afece19059d85caeef/regex-2026.5.9-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8f3af7a4903c5c04a11a196a5aa75cdd7dd3f8508132f9fb3259d9f5908e3b88", size = 811681, upload-time = "2026-05-09T23:13:42.543Z" }, + { url = "https://files.pythonhosted.org/packages/87/83/a5c1c525fba0aa656e88ad0face0b1829788ef4c2fb6b26df58aa1151b84/regex-2026.5.9-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:7e87577720152d2caae19fe2baaf1f8d5ca12091e9e229f03915c37d1e4b9178", size = 871135, upload-time = "2026-05-09T23:13:44.326Z" }, + { url = "https://files.pythonhosted.org/packages/18/d4/80882e799e440dd878b0979cbebf8fa4d54624a332c83037c7a701649e3f/regex-2026.5.9-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c8b9b9d294cfea3cd19c718ade7cc93492b2c4991abd9a68d0b3477ae6d8e100", size = 917265, upload-time = "2026-05-09T23:13:47.295Z" }, + { url = "https://files.pythonhosted.org/packages/ae/ff/8db60211e2286e396aad7dc7725356c502bff0901ea05bd6cdc2e1a042b9/regex-2026.5.9-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:728d8bfd28a8845c8b6bc5dc7ce010453d206396786c0765c2740cb65f37791e", size = 816311, upload-time = "2026-05-09T23:13:49.885Z" }, + { url = "https://files.pythonhosted.org/packages/4c/47/742ef579c61730f8d268e5cf1f9ce0e37e2ea041ad0f5644724f2378e463/regex-2026.5.9-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7e30b874d341fac767d7df5a0870540541c2c054b80cfaac116e8d367a8a7ff2", size = 785498, upload-time = "2026-05-09T23:13:52.25Z" }, + { url = "https://files.pythonhosted.org/packages/7f/ab/cb0999802dcb0fb95b1ab005e8d4163d8afdd67efc2cb6b6630ac13f8cb1/regex-2026.5.9-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:fd190e88a895a8901325fad284a3f74ea52b1da8525b76cc811fa9b1edf0ce2b", size = 801348, upload-time = "2026-05-09T23:13:54.127Z" }, + { url = "https://files.pythonhosted.org/packages/7d/62/8ca59a24c55bc34d166eefaf3717bd77772f329fdbf984d86581e0a3571c/regex-2026.5.9-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:8e76e8161ad00694cfce6767d5dea860c6391ac5b83e5c3a39661e696f11fc7e", size = 866493, upload-time = "2026-05-09T23:13:56.067Z" }, + { url = "https://files.pythonhosted.org/packages/8d/3d/30f2ae62cef3278bb5bb821f467277a55fb73f01032cf85997e15e8289a8/regex-2026.5.9-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:ddda5340e6c01a293027dd46232fa79eaff1b48058ce7a98f572b6445b088041", size = 772811, upload-time = "2026-05-09T23:13:57.867Z" }, + { url = "https://files.pythonhosted.org/packages/d8/ae/7d2089bcd78ad0c0161bc684339df50032acb438a7bd3305e7ddb1193cec/regex-2026.5.9-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:205109e96b3cf5adf8f4cd62bedde9487feb282b9497a3535451e5a24cd706a0", size = 856584, upload-time = "2026-05-09T23:13:59.679Z" }, + { url = "https://files.pythonhosted.org/packages/a9/29/92ff47f75990131ea4f24ba17819e5a9d141e10819807e09addd73409af6/regex-2026.5.9-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:dfbe4579b9f08036aa7d101d1835437a20783574ac66327e6b29b4018a138081", size = 803453, upload-time = "2026-05-09T23:14:01.978Z" }, + { url = "https://files.pythonhosted.org/packages/04/99/eff29f1037dcab36702c9ee5d6858cf1ce2336ea8ea2987f64245b99ea5e/regex-2026.5.9-cp313-cp313t-win32.whl", hash = "sha256:ed2c9e8068b614c574d8d30e543d617cf5379b0535d46f97ef00e904745a08b5", size = 269951, upload-time = "2026-05-09T23:14:03.661Z" }, + { url = "https://files.pythonhosted.org/packages/0e/9d/8870b8981d27b22cda77bb26a5ac7ebfa9c7d9e0dea195a834a82380e748/regex-2026.5.9-cp313-cp313t-win_amd64.whl", hash = "sha256:b46b0f094dc1d3b90356c85a0bd2c9bafc4a6a190b9d6f8ddd5a033b6e088ed4", size = 281240, upload-time = "2026-05-09T23:14:05.56Z" }, + { url = "https://files.pythonhosted.org/packages/72/b1/3379415e8f135c13ac551353397cc4fe97b4978f3cac73c5fcbcded548b8/regex-2026.5.9-cp313-cp313t-win_arm64.whl", hash = "sha256:872acc074bd29ffc9913ecdfedf6ea77502312ca44a4aa0d3779089c6069d8de", size = 272383, upload-time = "2026-05-09T23:14:07.843Z" }, + { url = "https://files.pythonhosted.org/packages/13/3e/9c3cd292d8808b3645a2ce517e200179b6d0e903f176300bd8b542e14de5/regex-2026.5.9-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:1bd7587a2948b4085195d5a3374eaf4a425dc3e55784c038175355ecf3bbbf8a", size = 490376, upload-time = "2026-05-09T23:14:09.64Z" }, + { url = "https://files.pythonhosted.org/packages/60/70/d43ee8a2ca0a8b68d167f21658b85520ac0574617c7f320367c5047f7556/regex-2026.5.9-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:dea2e88e1cce4522496cce630e11e67b98b7076620bc4336c3f674bc21a375f4", size = 291964, upload-time = "2026-05-09T23:14:11.424Z" }, + { url = "https://files.pythonhosted.org/packages/21/91/9d50b433828d8e74196904e168a43abf1e6e88b2a15d47ed742456720c37/regex-2026.5.9-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:2099f7e7ff7b6aa3192312650a56e91cc091e49d50b04e4f6f8b6e28b3b27f1c", size = 289682, upload-time = "2026-05-09T23:14:13.123Z" }, + { url = "https://files.pythonhosted.org/packages/3e/d2/b835e3cafbb9d977736912436259ff551d60919f7d7b3d37d46659c63564/regex-2026.5.9-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecd353045824e4477562a2ac718c25799cdaaa41f7aa925a806a8a3e6848a5b9", size = 796996, upload-time = "2026-05-09T23:14:14.923Z" }, + { url = "https://files.pythonhosted.org/packages/2c/a6/9f992d00019166b9de01c546dd4549bc679f2a68df11b877740b0760b7c2/regex-2026.5.9-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:65c8c8c37377794bd5b2f3ebe51919042bf17aec802e23c833d89782ed0c78af", size = 866089, upload-time = "2026-05-09T23:14:17.757Z" }, + { url = "https://files.pythonhosted.org/packages/e0/08/4d32af657e049b19cb62b02e46e38fe1518797bfb2203ee93a510b21b0dc/regex-2026.5.9-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5b73ab8afcf66c622db143d1c6fda4e58e4d537ee4f125229ad47b1ab80f34c0", size = 911530, upload-time = "2026-05-09T23:14:20.353Z" }, + { url = "https://files.pythonhosted.org/packages/d9/27/2af43dd1dc201d1fecefda64a45f4ad0995855b92724f795a777b402ee69/regex-2026.5.9-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0de5cf193997384ed2ca6f1cd4f78055b255d93d82d5a8cd6ba0d11c10b167e4", size = 800643, upload-time = "2026-05-09T23:14:22.265Z" }, + { url = "https://files.pythonhosted.org/packages/a4/dd/23a249047013b5321d4a60c4d2437462086f601b061776a525e5fba2a59f/regex-2026.5.9-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d641a8c9a61618047796d572a39a79b26167b0411d2c3031937b2fe2d081e2cf", size = 777223, upload-time = "2026-05-09T23:14:24.179Z" }, + { url = "https://files.pythonhosted.org/packages/94/6a/e85ed9538cd19586d0465076a4578a12e093ce776d15f3f8ce92733a8dd6/regex-2026.5.9-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:24b2355ef5cc9aa5b8f07d17704face1c166fdcc2290fa7bd6e6c925655a8346", size = 785760, upload-time = "2026-05-09T23:14:26.065Z" }, + { url = "https://files.pythonhosted.org/packages/2a/c4/f25473209438638e947c55f9156fd8f236f74169229028cc99116380868e/regex-2026.5.9-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:a24852d3c29ad9e47593593d8a247c44ccc3d0548ef12c822d6ed0810affe676", size = 860891, upload-time = "2026-05-09T23:14:28.17Z" }, + { url = "https://files.pythonhosted.org/packages/f9/f7/f4f86e3c74419c37370e91f150ae0c2ef7d34b2e0e4cdd5da046a02e4022/regex-2026.5.9-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:916714069da19329ef7de197dcbc77bb3104145c7c2c864dbfbe318f46b88b14", size = 765891, upload-time = "2026-05-09T23:14:30.06Z" }, + { url = "https://files.pythonhosted.org/packages/26/70/704d8e13765939146b1cd0ef4e2feb71d7929727d2290f026eed10095955/regex-2026.5.9-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:fa411799ca8da32a8d38d020a88faa5b6f91657d284761352940ecf9f7c3bbdd", size = 851380, upload-time = "2026-05-09T23:14:32.123Z" }, + { url = "https://files.pythonhosted.org/packages/26/29/1a13582a8460038edc38e49f64ceb0dd7c60f5caba77571f4bf6601965d9/regex-2026.5.9-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:1e6da47d679b7010ef27556b6e0f99771b744936db1792a10ceac6547ae1503e", size = 789350, upload-time = "2026-05-09T23:14:34.799Z" }, + { url = "https://files.pythonhosted.org/packages/73/56/3dcafe34fc72e271d62ad9a291801e88a1457bb251c132f15fcc2e5aad1a/regex-2026.5.9-cp314-cp314-win32.whl", hash = "sha256:98bd73080e8756255137e1bd3f3f00295bbc5aa383c0e0f973920e9134d7c4ad", size = 272130, upload-time = "2026-05-09T23:14:36.729Z" }, + { url = "https://files.pythonhosted.org/packages/d0/9c/02eebf0be95efe416c664db7fb8b6b05b7a0b06a7544f2884f2558b0526f/regex-2026.5.9-cp314-cp314-win_amd64.whl", hash = "sha256:ff8d372ac2acdc048d1c19916f27ee61bc5722728458ba6ca5052f2c72d51763", size = 280999, upload-time = "2026-05-09T23:14:39.126Z" }, + { url = "https://files.pythonhosted.org/packages/70/5a/1dd1abee76cb7a846a0bcf42fdc87e5720c3c33c24f3e37814310a513d9f/regex-2026.5.9-cp314-cp314-win_arm64.whl", hash = "sha256:e1d93bf647916292e8edcec150c07ddf3dc50179ccaf770c04a7f9e452155372", size = 273500, upload-time = "2026-05-09T23:14:41.059Z" }, + { url = "https://files.pythonhosted.org/packages/86/c1/c5f619b0057a7965cb78ec559c1d7a45ce8c99a35bea95483d64959a93d9/regex-2026.5.9-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:83d0ee4a57d1c87cb549e195ec300b8f0ec3a82eba66d835e4e2ed8634fe4499", size = 494269, upload-time = "2026-05-09T23:14:42.869Z" }, + { url = "https://files.pythonhosted.org/packages/05/2c/5d01f1aee33de4bbe60c8452945bfc8477ca7c5ae4450f6bfe711036cb36/regex-2026.5.9-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:d3d7eb5c9a7f6df82ed3cfac9beb93882a5cbcb5b8b157b56cb2b3b276574ac1", size = 293954, upload-time = "2026-05-09T23:14:44.822Z" }, + { url = "https://files.pythonhosted.org/packages/7a/fe/e8988b2ae2108c6ef71bd4aa8d87fbe257976dd0810e826cd75f701c68b6/regex-2026.5.9-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:075160bf16658e16d35233300b8453aac25de4cbea808d22348b6979668e924d", size = 292405, upload-time = "2026-05-09T23:14:47.211Z" }, + { url = "https://files.pythonhosted.org/packages/79/34/d2b0937faa7859263f7f0a3c6b103a1296306be6952dc173d0154e9a2f49/regex-2026.5.9-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:45375819235558a4ff1c4971dc32881f022613abdb180128f5cb4768c1765a1c", size = 811855, upload-time = "2026-05-09T23:14:49.21Z" }, + { url = "https://files.pythonhosted.org/packages/80/fe/daf53a47457a8486db66c66c01ceb9c2303eecee3f87197f1e77eb1a736d/regex-2026.5.9-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ead4b163ac30a29574510cd4b3e2e985ac5290c05fc7095557d6a5f403fc31b5", size = 871189, upload-time = "2026-05-09T23:14:51.555Z" }, + { url = "https://files.pythonhosted.org/packages/1c/75/058fc4470cbfbf57d800aff1a0022b929a3f9fa553ee10a0cdf2070eb31f/regex-2026.5.9-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c6e4218fbdfbcd4f6c19efca40930d24a621bf4b48cb76bc6640543bd28ef20", size = 917485, upload-time = "2026-05-09T23:14:53.633Z" }, + { url = "https://files.pythonhosted.org/packages/88/e7/179cfda3a28bc843b5c6cfe7f79f23489c791ed95f151083803660878432/regex-2026.5.9-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6351571c8a42b505eb555c0dc47d740d0fb66977dc142919eea6f4325b7c56a0", size = 816369, upload-time = "2026-05-09T23:14:56.198Z" }, + { url = "https://files.pythonhosted.org/packages/41/90/6f0cc422071688266d344fca8462d787cba0a2c144acb25721f9a61ec265/regex-2026.5.9-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:002205cafd2a9e78c6290c7d1df277bf3277b3b7a30e0b4bb0dac2e2e3f7cb2d", size = 785869, upload-time = "2026-05-09T23:14:58.602Z" }, + { url = "https://files.pythonhosted.org/packages/02/67/a31f1760f09c27b251ef39e9beb541f462cf977381d067faa764c2c0e393/regex-2026.5.9-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8abd33fef90b2a9efac5557d6033ca82d1195ed3a15fea5af15ba7b463c6a63b", size = 801427, upload-time = "2026-05-09T23:15:00.642Z" }, + { url = "https://files.pythonhosted.org/packages/e3/c4/1a80654597b6bc1e1ea0494824c31200e8a956abe290afae9b19a166a148/regex-2026.5.9-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:31037c82eccb44b7ea2e9e221d7c01429430e989a1f4b91ea5a855f6017b509a", size = 866482, upload-time = "2026-05-09T23:15:03.384Z" }, + { url = "https://files.pythonhosted.org/packages/d1/11/960724e06482c08466ff5611e242e86f80062949cdf6b4b9cc317b9dd93d/regex-2026.5.9-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:5604dfd046dc37eca90250fc3be938b076c8059fa772ac0ed6f499b0f0fb0415", size = 773022, upload-time = "2026-05-09T23:15:05.625Z" }, + { url = "https://files.pythonhosted.org/packages/50/a8/a9979c3e7918280e93159ebcab5ef1a65116dd4f3bd6091be0eae4a126e8/regex-2026.5.9-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:0e1b1b4e496afbb24f4a62aba855ee4f88f25578927697b340702e48c9ee6bc2", size = 856642, upload-time = "2026-05-09T23:15:07.966Z" }, + { url = "https://files.pythonhosted.org/packages/fe/d4/a9b732f2f0072c0ab12227483abb24fffcb9f73f8a2b203df0a6d0434735/regex-2026.5.9-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:be3372b9df6ddecff6486d37e19095a7b4973137caf5512407a89f4455361f41", size = 803552, upload-time = "2026-05-09T23:15:10.215Z" }, + { url = "https://files.pythonhosted.org/packages/d5/fe/1b3113817447a1d4155e4ac76d2e072f42c0bcba2f43fa8a0e756ea2cd91/regex-2026.5.9-cp314-cp314t-win32.whl", hash = "sha256:3ddd90103f9e5c471c49c7852ecc1fe27c7e45eb99e977aefe7caa4e779f4f58", size = 275746, upload-time = "2026-05-09T23:15:12.609Z" }, + { url = "https://files.pythonhosted.org/packages/92/73/93d42045302636c91f2e5ef588b65b84b01428f28ec77de256b1dfdfbe5c/regex-2026.5.9-cp314-cp314t-win_amd64.whl", hash = "sha256:ca518ed29c46eecba6010b15f1b9a479314d2de409536e71b6a13aa04e3b8a77", size = 285685, upload-time = "2026-05-09T23:15:15.086Z" }, + { url = "https://files.pythonhosted.org/packages/da/80/35b4c33c804a165a7f55289afda3ea9e3eb6d15800341a2d66455c0f1f30/regex-2026.5.9-cp314-cp314t-win_arm64.whl", hash = "sha256:5e41809d2683fcde7d5a8c87a6567ba1fb1ce0de9f31bff578de00a4b2d76daa", size = 275713, upload-time = "2026-05-09T23:15:16.98Z" }, +] + +[[package]] +name = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + +[[package]] +name = "safetensors" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/45/06/f955dbbb1859e3bd23c8ac6141af5106e7ad5fedec4a3a6e3d60f94b7001/safetensors-0.8.0.tar.gz", hash = "sha256:fabaf3e0f18a6618d9b36560682562157f77c2b71fcffc7b432be2baed9d753d", size = 325846, upload-time = "2026-06-09T07:52:25.563Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/39/a0/f718cda65b05407d228f97602cf60dca269c979867aa5beb25410de26cd3/safetensors-0.8.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:c554f85858e05226d3c2828e32395e677434685d6d94594a41643361c5e837f0", size = 473568, upload-time = "2026-06-09T07:52:18.829Z" }, + { url = "https://files.pythonhosted.org/packages/f5/b1/fa7c600e7dceae12e9606c7578cbc9ff1e1ed55844883ee5c92205e86226/safetensors-0.8.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:c80201d22cbf405b80647a60ada77bba06c8fba2da2743ba1e89cdcc39a81f25", size = 484562, upload-time = "2026-06-09T07:52:17.518Z" }, + { url = "https://files.pythonhosted.org/packages/09/7d/65a7de0af421317bb36a067241e4235fff194eed60b961ed6d3f59a3fc60/safetensors-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a46e5ff292c356d6991e60942ba7f79817682d3a2cef0702136448cb9c4d235", size = 502844, upload-time = "2026-06-09T07:52:07.624Z" }, + { url = "https://files.pythonhosted.org/packages/91/4f/3175c9d75634e0e0dda0082794193521035edd7c70a6f212bf33ca06ddf4/safetensors-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4124502b78f03534117c848f87a39b8f31e577b15eff423bf8bfb95f2a8c30d0", size = 511823, upload-time = "2026-06-09T07:52:09.565Z" }, + { url = "https://files.pythonhosted.org/packages/20/87/846c289e7aa2299eff406335717cf43ce8777194ece8aad75772e0411615/safetensors-0.8.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7bc0a787ba8a35be368ee3574edfa2b1ad389eebd0a72e482ae275490e3f6c98", size = 633461, upload-time = "2026-06-09T07:52:11.128Z" }, + { url = "https://files.pythonhosted.org/packages/76/22/8d64d9df2c45d5ded401df889d0ad90882804ca172d79ec4f0df8f727fe0/safetensors-0.8.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:040070828e36dc8e122178bbbd5830ff9e97920affb84cbe0f46442497bed358", size = 545148, upload-time = "2026-06-09T07:52:13.603Z" }, + { url = "https://files.pythonhosted.org/packages/28/50/f203ff3a3ddfe19308efc83c5a3a29ed02bf786732ec35e68bf9162f3365/safetensors-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd6f3f93c9a0a7cc2788ee63fb763353d4bd2e89b0751bc78fcf7dda00bea774", size = 516040, upload-time = "2026-06-09T07:52:16.29Z" }, + { url = "https://files.pythonhosted.org/packages/46/fb/cdaed17ceb2948784fd9c36b6fd3e951b608547cea81a48e8ee6f8cfdfcb/safetensors-0.8.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:fcdd41ec4628fee5799f807c73c353629130fbd942aa23d83c623dd6c9d52d78", size = 513832, upload-time = "2026-06-09T07:52:12.37Z" }, + { url = "https://files.pythonhosted.org/packages/0d/49/1e15de264dcc3b77943d2d0c56a95809956883b1c2d6d585c792523f180b/safetensors-0.8.0-cp310-abi3-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:8e9f537aa183a38ace122d27303dcd986b26bd2a7591f9181d7f0c396f4677ca", size = 559930, upload-time = "2026-06-09T07:52:14.743Z" }, + { url = "https://files.pythonhosted.org/packages/2a/43/bf38443278eab4b1be1fce2931e2b012ad9cb7df52ada751d0aab8f7659a/safetensors-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:87eec7ffed2b809f05a398a8becb7d013f19f7837cd15d9748580d6cf30dbaf4", size = 678670, upload-time = "2026-06-09T07:52:20.032Z" }, + { url = "https://files.pythonhosted.org/packages/72/e3/68cd3fa5b48488e84add63e04cb12f3bc28ae4638c06d4508c6e88823d0e/safetensors-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:4a95ae2b05d7726d751da4ebf626a2ca782b706e101bd894c95bc2450b1cffcc", size = 786679, upload-time = "2026-06-09T07:52:21.322Z" }, + { url = "https://files.pythonhosted.org/packages/29/4b/1c19c509d56e01f4fbb3d0a2e597450f6cc04d1d56cf52defb0a62dfd715/safetensors-0.8.0-cp310-abi3-musllinux_1_2_i686.whl", hash = "sha256:3ae091f16662658bdc019a4ff6cb4c085bb7d725eb5978b183ffd265863b6d2d", size = 765683, upload-time = "2026-06-09T07:52:22.594Z" }, + { url = "https://files.pythonhosted.org/packages/27/43/41c1621732edd934d868a00d1b891584c892a7b62a9aab82ea5a0a5623ee/safetensors-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:8e080062fcde23be189565e1c3305d16751a218ecf9412c8601e64204eb6f846", size = 722361, upload-time = "2026-06-09T07:52:23.924Z" }, + { url = "https://files.pythonhosted.org/packages/8e/3f/73ccf82579412b4a71c4ca673f10b5f1f888d7cf5af7fe24f27d30307be4/safetensors-0.8.0-cp310-abi3-win32.whl", hash = "sha256:2ddf52eac562eda224f99acfa7889d02968c1fd59a5b011ae7d8137c37e9c02d", size = 342401, upload-time = "2026-06-09T07:52:28.895Z" }, + { url = "https://files.pythonhosted.org/packages/1b/6d/3fba214c1e5e0f69991677ec3bc17023f0421776975e1de0c682dca475e2/safetensors-0.8.0-cp310-abi3-win_amd64.whl", hash = "sha256:096ec1a98435df7beb08853bb5aa9081a84f23d0adc67ed1a0a10550f608373f", size = 355540, upload-time = "2026-06-09T07:52:27.832Z" }, + { url = "https://files.pythonhosted.org/packages/8d/fc/7eedc3510d97878876e32774eebbeb61c43f148a96e915c84229a3e967aa/safetensors-0.8.0-cp310-abi3-win_arm64.whl", hash = "sha256:f7838e5135a406ad3e02efdcb8cf2e5397d368b0154537c4fec682dbc544d452", size = 340500, upload-time = "2026-06-09T07:52:26.745Z" }, +] + +[[package]] +name = "scikit-learn" +version = "1.9.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "joblib" }, + { name = "narwhals" }, + { name = "numpy" }, + { name = "scipy" }, + { name = "threadpoolctl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fa/6f/37092bdb25f712817231799fc5674d8e704066a8a70c1d2d40517e18b4ab/scikit_learn-1.9.0.tar.gz", hash = "sha256:8833266989d3a5110178a9fae30783675460724d0e1efb13b14901d2c660c557", size = 7750767, upload-time = "2026-06-02T11:54:32.706Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ac/20/75f915ff375d6249e6550ac740fdbbd66159a068fd3af1400ff62036b07a/scikit_learn-1.9.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:2bd41b0d201bc81575531b96b713d3eb5e5f50fb0b82101ff0f92294fdc236ac", size = 8741122, upload-time = "2026-06-02T11:53:24.08Z" }, + { url = "https://files.pythonhosted.org/packages/cc/d5/2b5148f2279196775e1db2aeb85d14b70ac80e7e32b3b28e7ebeafb0901d/scikit_learn-1.9.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:5be45aa4a42a68a533913a6ed736cf309de2226411c79ef8d609a5456f1939b1", size = 8261512, upload-time = "2026-06-02T11:53:27.183Z" }, + { url = "https://files.pythonhosted.org/packages/a0/ee/5adbc77656b71f9456a2f5a7a9fdb4bcf9207a6b962889f1c2f9323afa4e/scikit_learn-1.9.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5e50ed4da51974e86e940690e9a3d82e729b62b5a49f7c9bac534d515d39d86f", size = 8837603, upload-time = "2026-06-02T11:53:30.328Z" }, + { url = "https://files.pythonhosted.org/packages/6c/c2/63fdda36c56437eeb44aaf9493c8bcd62ce230ab1598924fc626ffbfa943/scikit_learn-1.9.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:056c92bb67ad4c28463c2f2653d9701449201e7e7a9e94e321be0f71c4fef2b8", size = 9132097, upload-time = "2026-06-02T11:53:33.456Z" }, + { url = "https://files.pythonhosted.org/packages/83/a4/c8e67227c680e2259c8864ae72ff48b06e16a6f51253a22167aa02a8aa4e/scikit_learn-1.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:4306775fad04cc4b472a1b15af1ae9cede1540fbfcc17fbce3767cd8dc7ae283", size = 8211173, upload-time = "2026-06-02T11:53:36.602Z" }, + { url = "https://files.pythonhosted.org/packages/cf/fd/3c0863792e98e67e9184aa4029288a175935eb65443afcd30d4f143450cf/scikit_learn-1.9.0-cp312-cp312-win_arm64.whl", hash = "sha256:26e22435f63bcdcf396b574273f29f13dd531f5ea035801f5be10ba1540a4e60", size = 7867451, upload-time = "2026-06-02T11:53:39.075Z" }, + { url = "https://files.pythonhosted.org/packages/3c/01/cf3310626b6d48d3e9be69a1223f9180360b5e6edb045f50fade723ce494/scikit_learn-1.9.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:80746d63bd4b6eaca54d36fe5feaf4d28bb38dc6f9470f81c7cad7c40155f119", size = 8705188, upload-time = "2026-06-02T11:53:41.964Z" }, + { url = "https://files.pythonhosted.org/packages/3e/04/5acd7ae280c5f93b6ac5ef6cdec14eef4c8d1cd91d85b3292989c94d96b1/scikit_learn-1.9.0-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:5b934c45c252844a91d69fda3a34cff5e7307e1db10d77cb10a3980312c74713", size = 8228299, upload-time = "2026-06-02T11:53:44.817Z" }, + { url = "https://files.pythonhosted.org/packages/0c/39/ffe829a5b8ecb40a518724a997794657fdc354ada5e8fe8e64d998c0bac9/scikit_learn-1.9.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:38c3dcb9a1ffb85505ec53d54c7b4aea0cff70050425a7760c2af661ac85df05", size = 8789690, upload-time = "2026-06-02T11:53:47.461Z" }, + { url = "https://files.pythonhosted.org/packages/1f/88/8dab5de10c638c083772a6be83a3d8106ced492f74a928c8693638e5bb50/scikit_learn-1.9.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:da76d09304a4706db7cc1e3ebaa3b6b98a67365cc11d2996c4f1e58ba47df714", size = 9087723, upload-time = "2026-06-02T11:53:50.702Z" }, + { url = "https://files.pythonhosted.org/packages/20/3f/7917ca72464038f6240ec70c29f94862d08a34a74291ae4d4ec5eb8186a0/scikit_learn-1.9.0-cp313-cp313-win_amd64.whl", hash = "sha256:5808d98f15c6bf6d9d96d2348c1997392a5888ce7097e664105f930c4bca1277", size = 8184330, upload-time = "2026-06-02T11:53:53.396Z" }, + { url = "https://files.pythonhosted.org/packages/78/c7/15739eb2f61fda3c54639e9942414e5a19ad8a8d1f5a3266afad7cb7df80/scikit_learn-1.9.0-cp313-cp313-win_arm64.whl", hash = "sha256:d77f54c017633791bc0225a43e2f8d03745fdcfe4880268fcc4df15f505dec2e", size = 7840653, upload-time = "2026-06-02T11:53:56.035Z" }, + { url = "https://files.pythonhosted.org/packages/f4/7d/c9a35cf59b20a86fec24d306f1547b78dec194b08d367ce2a3e4854169d9/scikit_learn-1.9.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:9656acd4e93f74e0b66c8a36c88830a99252dfa900044d36bc2212ae89a47162", size = 8713289, upload-time = "2026-06-02T11:53:58.788Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a7/552a7821597c632b907f7bfe8f36f9f572777af8ef8a48353041cf8e091a/scikit_learn-1.9.0-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:24360002ae845e7866522b0a5bbf690802e7bc388cac8663502e78aa98598aa2", size = 8245141, upload-time = "2026-06-02T11:54:01.694Z" }, + { url = "https://files.pythonhosted.org/packages/7d/79/f4a0c4fe9711154cddabf913471153af79056382ddc612cfe5ee0ff4b72e/scikit_learn-1.9.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5162ad10a418c8a282dde04c9aa06965de3e9a65f33c1440c0ae69bb1a09d913", size = 8847671, upload-time = "2026-06-02T11:54:04.448Z" }, + { url = "https://files.pythonhosted.org/packages/f0/af/4d72d9e475ac83719160c662619e4bf7b95c19507cd582e7d0167a3c3dae/scikit_learn-1.9.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1fea2cc5677ab49d6f5bade978c866da44957b712d92e9635e8b4f723013c3cb", size = 9118104, upload-time = "2026-06-02T11:54:07.205Z" }, + { url = "https://files.pythonhosted.org/packages/a2/d5/6a58eea2cb9abbb9b3f2bb8b2cfb3243d1152d69f442d256c7af71304769/scikit_learn-1.9.0-cp314-cp314-win_amd64.whl", hash = "sha256:64fa347efc1c839c487433e40c5144d38c336e8a2b59c81aa8660373945c2673", size = 8290674, upload-time = "2026-06-02T11:54:10.087Z" }, + { url = "https://files.pythonhosted.org/packages/65/5b/d4c879cf358f1187141cf90ced473f087183489090244f50c124a2ee478b/scikit_learn-1.9.0-cp314-cp314-win_arm64.whl", hash = "sha256:1b944b6db288f6b926e3650026ddafb988929de95d11fc2cc5fa117773c9ba42", size = 7978807, upload-time = "2026-06-02T11:54:12.769Z" }, + { url = "https://files.pythonhosted.org/packages/8a/43/bfae3121ec67ae09150d453c442c7c1cc166e9aefe056e6ab3b7728a5cfc/scikit_learn-1.9.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:4ccacf04ca5f4b492158a5f28afe0ace43f81b2571e4b9a66d34848b46128949", size = 9031941, upload-time = "2026-06-02T11:54:15.436Z" }, + { url = "https://files.pythonhosted.org/packages/75/b0/20a4546eb17f3b25d3c66df15810411c14ed5065bcfab50b53c96fb627b2/scikit_learn-1.9.0-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:ee1a8db2c18c08e34c7412d4b10be1cac214cd4ea7dc9715a6a327eb49a37c96", size = 8613528, upload-time = "2026-06-02T11:54:18.842Z" }, + { url = "https://files.pythonhosted.org/packages/18/3c/e440e039bb82cd19004edaaad00acbde0fb9b461083c3ecf37941c557312/scikit_learn-1.9.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:147e9329ef0e39f75d4cffa02b2aa48d827832684926cd5210d9a2cb5c57246b", size = 8855050, upload-time = "2026-06-02T11:54:21.699Z" }, + { url = "https://files.pythonhosted.org/packages/43/26/b341b8dab5998da6270a3a42c2152c578501354d36f944b5856757035ef8/scikit_learn-1.9.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5bad8f8b9950321b54c965fdcbac6c6c55e79e16646b49977bcf3668d3870a1a", size = 9097190, upload-time = "2026-06-02T11:54:24.454Z" }, + { url = "https://files.pythonhosted.org/packages/fb/de/b650b4d69b84468cfa2e28a3ff7b8103743029e6446ce1a97fe060ef688c/scikit_learn-1.9.0-cp314-cp314t-win_amd64.whl", hash = "sha256:78fc56eafd4edb9575d2d8950d1dd152061abb573341a1cb7e099fc40f6c6666", size = 8963204, upload-time = "2026-06-02T11:54:27.428Z" }, + { url = "https://files.pythonhosted.org/packages/ee/f3/ff83d76d7418112e5a61326443cdda87be3545dd8d6599c95b2481a4419e/scikit_learn-1.9.0-cp314-cp314t-win_arm64.whl", hash = "sha256:051075bda8b7aab87b1906ab3d4740a1e1224a19d7b3781a576736edc94e76aa", size = 8222661, upload-time = "2026-06-02T11:54:30.192Z" }, +] + +[[package]] +name = "scipy" +version = "1.17.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "numpy" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7a/97/5a3609c4f8d58b039179648e62dd220f89864f56f7357f5d4f45c29eb2cc/scipy-1.17.1.tar.gz", hash = "sha256:95d8e012d8cb8816c226aef832200b1d45109ed4464303e997c5b13122b297c0", size = 30573822, upload-time = "2026-02-23T00:26:24.851Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/35/48/b992b488d6f299dbe3f11a20b24d3dda3d46f1a635ede1c46b5b17a7b163/scipy-1.17.1-cp312-cp312-macosx_10_14_x86_64.whl", hash = "sha256:35c3a56d2ef83efc372eaec584314bd0ef2e2f0d2adb21c55e6ad5b344c0dcb8", size = 31610954, upload-time = "2026-02-23T00:17:49.855Z" }, + { url = "https://files.pythonhosted.org/packages/b2/02/cf107b01494c19dc100f1d0b7ac3cc08666e96ba2d64db7626066cee895e/scipy-1.17.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:fcb310ddb270a06114bb64bbe53c94926b943f5b7f0842194d585c65eb4edd76", size = 28172662, upload-time = "2026-02-23T00:18:01.64Z" }, + { url = "https://files.pythonhosted.org/packages/cf/a9/599c28631bad314d219cf9ffd40e985b24d603fc8a2f4ccc5ae8419a535b/scipy-1.17.1-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:cc90d2e9c7e5c7f1a482c9875007c095c3194b1cfedca3c2f3291cdc2bc7c086", size = 20344366, upload-time = "2026-02-23T00:18:12.015Z" }, + { url = "https://files.pythonhosted.org/packages/35/f5/906eda513271c8deb5af284e5ef0206d17a96239af79f9fa0aebfe0e36b4/scipy-1.17.1-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:c80be5ede8f3f8eded4eff73cc99a25c388ce98e555b17d31da05287015ffa5b", size = 22704017, upload-time = "2026-02-23T00:18:21.502Z" }, + { url = "https://files.pythonhosted.org/packages/da/34/16f10e3042d2f1d6b66e0428308ab52224b6a23049cb2f5c1756f713815f/scipy-1.17.1-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e19ebea31758fac5893a2ac360fedd00116cbb7628e650842a6691ba7ca28a21", size = 32927842, upload-time = "2026-02-23T00:18:35.367Z" }, + { url = "https://files.pythonhosted.org/packages/01/8e/1e35281b8ab6d5d72ebe9911edcdffa3f36b04ed9d51dec6dd140396e220/scipy-1.17.1-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:02ae3b274fde71c5e92ac4d54bc06c42d80e399fec704383dcd99b301df37458", size = 35235890, upload-time = "2026-02-23T00:18:49.188Z" }, + { url = "https://files.pythonhosted.org/packages/c5/5c/9d7f4c88bea6e0d5a4f1bc0506a53a00e9fcb198de372bfe4d3652cef482/scipy-1.17.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8a604bae87c6195d8b1045eddece0514d041604b14f2727bbc2b3020172045eb", size = 35003557, upload-time = "2026-02-23T00:18:54.74Z" }, + { url = "https://files.pythonhosted.org/packages/65/94/7698add8f276dbab7a9de9fb6b0e02fc13ee61d51c7c3f85ac28b65e1239/scipy-1.17.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:f590cd684941912d10becc07325a3eeb77886fe981415660d9265c4c418d0bea", size = 37625856, upload-time = "2026-02-23T00:19:00.307Z" }, + { url = "https://files.pythonhosted.org/packages/a2/84/dc08d77fbf3d87d3ee27f6a0c6dcce1de5829a64f2eae85a0ecc1f0daa73/scipy-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:41b71f4a3a4cab9d366cd9065b288efc4d4f3c0b37a91a8e0947fb5bd7f31d87", size = 36549682, upload-time = "2026-02-23T00:19:07.67Z" }, + { url = "https://files.pythonhosted.org/packages/bc/98/fe9ae9ffb3b54b62559f52dedaebe204b408db8109a8c66fdd04869e6424/scipy-1.17.1-cp312-cp312-win_arm64.whl", hash = "sha256:f4115102802df98b2b0db3cce5cb9b92572633a1197c77b7553e5203f284a5b3", size = 24547340, upload-time = "2026-02-23T00:19:12.024Z" }, + { url = "https://files.pythonhosted.org/packages/76/27/07ee1b57b65e92645f219b37148a7e7928b82e2b5dbeccecb4dff7c64f0b/scipy-1.17.1-cp313-cp313-macosx_10_14_x86_64.whl", hash = "sha256:5e3c5c011904115f88a39308379c17f91546f77c1667cea98739fe0fccea804c", size = 31590199, upload-time = "2026-02-23T00:19:17.192Z" }, + { url = "https://files.pythonhosted.org/packages/ec/ae/db19f8ab842e9b724bf5dbb7db29302a91f1e55bc4d04b1025d6d605a2c5/scipy-1.17.1-cp313-cp313-macosx_12_0_arm64.whl", hash = "sha256:6fac755ca3d2c3edcb22f479fceaa241704111414831ddd3bc6056e18516892f", size = 28154001, upload-time = "2026-02-23T00:19:22.241Z" }, + { url = "https://files.pythonhosted.org/packages/5b/58/3ce96251560107b381cbd6e8413c483bbb1228a6b919fa8652b0d4090e7f/scipy-1.17.1-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:7ff200bf9d24f2e4d5dc6ee8c3ac64d739d3a89e2326ba68aaf6c4a2b838fd7d", size = 20325719, upload-time = "2026-02-23T00:19:26.329Z" }, + { url = "https://files.pythonhosted.org/packages/b2/83/15087d945e0e4d48ce2377498abf5ad171ae013232ae31d06f336e64c999/scipy-1.17.1-cp313-cp313-macosx_14_0_x86_64.whl", hash = "sha256:4b400bdc6f79fa02a4d86640310dde87a21fba0c979efff5248908c6f15fad1b", size = 22683595, upload-time = "2026-02-23T00:19:30.304Z" }, + { url = "https://files.pythonhosted.org/packages/b4/e0/e58fbde4a1a594c8be8114eb4aac1a55bcd6587047efc18a61eb1f5c0d30/scipy-1.17.1-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2b64ca7d4aee0102a97f3ba22124052b4bd2152522355073580bf4845e2550b6", size = 32896429, upload-time = "2026-02-23T00:19:35.536Z" }, + { url = "https://files.pythonhosted.org/packages/f5/5f/f17563f28ff03c7b6799c50d01d5d856a1d55f2676f537ca8d28c7f627cd/scipy-1.17.1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:581b2264fc0aa555f3f435a5944da7504ea3a065d7029ad60e7c3d1ae09c5464", size = 35203952, upload-time = "2026-02-23T00:19:42.259Z" }, + { url = "https://files.pythonhosted.org/packages/8d/a5/9afd17de24f657fdfe4df9a3f1ea049b39aef7c06000c13db1530d81ccca/scipy-1.17.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:beeda3d4ae615106d7094f7e7cef6218392e4465cc95d25f900bebabfded0950", size = 34979063, upload-time = "2026-02-23T00:19:47.547Z" }, + { url = "https://files.pythonhosted.org/packages/8b/13/88b1d2384b424bf7c924f2038c1c409f8d88bb2a8d49d097861dd64a57b2/scipy-1.17.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6609bc224e9568f65064cfa72edc0f24ee6655b47575954ec6339534b2798369", size = 37598449, upload-time = "2026-02-23T00:19:53.238Z" }, + { url = "https://files.pythonhosted.org/packages/35/e5/d6d0e51fc888f692a35134336866341c08655d92614f492c6860dc45bb2c/scipy-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:37425bc9175607b0268f493d79a292c39f9d001a357bebb6b88fdfaff13f6448", size = 36510943, upload-time = "2026-02-23T00:20:50.89Z" }, + { url = "https://files.pythonhosted.org/packages/2a/fd/3be73c564e2a01e690e19cc618811540ba5354c67c8680dce3281123fb79/scipy-1.17.1-cp313-cp313-win_arm64.whl", hash = "sha256:5cf36e801231b6a2059bf354720274b7558746f3b1a4efb43fcf557ccd484a87", size = 24545621, upload-time = "2026-02-23T00:20:55.871Z" }, + { url = "https://files.pythonhosted.org/packages/6f/6b/17787db8b8114933a66f9dcc479a8272e4b4da75fe03b0c282f7b0ade8cd/scipy-1.17.1-cp313-cp313t-macosx_10_14_x86_64.whl", hash = "sha256:d59c30000a16d8edc7e64152e30220bfbd724c9bbb08368c054e24c651314f0a", size = 31936708, upload-time = "2026-02-23T00:19:58.694Z" }, + { url = "https://files.pythonhosted.org/packages/38/2e/524405c2b6392765ab1e2b722a41d5da33dc5c7b7278184a8ad29b6cb206/scipy-1.17.1-cp313-cp313t-macosx_12_0_arm64.whl", hash = "sha256:010f4333c96c9bb1a4516269e33cb5917b08ef2166d5556ca2fd9f082a9e6ea0", size = 28570135, upload-time = "2026-02-23T00:20:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/fd/c3/5bd7199f4ea8556c0c8e39f04ccb014ac37d1468e6cfa6a95c6b3562b76e/scipy-1.17.1-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:2ceb2d3e01c5f1d83c4189737a42d9cb2fc38a6eeed225e7515eef71ad301dce", size = 20741977, upload-time = "2026-02-23T00:20:07.935Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b8/8ccd9b766ad14c78386599708eb745f6b44f08400a5fd0ade7cf89b6fc93/scipy-1.17.1-cp313-cp313t-macosx_14_0_x86_64.whl", hash = "sha256:844e165636711ef41f80b4103ed234181646b98a53c8f05da12ca5ca289134f6", size = 23029601, upload-time = "2026-02-23T00:20:12.161Z" }, + { url = "https://files.pythonhosted.org/packages/6d/a0/3cb6f4d2fb3e17428ad2880333cac878909ad1a89f678527b5328b93c1d4/scipy-1.17.1-cp313-cp313t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:158dd96d2207e21c966063e1635b1063cd7787b627b6f07305315dd73d9c679e", size = 33019667, upload-time = "2026-02-23T00:20:17.208Z" }, + { url = "https://files.pythonhosted.org/packages/f3/c3/2d834a5ac7bf3a0c806ad1508efc02dda3c8c61472a56132d7894c312dea/scipy-1.17.1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:74cbb80d93260fe2ffa334efa24cb8f2f0f622a9b9febf8b483c0b865bfb3475", size = 35264159, upload-time = "2026-02-23T00:20:23.087Z" }, + { url = "https://files.pythonhosted.org/packages/4d/77/d3ed4becfdbd217c52062fafe35a72388d1bd82c2d0ba5ca19d6fcc93e11/scipy-1.17.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:dbc12c9f3d185f5c737d801da555fb74b3dcfa1a50b66a1a93e09190f41fab50", size = 35102771, upload-time = "2026-02-23T00:20:28.636Z" }, + { url = "https://files.pythonhosted.org/packages/bd/12/d19da97efde68ca1ee5538bb261d5d2c062f0c055575128f11a2730e3ac1/scipy-1.17.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:94055a11dfebe37c656e70317e1996dc197e1a15bbcc351bcdd4610e128fe1ca", size = 37665910, upload-time = "2026-02-23T00:20:34.743Z" }, + { url = "https://files.pythonhosted.org/packages/06/1c/1172a88d507a4baaf72c5a09bb6c018fe2ae0ab622e5830b703a46cc9e44/scipy-1.17.1-cp313-cp313t-win_amd64.whl", hash = "sha256:e30bdeaa5deed6bc27b4cc490823cd0347d7dae09119b8803ae576ea0ce52e4c", size = 36562980, upload-time = "2026-02-23T00:20:40.575Z" }, + { url = "https://files.pythonhosted.org/packages/70/b0/eb757336e5a76dfa7911f63252e3b7d1de00935d7705cf772db5b45ec238/scipy-1.17.1-cp313-cp313t-win_arm64.whl", hash = "sha256:a720477885a9d2411f94a93d16f9d89bad0f28ca23c3f8daa521e2dcc3f44d49", size = 24856543, upload-time = "2026-02-23T00:20:45.313Z" }, + { url = "https://files.pythonhosted.org/packages/cf/83/333afb452af6f0fd70414dc04f898647ee1423979ce02efa75c3b0f2c28e/scipy-1.17.1-cp314-cp314-macosx_10_14_x86_64.whl", hash = "sha256:a48a72c77a310327f6a3a920092fa2b8fd03d7deaa60f093038f22d98e096717", size = 31584510, upload-time = "2026-02-23T00:21:01.015Z" }, + { url = "https://files.pythonhosted.org/packages/ed/a6/d05a85fd51daeb2e4ea71d102f15b34fedca8e931af02594193ae4fd25f7/scipy-1.17.1-cp314-cp314-macosx_12_0_arm64.whl", hash = "sha256:45abad819184f07240d8a696117a7aacd39787af9e0b719d00285549ed19a1e9", size = 28170131, upload-time = "2026-02-23T00:21:05.888Z" }, + { url = "https://files.pythonhosted.org/packages/db/7b/8624a203326675d7746a254083a187398090a179335b2e4a20e2ddc46e83/scipy-1.17.1-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:3fd1fcdab3ea951b610dc4cef356d416d5802991e7e32b5254828d342f7b7e0b", size = 20342032, upload-time = "2026-02-23T00:21:09.904Z" }, + { url = "https://files.pythonhosted.org/packages/c9/35/2c342897c00775d688d8ff3987aced3426858fd89d5a0e26e020b660b301/scipy-1.17.1-cp314-cp314-macosx_14_0_x86_64.whl", hash = "sha256:7bdf2da170b67fdf10bca777614b1c7d96ae3ca5794fd9587dce41eb2966e866", size = 22678766, upload-time = "2026-02-23T00:21:14.313Z" }, + { url = "https://files.pythonhosted.org/packages/ef/f2/7cdb8eb308a1a6ae1e19f945913c82c23c0c442a462a46480ce487fdc0ac/scipy-1.17.1-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:adb2642e060a6549c343603a3851ba76ef0b74cc8c079a9a58121c7ec9fe2350", size = 32957007, upload-time = "2026-02-23T00:21:19.663Z" }, + { url = "https://files.pythonhosted.org/packages/0b/2e/7eea398450457ecb54e18e9d10110993fa65561c4f3add5e8eccd2b9cd41/scipy-1.17.1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:eee2cfda04c00a857206a4330f0c5e3e56535494e30ca445eb19ec624ae75118", size = 35221333, upload-time = "2026-02-23T00:21:25.278Z" }, + { url = "https://files.pythonhosted.org/packages/d9/77/5b8509d03b77f093a0d52e606d3c4f79e8b06d1d38c441dacb1e26cacf46/scipy-1.17.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d2650c1fb97e184d12d8ba010493ee7b322864f7d3d00d3f9bb97d9c21de4068", size = 35042066, upload-time = "2026-02-23T00:21:31.358Z" }, + { url = "https://files.pythonhosted.org/packages/f9/df/18f80fb99df40b4070328d5ae5c596f2f00fffb50167e31439e932f29e7d/scipy-1.17.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:08b900519463543aa604a06bec02461558a6e1cef8fdbb8098f77a48a83c8118", size = 37612763, upload-time = "2026-02-23T00:21:37.247Z" }, + { url = "https://files.pythonhosted.org/packages/4b/39/f0e8ea762a764a9dc52aa7dabcfad51a354819de1f0d4652b6a1122424d6/scipy-1.17.1-cp314-cp314-win_amd64.whl", hash = "sha256:3877ac408e14da24a6196de0ddcace62092bfc12a83823e92e49e40747e52c19", size = 37290984, upload-time = "2026-02-23T00:22:35.023Z" }, + { url = "https://files.pythonhosted.org/packages/7c/56/fe201e3b0f93d1a8bcf75d3379affd228a63d7e2d80ab45467a74b494947/scipy-1.17.1-cp314-cp314-win_arm64.whl", hash = "sha256:f8885db0bc2bffa59d5c1b72fad7a6a92d3e80e7257f967dd81abb553a90d293", size = 25192877, upload-time = "2026-02-23T00:22:39.798Z" }, + { url = "https://files.pythonhosted.org/packages/96/ad/f8c414e121f82e02d76f310f16db9899c4fcde36710329502a6b2a3c0392/scipy-1.17.1-cp314-cp314t-macosx_10_14_x86_64.whl", hash = "sha256:1cc682cea2ae55524432f3cdff9e9a3be743d52a7443d0cba9017c23c87ae2f6", size = 31949750, upload-time = "2026-02-23T00:21:42.289Z" }, + { url = "https://files.pythonhosted.org/packages/7c/b0/c741e8865d61b67c81e255f4f0a832846c064e426636cd7de84e74d209be/scipy-1.17.1-cp314-cp314t-macosx_12_0_arm64.whl", hash = "sha256:2040ad4d1795a0ae89bfc7e8429677f365d45aa9fd5e4587cf1ea737f927b4a1", size = 28585858, upload-time = "2026-02-23T00:21:47.706Z" }, + { url = "https://files.pythonhosted.org/packages/ed/1b/3985219c6177866628fa7c2595bfd23f193ceebbe472c98a08824b9466ff/scipy-1.17.1-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:131f5aaea57602008f9822e2115029b55d4b5f7c070287699fe45c661d051e39", size = 20757723, upload-time = "2026-02-23T00:21:52.039Z" }, + { url = "https://files.pythonhosted.org/packages/c0/19/2a04aa25050d656d6f7b9e7b685cc83d6957fb101665bfd9369ca6534563/scipy-1.17.1-cp314-cp314t-macosx_14_0_x86_64.whl", hash = "sha256:9cdc1a2fcfd5c52cfb3045feb399f7b3ce822abdde3a193a6b9a60b3cb5854ca", size = 23043098, upload-time = "2026-02-23T00:21:56.185Z" }, + { url = "https://files.pythonhosted.org/packages/86/f1/3383beb9b5d0dbddd030335bf8a8b32d4317185efe495374f134d8be6cce/scipy-1.17.1-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e3dcd57ab780c741fde8dc68619de988b966db759a3c3152e8e9142c26295ad", size = 33030397, upload-time = "2026-02-23T00:22:01.404Z" }, + { url = "https://files.pythonhosted.org/packages/41/68/8f21e8a65a5a03f25a79165ec9d2b28c00e66dc80546cf5eb803aeeff35b/scipy-1.17.1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a9956e4d4f4a301ebf6cde39850333a6b6110799d470dbbb1e25326ac447f52a", size = 35281163, upload-time = "2026-02-23T00:22:07.024Z" }, + { url = "https://files.pythonhosted.org/packages/84/8d/c8a5e19479554007a5632ed7529e665c315ae7492b4f946b0deb39870e39/scipy-1.17.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:a4328d245944d09fd639771de275701ccadf5f781ba0ff092ad141e017eccda4", size = 35116291, upload-time = "2026-02-23T00:22:12.585Z" }, + { url = "https://files.pythonhosted.org/packages/52/52/e57eceff0e342a1f50e274264ed47497b59e6a4e3118808ee58ddda7b74a/scipy-1.17.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a77cbd07b940d326d39a1d1b37817e2ee4d79cb30e7338f3d0cddffae70fcaa2", size = 37682317, upload-time = "2026-02-23T00:22:18.513Z" }, + { url = "https://files.pythonhosted.org/packages/11/2f/b29eafe4a3fbc3d6de9662b36e028d5f039e72d345e05c250e121a230dd4/scipy-1.17.1-cp314-cp314t-win_amd64.whl", hash = "sha256:eb092099205ef62cd1782b006658db09e2fed75bffcae7cc0d44052d8aa0f484", size = 37345327, upload-time = "2026-02-23T00:22:24.442Z" }, + { url = "https://files.pythonhosted.org/packages/07/39/338d9219c4e87f3e708f18857ecd24d22a0c3094752393319553096b98af/scipy-1.17.1-cp314-cp314t-win_arm64.whl", hash = "sha256:200e1050faffacc162be6a486a984a0497866ec54149a01270adc8a59b7c7d21", size = 25489165, upload-time = "2026-02-23T00:22:29.563Z" }, +] + +[[package]] +name = "sentence-transformers" +version = "5.5.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "scikit-learn" }, + { name = "scipy" }, + { name = "torch", version = "2.12.0", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform == 'darwin'" }, + { name = "torch", version = "2.12.0+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform != 'darwin'" }, + { name = "tqdm" }, + { name = "transformers" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cf/d4/7ef93157485e978c016f49da05363c1e4e7237beb5343b64b5631101f0f1/sentence_transformers-5.5.1.tar.gz", hash = "sha256:02b7740dfc60bdbbcb6061625f5d97a5c1a4e2d3baac5f9391b912bb5eae2290", size = 445161, upload-time = "2026-05-20T07:37:44.465Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/03/ee99a6b030e7a2e056547729f8a4709dd93e13d9c6f07590f74c395c4017/sentence_transformers-5.5.1-py3-none-any.whl", hash = "sha256:4fe11d433badc5282d32f7fc08bc714216b7a5aca426f9df77a45a554756deb7", size = 588887, upload-time = "2026-05-20T07:37:43.004Z" }, +] + [[package]] name = "service" version = "0.1.0" @@ -606,7 +1137,10 @@ dependencies = [ { name = "pytest" }, { name = "python-multipart" }, { name = "pyyaml" }, + { name = "sentence-transformers" }, { name = "sqlalchemy" }, + { name = "torch", version = "2.12.0", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform == 'darwin'" }, + { name = "torch", version = "2.12.0+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "sys_platform != 'darwin'" }, { name = "uvicorn" }, ] @@ -617,17 +1151,37 @@ requires-dist = [ { name = "elasticsearch", specifier = "~=9.4.0" }, { name = "fastapi", specifier = "~=0.115.0" }, { name = "httpx", specifier = "~=0.27.0" }, - { name = "openai", specifier = ">=2.41.0" }, + { name = "openai", specifier = "~=2.41.0" }, { name = "pydantic", specifier = "~=2.7.1" }, { name = "pydantic-settings", specifier = "~=2.2.1" }, { name = "pyjwt", specifier = "~=2.8.0" }, { name = "pytest", specifier = "~=8.1.0" }, { name = "python-multipart", specifier = "~=0.0.19" }, { name = "pyyaml", specifier = "~=6.0.1" }, + { name = "sentence-transformers", specifier = "~=5.5.1" }, { name = "sqlalchemy", specifier = "~=2.0.0" }, + { name = "torch", index = "https://download.pytorch.org/whl/cpu" }, { name = "uvicorn", specifier = "~=0.29.0" }, ] +[[package]] +name = "setuptools" +version = "81.0.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0d/1c/73e719955c59b8e424d015ab450f51c0af856ae46ea2da83eba51cc88de1/setuptools-81.0.0.tar.gz", hash = "sha256:487b53915f52501f0a79ccfd0c02c165ffe06631443a886740b91af4b7a5845a", size = 1198299, upload-time = "2026-02-06T21:10:39.601Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e1/e3/c164c88b2e5ce7b24d667b9bd83589cf4f3520d97cad01534cd3c4f55fdb/setuptools-81.0.0-py3-none-any.whl", hash = "sha256:fdd925d5c5d9f62e4b74b30d6dd7828ce236fd6ed998a08d81de62ce5a6310d6", size = 1062021, upload-time = "2026-02-06T21:10:37.175Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + [[package]] name = "six" version = "1.17.0" @@ -699,6 +1253,118 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8b/0c/9d30a4ebeb6db2b25a841afbb80f6ef9a854fc3b41be131d249a977b4959/starlette-0.46.2-py3-none-any.whl", hash = "sha256:595633ce89f8ffa71a015caed34a5b2dc1c0cdb3f0f1fbd1e69339cf2abeec35", size = 72037, upload-time = "2025-04-13T13:56:16.21Z" }, ] +[[package]] +name = "sympy" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mpmath" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/83/d3/803453b36afefb7c2bb238361cd4ae6125a569b4db67cd9e79846ba2d68c/sympy-1.14.0.tar.gz", hash = "sha256:d3d3fe8df1e5a0b42f0e7bdf50541697dbe7d23746e894990c030e2b05e72517", size = 7793921, upload-time = "2025-04-27T18:05:01.611Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/09/77d55d46fd61b4a135c444fc97158ef34a095e5681d0a6c10b75bf356191/sympy-1.14.0-py3-none-any.whl", hash = "sha256:e091cc3e99d2141a0ba2847328f5479b05d94a6635cb96148ccb3f34671bd8f5", size = 6299353, upload-time = "2025-04-27T18:04:59.103Z" }, +] + +[[package]] +name = "threadpoolctl" +version = "3.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b7/4d/08c89e34946fce2aec4fbb45c9016efd5f4d7f24af8e5d93296e935631d8/threadpoolctl-3.6.0.tar.gz", hash = "sha256:8ab8b4aa3491d812b623328249fab5302a68d2d71745c8a4c719a2fcaba9f44e", size = 21274, upload-time = "2025-03-13T13:49:23.031Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/32/d5/f9a850d79b0851d1d4ef6456097579a9005b31fea68726a4ae5f2d82ddd9/threadpoolctl-3.6.0-py3-none-any.whl", hash = "sha256:43a0b8fd5a2928500110039e43a5eed8480b918967083ea48dc3ab9f13c4a7fb", size = 18638, upload-time = "2025-03-13T13:49:21.846Z" }, +] + +[[package]] +name = "tokenizers" +version = "0.22.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/73/6f/f80cfef4a312e1fb34baf7d85c72d4411afde10978d4657f8cdd811d3ccc/tokenizers-0.22.2.tar.gz", hash = "sha256:473b83b915e547aa366d1eee11806deaf419e17be16310ac0a14077f1e28f917", size = 372115, upload-time = "2026-01-05T10:45:15.988Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/92/97/5dbfabf04c7e348e655e907ed27913e03db0923abb5dfdd120d7b25630e1/tokenizers-0.22.2-cp39-abi3-macosx_10_12_x86_64.whl", hash = "sha256:544dd704ae7238755d790de45ba8da072e9af3eea688f698b137915ae959281c", size = 3100275, upload-time = "2026-01-05T10:41:02.158Z" }, + { url = "https://files.pythonhosted.org/packages/2e/47/174dca0502ef88b28f1c9e06b73ce33500eedfac7a7692108aec220464e7/tokenizers-0.22.2-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:1e418a55456beedca4621dbab65a318981467a2b188e982a23e117f115ce5001", size = 2981472, upload-time = "2026-01-05T10:41:00.276Z" }, + { url = "https://files.pythonhosted.org/packages/d6/84/7990e799f1309a8b87af6b948f31edaa12a3ed22d11b352eaf4f4b2e5753/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2249487018adec45d6e3554c71d46eb39fa8ea67156c640f7513eb26f318cec7", size = 3290736, upload-time = "2026-01-05T10:40:32.165Z" }, + { url = "https://files.pythonhosted.org/packages/78/59/09d0d9ba94dcd5f4f1368d4858d24546b4bdc0231c2354aa31d6199f0399/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25b85325d0815e86e0bac263506dd114578953b7b53d7de09a6485e4a160a7dd", size = 3168835, upload-time = "2026-01-05T10:40:38.847Z" }, + { url = "https://files.pythonhosted.org/packages/47/50/b3ebb4243e7160bda8d34b731e54dd8ab8b133e50775872e7a434e524c28/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfb88f22a209ff7b40a576d5324bf8286b519d7358663db21d6246fb17eea2d5", size = 3521673, upload-time = "2026-01-05T10:40:56.614Z" }, + { url = "https://files.pythonhosted.org/packages/e0/fa/89f4cb9e08df770b57adb96f8cbb7e22695a4cb6c2bd5f0c4f0ebcf33b66/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1c774b1276f71e1ef716e5486f21e76333464f47bece56bbd554485982a9e03e", size = 3724818, upload-time = "2026-01-05T10:40:44.507Z" }, + { url = "https://files.pythonhosted.org/packages/64/04/ca2363f0bfbe3b3d36e95bf67e56a4c88c8e3362b658e616d1ac185d47f2/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df6c4265b289083bf710dff49bc51ef252f9d5be33a45ee2bed151114a56207b", size = 3379195, upload-time = "2026-01-05T10:40:51.139Z" }, + { url = "https://files.pythonhosted.org/packages/2e/76/932be4b50ef6ccedf9d3c6639b056a967a86258c6d9200643f01269211ca/tokenizers-0.22.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:369cc9fc8cc10cb24143873a0d95438bb8ee257bb80c71989e3ee290e8d72c67", size = 3274982, upload-time = "2026-01-05T10:40:58.331Z" }, + { url = "https://files.pythonhosted.org/packages/1d/28/5f9f5a4cc211b69e89420980e483831bcc29dade307955cc9dc858a40f01/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:29c30b83d8dcd061078b05ae0cb94d3c710555fbb44861139f9f83dcca3dc3e4", size = 9478245, upload-time = "2026-01-05T10:41:04.053Z" }, + { url = "https://files.pythonhosted.org/packages/6c/fb/66e2da4704d6aadebf8cb39f1d6d1957df667ab24cff2326b77cda0dcb85/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:37ae80a28c1d3265bb1f22464c856bd23c02a05bb211e56d0c5301a435be6c1a", size = 9560069, upload-time = "2026-01-05T10:45:10.673Z" }, + { url = "https://files.pythonhosted.org/packages/16/04/fed398b05caa87ce9b1a1bb5166645e38196081b225059a6edaff6440fac/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_i686.whl", hash = "sha256:791135ee325f2336f498590eb2f11dc5c295232f288e75c99a36c5dbce63088a", size = 9899263, upload-time = "2026-01-05T10:45:12.559Z" }, + { url = "https://files.pythonhosted.org/packages/05/a1/d62dfe7376beaaf1394917e0f8e93ee5f67fea8fcf4107501db35996586b/tokenizers-0.22.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:38337540fbbddff8e999d59970f3c6f35a82de10053206a7562f1ea02d046fa5", size = 10033429, upload-time = "2026-01-05T10:45:14.333Z" }, + { url = "https://files.pythonhosted.org/packages/fd/18/a545c4ea42af3df6effd7d13d250ba77a0a86fb20393143bbb9a92e434d4/tokenizers-0.22.2-cp39-abi3-win32.whl", hash = "sha256:a6bf3f88c554a2b653af81f3204491c818ae2ac6fbc09e76ef4773351292bc92", size = 2502363, upload-time = "2026-01-05T10:45:20.593Z" }, + { url = "https://files.pythonhosted.org/packages/65/71/0670843133a43d43070abeb1949abfdef12a86d490bea9cd9e18e37c5ff7/tokenizers-0.22.2-cp39-abi3-win_amd64.whl", hash = "sha256:c9ea31edff2968b44a88f97d784c2f16dc0729b8b143ed004699ebca91f05c48", size = 2747786, upload-time = "2026-01-05T10:45:18.411Z" }, + { url = "https://files.pythonhosted.org/packages/72/f4/0de46cfa12cdcbcd464cc59fde36912af405696f687e53a091fb432f694c/tokenizers-0.22.2-cp39-abi3-win_arm64.whl", hash = "sha256:9ce725d22864a1e965217204946f830c37876eee3b2ba6fc6255e8e903d5fcbc", size = 2612133, upload-time = "2026-01-05T10:45:17.232Z" }, +] + +[[package]] +name = "torch" +version = "2.12.0" +source = { registry = "https://download.pytorch.org/whl/cpu" } +resolution-markers = [ + "sys_platform == 'darwin'", +] +dependencies = [ + { name = "filelock", marker = "sys_platform == 'darwin'" }, + { name = "fsspec", marker = "sys_platform == 'darwin'" }, + { name = "jinja2", marker = "sys_platform == 'darwin'" }, + { name = "networkx", marker = "sys_platform == 'darwin'" }, + { name = "setuptools", marker = "sys_platform == 'darwin'" }, + { name = "sympy", marker = "sys_platform == 'darwin'" }, + { name = "typing-extensions", marker = "sys_platform == 'darwin'" }, +] +wheels = [ + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:b41339df93d491435e790ff8bcbae1c0ce777175889bfd1281d119862793e6a2", upload-time = "2026-05-12T16:20:12Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp313-cp313-macosx_14_0_arm64.whl", hash = "sha256:90dd587a5f61bfe1307148b581e2084fc5bc4a06e2b90a20e9a36b81087ff16b", upload-time = "2026-05-12T16:20:17Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp313-cp313t-macosx_14_0_arm64.whl", hash = "sha256:10ee1448a9f304d3b987eb4656f664ba6e4d7b410ca7a5a7c642199777a2cf88", upload-time = "2026-05-12T16:20:21Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp314-cp314-macosx_14_0_arm64.whl", hash = "sha256:f7dfae4a519197dfa050e98d8e36378a0fb5899625a875c2b54445005a2e404e", upload-time = "2026-05-12T16:20:26Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0-cp314-cp314t-macosx_14_0_arm64.whl", hash = "sha256:b4556715c8572758625d62b6e0ae3b1f76c440221913a6fb5e100f321fb4fb02", upload-time = "2026-05-12T16:20:31Z" }, +] + +[[package]] +name = "torch" +version = "2.12.0+cpu" +source = { registry = "https://download.pytorch.org/whl/cpu" } +resolution-markers = [ + "sys_platform != 'darwin'", +] +dependencies = [ + { name = "filelock", marker = "sys_platform != 'darwin'" }, + { name = "fsspec", marker = "sys_platform != 'darwin'" }, + { name = "jinja2", marker = "sys_platform != 'darwin'" }, + { name = "networkx", marker = "sys_platform != 'darwin'" }, + { name = "setuptools", marker = "sys_platform != 'darwin'" }, + { name = "sympy", marker = "sys_platform != 'darwin'" }, + { name = "typing-extensions", marker = "sys_platform != 'darwin'" }, +] +wheels = [ + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-linux_s390x.whl", hash = "sha256:b9d0e8eed0af9321ffb12b75f4aca371b071254f12cf75875d5a8e7cc8f52b51", upload-time = "2026-05-12T23:16:33Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-manylinux_2_28_aarch64.whl", hash = "sha256:ce2ddb880b0813fcc91a737f08fdd973a8115a74c64ccb34e9c09a7964b4d448", upload-time = "2026-05-12T23:16:40Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:5e3dc83725581fa38b7b2e45c58692e30b2a3cde19191af54b675ffcac3840a6", upload-time = "2026-05-12T23:16:48Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-win_amd64.whl", hash = "sha256:70ead47f538417323a230c0e743e5cbb6d91f11bd8339abf8c05c9d02f8409bc", upload-time = "2026-05-12T23:16:56Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp312-cp312-win_arm64.whl", hash = "sha256:5a3b24f429d126a08acafd5cfe8b719409618ad57c49bf4f20df4f8cd32cd682", upload-time = "2026-05-12T23:17:00Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-linux_s390x.whl", hash = "sha256:5e0da19e1c3bfdc9b92638c552579eac678354485d61fc8921b0461fd6c40449", upload-time = "2026-05-12T23:17:05Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-manylinux_2_28_aarch64.whl", hash = "sha256:68b7ddd4db4603a03e106e74c7098c8d8c8943d33c1e5ada009ca4cd885759c3", upload-time = "2026-05-12T23:17:12Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-manylinux_2_28_x86_64.whl", hash = "sha256:ada78018bdfa30d1c766596cd32d910dbf5b03424cd859231b6d2a00533de922", upload-time = "2026-05-12T23:17:20Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-win_amd64.whl", hash = "sha256:59bc266826e683899d49ee0af9829f3eafd0a16e15b5db9dc591c8d955003b66", upload-time = "2026-05-12T23:17:27Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313-win_arm64.whl", hash = "sha256:97a5160abf3ca9d59a2cd7b4b4de89d9dfe290d36a1ac720262a55fbcee10b6c", upload-time = "2026-05-12T23:17:31Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-linux_s390x.whl", hash = "sha256:32b9b7a0974cd6149cb98def0a28a49d92d7c14a384273d5539da9624239e950", upload-time = "2026-05-12T23:17:36Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:93ed8dc52c113580daf6124982b3232629045dccc5cd83a8f5ed478f7bac7340", upload-time = "2026-05-12T23:17:43Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-manylinux_2_28_x86_64.whl", hash = "sha256:6a1c86abd4ed15a0736cf2663ad69642ae5d1288c99e30346070e6241018a0a9", upload-time = "2026-05-12T23:17:54Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp313-cp313t-win_amd64.whl", hash = "sha256:768dce4b7b3353795f667d1cb0dd7dfba06f570cd39539576097335e05bb71fe", upload-time = "2026-05-12T23:18:02Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-linux_s390x.whl", hash = "sha256:ee1f329acfd0c2a1ccaa3393bcaf9857ea58759549bb2d67e271a6eab42382b3", upload-time = "2026-05-12T23:18:08Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-manylinux_2_28_aarch64.whl", hash = "sha256:797c066367792c92eb97cafba7fd0caa8d7455e6078a4ee880630077378dc372", upload-time = "2026-05-12T23:18:15Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-manylinux_2_28_x86_64.whl", hash = "sha256:a8f419ce3f25388d36e67153ec63b3a1b17059c49f5a7759a7e91ac4843660d3", upload-time = "2026-05-12T23:18:22Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314-win_amd64.whl", hash = "sha256:1dd196c43e74e7b3b526ff434e7efbdef3f3792a2efbecfc983d7dce501840d2", upload-time = "2026-05-12T23:18:30Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-linux_s390x.whl", hash = "sha256:d0d2080cb13c94ebc0c884d237e404490743d0f40192c8a180abf3b6b6f334cf", upload-time = "2026-05-12T23:18:35Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:f7bc15972acad257723775237cdd120024cca844b8bc64701822fa596bcb7e14", upload-time = "2026-05-12T23:18:42Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-manylinux_2_28_x86_64.whl", hash = "sha256:4d79f961250d1763487ecbc90af019a80009f9e87cadc5366b3ec4ba5671fea6", upload-time = "2026-05-12T23:18:50Z" }, + { url = "https://download-r2.pytorch.org/whl/cpu/torch-2.12.0%2Bcpu-cp314-cp314t-win_amd64.whl", hash = "sha256:46b8f4c41ac36bb5d5b47f5437b3de5541b313275e59c1d2aefd3bef32b0f531", upload-time = "2026-05-12T23:18:58Z" }, +] + [[package]] name = "tqdm" version = "4.67.3" @@ -711,6 +1377,41 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/16/e1/3079a9ff9b8e11b846c6ac5c8b5bfb7ff225eee721825310c91b3b50304f/tqdm-4.67.3-py3-none-any.whl", hash = "sha256:ee1e4c0e59148062281c49d80b25b67771a127c85fc9676d3be5f243206826bf", size = 78374, upload-time = "2026-02-03T17:35:50.982Z" }, ] +[[package]] +name = "transformers" +version = "5.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "huggingface-hub" }, + { name = "numpy" }, + { name = "packaging" }, + { name = "pyyaml" }, + { name = "regex" }, + { name = "safetensors" }, + { name = "tokenizers" }, + { name = "tqdm" }, + { name = "typer" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7d/4a/2ee05f9a06bb2dd34cac951548553738a826762fb7adfa7ce256daeaeac8/transformers-5.11.0.tar.gz", hash = "sha256:1dbecade5b8a09bdf3e9e8fdfc9d312cb9eccf5a201080dc894b373f0f3eb5f4", size = 8874363, upload-time = "2026-06-10T16:31:52.441Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9b/40/30fdefda9b8aff8d36054dbb37d8e1464cc1130c29623403c3c2147bdee1/transformers-5.11.0-py3-none-any.whl", hash = "sha256:06d0a34eab529955f8e704b530663c7d6bd6f9c7a9e47a05cddb4a44e7b6566b", size = 11094597, upload-time = "2026-06-10T16:31:49.08Z" }, +] + +[[package]] +name = "typer" +version = "0.25.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "click" }, + { name = "rich" }, + { name = "shellingham" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/51/9aed62104cea109b820bbd6c14245af756112017d309da813ef107d42e7e/typer-0.25.1.tar.gz", hash = "sha256:9616eb8853a09ffeabab1698952f33c6f29ffdbceb4eaeecf571880e8d7664cc", size = 122276, upload-time = "2026-04-30T19:32:16.964Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3f/f9/2b3ff4e56e5fa7debfaf9eb135d0da96f3e9a1d5b27222223c7296336e5f/typer-0.25.1-py3-none-any.whl", hash = "sha256:75caa44ed46a03fb2dab8808753ffacdbfea88495e74c85a28c5eefcf5f39c89", size = 58409, upload-time = "2026-04-30T19:32:18.271Z" }, +] + [[package]] name = "typing-extensions" version = "4.15.0" diff --git a/ude_person.http b/ude_person.http new file mode 100644 index 00000000..9354020f --- /dev/null +++ b/ude_person.http @@ -0,0 +1,1428 @@ +GET https://inse.nes.uni-due.de/elastic/ude_persons_1.0/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "query": { + "query_string": { + "default_field": "name", + "query": "Marcus Handte" + } + } + +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_publications/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 100, + "query": { + "bool": { + "filter": [ + { + "terms": { + "projectID": ["287661"] + } + } + ] + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_projects/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_projects/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 100, + "query": { + "bool": { + "filter": [ + { + "terms": { + "id": ["604123", "101003555"] + } + } + ] + } + } +} + +# 10.1371/journal.pone.0018216 + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_publications/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_publications/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_fp7_project_iprs/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_publications/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "query": { + "bool": { + "filter": [ + { + "terms": { + "qaProcessedDoi": [ + "10.5555/3234847.3234861", + "10.1145/1858367.1858373", + "10.1145/3583120.3586961", + "10.1109/ipin.2017.8115906", + "10.1145/3274783.3275217", + "10.1007/978-3-031-20716-7_7", + "10.1109/percomw.2012.6197554", + "10.1016/j.pmcj.2012.12.002", + "10.1007/978-3-658-32266-3_30", + "10.1109/percomw.2013.6529502", + "10.1109/ie.2010.40", + "10.18419/opus-2650", + "10.1007/s00138-024-01553-z", + "10.1007/978-3-030-90439-5_15", + "10.1201/9781003338659-4", + "10.1016/j.pmcj.2013.10.013", + "10.1109/percom.2009.4912852", + "10.1109/icra55743.2025.11128432", + "10.1145/2494091.2497327", + "10.1007/978-3-658-46485-1_31", + "10.1109/ie.2017.22", + "10.1109/jiot.2016.2554146", + "10.1145/2493432.2493459", + "10.3233/ais-160416", + "10.1109/percomw.2007.111", + "10.5194/asr-17-183-2020", + "10.1007/978-3-658-36430-4_37", + "10.1007/978-3-030-64559-5_50" + ] + } + } + ] + } + } +} + + + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "filter": [ + { + "term": { + "organisationID": "999843312" + } + } + ] + } + }, + "aggs": { + "associated_project_ids": { + "terms": { + "field": "projectID" + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 1000, + "query": { + "bool": { + "filter": [ + { + "term": { + "name.keyword": "UNIVERSITAET DUISBURG-ESSEN" + } + } + ] + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "filter": [ + { + "term": { + "name.keyword": "UNIVERSITAET DUISBURG-ESSEN" + } + } + ] + } + }, + "aggs": { + "associated_project_ids": { + "terms": { + "field": "projectID" + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_projects/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "query": { + "terms": { + "name": [ + "UNIVERSITÄT DUISBURG-ESSEN", + "UNIVERSITY OF DUISBURG-ESSEN", + "UNIVERSITAT DUISBURG-ESSEN", + "UNIVERSITY OF DUISBURG ESSEN", + "UNIVERSITAT DUISBURG-ESSEN", + "UNIVERSITAET DUISBURG ESSEN", + "UNIVERSITÄT DUISBURG ESSEN", + "UNIVERSITAT DUISBURG ESSEN", + "UNIVERSITÄT DUISBURG-ESSEN", + "UNIVERSITAET DUISBURG-ESSEN", + "UNIVERSITY OF DUISBURG-ESSEN" + ] + } + }, + "_source": ["projectID", "organisationID", "ecContribution"] +} + + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 10, + "query": { + "bool": { + "filter": [ + { + "term": { + "name.keyword": "UNIVERSITAET DUISBURG-ESSEN" + } + } + ] + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_*_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "filter": [ + { + "terms": { + "name.keyword": [ + "UNIVERSITAET DUISBURG-ESSEN", + "UNIVERSITY OF DUISBURG-ESSEN", + "UNIVERSITÄT DUISBURG-ESSEN", + "UNIVERSITAT DUISBURG ESSEN", + "UNIVERSITÄT DUISBURG ESSEN", + "UNIVERSITY OF DUISBURG ESSEN", + "UNIVERSITAET DUISBURG ESSEN", + "UNIVERSITAT DUISBURG-ESSEN" + ] + } + } + ] + } + }, + "aggs": { + "organisation_ids": { + "terms": { + "field": "organisationID", + "size": 10000 + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_horizon_europe_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "match": { + "name": { + "query": "Essen", + "fuzziness": "AUTO" + } + } + }, + "aggs": { + "distinct_matched_names": { + "terms": { + "field": "name.keyword", + "size": 100 + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/cordis_eu_fp7_organizations/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "match": { + "name": { + "query": "Essen", + "fuzziness": "AUTO" + } + } + }, + "aggs": { + "distinct_matched_names": { + "terms": { + "field": "name.keyword", + "size": 100 + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 10, + "from": 0, + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung" + ], + "query": { + "bool": { + "must": [ + { + "bool": { + "should": [ + { + "bool": { + "must": [ + { + "multi_match": { + "query": "Kurt", + "fields": [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher" + ] + } + }, + { + "multi_match": { + "query": "Rothermel", + "fields": [ + "Antragsteller", + "Antragstellerin", + "Antragstellerinnen", + "Antragstellerinnen / Antragsteller", + "Beteiligte Person", + "Beteiligte Personen", + "Co-Sprecher", + "Co-Sprecherinnen / Co-Sprecher", + "Ehemalige Antragsteller", + "Ehemalige Antragstellerin", + "Ehemalige Antragstellerinnen", + "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", + "Ehemaliger Antragsteller", + "Gastgeber", + "Gastgeberin", + "Gastgeberinnen", + "Gastgeberinnen / Gastgeber", + "Kooperationspartner", + "Kooperationspartnerin", + "Kooperationspartnerinnen", + "Kooperationspartnerinnen / Kooperationspartner", + "Leiter", + "Leiterin", + "Leiterinnen", + "Leiterinnen / Leiter", + "Mitantragsteller", + "Mitantragstellerin", + "Mitantragstellerinnen", + "Mitantragstellerinnen / Mitantragsteller", + "Mitverantwortlich", + "Mitverantwortlich(e)", + "Mitverantwortliche", + "Sprecher", + "Sprecher (IGK-Partner)", + "Sprecherin", + "Sprecherin (IGK-Partner)", + "Sprecherinnen", + "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", + "Sprecherinnen / Sprecher", + "Teilprojektleiter", + "Teilprojektleiterin", + "Teilprojektleiterinnen", + "Teilprojektleiterinnen / Teilprojektleiter", + "ausländ. Mitantragstellerin", + "ausländ. Mitantragstellerinnen", + "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", + "ausländische Mitantragsteller", + "ausländischer Mitantragsteller", + "beteiligte Wissenschaftler", + "beteiligte Wissenschaftlerin", + "beteiligte Wissenschaftlerinnen", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "beteiligter Wissenschaftler", + "person_creater_name", + "stellvertr. Sprecher", + "stellvertr. Sprecherin", + "stellvertr. Sprecherinnen / stellvertr. Sprecher" + ] + } + } + ] + } + } + ], + "minimum_should_match": 1 + } + } + ], + "filter": [ + { + "script": { + "script": { + "lang": "painless", + "source": "def fields = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Antragstellerinnen.keyword', 'Antragstellerinnen / Antragsteller.keyword', 'Beteiligte Person.keyword', 'Beteiligte Personen.keyword', 'Co-Sprecher.keyword', 'Co-Sprecherinnen / Co-Sprecher.keyword', 'Ehemalige Antragsteller.keyword', 'Ehemalige Antragstellerin.keyword', 'Ehemalige Antragstellerinnen.keyword', 'Ehemalige Antragstellerinnen / Ehemalige Antragsteller.keyword', 'Ehemaliger Antragsteller.keyword', 'Gastgeber.keyword', 'Gastgeberin.keyword', 'Gastgeberinnen.keyword', 'Gastgeberinnen / Gastgeber.keyword', 'Kooperationspartner.keyword', 'Kooperationspartnerin.keyword', 'Kooperationspartnerinnen.keyword', 'Kooperationspartnerinnen / Kooperationspartner.keyword', 'Leiter.keyword', 'Leiterin.keyword', 'Leiterinnen.keyword', 'Leiterinnen / Leiter.keyword', 'Mitantragsteller.keyword', 'Mitantragstellerin.keyword', 'Mitantragstellerinnen.keyword', 'Mitantragstellerinnen / Mitantragsteller.keyword', 'Mitverantwortlich.keyword', 'Mitverantwortlich(e).keyword', 'Mitverantwortliche.keyword', 'Sprecher.keyword', 'Sprecher (IGK-Partner).keyword', 'Sprecherin.keyword', 'Sprecherin (IGK-Partner).keyword', 'Sprecherinnen.keyword', 'Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner).keyword', 'Sprecherinnen / Sprecher.keyword', 'Teilprojektleiter.keyword', 'Teilprojektleiterin.keyword', 'Teilprojektleiterinnen.keyword', 'Teilprojektleiterinnen / Teilprojektleiter.keyword', 'ausländ. Mitantragstellerin.keyword', 'ausländ. Mitantragstellerinnen.keyword', 'ausländ. Mitantragstellerinnen / ausländische Mitantragsteller.keyword', 'ausländische Mitantragsteller.keyword', 'ausländischer Mitantragsteller.keyword', 'beteiligte Wissenschaftler.keyword', 'beteiligte Wissenschaftlerin.keyword', 'beteiligte Wissenschaftlerinnen.keyword', 'beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler.keyword', 'beteiligter Wissenschaftler.keyword', 'person_creater_name.keyword', 'stellvertr. Sprecher.keyword', 'stellvertr. Sprecherin.keyword', 'stellvertr. Sprecherinnen / stellvertr. Sprecher.keyword']; for (field in fields) { if (doc.containsKey(field) && !doc[field].empty) { for (value in doc[field]) { if (value.contains(';')) { def splitValues = value.splitOnToken(';'); for (singlePersonRaw in splitValues) { def singlePerson = singlePersonRaw.toLowerCase(); if ((singlePerson.contains('kurt') && singlePerson.contains('rothermel'))) { return true; } } } else { def singlePerson = value.toLowerCase(); if ((singlePerson.contains('kurt') && singlePerson.contains('rothermel'))) { return true; } } } } } return false;" + } + } + } + ] + } + }, + "script_fields": { + "all_found_names": { + "script": { + "lang": "painless", + "source": "def names = new HashSet(); def fields = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Antragstellerinnen.keyword', 'Antragstellerinnen / Antragsteller.keyword', 'Beteiligte Person.keyword', 'Beteiligte Personen.keyword', 'Co-Sprecher.keyword', 'Co-Sprecherinnen / Co-Sprecher.keyword', 'Ehemalige Antragsteller.keyword', 'Ehemalige Antragstellerin.keyword', 'Ehemalige Antragstellerinnen.keyword', 'Ehemalige Antragstellerinnen / Ehemalige Antragsteller.keyword', 'Ehemaliger Antragsteller.keyword', 'Gastgeber.keyword', 'Gastgeberin.keyword', 'Gastgeberinnen.keyword', 'Gastgeberinnen / Gastgeber.keyword', 'Kooperationspartner.keyword', 'Kooperationspartnerin.keyword', 'Kooperationspartnerinnen.keyword', 'Kooperationspartnerinnen / Kooperationspartner.keyword', 'Leiter.keyword', 'Leiterin.keyword', 'Leiterinnen.keyword', 'Leiterinnen / Leiter.keyword', 'Mitantragsteller.keyword', 'Mitantragstellerin.keyword', 'Mitantragstellerinnen.keyword', 'Mitantragstellerinnen / Mitantragsteller.keyword', 'Mitverantwortlich.keyword', 'Mitverantwortlich(e).keyword', 'Mitverantwortliche.keyword', 'Sprecher.keyword', 'Sprecher (IGK-Partner).keyword', 'Sprecherin.keyword', 'Sprecherin (IGK-Partner).keyword', 'Sprecherinnen.keyword', 'Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner).keyword', 'Sprecherinnen / Sprecher.keyword', 'Teilprojektleiter.keyword', 'Teilprojektleiterin.keyword', 'Teilprojektleiterinnen.keyword', 'Teilprojektleiterinnen / Teilprojektleiter.keyword', 'ausländ. Mitantragstellerin.keyword', 'ausländ. Mitantragstellerinnen.keyword', 'ausländ. Mitantragstellerinnen / ausländische Mitantragsteller.keyword', 'ausländische Mitantragsteller.keyword', 'ausländischer Mitantragsteller.keyword', 'beteiligte Wissenschaftler.keyword', 'beteiligte Wissenschaftlerin.keyword', 'beteiligte Wissenschaftlerinnen.keyword', 'beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler.keyword', 'beteiligter Wissenschaftler.keyword', 'person_creater_name.keyword', 'stellvertr. Sprecher.keyword', 'stellvertr. Sprecherin.keyword', 'stellvertr. Sprecherinnen / stellvertr. Sprecher.keyword']; for (field in fields) { if (doc.containsKey(field) && !doc[field].empty) { for (value in doc[field]) { if (value.contains(';')) { def splitNames = value.splitOnToken(';'); for (sn in splitNames) { names.add(sn.trim()); } } else { names.add(value.trim()); } } } } return new ArrayList(names);" + } + } + }, + "sort": [{ "id.keyword": { "order": "asc" } }] +} + + + + + + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "_source": [ + "id", + "link", + "title", + "funding_start", + "funding_end", + "Fachliche Zuordnung" + ], + "query": { + "bool": { + "must": [ + { + "bool": { + "minimum_should_match": 1, + "should": [ + { + "bool": { + "must": [ + { "multi_match": { "query": "Marcus", "fields": ["Antragsteller", "Beteiligte Person"] } }, + { "multi_match": { "query": "Roth", "fields": ["Antragsteller", "Beteiligte Person"] } } + ] + } + } + ] + } + } + ], + "filter": [ + { + "script": { + "script": { + "lang": "painless", + "source": "def felder = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Beteiligte Person.keyword', 'person_creater_name.keyword']; for (feld in felder) { if (doc.containsKey(feld) && !doc[feld].empty) { for (wert in doc[feld]) { def nameImFeld = wert.toLowerCase(); if (nameImFeld.contains('marcus') && (nameImFeld.contains('roth'))) { return true; } } } } return false;" + } + } + } + ] + } + }, + "script_fields": { + "alle_gefundenen_namen": { + "script": { + "lang": "painless", + "source": "def namen = new HashSet(); def felder = ['Antragsteller.keyword', 'Antragstellerin.keyword', 'Beteiligte Person.keyword', 'person_creater_name.keyword']; for (feld in felder) { if (doc.containsKey(feld) && !doc[feld].empty) { for (wert in doc[feld]) { namen.add(wert); } } } return new ArrayList(namen);" + } + } + } +} + +# { +# "query": { +# "bool": { +# "minimum_should_match": 1, +# "should": [ +# { +# "multi_match": { +# "query": "Marcus Roth", +# "type": "cross_fields", +# "operator": "and", +# "fields": [ +# "Antragsteller", +# "Antragstellerin", +# "Antragstellerinnen", +# "Antragstellerinnen / Antragsteller", +# "Beteiligte Person", +# "Beteiligte Personen", +# "Co-Sprecher", +# "Co-Sprecherinnen / Co-Sprecher", +# "Ehemalige Antragsteller", +# "Ehemalige Antragstellerin", +# "Ehemalige Antragstellerinnen", +# "Ehemalige Antragstellerinnen / Ehemalige Antragsteller", +# "Ehemaliger Antragsteller", +# "Gastgeber", +# "Gastgeberin", +# "Gastgeberinnen", +# "Gastgeberinnen / Gastgeber", +# "Kooperationspartner", +# "Kooperationspartnerin", +# "Kooperationspartnerinnen", +# "Kooperationspartnerinnen / Kooperationspartner", +# "Leiter", +# "Leiterin", +# "Leiterinnen", +# "Leiterinnen / Leiter", +# "Mitantragsteller", +# "Mitantragstellerin", +# "Mitantragstellerinnen", +# "Mitantragstellerinnen / Mitantragsteller", +# "Mitverantwortlich", +# "Mitverantwortlich(e)", +# "Mitverantwortliche", +# "Sprecher", +# "Sprecher (IGK-Partner)", +# "Sprecherin", +# "Sprecherin (IGK-Partner)", +# "Sprecherinnen", +# "Sprecherinnen (IGK-Partner) / Sprecher (IGK-Partner)", +# "Sprecherinnen / Sprecher", +# "Teilprojektleiter", +# "Teilprojektleiterin", +# "Teilprojektleiterinnen", +# "Teilprojektleiterinnen / Teilprojektleiter", +# "ausländ. Mitantragstellerin", +# "ausländ. Mitantragstellerinnen", +# "ausländ. Mitantragstellerinnen / ausländische Mitantragsteller", +# "ausländische Mitantragsteller", +# "ausländischer Mitantragsteller", +# "beteiligte Wissenschaftler", +# "beteiligte Wissenschaftlerin", +# "beteiligte Wissenschaftlerinnen", +# "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", +# "beteiligter Wissenschaftler", +# "person_creater_name", +# "stellvertr. Sprecher", +# "stellvertr. Sprecherin", +# "stellvertr. Sprecherinnen / stellvertr. Sprecher" +# ] +# } +# } +# ] +# } +# } +# } + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "query": { + "bool": { + "should": [ + { + "wildcard": { + "title.keyword": { + "value": "*generic*", + "case_insensitive": true + } + } + }, + { + "wildcard": { + "Thema.keyword": { + "value": "*generic*", + "case_insensitive": true + } + } + } + ] + } + } +} + + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 100, + "query": { + "multi_match": { + "query": "Universität Duisburg-Essen", + "type": "phrase", + "fields": [ + "person_creater_address" + ] + } + } +} + + +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 100, + "query": { + "multi_match": { + "query": "Mathias Ulbricht", + "type": "phrase", + "fields": [ + "Antragsteller", + "Antragstellerin", + "Sprecher", + "Sprecherin", + "Leiter", + "Leiterin", + "beteiligte Wissenschaftlerinnen / beteiligte Wissenschaftler", + "Teilprojektleiter" + ] + } + } +} + +# { +# "size": 100, +# "query": { +# "multi_match": { +# "query": "Duisburg-Essen", +# "fields": [ +# "Antragstellende Institution", +# "Mitantragstellende Institution", +# "Beteiligte Institution" +# ] +# } +# } +# } + +# "aggs": { + +# "antragstellende": { + +# "terms": { + +# "field": "Antragstellende Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "mitantragstellende": { + +# "terms": { + +# "field": "Mitantragstellende Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "beteiligte": { + +# "terms": { + +# "field": "Beteiligte Institution.keyword", + +# "size": 100 + +# } + +# }, + +# "partner": { + +# "terms": { + +# "field": "Partnerorganisation.keyword", + +# "size": 100 + +# } + +# } + +# } + +# } + + +### +GET https://inse.nes.uni-due.de/elastic/projects_bund_v1/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/projects_bund_v1/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "must": [ + { + "bool": { + "should": [ + { + "match": { + "Zuwendungsempfänger": { + "query": "university of duisburg-eßen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "university of duisburg-essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universitaet duisburg-essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universitaet duisburg essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universität duisburg-essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universitat duisburg-eßen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universitat duisburg essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "university of duisburg essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universitat duisburg-essen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universität duisburg-eßen", + "operator": "and" + } + } + }, + { + "match": { + "Zuwendungsempfänger": { + "query": "universität duisburg essen", + "operator": "and" + } + } + } + ], + "minimum_should_match": 1 + } + } + ] + } + }, + "aggs": { + "distributed_annual_amounts": { + "scripted_metric": { + "init_script": "state.years_map = [:]", + "map_script": "if (doc['funding_start'].size() == 0 || doc['funding_end'].size() == 0 || doc['Fördersumme'].size() == 0) { return; } def start = doc['funding_start'].value.toLocalDate(); def end = doc['funding_end'].value.toLocalDate(); def totalAmount = doc['Fördersumme'].value; def startYear = start.getYear(); def endYear = end.getYear(); if (startYear == endYear) { state.years_map[startYear] = state.years_map.getOrDefault(startYear, 0.0) + totalAmount; } else { long totalDays = ChronoUnit.DAYS.between(start, end) + 1; if (totalDays <= 0) return; double amountPerDay = totalAmount / (double)totalDays; for (int y = startYear; y <= endYear; y++) { def yearStart = (y == startYear) ? start : LocalDate.of(y, 1, 1); def yearEnd = (y == endYear) ? end : LocalDate.of(y, 12, 31); long daysInYear = ChronoUnit.DAYS.between(yearStart, yearEnd) + 1; double proportionalShare = daysInYear * amountPerDay; state.years_map[y] = state.years_map.getOrDefault(y, 0.0) + proportionalShare; } }", + "combine_script": "return state.years_map", + "reduce_script": "def final_map = [:]; for (state in states) { for (entry in state.entrySet()) { final_map[entry.getKey()] = final_map.getOrDefault(entry.getKey(), 0.0) + entry.getValue(); } } if (final_map.isEmpty()) { return ['funding_per_year': final_map, 'annual_average_over_period': 0.0]; } double totalSum = 0.0; for (val in final_map.values()) { totalSum += val; } double avg = totalSum / final_map.size(); return ['funding_per_year': final_map, 'annual_average_over_period': avg];" + } + } + } +} + + + + +### + +# { + +# "size": 10, +# "from": 1000, +# "query": { +# "match": { +# "Zuwendungsempf\u00e4nger": { +# "query": "Universit\u00e4t Duisburg-Essen", +# "operator": "and" +# } +# } +# }, +# "sort": [ +# { +# "Thema.keyword": { +# "order": "asc" +# } +# } +# ] + +# } + +#{'size': 10, 'from': 0, 'query': {'match': {'Zuwendungsempfänger': {'query': 'Universität Duisburg-Essen', 'operator': 'and'}}}, 'sort': [{'Thema': {'order': 'asc'}}]} + +# { +# "size": 1000, +# "query": { +# "match": { +# "Zuwendungsempfänger": { +# "query": "Universität Duisburg-Essen", +# "operator": "and" +# } +# } +# } +# } + +### +GET https://inse.nes.uni-due.de/elastic/projects_eu_all/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + + +### +GET https://inse.nes.uni-due.de/elastic/projects_eu_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 10, + "from": 0, + "query": { + "bool": { + "must": [ + { + "match_phrase_prefix": { + "title": { + "query": "A", + "max_expansions": 50 + } + } + }, + { + "nested": { + "path": "organization_nested", + "query": { + "bool": { + "should": [ + { "match": { "organization_nested.name": { "query": "university duisburg essen", "operator": "and" } } }, + { "match": { "organization_nested.name": { "query": "universitaet duisburg essen", "operator": "and" } } }, + { "match": { "organization_nested.name": { "query": "universität duisburg-essen", "operator": "and" } } }, + { "match": { "organization_nested.name": { "query": "universitat duisburg-essen", "operator": "and" } } } + ], + "minimum_should_match": 1 + } + } + } + } + ] + } + }, + "sort": [ + { + "title.keyword": { + "order": "asc" + } + } + ] +} + +# { +# "size": 10, +# "from": 0, +# "query": { +# "bool": { +# "must": [ +# { +# "match_phrase_prefix": { +# "title": { +# "query": "Cars", +# "max_expansions": 50 +# } +# } +# } +# ] +# } +# } +# } + + +### +GET https://inse.nes.uni-due.de/elastic/projects_eu_all/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + + "size": 0, + + "query": { + + "nested": { + + "path": "organization_nested", + + "query": { + + "match": { + + "organization_nested.name": "Dortmund" + + } + + } + + } + + }, + + "aggs": { + + "organizations": { + + "nested": { + + "path": "organization_nested" + + }, + + "aggs": { + + "matching": { + + "filter": { + + "match": { + + "organization_nested.name": "Dortmund" + + } + + }, + + "aggs": { + + "names": { + + "terms": { + + "field": "organization_nested.name.keyword", + + "size": 100 + + } + + } + + } + + } + + } + + } + + } + +} + +### + +GET https://inse.nes.uni-due.de/elastic/ude_organization_content_august_2025/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +# { +# "query": {"match": {"staff.name": {"query": "Peter Roch", "operator": "and"}}} +# } + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_mapping +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "_source": ["id", "display_name"], + "query": { + "term": { + "id": { + "value": "https://openalex.org/A5023430147" + } + } + }, + "size": 1 +} + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "query": { + "bool": { + "must": [ + { + "prefix": { + "display_name.keyword": "Marcus Roth" + } + }, + { + "nested": { + "path": "last_known_institutions", + "query": { + "match": { + "last_known_institutions.display_name": "University of Duisburg-Essen" + } + } + } + } + ] + } + } +} + +### + +GET https://project.nes.uni-due.de/elastic/openalex-works/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +### + +GET https://project.nes.uni-due.de/elastic/openalex-works/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "_source": ["title", "doi"], + "size": 100, + "query": { + "bool": { + "must": [ + { + "nested": { + "path": "authorships", + "query": { + "term": { + "authorships.author.id": "https://openalex.org/A5007170803" + } + } + } + } + ], + "filter": [ + { + "exists": { + "field": "doi" + } + } + ] + } + } +} + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "_source": [ + "display_name", + "works_count" + ], + "size": 1000, + "query": { + "bool": { + "must": [ + { + "range": { + "works_count": { "gte": 10 } + } + }, + { + "nested": { + "path": "affiliations", + "query": { + "bool": { + "must": [ + { + "term": { + "affiliations.institution.id": "https://openalex.org/I62318514" + } + }, + { + "range": { + "affiliations.years": { "gte": 2025, "lte": 2026 } + } + }, + { + "script": { + "script": { + "source": "doc['affiliations.years'].length >= params.expected_length", + "params": { + "expected_length": 15 + } + } + } + } + ] + } + } + } + } + ] + } + }, + "sort": [ + { "works_count": { "order": "desc" } } + ] +} + +# { +# "query": { +# "nested": { +# "path": "last_known_institutions", +# "query": { +# "term": { +# "last_known_institutions.id": "https://openalex.org/I62318514" +# } +# } +# } +# } +# } + + +# { +# "query": { +# "query_string": { +# "default_field": "display_name", +# "query": "Tobias Janelt" +# } +# } +# } + +### + +GET https://project.nes.uni-due.de/elastic/openalex-awards/_mapping +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_mapping +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +### + +GET https://project.nes.uni-due.de/elastic/openalex-institutions/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "query": {}, + "size": 10, + "from": 0, + "sort": [{ "works_count": { "order": "desc" } }] +} + + +### + +GET https://project.nes.uni-due.de/elastic/openalex-awards/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 1000, + "query": { + "bool": { + "must": [ + { + "prefix": { + "landing_page_url": "https://gepris.dfg.de/gepris/projekt/" + } + } + ] + } + } +} + + +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "query": { + "bool": { + "must": [ + { + "nested": { + "path": "affiliations", + "query": { + "match_phrase": { + "affiliations.institution.display_name": "University of Duisburg-Essen" + } + } + } + }, + { + "nested": { + "path": "counts_by_year", + "query": { + "range": { + "counts_by_year.year": { + "gte": 2020 + } + } + } + } + } + ], + "must_not": [ + + { + + "nested": { + + "path": "counts_by_year", + + "query": { + + "range": { + + "counts_by_year.year": { + + "lt": 2020 + + } + + } + + } + + } + + } + + ] + } + } +} \ No newline at end of file diff --git a/webapp/.npmrc b/webapp/.npmrc new file mode 100644 index 00000000..521a9f7c --- /dev/null +++ b/webapp/.npmrc @@ -0,0 +1 @@ +legacy-peer-deps=true diff --git a/webapp/angular.json b/webapp/angular.json index 9dbedad5..bf59135f 100644 --- a/webapp/angular.json +++ b/webapp/angular.json @@ -17,19 +17,14 @@ "build": { "builder": "@angular/build:application", "options": { - "baseHref":"/inse-webapp/", + "baseHref": "/inse-webapp/", "outputPath": "dist/inse", "index": "src/index.html", "browser": "src/main.ts", - "polyfills": [ - "zone.js" - ], + "polyfills": ["zone.js"], "tsConfig": "tsconfig.app.json", "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], + "assets": ["src/favicon.ico", "src/assets"], "styles": [ "@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss" @@ -84,16 +79,10 @@ "test": { "builder": "@angular/build:karma", "options": { - "polyfills": [ - "zone.js", - "zone.js/testing" - ], + "polyfills": ["zone.js", "zone.js/testing"], "tsConfig": "tsconfig.spec.json", "inlineStyleLanguage": "scss", - "assets": [ - "src/favicon.ico", - "src/assets" - ], + "assets": ["src/favicon.ico", "src/assets"], "styles": [ "@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss" diff --git a/webapp/build.gradle b/webapp/build.gradle index d6f8a0a4..d3f69e7e 100644 --- a/webapp/build.gradle +++ b/webapp/build.gradle @@ -39,7 +39,7 @@ task generateOpenApiClient(type: GenerateTask) { description = "Generates the API client using OpenAPI Generator" generatorName = "typescript-angular" - inputSpec = file("../service/build/openapi/inse-service.openapi.json").path + inputSpec = file("../service/build/openapi/inse-service.openapi.json").toURI().toString() outputDir = file("src/app/api").path } diff --git a/webapp/openapi.json b/webapp/openapi.json deleted file mode 100644 index a0e514dd..00000000 --- a/webapp/openapi.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Innovation Search Engine API", - "description": "API for the Innovation Search Engine (INSE) application.", - "version": "0.1.0" - }, - "servers": [ - { - "url": "http://localhost:8000", - "description": "Local development server" - } - ], - "paths": { - "/api/person/network/{raw_user_id}": { - "get": { - "tags": ["Person Network"], - "summary": "Get a person's collaboration network.", - "description": "Returns a person's collaboration network based on their works and co-authors.", - "operationId": "getCollaborationNetwork", - "parameters": [ - { - "name": "raw_user_id", - "in": "path", - "required": true, - "schema": { - "type": "string", - "description": "The raw user ID of the person.", - "title": "Raw User Id" - }, - "description": "The raw user ID of the person." - } - ], - "responses": { - "200": { - "description": "Successful Response", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CollaborationNetwork" - } - } - } - }, - "404": { "description": "Person not found" }, - "422": { - "description": "Validation Error", - "content": { - "application/json": { - "schema": { "$ref": "#/components/schemas/HTTPValidationError" } - } - } - } - } - } - } - }, - "components": { - "schemas": { - "CollaborationNetwork": { - "properties": { - "raw_person_id": { - "type": "string", - "title": "Raw Person ID", - "description": "The raw person ID of the person whose collaboration network this is." - }, - "nodes": { - "items": { - "$ref": "#/components/schemas/CollaborationNetworkNode" - }, - "type": "array", - "title": "Collaboration Network Nodes", - "description": "The nodes in the collaboration network." - }, - "edges": { - "items": { - "$ref": "#/components/schemas/CollaborationNetworkEdge" - }, - "type": "array", - "title": "Collaboration Network Edges", - "description": "The edges in the collaboration network." - }, - "works": { - "items": { "$ref": "#/components/schemas/CollaborationWork" }, - "type": "array", - "title": "Collaboration Works", - "description": "The works that represent the collaborations in the collaboration network." - } - }, - "type": "object", - "required": ["raw_person_id", "nodes", "edges", "works"], - "title": "CollaborationNetwork" - }, - "CollaborationNetworkEdge": { - "properties": { - "raw_source_person_id": { - "type": "string", - "title": "Source Raw Person ID", - "description": "The raw person ID of the source person." - }, - "raw_target_person_id": { - "type": "string", - "title": "Target Raw Person ID", - "description": "The raw person ID of the target person." - }, - "raw_work_ids": { - "items": { "type": "string" }, - "type": "array", - "title": "Work IDs", - "description": "The list of work IDs that represent the collaborations between the two persons." - } - }, - "type": "object", - "required": [ - "raw_source_person_id", - "raw_target_person_id", - "raw_work_ids" - ], - "title": "CollaborationNetworkEdge" - }, - "CollaborationNetworkNode": { - "properties": { - "raw_person_id": { - "type": "string", - "title": "Raw Person ID", - "description": "The raw person ID of the person." - }, - "display_name": { - "type": "string", - "title": "Display Name", - "description": "The display name of the person." - } - }, - "type": "object", - "required": ["raw_person_id", "display_name"], - "title": "CollaborationNetworkNode" - }, - "CollaborationWork": { - "properties": { - "raw_work_id": { - "type": "string", - "title": "Raw Work ID", - "description": "The raw work ID of the work." - }, - "display_title": { - "type": "string", - "title": "Display Title", - "description": "The display title of the work." - } - }, - "type": "object", - "required": ["raw_work_id", "display_title"], - "title": "CollaborationWork" - }, - "HTTPValidationError": { - "properties": { - "detail": { - "items": { "$ref": "#/components/schemas/ValidationError" }, - "type": "array", - "title": "Detail" - } - }, - "type": "object", - "title": "HTTPValidationError" - }, - "ValidationError": { - "properties": { - "loc": { - "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] }, - "type": "array", - "title": "Location" - }, - "msg": { "type": "string", "title": "Message" }, - "type": { "type": "string", "title": "Error Type" } - }, - "type": "object", - "required": ["loc", "msg", "type"], - "title": "ValidationError" - } - } - } -} diff --git a/webapp/package-lock.json b/webapp/package-lock.json index b22aea70..94bb537f 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -19,6 +19,7 @@ "@angular/platform-browser-dynamic": "^21.2.14", "@angular/router": "^21.2.14", "echarts": "^6.1.0", + "echarts-wordcloud": "^2.1.0", "ngx-echarts": "^21.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", @@ -325,38 +326,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-devkit/architect/node_modules/chokidar": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", - "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "readdirp": "^5.0.0" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@angular-devkit/architect/node_modules/readdirp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", - "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@angular-devkit/architect/node_modules/source-map": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", @@ -431,38 +400,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular-devkit/schematics/node_modules/chokidar": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", - "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "readdirp": "^5.0.0" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@angular-devkit/schematics/node_modules/readdirp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", - "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@angular-devkit/schematics/node_modules/source-map": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", @@ -701,38 +638,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@angular/cli/node_modules/chokidar": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", - "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "readdirp": "^5.0.0" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@angular/cli/node_modules/readdirp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", - "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@angular/cli/node_modules/source-map": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", @@ -1264,43 +1169,6 @@ "node": ">=0.1.90" } }, - "node_modules/@emnapi/core": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", - "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.1", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", - "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/wasi-threads": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.27.3", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.3.tgz", @@ -4535,38 +4403,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@schematics/angular/node_modules/chokidar": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", - "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "readdirp": "^5.0.0" - }, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@schematics/angular/node_modules/readdirp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", - "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">= 20.19.0" - }, - "funding": { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@schematics/angular/node_modules/source-map": { "version": "0.7.6", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", @@ -6252,6 +6088,15 @@ "zrender": "6.1.0" } }, + "node_modules/echarts-wordcloud": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/echarts-wordcloud/-/echarts-wordcloud-2.1.0.tgz", + "integrity": "sha512-Kt1JmbcROgb+3IMI48KZECK2AP5lG6bSsOEs+AsuwaWJxQom31RTNd6NFYI01E/YaI1PFZeueaupjlmzSQasjQ==", + "license": "ISC", + "peerDependencies": { + "echarts": "^5.0.1" + } + }, "node_modules/echarts/node_modules/tslib": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", @@ -10635,9 +10480,9 @@ } }, "node_modules/tmp": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", - "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.7.tgz", + "integrity": "sha512-e0votIpp4Uo2AJYSzVHV6xCcawuiez3DzqDAbrTc3YxBkplN6e+dM13ZeIcZnDg/QpSuU2zfZ3rzwY8ukEnaXw==", "dev": true, "license": "MIT", "engines": { diff --git a/webapp/package.json b/webapp/package.json index 3c83c9ca..7c6bbb36 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -22,6 +22,7 @@ "@angular/platform-browser-dynamic": "^21.2.14", "@angular/router": "^21.2.14", "echarts": "^6.1.0", + "echarts-wordcloud": "^2.1.0", "ngx-echarts": "^21.0.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 87266ecf..0a468ed3 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -4,91 +4,147 @@ README.md api.base.service.ts api.module.ts api/api.ts -api/inse-account-service.service.ts -api/inse-account-service.serviceInterface.ts -api/inse-service.service.ts -api/inse-service.serviceInterface.ts +api/companyConnections.service.ts +api/funding.service.ts +api/iNSEAccountService.service.ts +api/iNSEService.service.ts +api/institutions.service.ts api/items.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/news.service.ts +api/patents.service.ts +api/personNetwork.service.ts api/persons.service.ts -api/persons.serviceInterface.ts +api/projects.service.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/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/accessGrant.ts +model/authAccount.ts +model/authScope.ts model/author.ts -model/authors-list-response.ts +model/authorAffiliationsInner.ts +model/authorCountsByYearInner.ts +model/authorIds.ts +model/authorNetworkNode.ts +model/authorParsedLongestName.ts +model/authorPositionCount.ts +model/authorSummaryStats.ts +model/authorsFilterProperties.ts +model/authorsListResponse.ts model/authorship.ts +model/autocompleteResponse.ts +model/autocompleteResponseMeta.ts +model/autocompleteResponseResultsInner.ts model/award.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/bodyCreateUser.ts +model/bundProject.ts +model/bundProjectDetails.ts +model/bundProjectPage.ts +model/careerMetrics.ts +model/collaborationNetwork.ts +model/collaborationNetworkEdge.ts +model/collaborationNetworkNodeType.ts +model/companyConnection.ts +model/companyConnectionsResponse.ts +model/cordisEuProject.ts +model/cordisEuProjectPage.ts +model/costUsd.ts +model/customAuthor.ts +model/customAuthorsListResponse.ts +model/dehydratedAuthor.ts +model/dehydratedFunder.ts +model/dehydratedInstitution.ts +model/dehydratedSource.ts +model/dfgProjectDetails.ts +model/dfgProjectPage.ts +model/dfgProjectSummary.ts +model/euOrganizationProjectSummary.ts +model/euOrganizationProjectSummaryPage.ts +model/filterInformation.ts +model/filterProperties.ts +model/funderByAuthor.ts +model/fundersByAuthorResponse.ts +model/fundingProject.ts +model/fundingProjectPage.ts model/fwci.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/groupByResult.ts +model/hTTPValidationError.ts +model/identityGrant.ts +model/institution.ts +model/institutionFunderSummary.ts +model/institutionGeo.ts +model/institutionIds.ts +model/institutionInformation.ts +model/institutionNetworkNode.ts +model/institutionPage.ts +model/institutionsListResponse.ts model/item.ts +model/itemCreate.ts +model/itemPage.ts +model/keywords.ts +model/latitude.ts model/location.ts +model/longitude.ts +model/matchedOfficer.ts +model/mentionedPerson.ts model/meta.ts -model/model2-yr-mean-citedness.ts +model/model2YrMeanCitedness.ts model/models.ts -model/open-access.ts -model/person-bio.ts +model/newsArticle.ts +model/newsArticleDetail.ts +model/newsPage.ts +model/openAccess.ts +model/patentEntry.ts +model/patentsByAuthorResponse.ts +model/personBio.ts +model/projectType.ts +model/projectsFilteringProperties.ts +model/projectsSortBy.ts +model/publicationDetailByFunder.ts +model/publicationIdsByAuthorPosition.ts +model/publicationsByAuthorResponse.ts +model/rankingResponse.ts model/score.ts -model/validation-error-loc-inner.ts -model/validation-error.ts +model/sortDirection.ts +model/topic.ts model/topicCount.ts +model/topicDomain.ts +model/topicField.ts +model/topicIds.ts +model/topicSubfield.ts +model/topics.ts model/topicsByTime.ts model/topicsByYear.ts +model/topicsListResponse.ts +model/universityRanking.ts +model/universityTopicData.ts +model/user.ts model/validationError.ts model/validationErrorLocInner.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/works-list-response.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/workNetworkNode.ts +model/workPage.ts +model/workSustainableDevelopmentGoalsInner.ts +model/workTopic.ts +model/workTopicDomain.ts +model/workTopicField.ts +model/workTopicInformation.ts +model/workTopicSubfield.ts +model/worksFilterProperties.ts +model/worksListResponse.ts +model/yearlyData.ts param.ts provide-api.ts variables.ts diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md index dfa7b6e7..2df9da7b 100644 --- a/webapp/src/app/api/README.md +++ b/webapp/src/app/api/README.md @@ -46,10 +46,10 @@ npm link In your project: ```console -npm link +npm link ``` -__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +**Note for Windows users:** The Angular CLI has troubles to use linked npm packages. Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. @@ -58,22 +58,22 @@ Published packages are not effected by this issue. In your Angular project: ```typescript - import { ApplicationConfig } from '@angular/core'; import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi() - ], + providers: [ + // ... + provideHttpClient(), + provideApi(), + ], }; ``` **NOTE** If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: + ```typescript import { ApiModule } from ''; ``` @@ -86,11 +86,11 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi('http://localhost:9999') - ], + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999'), + ], }; ``` @@ -101,15 +101,15 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi({ - withCredentials: true, - username: 'user', - password: 'password' - }) - ], + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password', + }), + ], }; ``` @@ -120,21 +120,22 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi, Configuration } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - { - provide: Configuration, - useFactory: (authService: AuthService) => new Configuration({ - basePath: 'http://localhost:9999', - withCredentials: true, - username: authService.getUsername(), - password: authService.getPassword(), - }), - deps: [AuthService], - multi: false - } - ], + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => + new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false, + }, + ], }; ``` @@ -151,12 +152,12 @@ import { HttpClientModule } from '@angular/common/http'; import { environment } from '../environments/environment'; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideUserApi(environment.basePath), - provideAdminApi(environment.basePath), - ], + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], }; ``` @@ -176,8 +177,8 @@ Example value for use in your Configuration-Provider: ```typescript new Configuration({ - encodeParam: (param: Param) => myFancyParamEncoder(param), -}) + encodeParam: (param: Param) => myFancyParamEncoder(param), +}); ``` [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts index dcf56358..d9ec8f2e 100644 --- a/webapp/src/app/api/api.base.service.ts +++ b/webapp/src/app/api/api.base.service.ts @@ -1,83 +1,109 @@ /** * 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, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, + HttpParameterCodec, +} from '@angular/common/http'; import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:8000'; - public defaultHeaders = new HttpHeaders(); - public configuration: Configuration; - public encoder: HttpParameterCodec; + protected basePath = 'http://localhost:8000'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; - constructor(basePath?: string|string[], configuration?: Configuration) { - this.configuration = configuration || new Configuration(); - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } + constructor(basePath?: string | string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } - protected canConsumeForm(consumes: string[]): boolean { - return consumes.indexOf('multipart/form-data') !== -1; - } + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } - protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { - // If the value is an object (but not a Date), recursively add its keys. - if (typeof value === 'object' && !(value instanceof Date)) { - return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); - } - return this.addToHttpParamsRecursive(httpParams, value, key); + protected addToHttpParams( + httpParams: HttpParams, + value: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive( + httpParams, + value, + isDeep ? key : undefined, + isDeep, + ); } + return this.addToHttpParamsRecursive(httpParams, value, key); + } - protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { - if (value === null || value === undefined) { - return httpParams; - } - if (typeof value === 'object') { - // If JSON format is preferred, key must be provided. - if (key != null) { - return isDeep - ? Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ) - : httpParams.append(key, JSON.stringify(value)); - } - // Otherwise, if it's an array, add each element. - if (Array.isArray(value)) { - value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, value.toISOString()); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach(k => { - const paramKey = key ? `${key}.${k}` : k; - httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); - }); - } - return httpParams; - } else if (key != null) { - return httpParams.append(key, value); - } - throw Error("key may not be null if value is not object or array"); + protected addToHttpParamsRecursive( + httpParams: HttpParams, + value?: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + if (value === null || value === undefined) { + return httpParams; } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach( + (elem) => + (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), + ); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error('key may not be null if value is Date'); + } + } else { + Object.keys(value).forEach((k) => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive( + httpParams, + value[k], + paramKey, + ); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error('key may not be null if value is not object or array'); + } } diff --git a/webapp/src/app/api/api.module.ts b/webapp/src/app/api/api.module.ts index 58d341fb..e29250f2 100644 --- a/webapp/src/app/api/api.module.ts +++ b/webapp/src/app/api/api.module.ts @@ -1,30 +1,42 @@ -import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { + NgModule, + ModuleWithProviders, + SkipSelf, + Optional, +} from '@angular/core'; import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; - @NgModule({ - imports: [], + imports: [], declarations: [], - exports: [], - providers: [] + exports: [], + providers: [], }) export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] - }; - } + public static forRoot( + configurationFactory: () => Configuration, + ): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [{ provide: Configuration, useFactory: configurationFactory }], + }; + } - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { - if (parentModule) { - throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); - } - if (!http) { - throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); - } + constructor( + @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient, + ) { + if (parentModule) { + throw new Error( + 'ApiModule is already loaded. Import in your base AppModule only.', + ); } + if (!http) { + throw new Error( + 'You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575', + ); + } + } } diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index 18f669bf..7f47efcd 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,25 +1,41 @@ -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 './companyConnections.service'; +import { CompanyConnectionsService } from './companyConnections.service'; +export * from './funding.service'; +import { FundingService } from './funding.service'; +export * from './iNSEAccountService.service'; +import { INSEAccountServiceService } from './iNSEAccountService.service'; +export * from './iNSEService.service'; +import { INSEServiceService } from './iNSEService.service'; +export * from './institutions.service'; +import { InstitutionsService } from './institutions.service'; export * from './items.service'; import { ItemsService } from './items.service'; -export * from './items.serviceInterface'; -export * from './person-network.service'; -import { PersonNetworkService } from './person-network.service'; -export * from './person-network.serviceInterface'; +export * from './news.service'; +import { NewsService } from './news.service'; +export * from './patents.service'; +import { PatentsService } from './patents.service'; +export * from './personNetwork.service'; +import { PersonNetworkService } from './personNetwork.service'; 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 './projects.service'; +import { ProjectsService } from './projects.service'; export * from './topics.service'; import { TopicsService } from './topics.service'; -export * from './topics.serviceInterface'; export * from './works.service'; import { WorksService } from './works.service'; -export * from './works.serviceInterface'; -export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService]; +export const APIS = [ + CompanyConnectionsService, + FundingService, + INSEAccountServiceService, + INSEServiceService, + InstitutionsService, + ItemsService, + NewsService, + PatentsService, + PersonNetworkService, + PersonsService, + ProjectsService, + TopicsService, + WorksService, +]; diff --git a/webapp/src/app/api/api/companyConnections.service.ts b/webapp/src/app/api/api/companyConnections.service.ts new file mode 100644 index 00000000..6ad850ea --- /dev/null +++ b/webapp/src/app/api/api/companyConnections.service.ts @@ -0,0 +1,148 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class CompanyConnectionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get possible company connections by OpenAlex author ID. + * @endpoint get /api/inse-service/authors/{author_id}/company-connections + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts new file mode 100644 index 00000000..f1f0a1a7 --- /dev/null +++ b/webapp/src/app/api/api/funding.service.ts @@ -0,0 +1,275 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class FundingService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get funding organizations by author. + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFundersByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getFundersByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getFundersByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funded publications by author. + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPublicationsByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/iNSEAccountService.service.ts b/webapp/src/app/api/api/iNSEAccountService.service.ts new file mode 100644 index 00000000..4874a0a8 --- /dev/null +++ b/webapp/src/app/api/api/iNSEAccountService.service.ts @@ -0,0 +1,457 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { AccessGrant } from '../model/accessGrant'; +// @ts-ignore +import { BodyCreateUser } from '../model/bodyCreateUser'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { IdentityGrant } from '../model/identityGrant'; +// @ts-ignore +import { User } from '../model/user'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class INSEAccountServiceService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Create User + * @endpoint post /inse-account/create + * @param bodyCreateUser + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createUser( + bodyCreateUser: BodyCreateUser, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createUser( + bodyCreateUser: BodyCreateUser, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createUser( + bodyCreateUser: BodyCreateUser, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createUser( + bodyCreateUser: BodyCreateUser, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyCreateUser === null || bodyCreateUser === undefined) { + throw new Error( + 'Required parameter bodyCreateUser was null or undefined when calling createUser.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/inse-account/create`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: bodyCreateUser, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Get Access Grant + * @endpoint post /inse-account/auth/access + * @param secret + * @param account + * @param organization + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAccessGrant( + secret: string, + account: number, + organization: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAccessGrant( + secret: string, + account: number, + organization: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessGrant( + secret: string, + account: number, + organization: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessGrant( + secret: string, + account: number, + organization: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (secret === null || secret === undefined) { + throw new Error( + 'Required parameter secret was null or undefined when calling getAccessGrant.', + ); + } + if (account === null || account === undefined) { + throw new Error( + 'Required parameter account was null or undefined when calling getAccessGrant.', + ); + } + if (organization === null || organization === undefined) { + throw new Error( + 'Required parameter organization was null or undefined when calling getAccessGrant.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/x-www-form-urlencoded']; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({ encoder: this.encoder }); + } + + if (secret !== undefined) { + localVarFormParams = + (localVarFormParams.append('secret', secret) as any) || + localVarFormParams; + } + if (account !== undefined) { + localVarFormParams = + (localVarFormParams.append('account', account) as any) || + localVarFormParams; + } + if (organization !== undefined) { + localVarFormParams = + (localVarFormParams.append('organization', organization) as any) || + localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/inse-account/auth/access`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString + ? localVarFormParams.toString() + : localVarFormParams, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Identity Grant + * @endpoint post /inse-account/auth/id + * @param username + * @param password + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getIdentityGrant( + username: string, + password: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getIdentityGrant( + username: string, + password: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getIdentityGrant( + username: string, + password: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getIdentityGrant( + username: string, + password: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (username === null || username === undefined) { + throw new Error( + 'Required parameter username was null or undefined when calling getIdentityGrant.', + ); + } + if (password === null || password === undefined) { + throw new Error( + 'Required parameter password was null or undefined when calling getIdentityGrant.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/x-www-form-urlencoded']; + + const canConsumeForm = this.canConsumeForm(consumes); + + let localVarFormParams: { append(param: string, value: any): any }; + let localVarUseForm = false; + let localVarConvertFormParamsToString = false; + if (localVarUseForm) { + localVarFormParams = new FormData(); + } else { + localVarFormParams = new HttpParams({ encoder: this.encoder }); + } + + if (username !== undefined) { + localVarFormParams = + (localVarFormParams.append('username', username) as any) || + localVarFormParams; + } + if (password !== undefined) { + localVarFormParams = + (localVarFormParams.append('password', password) as any) || + localVarFormParams; + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/inse-account/auth/id`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: localVarConvertFormParamsToString + ? localVarFormParams.toString() + : localVarFormParams, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/iNSEService.service.ts b/webapp/src/app/api/api/iNSEService.service.ts new file mode 100644 index 00000000..8788adee --- /dev/null +++ b/webapp/src/app/api/api/iNSEService.service.ts @@ -0,0 +1,953 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { Item } from '../model/item'; +// @ts-ignore +import { ItemCreate } from '../model/itemCreate'; +// @ts-ignore +import { ItemPage } from '../model/itemPage'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class INSEServiceService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Adds a new item. + * @endpoint post /api/inse-service/items + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addItem( + itemCreate: ItemCreate, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public addItem( + itemCreate: ItemCreate, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public addItem( + itemCreate: ItemCreate, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public addItem( + itemCreate: ItemCreate, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (itemCreate === null || itemCreate === undefined) { + throw new Error( + 'Required parameter itemCreate was null or undefined when calling addItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * 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. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + saveJson, + 'save_json', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy( + topic: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public countTopicHierarchy( + topic: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling countTopicHierarchy.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', + ); + }); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Deletes the item with the id. + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteItem( + id: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteItem( + id: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteItem( + id: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteItem( + id: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling deleteItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the item with the id. + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItem( + id: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getItem( + id: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItem( + id: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItem( + id: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Returns a page of items. + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItems( + pageOffset?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'pageOffset', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicHierarchy( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Updates the item with the id. + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling updateItem.', + ); + } + if (itemCreate === null || itemCreate === undefined) { + throw new Error( + 'Required parameter itemCreate was null or undefined when calling updateItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } +} diff --git a/webapp/src/app/api/api/inse-account-service.service.ts b/webapp/src/app/api/api/inse-account-service.service.ts deleted file mode 100644 index ef79eace..00000000 --- a/webapp/src/app/api/api/inse-account-service.service.ts +++ /dev/null @@ -1,216 +0,0 @@ -/** - * 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. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { AccessGrant } from '../model/access-grant'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -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 implements INSEAccountServiceServiceInterface { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * Get Access Grant - * @endpoint post /inse-account/auth/access - * @param secret - * @param account - * @param organization - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessGrantInseAccountAuthAccessPost(secret: string, account: number, organization: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (secret === null || secret === undefined) { - throw new Error('Required parameter secret was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); - } - if (account === null || account === undefined) { - throw new Error('Required parameter account was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); - } - if (organization === null || organization === undefined) { - throw new Error('Required parameter organization was null or undefined when calling getAccessGrantInseAccountAuthAccessPost.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - const canConsumeForm = this.canConsumeForm(consumes); - - let localVarFormParams: { append(param: string, value: any): any; }; - let localVarUseForm = false; - let localVarConvertFormParamsToString = false; - if (localVarUseForm) { - localVarFormParams = new FormData(); - } else { - localVarFormParams = new HttpParams({encoder: this.encoder}); - } - - if (secret !== undefined) { - localVarFormParams = localVarFormParams.append('secret', secret) as any || localVarFormParams; - } - if (account !== undefined) { - localVarFormParams = localVarFormParams.append('account', account) as any || localVarFormParams; - } - if (organization !== undefined) { - localVarFormParams = localVarFormParams.append('organization', organization) as any || localVarFormParams; - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/inse-account/auth/access`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get Identity Grant - * @endpoint post /inse-account/auth/id - * @param username - * @param password - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getIdentityGrantInseAccountAuthIdPost(username: string, password: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (username === null || username === undefined) { - throw new Error('Required parameter username was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.'); - } - if (password === null || password === undefined) { - throw new Error('Required parameter password was null or undefined when calling getIdentityGrantInseAccountAuthIdPost.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/x-www-form-urlencoded' - ]; - - const canConsumeForm = this.canConsumeForm(consumes); - - let localVarFormParams: { append(param: string, value: any): any; }; - let localVarUseForm = false; - let localVarConvertFormParamsToString = false; - if (localVarUseForm) { - localVarFormParams = new FormData(); - } else { - localVarFormParams = new HttpParams({encoder: this.encoder}); - } - - if (username !== undefined) { - localVarFormParams = localVarFormParams.append('username', username) as any || localVarFormParams; - } - if (password !== undefined) { - localVarFormParams = localVarFormParams.append('password', password) as any || localVarFormParams; - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/inse-account/auth/id`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: localVarConvertFormParamsToString ? localVarFormParams.toString() : localVarFormParams, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts b/webapp/src/app/api/api/inse-account-service.serviceInterface.ts deleted file mode 100644 index 2cb6b360..00000000 --- a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * 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/inse-service.service.ts b/webapp/src/app/api/api/inse-service.service.ts deleted file mode 100644 index 80543705..00000000 --- a/webapp/src/app/api/api/inse-service.service.ts +++ /dev/null @@ -1,816 +0,0 @@ -/** - * 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. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { AuthorsListResponse } from '../model/authors-list-response'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -import { Item } from '../model/item'; -// @ts-ignore -import { ItemCreate } from '../model/item-create'; -// @ts-ignore -import { ItemPage } from '../model/item-page'; -// @ts-ignore -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 implements INSEServiceServiceInterface { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * Adds a new item. - * @endpoint post /api/inse-service/items - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public addItem(itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public addItem(itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public addItem(itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public addItem(itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (itemCreate === null || itemCreate === undefined) { - throw new Error('Required parameter itemCreate was null or undefined when calling addItem.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * 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. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - saveJson, 'save_json'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Deletes the item with the id. - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deleteItem.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Returns the item with the id. - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getItem.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Returns a page of items. - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItems(pageOffset?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getItems(pageOffset?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItems(pageOffset?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItems(pageOffset?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'pageOffset'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID(id: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID(id: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling getPersonByID.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institution_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Updates the item with the id. - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateItem(id: number, itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling updateItem.'); - } - if (itemCreate === null || itemCreate === undefined) { - throw new Error('Required parameter itemCreate was null or undefined when calling updateItem.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/api/api/inse-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts deleted file mode 100644 index 1326e650..00000000 --- a/webapp/src/app/api/api/inse-service.serviceInterface.ts +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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; - - /** - * Counts topic hierarchy occurrences from cache. - * - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - */ - countTopicHierarchy(topic: Array, extraHttpRequestParams?: any): Observable; - - /** - * Deletes the item with the id. - * - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - */ - deleteItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Generates a bio for a person by author ID. - * - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - */ - generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable; - - /** - * Returns the item with the id. - * - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - */ - getItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns a page of items. - * - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - */ - getItems(pageOffset?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; - - /** - * Searches for person by ID. - * - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for persons by ID or name. - * - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - */ - searchPersons(authorId?: string, query?: string, include?: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for persons by institution name. - * - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsByInstitution(institutionName: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsByName(authorName: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Updates the item with the id. - * - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - */ - updateItem(id: number, itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/institutions.service.ts b/webapp/src/app/api/api/institutions.service.ts new file mode 100644 index 00000000..8b27a539 --- /dev/null +++ b/webapp/src/app/api/api/institutions.service.ts @@ -0,0 +1,762 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { AutocompleteResponse } from '../model/autocompleteResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { Institution } from '../model/institution'; +// @ts-ignore +import { InstitutionPage } from '../model/institutionPage'; +// @ts-ignore +import { InstitutionsListResponse } from '../model/institutionsListResponse'; +// @ts-ignore +import { RankingResponse } from '../model/rankingResponse'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class InstitutionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Returns institution options for autocomplete inputs. + * @endpoint get /api/inse-service/institutions/autocomplete + * @param query Institution search text, for example \'Duisburg Essen\'. + * @param countryCode Optional ISO country code filter. + * @param type Optional institution type filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteInstitutions( + query: string, + countryCode?: string, + type?: string, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling autocompleteInstitutions.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + countryCode, + 'countryCode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + type, + 'type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a single institution by ID. + * Returns a single institution by its OpenAlex ID. + * @endpoint get /api/inse-service/institutions/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionById( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionById( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionById( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionById( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getInstitutionById.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns data for the University Ranking Dashboard. + * @endpoint get /api/inse-service/university-rankings + * @param topic Research topic (e.g., \'Artificial Intelligence\') + * @param metric Metric to rank by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getRankingsApiInseServiceUniversityRankingsGet( + topic: + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology', + metric?: 'publications' | 'citations', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology', + metric?: 'publications' | 'citations', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology', + metric?: 'publications' | 'citations', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology', + metric?: 'publications' | 'citations', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + metric, + 'metric', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a list of OpenAlex institutions. + * @endpoint get /api/inse-service/institutions + * @param search Full-text search, for example \'Duisburg Essen\'. + * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'country_code\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listInstitutions( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filter, + 'filter', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + groupBy, + 'group_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + perPage, + 'per_page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + cursor, + 'cursor', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sample, + 'sample', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + select, + 'select', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for institutions by name. + * Searches for institutions by name with pagination. + * @endpoint get /api/inse-service/institutions/search + * @param name Institution name to search for, for example \'University of Duisburg Essen\'. + * @param page Page number (0-indexed). + * @param size Number of institutions per page. + * @param sortBy Field to sort by, either \'relevance\', \'name\', \'works_count\', or \'citations_count\'. + * @param sortingDirection Sorting direction, either \'asc\' or \'desc\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchInstitutionsByName( + name?: string, + page?: number, + size?: number, + sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', + sortingDirection?: 'asc' | 'desc', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + name, + 'name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortingDirection, + 'sorting_direction', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/items.service.ts b/webapp/src/app/api/api/items.service.ts index 1d00c8c8..bc3c2293 100644 --- a/webapp/src/app/api/api/items.service.ts +++ b/webapp/src/app/api/api/items.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,358 +9,626 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore import { Item } from '../model/item'; // @ts-ignore -import { ItemCreate } from '../model/item-create'; +import { ItemCreate } from '../model/itemCreate'; // @ts-ignore -import { ItemPage } from '../model/item-page'; +import { ItemPage } from '../model/itemPage'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { - ItemsServiceInterface -} from './items.serviceInterface'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class ItemsService extends BaseService implements ItemsServiceInterface { +export class ItemsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Adds a new item. + * @endpoint post /api/inse-service/items + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addItem( + itemCreate: ItemCreate, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public addItem( + itemCreate: ItemCreate, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public addItem( + itemCreate: ItemCreate, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public addItem( + itemCreate: ItemCreate, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (itemCreate === null || itemCreate === undefined) { + throw new Error( + 'Required parameter itemCreate was null or undefined when calling addItem.', + ); } - /** - * Adds a new item. - * @endpoint post /api/inse-service/items - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public addItem(itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public addItem(itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public addItem(itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public addItem(itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (itemCreate === null || itemCreate === undefined) { - throw new Error('Required parameter itemCreate was null or undefined when calling addItem.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Deletes the item with the id. - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling deleteItem.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } - /** - * Returns the item with the id. - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItem(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getItem.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a page of items. - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getItems(pageOffset?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getItems(pageOffset?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItems(pageOffset?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getItems(pageOffset?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'pageOffset'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Deletes the item with the id. + * @endpoint delete /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteItem( + id: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteItem( + id: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteItem( + id: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteItem( + id: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling deleteItem.', + ); } - /** - * Updates the item with the id. - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateItem(id: number, itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateItem(id: number, itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling updateItem.'); - } - if (itemCreate === null || itemCreate === undefined) { - throw new Error('Required parameter itemCreate was null or undefined when calling updateItem.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: itemCreate, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the item with the id. + * @endpoint get /api/inse-service/items/{id} + * @param id The item id. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItem( + id: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getItem( + id: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItem( + id: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItem( + id: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Returns a page of items. + * @endpoint get /api/inse-service/items + * @param pageOffset The page offset. + * @param pageSize The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItems( + pageOffset?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getItems( + pageOffset?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'pageOffset', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Updates the item with the id. + * @endpoint put /api/inse-service/items/{id} + * @param id The item id. + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateItem( + id: number, + itemCreate: ItemCreate, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling updateItem.', + ); + } + if (itemCreate === null || itemCreate === undefined) { + throw new Error( + 'Required parameter itemCreate was null or undefined when calling updateItem.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/items/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'number', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } } diff --git a/webapp/src/app/api/api/items.serviceInterface.ts b/webapp/src/app/api/api/items.serviceInterface.ts deleted file mode 100644 index 140cbec0..00000000 --- a/webapp/src/app/api/api/items.serviceInterface.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * 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 { HTTPValidationError } from '../model/models'; -import { Item } from '../model/models'; -import { ItemCreate } from '../model/models'; -import { ItemPage } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface ItemsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Adds a new item. - * - * @endpoint post /api/inse-service/items - * @param itemCreate - */ - addItem(itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; - - /** - * Deletes the item with the id. - * - * @endpoint delete /api/inse-service/items/{id} - * @param id The item id. - */ - deleteItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns the item with the id. - * - * @endpoint get /api/inse-service/items/{id} - * @param id The item id. - */ - getItem(id: number, extraHttpRequestParams?: any): Observable; - - /** - * Returns a page of items. - * - * @endpoint get /api/inse-service/items - * @param pageOffset The page offset. - * @param pageSize The page size. - */ - getItems(pageOffset?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; - - /** - * Updates the item with the id. - * - * @endpoint put /api/inse-service/items/{id} - * @param id The item id. - * @param itemCreate - */ - updateItem(id: number, itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/news.service.ts b/webapp/src/app/api/api/news.service.ts new file mode 100644 index 00000000..de08c0d1 --- /dev/null +++ b/webapp/src/app/api/api/news.service.ts @@ -0,0 +1,1060 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { NewsArticleDetail } from '../model/newsArticleDetail'; +// @ts-ignore +import { NewsPage } from '../model/newsPage'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class NewsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor_1.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById_2( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById_2( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById_2.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews( + query: string, + page?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews( + query: string, + page?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews_4.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts new file mode 100644 index 00000000..d8715dc1 --- /dev/null +++ b/webapp/src/app/api/api/patents.service.ts @@ -0,0 +1,148 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class PatentsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/person-network.service.ts b/webapp/src/app/api/api/person-network.service.ts deleted file mode 100644 index 135a20d8..00000000 --- a/webapp/src/app/api/api/person-network.service.ts +++ /dev/null @@ -1,112 +0,0 @@ -/** - * 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. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { CollaborationNetwork } from '../model/collaboration-network'; -// @ts-ignore -import { FilterProperties } from '../model/filter-properties'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; -import { - PersonNetworkServiceInterface -} from './person-network.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class PersonNetworkService extends BaseService implements PersonNetworkServiceInterface { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/api/api/person-network.serviceInterface.ts b/webapp/src/app/api/api/person-network.serviceInterface.ts deleted file mode 100644 index 58e7a1fb..00000000 --- a/webapp/src/app/api/api/person-network.serviceInterface.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * 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 { CollaborationNetwork } from '../model/models'; -import { FilterProperties } from '../model/models'; -import { HTTPValidationError } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface PersonNetworkServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - */ - getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/personNetwork.service.ts new file mode 100644 index 00000000..5b468938 --- /dev/null +++ b/webapp/src/app/api/api/personNetwork.service.ts @@ -0,0 +1,168 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { CollaborationNetwork } from '../model/collaborationNetwork'; +// @ts-ignore +import { FilterProperties } from '../model/filterProperties'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class PersonNetworkService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawUserId === null || rawUserId === undefined) { + throw new Error( + 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: filterProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/persons-search.service.ts b/webapp/src/app/api/api/persons-search.service.ts deleted file mode 100644 index 27a75280..00000000 --- a/webapp/src/app/api/api/persons-search.service.ts +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; -import { - PersonsSearchServiceInterface -} from './persons-search.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class PersonsSearchService extends BaseService implements PersonsSearchServiceInterface { - - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institutionName'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - strict, 'strict'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/api/api/persons-search.serviceInterface.ts b/webapp/src/app/api/api/persons-search.serviceInterface.ts deleted file mode 100644 index 57bd6eee..00000000 --- a/webapp/src/app/api/api/persons-search.serviceInterface.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 { CustomAuthorsListResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface PersonsSearchServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict search parameter - */ - searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index 42f22d04..cef36fc4 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -9,459 +9,1762 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { AuthorsListResponse } from '../model/authors-list-response'; -// @ts-ignore -import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; -// @ts-ignore -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 { Inject, Injectable, Optional } from '@angular/core'; import { - PersonsServiceInterface -} from './persons.serviceInterface'; + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; +// @ts-ignore +import { AuthorsListResponse } from '../model/authorsListResponse'; +// @ts-ignore +import { CustomAuthorsListResponse } from '../model/customAuthorsListResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { PersonBio } from '../model/personBio'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class PersonsService extends BaseService implements PersonsServiceInterface { +export class PersonsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Generates a bio for a person by author ID. + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling generatePersonBio.', + ); } - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/inse-service/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID.', + ); + } - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID_1( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID_1.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error( + 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByInstitution.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institution_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error( + 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByInstitution_3.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institution_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName_4.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName_4.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institutionName', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + strict, + 'strict', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID(id: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID(id: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling getPersonByID.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institutionName', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + strict, + 'strict', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institution_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institutionName'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.'); - } - - let localVarHeaders = this.defaultHeaders; - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - let localVarPath = `/api/inse-service/authors/${encodeURIComponent(authorId)}/funders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: 'json', - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/persons.serviceInterface.ts b/webapp/src/app/api/api/persons.serviceInterface.ts deleted file mode 100644 index e7235d9c..00000000 --- a/webapp/src/app/api/api/persons.serviceInterface.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * 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 { CustomAuthorsListResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { PersonBio } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface PersonsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Generates a bio for a person by author ID. - * - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - */ - generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for person by ID. - * - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for persons by ID or name. - * - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - */ - searchPersons(authorId?: string, query?: string, include?: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for persons by institution name. - * - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsByInstitution(institutionName: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for person by name. - * - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - */ - searchPersonsByName(authorName: string, include: string, extraHttpRequestParams?: any): Observable; - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - */ - searchPersonsList(query?: string, institutionName?: string, topic?: Array, page?: number, pageSize?: number, include?: string, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts new file mode 100644 index 00000000..35cdba8a --- /dev/null +++ b/webapp/src/app/api/api/projects.service.ts @@ -0,0 +1,1155 @@ +/** + * 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. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { BundProjectDetails } from '../model/bundProjectDetails'; +// @ts-ignore +import { BundProjectPage } from '../model/bundProjectPage'; +// @ts-ignore +import { CordisEuProjectPage } from '../model/cordisEuProjectPage'; +// @ts-ignore +import { DfgProjectDetails } from '../model/dfgProjectDetails'; +// @ts-ignore +import { DfgProjectPage } from '../model/dfgProjectPage'; +// @ts-ignore +import { EuOrganizationProjectSummaryPage } from '../model/euOrganizationProjectSummaryPage'; +// @ts-ignore +import { FundingProjectPage } from '../model/fundingProjectPage'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { InstitutionFunderSummary } from '../model/institutionFunderSummary'; +// @ts-ignore +import { ProjectType } from '../model/projectType'; +// @ts-ignore +import { ProjectsFilteringProperties } from '../model/projectsFilteringProperties'; +// @ts-ignore +import { ProjectsSortBy } from '../model/projectsSortBy'; +// @ts-ignore +import { SortDirection } from '../model/sortDirection'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class ProjectsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get DFG projects. + * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/person/dfg/search + * @param authorId The author ID to filter by. + * @param topic The topic to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getDfgProjects.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/person/dfg/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get EU projects for an author. + * Returns a list of EU projects associated with the specified author ID. + * @endpoint get /api/projects/author/{raw_oa_author_id}/eu + * @param rawOaAuthorId The author ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getEuProjectsForAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funding over time for bund projects. + * Returns the funding over time for bund projects associated with the specified institution. + * @endpoint get /api/projects/institution/bund/funding-over-time + * @param rawOaInstitutionId The institution ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionBundProjectsFundingOverTime.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaInstitutionId, + 'raw_oa_institution_id', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/bund/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funding over time for EU projects. + * Returns the funding over time for EU projects associated with the specified institution. + * @endpoint get /api/projects/institution/eu/funding-over-time + * @param rawOaInstitutionId The institution ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionCordisEuProjectsFundingOverTime.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaInstitutionId, + 'raw_oa_institution_id', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/eu/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get a single BUND project. + * Returns a single BUND project based on its ID. + * @endpoint get /api/projects/bund/{id} + * @param id The ID of the BUND project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleBundProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleBundProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleBundProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleBundProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleBundProject.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/bund/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get a single DFG project. + * Returns a single DFG project based on its ID. + * @endpoint get /api/projects/dfg/{id} + * @param id The ID of the DFG project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleDfgProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleDfgProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleDfgProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleDfgProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleDfgProject.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/dfg/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get bund projects. + * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/bund/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + projectsFilteringProperties === null || + projectsFilteringProperties === undefined + ) { + throw new Error( + 'Required parameter projectsFilteringProperties was null or undefined when calling searchBundProjects.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/bund/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get EU projects. + * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/eu/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + projectsFilteringProperties === null || + projectsFilteringProperties === undefined + ) { + throw new Error( + 'Required parameter projectsFilteringProperties was null or undefined when calling searchCordisEuProjects.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/eu/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Search projects across all funders. + * Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/search + * @param page The page number. + * @param size The page size. + * @param selectedProjectTypes The set of project types to filter by (e.g., \'bund\', \'eu\', \'dfg\'). If not provided, projects of all types will be included. + * @param title The title to filter by. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (selectedProjectTypes) { + selectedProjectTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'selected_project_types', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index 193a1b1f..2b90f737 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,157 +9,824 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { BaseService } from '../api.base.service'; +import { Inject, Injectable, Optional } from '@angular/core'; import { - TopicsServiceInterface -} from './topics.serviceInterface'; + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; +// @ts-ignore +import { AutocompleteResponse } from '../model/autocompleteResponse'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { TopicsListResponse } from '../model/topicsListResponse'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class TopicsService extends BaseService implements TopicsServiceInterface { +export class TopicsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns topic options for autocomplete inputs. + * @endpoint get /api/topics/autocomplete + * @param query Topic search text, for example \'machine learning\'. + * @param domainId Optional OpenAlex domain id filter. + * @param fieldId Optional OpenAlex field id filter. + * @param subfieldId Optional OpenAlex subfield id filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopics( + query: string, + domainId?: string, + fieldId?: string, + subfieldId?: string, + limit?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling autocompleteTopics.', + ); } - /** - * 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. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + domainId, + 'domainId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fieldId, + 'fieldId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + subfieldId, + 'subfieldId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - saveJson, 'save_json'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/topics/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * 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. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public buildTopicCache( + pageSize?: number, + saveJson?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + saveJson, + 'save_json', + ); - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy( + topic: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public countTopicHierarchy( + topic: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public countTopicHierarchy( + topic: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling countTopicHierarchy.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); } - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicHierarchy( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicHierarchy( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a list of OpenAlex topics. + * @endpoint get /api/topics + * @param search Full-text search, for example \'machine learning\'. + * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'domain.id\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listTopics( + search?: string, + filter?: string, + sort?: string, + groupBy?: string, + perPage?: number, + page?: number, + cursor?: string, + sample?: number, + select?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filter, + 'filter', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + groupBy, + 'group_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + perPage, + 'per_page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + cursor, + 'cursor', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sample, + 'sample', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + select, + 'select', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Semantic / vector search for topics using a keyword/sentence. + * @endpoint get /api/topics/vector-search + * @param query Word or sentence to search by similarity. + * @param limit Maximum number of topics to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public vectorSearchTopics( + query: string, + limit?: number, + searchType?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling vectorSearchTopics.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + if (searchType !== undefined && searchType !== null) { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'searchType', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/topics.serviceInterface.ts b/webapp/src/app/api/api/topics.serviceInterface.ts deleted file mode 100644 index 6a60f441..00000000 --- a/webapp/src/app/api/api/topics.serviceInterface.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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 { HTTPValidationError } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface TopicsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * 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; - - /** - * Counts topic hierarchy occurrences from cache. - * - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - */ - countTopicHierarchy(topic: Array, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 2a156323..20d855a3 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,248 +11,716 @@ import { Inject, Injectable, Optional } from '@angular/core'; import { - HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { TopicCount } from '../model/topicCount'; // @ts-ignore import { TopicsByTime } from '../model/topicsByTime'; // @ts-ignore +import { Work } from '../model/work'; +// @ts-ignore import { WorkPage } from '../model/workPage'; // @ts-ignore -import { WorksListResponse } from '../model/works-list-response'; +import { WorksListResponse } from '../model/worksListResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { - WorksServiceInterface -} from './works.serviceInterface'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) -export class WorksService extends BaseService implements WorksServiceInterface { +export class WorksService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns all works for an author. + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllAuthorWorks( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllAuthorWorks( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAllAuthorWorks.', + ); } - /** - * Returns all works for an author. - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; - public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/all`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Returns a page of works for an author. + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + * @param institutionId Filter by OpenAlex institution id. Can be repeated. + * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAuthorWorks.', + ); + } - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/all`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_year', ); + }); } - - /** - * Returns a page of works for an author. - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); - }) - } - if (type) { - type.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'type'); - }) - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); - }) - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (type) { + type.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'type', ); + }); } - - /** - * Returns topics grouped by publication year for an author. - * @endpoint get /api/works/{author_id}/topics-by-time - * @param authorId The author id, for example A5023888391. - * @param maxTopicsPerYear The maximum number of topics per year. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - maxTopicsPerYear, 'max_topics_per_year'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (bearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/topics-by-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language', ); + }); + } + if (institutionId) { + institutionId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_id', + ); + }); + } + if (topicId) { + topicId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_id', + ); + }); } + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns work counts per primary topic for an author. + * @endpoint get /api/works/{author_id}/primary-topic-counts + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-topic-counts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param targetPublications Target number of publications used for the timeline. Complete years are always included. + * @param includeAll If true, all publications are used for the timeline. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + maxTopicsPerYear, + 'max_topics_per_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + targetPublications, + 'target_publications', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + includeAll, + 'include_all', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns one publication. + * @endpoint get /api/works/detail/{work_id} + * @param workId The OpenAlex work id, for example W2741809807. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWork( + workId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWork( + workId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + workId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + workId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (workId === null || workId === undefined) { + throw new Error( + 'Required parameter workId was null or undefined when calling getWork.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'bearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'workId', value: workId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } } diff --git a/webapp/src/app/api/api/works.serviceInterface.ts b/webapp/src/app/api/api/works.serviceInterface.ts deleted file mode 100644 index 887bb9c3..00000000 --- a/webapp/src/app/api/api/works.serviceInterface.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * 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 { HTTPValidationError } from '../model/models'; -import { WorkPage } from '../model/models'; -import { WorksListResponse } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface WorksServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Returns all works for an author. - * - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - */ - getAllAuthorWorks(authorId: string, extraHttpRequestParams?: any): Observable; - - /** - * Returns a page of works for an author. - * - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - */ - getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, extraHttpRequestParams?: any): Observable; - -} diff --git a/webapp/src/app/api/configuration.ts b/webapp/src/app/api/configuration.ts index c39ce2d6..664630b3 100644 --- a/webapp/src/app/api/configuration.ts +++ b/webapp/src/app/api/configuration.ts @@ -1,193 +1,219 @@ -import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, + HttpParameterCodec, +} from '@angular/common/http'; import { Param } from './param'; export interface ConfigurationParameters { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: {[ key: string ]: string}; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Override the default method for encoding path parameters in various - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam?: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials?: {[ key: string ]: string | (() => string | undefined)}; + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: { [key: string]: string }; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: { [key: string]: string | (() => string | undefined) }; } export class Configuration { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: {[ key: string ]: string}; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Encoding of various path parameter - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials: {[ key: string ]: string | (() => string | undefined)}; + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: { [key: string]: string }; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: { [key: string]: string | (() => string | undefined) }; -constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { - if (apiKeys) { - this.apiKeys = apiKeys; - } - if (username !== undefined) { - this.username = username; - } - if (password !== undefined) { - this.password = password; - } - if (accessToken !== undefined) { - this.accessToken = accessToken; - } - if (basePath !== undefined) { - this.basePath = basePath; - } - if (withCredentials !== undefined) { - this.withCredentials = withCredentials; - } - if (encoder) { - this.encoder = encoder; - } - this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); - this.credentials = credentials ?? {}; + constructor({ + accessToken, + apiKeys, + basePath, + credentials, + encodeParam, + encoder, + password, + username, + withCredentials, + }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = + encodeParam ?? ((param) => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; - // init default bearer credential - if (!this.credentials['bearer']) { - this.credentials['bearer'] = () => { - return typeof this.accessToken === 'function' - ? this.accessToken() - : this.accessToken; - }; - } + // init default bearer credential + if (!this.credentials['bearer']) { + this.credentials['bearer'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType(contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; } - /** - * Select the correct content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param contentTypes - the array of content types that are available for selection - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderContentType (contentTypes: string[]): string | undefined { - if (contentTypes.length === 0) { - return undefined; - } + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } - const type = contentTypes.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return contentTypes[0]; - } - return type; + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; } - /** - * Select the correct accept content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param accepts - the array of content types that are available for selection. - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderAccept(accepts: string[]): string | undefined { - if (accepts.length === 0) { - return undefined; - } - - const type = accepts.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return accepts[0]; - } - return type; + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; } + return type; + } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp( + '^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', + 'i', + ); + return ( + mime !== null && + (jsonMime.test(mime) || + mime.toLowerCase() === 'application/json-patch+json') + ); + } - public lookupCredential(key: string): string | undefined { - const value = this.credentials[key]; - return typeof value === 'function' - ? value() - : value; - } + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' ? value() : value; + } - public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { - const value = this.lookupCredential(credentialKey); - return value - ? headers.set(headerName, (prefix ?? '') + value) - : headers; - } + public addCredentialToHeaders( + credentialKey: string, + headerName: string, + headers: HttpHeaders, + prefix?: string, + ): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value ? headers.set(headerName, (prefix ?? '') + value) : headers; + } - public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { - const value = this.lookupCredential(credentialKey); - return value - ? query.set(paramName, value) - : query; - } + public addCredentialToQuery( + credentialKey: string, + paramName: string, + query: HttpParams, + ): HttpParams { + const value = this.lookupCredential(credentialKey); + return value ? query.set(paramName, value) : query; + } - private defaultEncodeParam(param: Param): string { - // This implementation exists as fallback for missing configuration - // and for backwards compatibility to older typescript-angular generator versions. - // It only works for the 'simple' parameter style. - // Date-handling only works for the 'date-time' format. - // All other styles and Date-formats are probably handled incorrectly. - // - // But: if that's all you need (i.e.: the most common use-case): no need for customization! + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! - const value = param.dataFormat === 'date-time' && param.value instanceof Date - ? (param.value as Date).toISOString() - : param.value; + const value = + param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; - return encodeURIComponent(String(value)); - } + return encodeURIComponent(String(value)); + } } diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts index 138c4d5c..889ef00d 100644 --- a/webapp/src/app/api/encoder.ts +++ b/webapp/src/app/api/encoder.ts @@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http'; * Workaround for https://github.com/angular/angular/issues/18261 */ export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } } diff --git a/webapp/src/app/api/model/accessGrant.ts b/webapp/src/app/api/model/accessGrant.ts new file mode 100644 index 00000000..0aa29f6f --- /dev/null +++ b/webapp/src/app/api/model/accessGrant.ts @@ -0,0 +1,18 @@ +/** + * 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 { AuthScope } from './authScope'; + +export interface AccessGrant { + token_type: string; + access_token: string; + expires_in: number; + scope: AuthScope; + refresh_token: string; +} diff --git a/webapp/src/app/api/model/authAccount.ts b/webapp/src/app/api/model/authAccount.ts new file mode 100644 index 00000000..7a672b04 --- /dev/null +++ b/webapp/src/app/api/model/authAccount.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +export interface AuthAccount { + i: number; + l: string; + o: number; + e: string; + on: string; +} diff --git a/webapp/src/app/api/model/authScope.ts b/webapp/src/app/api/model/authScope.ts new file mode 100644 index 00000000..3ccd752e --- /dev/null +++ b/webapp/src/app/api/model/authScope.ts @@ -0,0 +1,17 @@ +/** + * 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 { AuthAccount } from './authAccount'; + +export interface AuthScope { + t: string; + a: AuthAccount; + d?: number | null; + r?: Array; +} diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index 8d91fe5d..0a050590 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -1,41 +1,39 @@ /** * 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 { AuthorAffiliationsInner } from './author-affiliations-inner'; -import { AuthorParsedLongestName } from './author-parsed-longest-name'; -import { DehydratedInstitution } from './dehydrated-institution'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorIds } from './author-ids'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { WorkTopic } from './work-topic'; - +import { AuthorAffiliationsInner } from './authorAffiliationsInner'; +import { AuthorParsedLongestName } from './authorParsedLongestName'; +import { DehydratedInstitution } from './dehydratedInstitution'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorIds } from './authorIds'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { WorkTopic } from './workTopic'; /** * A person who creates scholarly works */ -export interface Author { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Author { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/author-affiliations-inner.ts b/webapp/src/app/api/model/authorAffiliationsInner.ts similarity index 55% rename from webapp/src/app/api/model/author-affiliations-inner.ts rename to webapp/src/app/api/model/authorAffiliationsInner.ts index 7d3ee92b..d1e8f764 100644 --- a/webapp/src/app/api/model/author-affiliations-inner.ts +++ b/webapp/src/app/api/model/authorAffiliationsInner.ts @@ -1,20 +1,18 @@ /** * 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 { DehydratedInstitution } from './dehydrated-institution'; - +import { DehydratedInstitution } from './dehydratedInstitution'; /** * AuthorAffiliationsInner */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; +export interface AuthorAffiliationsInner { + institution?: DehydratedInstitution | null; + years?: Array | null; } - diff --git a/webapp/src/app/api/model/author-counts-by-year-inner.ts b/webapp/src/app/api/model/authorCountsByYearInner.ts similarity index 62% rename from webapp/src/app/api/model/author-counts-by-year-inner.ts rename to webapp/src/app/api/model/authorCountsByYearInner.ts index d16c7c21..1fac5b45 100644 --- a/webapp/src/app/api/model/author-counts-by-year-inner.ts +++ b/webapp/src/app/api/model/authorCountsByYearInner.ts @@ -1,20 +1,18 @@ /** * 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. */ - /** * AuthorCountsByYearInner */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; +export interface AuthorCountsByYearInner { + year?: number | null; + works_count?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/author-ids.ts b/webapp/src/app/api/model/authorIds.ts similarity index 66% rename from webapp/src/app/api/model/author-ids.ts rename to webapp/src/app/api/model/authorIds.ts index 9235a207..0b079d33 100644 --- a/webapp/src/app/api/model/author-ids.ts +++ b/webapp/src/app/api/model/authorIds.ts @@ -1,20 +1,18 @@ /** * 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. */ - /** * External identifiers: */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; +export interface AuthorIds { + openalex?: string | null; + orcid?: string | null; + scopus?: string | null; } - diff --git a/webapp/src/app/api/model/authorNetworkNode.ts b/webapp/src/app/api/model/authorNetworkNode.ts new file mode 100644 index 00000000..f67c7148 --- /dev/null +++ b/webapp/src/app/api/model/authorNetworkNode.ts @@ -0,0 +1,26 @@ +/** + * 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 { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; + +export interface AuthorNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; +} +export namespace AuthorNetworkNode {} diff --git a/webapp/src/app/api/model/author-parsed-longest-name.ts b/webapp/src/app/api/model/authorParsedLongestName.ts similarity index 59% rename from webapp/src/app/api/model/author-parsed-longest-name.ts rename to webapp/src/app/api/model/authorParsedLongestName.ts index f49e04be..f08df27d 100644 --- a/webapp/src/app/api/model/author-parsed-longest-name.ts +++ b/webapp/src/app/api/model/authorParsedLongestName.ts @@ -1,22 +1,20 @@ /** * 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. */ - /** * The longest name parsed into its component parts. */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; +export interface AuthorParsedLongestName { + first?: string | null; + middle?: string | null; + last?: string | null; + suffix?: string | null; + nickname?: string | null; } - diff --git a/webapp/src/app/api/model/authorPositionCount.ts b/webapp/src/app/api/model/authorPositionCount.ts new file mode 100644 index 00000000..989d2c18 --- /dev/null +++ b/webapp/src/app/api/model/authorPositionCount.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; +} diff --git a/webapp/src/app/api/model/author-summary-stats.ts b/webapp/src/app/api/model/authorSummaryStats.ts similarity index 51% rename from webapp/src/app/api/model/author-summary-stats.ts rename to webapp/src/app/api/model/authorSummaryStats.ts index 9bdb23e8..63c35c31 100644 --- a/webapp/src/app/api/model/author-summary-stats.ts +++ b/webapp/src/app/api/model/authorSummaryStats.ts @@ -1,21 +1,19 @@ /** * 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 { Model2YrMeanCitedness } from './model2-yr-mean-citedness'; - +import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; /** * Citation metrics: */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; +export interface AuthorSummaryStats { + '2yr_mean_citedness'?: Model2YrMeanCitedness | null; + h_index?: number | null; + i10_index?: number | null; } - diff --git a/webapp/src/app/api/model/authorsFilterProperties.ts b/webapp/src/app/api/model/authorsFilterProperties.ts new file mode 100644 index 00000000..50795f2a --- /dev/null +++ b/webapp/src/app/api/model/authorsFilterProperties.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +export interface AuthorsFilterProperties { + /** + * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. + */ + allowed_institutions?: Array; + /** + * The minimum number of collaborations required for an author to be included in the collaboration network. + */ + min_collaborations?: number; + /** + * The maximum number of collaborations allowed for an author to be included in the collaboration network. + */ + max_collaborations?: number; +} diff --git a/webapp/src/app/api/model/authors-list-response.ts b/webapp/src/app/api/model/authorsListResponse.ts similarity index 60% rename from webapp/src/app/api/model/authors-list-response.ts rename to webapp/src/app/api/model/authorsListResponse.ts index 37a9fc2c..bb1a602c 100644 --- a/webapp/src/app/api/model/authors-list-response.ts +++ b/webapp/src/app/api/model/authorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,13 @@ */ import { Meta } from './meta'; import { Author } from './author'; -import { GroupByResult } from './group-by-result'; - +import { GroupByResult } from './groupByResult'; /** * AuthorsListResponse */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface AuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index cd95a07b..f1b9d48e 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -1,26 +1,24 @@ /** * 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 { DehydratedInstitution } from './dehydrated-institution'; -import { DehydratedAuthor } from './dehydrated-author'; - +import { DehydratedInstitution } from './dehydratedInstitution'; +import { DehydratedAuthor } from './dehydratedAuthor'; /** * Author and their affiliation for a work */ -export interface Authorship { - author_position?: string | null; - author?: DehydratedAuthor | null; - institutions?: Array | null; - countries?: Array | null; - is_corresponding?: boolean | null; - raw_author_name?: string | null; - raw_affiliation_strings?: Array | null; +export interface Authorship { + author_position?: string | null; + author?: DehydratedAuthor | null; + institutions?: Array | null; + countries?: Array | null; + is_corresponding?: boolean | null; + raw_author_name?: string | null; + raw_affiliation_strings?: Array | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponse.ts b/webapp/src/app/api/model/autocompleteResponse.ts new file mode 100644 index 00000000..8b52b300 --- /dev/null +++ b/webapp/src/app/api/model/autocompleteResponse.ts @@ -0,0 +1,19 @@ +/** + * 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 { AutocompleteResponseMeta } from './autocompleteResponseMeta'; +import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner'; + +/** + * AutocompleteResponse + */ +export interface AutocompleteResponse { + meta?: AutocompleteResponseMeta | null; + results?: Array | null; +} diff --git a/webapp/src/app/api/model/autocompleteResponseMeta.ts b/webapp/src/app/api/model/autocompleteResponseMeta.ts new file mode 100644 index 00000000..5bf94a57 --- /dev/null +++ b/webapp/src/app/api/model/autocompleteResponseMeta.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +/** + * AutocompleteResponseMeta + */ +export interface AutocompleteResponseMeta { + count?: number | null; + db_response_time_ms?: number | null; +} diff --git a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts new file mode 100644 index 00000000..0fa956b7 --- /dev/null +++ b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +/** + * AutocompleteResponseResultsInner + */ +export interface AutocompleteResponseResultsInner { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; +} diff --git a/webapp/src/app/api/model/award.ts b/webapp/src/app/api/model/award.ts index 4e3b5cc9..a461c971 100644 --- a/webapp/src/app/api/model/award.ts +++ b/webapp/src/app/api/model/award.ts @@ -1,23 +1,21 @@ /** * 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. */ - /** * Award */ -export interface Award { - id?: string | null; - display_name?: string | null; - funder_award_id?: string | null; - funder_id?: string | null; - funder_display_name?: string | null; - doi?: string | null; +export interface Award { + id?: string | null; + display_name?: string | null; + funder_award_id?: string | null; + funder_id?: string | null; + funder_display_name?: string | null; + doi?: string | null; } - diff --git a/webapp/src/app/api/model/http-validation-error.ts b/webapp/src/app/api/model/bodyCreateUser.ts similarity index 59% rename from webapp/src/app/api/model/http-validation-error.ts rename to webapp/src/app/api/model/bodyCreateUser.ts index a82a8f71..6a0778be 100644 --- a/webapp/src/app/api/model/http-validation-error.ts +++ b/webapp/src/app/api/model/bodyCreateUser.ts @@ -1,16 +1,17 @@ /** * 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 { ValidationError } from './validation-error'; - -export interface HTTPValidationError { - detail?: Array; +export interface BodyCreateUser { + username: string; + password: string; + email: string; + institution: string; + superadmin?: boolean; } - diff --git a/webapp/src/app/api/model/bundProject.ts b/webapp/src/app/api/model/bundProject.ts new file mode 100644 index 00000000..9f291399 --- /dev/null +++ b/webapp/src/app/api/model/bundProject.ts @@ -0,0 +1,40 @@ +/** + * 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. + */ + +export interface BundProject { + funding_code?: string | null; + department?: string | null; + department_fullname?: string | null; + referat?: string | null; + project_sponsor?: string | null; + project_sponsor_fullname?: string | null; + work_unit?: string | null; + recipient?: string | null; + municipal_code?: string | null; + municipality?: string | null; + place?: string | null; + state?: string | null; + country?: string | null; + implementing_agency?: string | null; + topic?: string | null; + performance_plan_system?: string | null; + performance_plan_system_text?: string | null; + funding_start?: string | null; + funding_end?: string | null; + grant_amount?: number | null; + funding_profile?: string | null; + joint_project?: string | null; + funding_type?: string | null; + publication_date?: string | null; + unix_timestamp?: number | null; + date?: string | null; + new?: boolean | null; + duration?: string | null; +} diff --git a/webapp/src/app/api/model/bundProjectDetails.ts b/webapp/src/app/api/model/bundProjectDetails.ts new file mode 100644 index 00000000..b61df06b --- /dev/null +++ b/webapp/src/app/api/model/bundProjectDetails.ts @@ -0,0 +1,55 @@ +/** + * 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. + */ + +/** + * Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types. + */ +export interface BundProjectDetails { + /** + * The ID of the Bund project + */ + id: string; + funding_reference?: string | null; + title?: string | null; + description?: string | null; + joint_project?: string | null; + funding_type?: string | null; + funding_profile?: string | null; + funding_amount?: number | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + duration?: string | null; + performance_plan_code?: string | null; + performance_plan_fullname?: string | null; + executing_agency?: string | null; + funding_recipient?: string | null; + project_agency?: string | null; + project_agency_fullname?: string | null; + department?: string | null; + department_fullname?: string | null; + division?: string | null; + location?: string | null; + municipality?: string | null; + state?: string | null; + country?: string | null; + municipality_code?: string | null; + publication_date?: string | null; + is_new?: boolean | null; + record_date?: string | null; + unix_timestamp?: number | null; + /** + * All persons associated with the Bund project (from nested Arb object) + */ + associated_persons?: Array; + /** + * All institutions associated with the Bund project + */ + institutions?: Array; +} diff --git a/webapp/src/app/api/model/bundProjectPage.ts b/webapp/src/app/api/model/bundProjectPage.ts new file mode 100644 index 00000000..6c38e7a6 --- /dev/null +++ b/webapp/src/app/api/model/bundProjectPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { BundProject } from './bundProject'; + +export interface BundProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The bund projects on this page. + */ + elements?: Array; +} diff --git a/webapp/src/app/api/model/careerMetrics.ts b/webapp/src/app/api/model/careerMetrics.ts new file mode 100644 index 00000000..eb84c19f --- /dev/null +++ b/webapp/src/app/api/model/careerMetrics.ts @@ -0,0 +1,32 @@ +/** + * 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. + */ + +export interface CareerMetrics { + first_publication_year?: number | null; + last_publication_year?: number | null; + career_age?: number | null; + career_span?: number | null; + career_stage?: string | null; + /** + * Number of distinct years with at least one publication. + */ + active_years?: number; + /** + * Number of publications used for career metrics. + */ + publication_count?: number; + publications_per_active_year?: number | null; + publications_per_career_year?: number | null; + years_since_last_publication?: number | null; + /** + * True if publication years look suspicious. + */ + has_suspicious_publication_years?: boolean; +} diff --git a/webapp/src/app/api/model/collaboration-network-edge.ts b/webapp/src/app/api/model/collaboration-network-edge.ts deleted file mode 100644 index 16fb5fc6..00000000 --- a/webapp/src/app/api/model/collaboration-network-edge.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - - -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; -} - diff --git a/webapp/src/app/api/model/collaboration-network-node.ts b/webapp/src/app/api/model/collaboration-network-node.ts deleted file mode 100644 index 3a4542d3..00000000 --- a/webapp/src/app/api/model/collaboration-network-node.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * 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 { CollaborationNetworkNodeType } from './collaboration-network-node-type'; - - -export interface CollaborationNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; -} -export namespace CollaborationNetworkNode { -} - - diff --git a/webapp/src/app/api/model/collaboration-network.ts b/webapp/src/app/api/model/collaboration-network.ts deleted file mode 100644 index 9956ae19..00000000 --- a/webapp/src/app/api/model/collaboration-network.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 { FilterInformation } from './filter-information'; -import { CollaborationNetworkEdge } from './collaboration-network-edge'; -import { CollaborationNetworkNode } from './collaboration-network-node'; - - -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The nodes in the collaboration network. - */ - nodes: Array; - /** - * The edges in the collaboration network. - */ - edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; -} - diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaborationNetwork.ts new file mode 100644 index 00000000..a2fbdc5b --- /dev/null +++ b/webapp/src/app/api/model/collaborationNetwork.ts @@ -0,0 +1,41 @@ +/** + * 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 { FilterInformation } from './filterInformation'; +import { WorkNetworkNode } from './workNetworkNode'; +import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; +import { InstitutionNetworkNode } from './institutionNetworkNode'; +import { AuthorNetworkNode } from './authorNetworkNode'; + +export interface CollaborationNetwork { + /** + * The raw person ID of the person whose collaboration network this is. + */ + raw_person_id: string; + /** + * The work nodes in the collaboration network. + */ + work_nodes: Array; + /** + * The author nodes in the collaboration network. + */ + author_nodes: Array; + /** + * The institution nodes in the collaboration network. + */ + institution_nodes: Array; + /** + * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I + */ + collaboration_edges: Array; + /** + * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. + */ + filter_information: FilterInformation; +} diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaborationNetworkEdge.ts new file mode 100644 index 00000000..baffb178 --- /dev/null +++ b/webapp/src/app/api/model/collaborationNetworkEdge.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +export interface CollaborationNetworkEdge { + /** + * The raw ID of the source node. + */ + raw_source_id: string; + /** + * The raw ID of the target node. + */ + raw_target_id: string; +} diff --git a/webapp/src/app/api/model/collaboration-network-node-type.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts similarity index 57% rename from webapp/src/app/api/model/collaboration-network-node-type.ts rename to webapp/src/app/api/model/collaborationNetworkNodeType.ts index 1b3c0d84..3e673f35 100644 --- a/webapp/src/app/api/model/collaboration-network-node-type.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -1,18 +1,17 @@ /** * 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. */ - export const CollaborationNetworkNodeType = { - author: 'author', - institution: 'institution', - work: 'work' + Author: 'author', + Institution: 'institution', + Work: 'work', } as const; -export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; - +export type CollaborationNetworkNodeType = + (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/companyConnection.ts b/webapp/src/app/api/model/companyConnection.ts new file mode 100644 index 00000000..2824c543 --- /dev/null +++ b/webapp/src/app/api/model/companyConnection.ts @@ -0,0 +1,25 @@ +/** + * 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 { MatchedOfficer } from './matchedOfficer'; + +export interface CompanyConnection { + company_number?: string | null; + company_name?: string | null; + company_status?: string | null; + register_art?: string | null; + register_nummer?: string | null; + native_company_number?: string | null; + registrar?: string | null; + registered_office?: string | null; + registered_address?: string | null; + retrieved_at?: string | null; + matched_officers?: Array; + officers?: Array; +} diff --git a/webapp/src/app/api/model/companyConnectionsResponse.ts b/webapp/src/app/api/model/companyConnectionsResponse.ts new file mode 100644 index 00000000..f4f5f42f --- /dev/null +++ b/webapp/src/app/api/model/companyConnectionsResponse.ts @@ -0,0 +1,23 @@ +/** + * 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 { CompanyConnection } from './companyConnection'; + +export interface CompanyConnectionsResponse { + author_id: string; + display_name?: string | null; + is_ude_author: boolean; + institution_scope?: string | null; + matching_institutions?: Array; + matching_method?: string | null; + company_count: number; + has_more_results: boolean; + common_name_warning: boolean; + connections?: Array; +} diff --git a/webapp/src/app/api/model/cordisEuProject.ts b/webapp/src/app/api/model/cordisEuProject.ts new file mode 100644 index 00000000..8d408ad6 --- /dev/null +++ b/webapp/src/app/api/model/cordisEuProject.ts @@ -0,0 +1,39 @@ +/** + * 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 { Keywords } from './keywords'; +import { Topics } from './topics'; + +export interface CordisEuProject { + /** + * Unique identifier for the project, typically the CORDIS ID + */ + id: string; + rcn?: string | null; + acronym?: string | null; + title?: string | null; + objective?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + subCall?: string | null; + topics?: Topics | null; + nature?: string | null; + status?: string | null; + ecMaxContribution?: number | null; + totalCost?: number | null; + startDate?: string | null; + endDate?: string | null; + ecSignatureDate?: string | null; + contentUpdateDate?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + keywords?: Keywords | null; +} diff --git a/webapp/src/app/api/model/cordisEuProjectPage.ts b/webapp/src/app/api/model/cordisEuProjectPage.ts new file mode 100644 index 00000000..8dc900f7 --- /dev/null +++ b/webapp/src/app/api/model/cordisEuProjectPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { CordisEuProject } from './cordisEuProject'; + +export interface CordisEuProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The CORDIS EU projects on this page. + */ + elements?: Array; +} diff --git a/webapp/src/app/api/model/cost-usd.ts b/webapp/src/app/api/model/costUsd.ts similarity index 87% rename from webapp/src/app/api/model/cost-usd.ts rename to webapp/src/app/api/model/costUsd.ts index c7bcbee8..494cb094 100644 --- a/webapp/src/app/api/model/cost-usd.ts +++ b/webapp/src/app/api/model/costUsd.ts @@ -1,17 +1,14 @@ /** * 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. */ - /** * Cost of this request in USD */ -export interface CostUsd { -} - +export interface CostUsd {} diff --git a/webapp/src/app/api/model/custom-author.ts b/webapp/src/app/api/model/custom-author.ts deleted file mode 100644 index 07000ade..00000000 --- a/webapp/src/app/api/model/custom-author.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * 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 { AuthorAffiliationsInner } from './author-affiliations-inner'; -import { AuthorParsedLongestName } from './author-parsed-longest-name'; -import { DehydratedInstitution } from './dehydrated-institution'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorIds } from './author-ids'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { WorkTopic } from './work-topic'; - - -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; -} - diff --git a/webapp/src/app/api/model/custom-authors-list-response.ts b/webapp/src/app/api/model/custom-authors-list-response.ts deleted file mode 100644 index 45aeae54..00000000 --- a/webapp/src/app/api/model/custom-authors-list-response.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * 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 { Meta } from './meta'; -import { CustomAuthor } from './custom-author'; -import { GroupByResult } from './group-by-result'; - - -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} - diff --git a/webapp/src/app/api/model/customAuthor.ts b/webapp/src/app/api/model/customAuthor.ts new file mode 100644 index 00000000..6fd54c51 --- /dev/null +++ b/webapp/src/app/api/model/customAuthor.ts @@ -0,0 +1,39 @@ +/** + * 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 { AuthorAffiliationsInner } from './authorAffiliationsInner'; +import { AuthorParsedLongestName } from './authorParsedLongestName'; +import { CareerMetrics } from './careerMetrics'; +import { DehydratedInstitution } from './dehydratedInstitution'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorIds } from './authorIds'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { WorkTopic } from './workTopic'; + +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; + career_metrics?: CareerMetrics | null; +} diff --git a/webapp/src/app/api/model/customAuthorsListResponse.ts b/webapp/src/app/api/model/customAuthorsListResponse.ts new file mode 100644 index 00000000..71f691a2 --- /dev/null +++ b/webapp/src/app/api/model/customAuthorsListResponse.ts @@ -0,0 +1,19 @@ +/** + * 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 { Meta } from './meta'; +import { CustomAuthor } from './customAuthor'; +import { GroupByResult } from './groupByResult'; + +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; + placeholder?: CustomAuthor | null; +} diff --git a/webapp/src/app/api/model/dehydrated-source.ts b/webapp/src/app/api/model/dehydrated-source.ts deleted file mode 100644 index ae714846..00000000 --- a/webapp/src/app/api/model/dehydrated-source.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * 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. - */ - - -/** - * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts - */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; -} - diff --git a/webapp/src/app/api/model/dehydrated-author.ts b/webapp/src/app/api/model/dehydratedAuthor.ts similarity index 72% rename from webapp/src/app/api/model/dehydrated-author.ts rename to webapp/src/app/api/model/dehydratedAuthor.ts index 4d3817f1..350718ef 100644 --- a/webapp/src/app/api/model/dehydrated-author.ts +++ b/webapp/src/app/api/model/dehydratedAuthor.ts @@ -1,20 +1,18 @@ /** * 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. */ - /** * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface DehydratedAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } - diff --git a/webapp/src/app/api/model/dehydrated-funder.ts b/webapp/src/app/api/model/dehydratedFunder.ts similarity index 71% rename from webapp/src/app/api/model/dehydrated-funder.ts rename to webapp/src/app/api/model/dehydratedFunder.ts index b134bbb1..c4231c13 100644 --- a/webapp/src/app/api/model/dehydrated-funder.ts +++ b/webapp/src/app/api/model/dehydratedFunder.ts @@ -1,20 +1,18 @@ /** * 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. */ - /** * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface DehydratedFunder { + id?: string | null; + display_name?: string | null; + ror?: string | null; } - diff --git a/webapp/src/app/api/model/dehydrated-institution.ts b/webapp/src/app/api/model/dehydratedInstitution.ts similarity index 61% rename from webapp/src/app/api/model/dehydrated-institution.ts rename to webapp/src/app/api/model/dehydratedInstitution.ts index 7b6c9824..956fc03e 100644 --- a/webapp/src/app/api/model/dehydrated-institution.ts +++ b/webapp/src/app/api/model/dehydratedInstitution.ts @@ -1,23 +1,21 @@ /** * 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. */ - /** * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; +export interface DehydratedInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; } - diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydratedSource.ts new file mode 100644 index 00000000..b672b5dd --- /dev/null +++ b/webapp/src/app/api/model/dehydratedSource.ts @@ -0,0 +1,26 @@ +/** + * 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. + */ + +/** + * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts + */ +export interface DehydratedSource { + id?: string | null; + display_name?: string | null; + issn_l?: string | null; + issn?: Array | null; + is_oa?: boolean | null; + is_in_doaj?: boolean | null; + is_core?: boolean | null; + host_organization?: string | null; + host_organization_name?: string | null; + host_organization_lineage?: Array | null; + type?: string | null; +} diff --git a/webapp/src/app/api/model/dfgProjectDetails.ts b/webapp/src/app/api/model/dfgProjectDetails.ts new file mode 100644 index 00000000..58ece5f7 --- /dev/null +++ b/webapp/src/app/api/model/dfgProjectDetails.ts @@ -0,0 +1,39 @@ +/** + * 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. + */ + +/** + * Clean summary model for a DFG project, consolidating all person roles and institution references into unified lists. + */ +export interface DfgProjectDetails { + /** + * The ID of the DFG project + */ + id: string; + link?: string | null; + title?: string | null; + description?: string | null; + project_identifier?: string | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + dfg_procedure?: string | null; + subject_area?: string | null; + funding_type?: string | null; + international_reference?: string | null; + website?: string | null; + /** + * All persons associated with the DFG project (any role) + */ + associated_persons?: Array; + /** + * All institutions associated with the DFG project + */ + institutions?: Array; + subproject_of?: string | null; +} diff --git a/webapp/src/app/api/model/dfgProjectPage.ts b/webapp/src/app/api/model/dfgProjectPage.ts new file mode 100644 index 00000000..a05d81d2 --- /dev/null +++ b/webapp/src/app/api/model/dfgProjectPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { DfgProjectSummary } from './dfgProjectSummary'; + +export interface DfgProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The DFG projects on this page. + */ + elements?: Array; +} diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts new file mode 100644 index 00000000..10c05a08 --- /dev/null +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + +export interface DfgProjectSummary { + /** + * The unique identifier of the DFG project. + */ + id: string; + link?: string | null; + title?: string | null; + professional_classification?: string | null; + funding_start?: string | null; + funding_end?: string | null; + /** + * The names of the researchers involved in the DFG project. + */ + names?: Array; +} diff --git a/webapp/src/app/api/model/euOrganizationProjectSummary.ts b/webapp/src/app/api/model/euOrganizationProjectSummary.ts new file mode 100644 index 00000000..af085ff3 --- /dev/null +++ b/webapp/src/app/api/model/euOrganizationProjectSummary.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + +export interface EuOrganizationProjectSummary { + /** + * The unique identifier of the organization. + */ + organization_id: string; + /** + * The unique identifier of the project. + */ + project_id: string; + title?: string | null; + start_date?: string | null; + end_date?: string | null; + acronym?: string | null; + ec_contribution?: number | null; +} diff --git a/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts new file mode 100644 index 00000000..90166a7e --- /dev/null +++ b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { EuOrganizationProjectSummary } from './euOrganizationProjectSummary'; + +export interface EuOrganizationProjectSummaryPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The organization project summaries on this page. + */ + elements?: Array; +} diff --git a/webapp/src/app/api/model/filter-information.ts b/webapp/src/app/api/model/filter-information.ts deleted file mode 100644 index a8e9d5dd..00000000 --- a/webapp/src/app/api/model/filter-information.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * 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 { InstitutionInformation } from './institution-information'; -import { WorkTopicInformation } from './work-topic-information'; - - -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; -} - diff --git a/webapp/src/app/api/model/filter-properties.ts b/webapp/src/app/api/model/filter-properties.ts deleted file mode 100644 index daeb08ee..00000000 --- a/webapp/src/app/api/model/filter-properties.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - - -export interface FilterProperties { - start_year: number | null; - end_year: number | null; - allowed_institutions: Array | null; - allowed_topics: Array | null; - min_collaborators: number | null; - max_collaborators: number | null; - min_collaborations: number | null; - max_collaborations: number | null; -} - diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts new file mode 100644 index 00000000..1c4af66d --- /dev/null +++ b/webapp/src/app/api/model/filterInformation.ts @@ -0,0 +1,30 @@ +/** + * 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 { InstitutionInformation } from './institutionInformation'; +import { WorkTopicInformation } from './workTopicInformation'; + +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; +} diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts new file mode 100644 index 00000000..7caac0b6 --- /dev/null +++ b/webapp/src/app/api/model/filterProperties.ts @@ -0,0 +1,20 @@ +/** + * 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 { WorksFilterProperties } from './worksFilterProperties'; +import { AuthorsFilterProperties } from './authorsFilterProperties'; + +export interface FilterProperties { + /** + * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. + */ + filter_by?: string; + works_filter_properties: WorksFilterProperties | null; + authors_filter_properties: AuthorsFilterProperties | null; +} diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts new file mode 100644 index 00000000..c62110e7 --- /dev/null +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -0,0 +1,23 @@ +/** + * 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 { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition'; +import { AuthorPositionCount } from './authorPositionCount'; +import { PublicationDetailByFunder } from './publicationDetailByFunder'; + +export interface FunderByAuthor { + funder_id?: string | null; + funder_name?: string | null; + publication_count: number; + author_position_count: AuthorPositionCount; + publication_ids: PublicationIdsByAuthorPosition; + publication_urls?: { [key: string]: string }; + publication_titles?: { [key: string]: string }; + publication_details?: { [key: string]: PublicationDetailByFunder }; +} diff --git a/webapp/src/app/api/model/fundersByAuthorResponse.ts b/webapp/src/app/api/model/fundersByAuthorResponse.ts new file mode 100644 index 00000000..d6e0e02f --- /dev/null +++ b/webapp/src/app/api/model/fundersByAuthorResponse.ts @@ -0,0 +1,17 @@ +/** + * 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 { FunderByAuthor } from './funderByAuthor'; + +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; +} diff --git a/webapp/src/app/api/model/fundingProject.ts b/webapp/src/app/api/model/fundingProject.ts new file mode 100644 index 00000000..fb8204e3 --- /dev/null +++ b/webapp/src/app/api/model/fundingProject.ts @@ -0,0 +1,27 @@ +/** + * 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 { ProjectType } from './projectType'; + +export interface FundingProject { + /** + * The type of the project. + */ + type: ProjectType; + /** + * The unique identifier of the project. + */ + id: string; + title?: string | null; + acronym?: string | null; + start_date?: string | null; + end_date?: string | null; + funding_amount?: number | null; +} +export namespace FundingProject {} diff --git a/webapp/src/app/api/model/fundingProjectPage.ts b/webapp/src/app/api/model/fundingProjectPage.ts new file mode 100644 index 00000000..e0996525 --- /dev/null +++ b/webapp/src/app/api/model/fundingProjectPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { FundingProject } from './fundingProject'; + +export interface FundingProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The funding projects on this page. + */ + elements?: Array; +} diff --git a/webapp/src/app/api/model/fwci.ts b/webapp/src/app/api/model/fwci.ts index 0c0cf8de..bd7eea69 100644 --- a/webapp/src/app/api/model/fwci.ts +++ b/webapp/src/app/api/model/fwci.ts @@ -1,17 +1,14 @@ /** * 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. */ - /** * Field-weighted Citation Impact, calculated as citations received / citations expected. */ -export interface Fwci { -} - +export interface Fwci {} diff --git a/webapp/src/app/api/model/group-by-result.ts b/webapp/src/app/api/model/groupByResult.ts similarity index 64% rename from webapp/src/app/api/model/group-by-result.ts rename to webapp/src/app/api/model/groupByResult.ts index 68c51855..98580663 100644 --- a/webapp/src/app/api/model/group-by-result.ts +++ b/webapp/src/app/api/model/groupByResult.ts @@ -1,20 +1,18 @@ /** * 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. */ - /** * GroupByResult */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; +export interface GroupByResult { + key?: string | null; + key_display_name?: string | null; + count?: number | null; } - diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/hTTPValidationError.ts new file mode 100644 index 00000000..c8e65c3e --- /dev/null +++ b/webapp/src/app/api/model/hTTPValidationError.ts @@ -0,0 +1,14 @@ +/** + * 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 { ValidationError } from './validationError'; + +export interface HTTPValidationError { + detail?: Array; +} diff --git a/webapp/src/app/api/model/identity-grant.ts b/webapp/src/app/api/model/identity-grant.ts deleted file mode 100644 index fd48137c..00000000 --- a/webapp/src/app/api/model/identity-grant.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * 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 { AuthScope } from './auth-scope'; - - -export interface IdentityGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; -} - diff --git a/webapp/src/app/api/model/auth-scope.ts b/webapp/src/app/api/model/identityGrant.ts similarity index 56% rename from webapp/src/app/api/model/auth-scope.ts rename to webapp/src/app/api/model/identityGrant.ts index 0d9d325d..4bf172b8 100644 --- a/webapp/src/app/api/model/auth-scope.ts +++ b/webapp/src/app/api/model/identityGrant.ts @@ -1,19 +1,17 @@ /** * 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 { AuthAccount } from './auth-account'; +import { AuthScope } from './authScope'; - -export interface AuthScope { - t: string; - a: AuthAccount; - d?: number | null; - r?: Array; +export interface IdentityGrant { + token_type: string; + access_token: string; + expires_in: number; + scope: AuthScope; } - diff --git a/webapp/src/app/api/model/institution-information.ts b/webapp/src/app/api/model/institution-information.ts deleted file mode 100644 index e287b0fa..00000000 --- a/webapp/src/app/api/model/institution-information.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - - -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; -} - diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts new file mode 100644 index 00000000..c099fc57 --- /dev/null +++ b/webapp/src/app/api/model/institution.ts @@ -0,0 +1,39 @@ +/** + * 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 { InstitutionIds } from './institutionIds'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { InstitutionGeo } from './institutionGeo'; + +/** + * A university, research organization, or other affiliation + */ +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; +} diff --git a/webapp/src/app/api/model/institutionFunderSummary.ts b/webapp/src/app/api/model/institutionFunderSummary.ts new file mode 100644 index 00000000..cf15754a --- /dev/null +++ b/webapp/src/app/api/model/institutionFunderSummary.ts @@ -0,0 +1,26 @@ +/** + * 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 { ProjectType } from './projectType'; + +export interface InstitutionFunderSummary { + /** + * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). + */ + type: ProjectType; + /** + * A dictionary mapping years to total funding amounts for that year. + */ + funding_per_year?: object; + /** + * The average annual funding over the continuous period covered by the data. + */ + annual_average_over_period?: number; +} +export namespace InstitutionFunderSummary {} diff --git a/webapp/src/app/api/model/institutionGeo.ts b/webapp/src/app/api/model/institutionGeo.ts new file mode 100644 index 00000000..b438d37c --- /dev/null +++ b/webapp/src/app/api/model/institutionGeo.ts @@ -0,0 +1,24 @@ +/** + * 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 { Latitude } from './latitude'; +import { Longitude } from './longitude'; + +/** + * Location information: + */ +export interface InstitutionGeo { + city?: string | null; + geonames_city_id?: string | null; + region?: string | null; + country_code?: string | null; + country?: string | null; + latitude?: Latitude | null; + longitude?: Longitude | null; +} diff --git a/webapp/src/app/api/model/institutionIds.ts b/webapp/src/app/api/model/institutionIds.ts new file mode 100644 index 00000000..fd952098 --- /dev/null +++ b/webapp/src/app/api/model/institutionIds.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + +/** + * External identifiers: + */ +export interface InstitutionIds { + openalex?: string | null; + ror?: string | null; + mag?: number | null; + grid?: string | null; + wikipedia?: string | null; + wikidata?: string | null; +} diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts new file mode 100644 index 00000000..9e12986d --- /dev/null +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; +} diff --git a/webapp/src/app/api/model/institutionNetworkNode.ts b/webapp/src/app/api/model/institutionNetworkNode.ts new file mode 100644 index 00000000..791645b7 --- /dev/null +++ b/webapp/src/app/api/model/institutionNetworkNode.ts @@ -0,0 +1,26 @@ +/** + * 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 { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; + +export interface InstitutionNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; +} +export namespace InstitutionNetworkNode {} diff --git a/webapp/src/app/api/model/institutionPage.ts b/webapp/src/app/api/model/institutionPage.ts new file mode 100644 index 00000000..b7640651 --- /dev/null +++ b/webapp/src/app/api/model/institutionPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { Institution } from './institution'; + +export interface InstitutionPage { + /** + * List of institutions in the current page. + */ + elements?: Array; + /** + * Current page number. (0-indexed) + */ + page?: number; + /** + * Number of institutions per page. + */ + size?: number; + /** + * Total number of institutions matching the search criteria. + */ + total?: number; +} diff --git a/webapp/src/app/api/model/institutionsListResponse.ts b/webapp/src/app/api/model/institutionsListResponse.ts new file mode 100644 index 00000000..0ac2c185 --- /dev/null +++ b/webapp/src/app/api/model/institutionsListResponse.ts @@ -0,0 +1,21 @@ +/** + * 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 { Meta } from './meta'; +import { Institution } from './institution'; +import { GroupByResult } from './groupByResult'; + +/** + * InstitutionsListResponse + */ +export interface InstitutionsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; +} diff --git a/webapp/src/app/api/model/item-create.ts b/webapp/src/app/api/model/item-create.ts deleted file mode 100644 index 608d6910..00000000 --- a/webapp/src/app/api/model/item-create.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - - -export interface ItemCreate { - /** - * The name of the item. - */ - name: string; - /** - * The description of the item. - */ - description: string; -} - diff --git a/webapp/src/app/api/model/item-page.ts b/webapp/src/app/api/model/item-page.ts deleted file mode 100644 index 56595b8a..00000000 --- a/webapp/src/app/api/model/item-page.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * 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 { Item } from './item'; - - -export interface ItemPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page offset in elements. - */ - offset?: number; - /** - * The total number of elements. - */ - total?: number; - /** - * The page size in elements. - */ - size?: number; -} - diff --git a/webapp/src/app/api/model/item.ts b/webapp/src/app/api/model/item.ts index cc33194a..377f3a81 100644 --- a/webapp/src/app/api/model/item.ts +++ b/webapp/src/app/api/model/item.ts @@ -1,26 +1,24 @@ /** * 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. */ - -export interface Item { - /** - * The id of the entity. - */ - id: number; - /** - * The name of the item. - */ - name: string; - /** - * The description of the item. - */ - description: string; +export interface Item { + /** + * The id of the entity. + */ + id: number; + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; } - diff --git a/webapp/src/app/api/model/itemCreate.ts b/webapp/src/app/api/model/itemCreate.ts new file mode 100644 index 00000000..36920a12 --- /dev/null +++ b/webapp/src/app/api/model/itemCreate.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +export interface ItemCreate { + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; +} diff --git a/webapp/src/app/api/model/itemPage.ts b/webapp/src/app/api/model/itemPage.ts new file mode 100644 index 00000000..53a7140a --- /dev/null +++ b/webapp/src/app/api/model/itemPage.ts @@ -0,0 +1,29 @@ +/** + * 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 { Item } from './item'; + +export interface ItemPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page offset in elements. + */ + offset?: number; + /** + * The total number of elements. + */ + total?: number; + /** + * The page size in elements. + */ + size?: number; +} diff --git a/webapp/src/app/api/model/auth-account.ts b/webapp/src/app/api/model/keywords.ts similarity index 71% rename from webapp/src/app/api/model/auth-account.ts rename to webapp/src/app/api/model/keywords.ts index 0c76d8dc..d93b5fe0 100644 --- a/webapp/src/app/api/model/auth-account.ts +++ b/webapp/src/app/api/model/keywords.ts @@ -1,17 +1,14 @@ /** * 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. */ - -export interface AuthAccount { - i: number; - l: string; - o: number; -} - +/** + * Keywords associated with the project + */ +export interface Keywords {} diff --git a/webapp/src/app/api/model/model2-yr-mean-citedness.ts b/webapp/src/app/api/model/latitude.ts similarity index 80% rename from webapp/src/app/api/model/model2-yr-mean-citedness.ts rename to webapp/src/app/api/model/latitude.ts index 67ec623c..8fb58a9b 100644 --- a/webapp/src/app/api/model/model2-yr-mean-citedness.ts +++ b/webapp/src/app/api/model/latitude.ts @@ -1,14 +1,11 @@ /** * 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. */ - -export interface Model2YrMeanCitedness { -} - +export interface Latitude {} diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index ed2aa1e2..f92e2ffb 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -1,27 +1,25 @@ /** * 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 { DehydratedSource } from './dehydrated-source'; - +import { DehydratedSource } from './dehydratedSource'; /** * Where a work is hosted */ -export interface Location { - is_oa?: boolean | null; - landing_page_url?: string | null; - pdf_url?: string | null; - source?: DehydratedSource | null; - license?: string | null; - license_id?: string | null; - version?: string | null; - is_accepted?: boolean | null; - is_published?: boolean | null; +export interface Location { + is_oa?: boolean | null; + landing_page_url?: string | null; + pdf_url?: string | null; + source?: DehydratedSource | null; + license?: string | null; + license_id?: string | null; + version?: string | null; + is_accepted?: boolean | null; + is_published?: boolean | null; } - diff --git a/webapp/src/app/api/model/validation-error-loc-inner.ts b/webapp/src/app/api/model/longitude.ts similarity index 80% rename from webapp/src/app/api/model/validation-error-loc-inner.ts rename to webapp/src/app/api/model/longitude.ts index d248a9b7..d222a6ff 100644 --- a/webapp/src/app/api/model/validation-error-loc-inner.ts +++ b/webapp/src/app/api/model/longitude.ts @@ -1,14 +1,11 @@ /** * 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. */ - -export interface ValidationErrorLocInner { -} - +export interface Longitude {} diff --git a/webapp/src/app/api/model/matchedOfficer.ts b/webapp/src/app/api/model/matchedOfficer.ts new file mode 100644 index 00000000..a9f00939 --- /dev/null +++ b/webapp/src/app/api/model/matchedOfficer.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + +export interface MatchedOfficer { + name?: string | null; + firstname?: string | null; + lastname?: string | null; + city?: string | null; + position?: string | null; + start_date?: string | null; + type?: string | null; + flag?: string | null; + is_matched_person?: boolean; +} diff --git a/webapp/src/app/api/model/person-bio.ts b/webapp/src/app/api/model/mentionedPerson.ts similarity index 67% rename from webapp/src/app/api/model/person-bio.ts rename to webapp/src/app/api/model/mentionedPerson.ts index f7291e6f..dad21357 100644 --- a/webapp/src/app/api/model/person-bio.ts +++ b/webapp/src/app/api/model/mentionedPerson.ts @@ -1,18 +1,15 @@ /** * 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. */ - -export interface PersonBio { - /** - * The generated biography. - */ - bio: string; +export interface MentionedPerson { + name: string; + is_ude?: boolean; + person_id?: string | null; } - diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index cf47d6d3..f9f56443 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -1,25 +1,23 @@ /** * 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 { CostUsd } from './cost-usd'; - +import { CostUsd } from './costUsd'; /** * Metadata about the query results */ -export interface Meta { - count?: number | null; - db_response_time_ms?: number | null; - page?: number | null; - per_page?: number | null; - next_cursor?: string | null; - groups_count?: number | null; - cost_usd?: CostUsd | null; +export interface Meta { + count?: number | null; + db_response_time_ms?: number | null; + page?: number | null; + per_page?: number | null; + next_cursor?: string | null; + groups_count?: number | null; + cost_usd?: CostUsd | null; } - diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2YrMeanCitedness.ts new file mode 100644 index 00000000..d9c3d9df --- /dev/null +++ b/webapp/src/app/api/model/model2YrMeanCitedness.ts @@ -0,0 +1,11 @@ +/** + * 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. + */ + +export interface Model2YrMeanCitedness {} diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 7010515c..89f601cc 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -1,62 +1,123 @@ -export * from './access-grant'; -export * from './auth-account'; -export * from './auth-scope'; +export * from './accessGrant'; +export * from './authAccount'; +export * from './authScope'; export * from './author'; -export * from './author-affiliations-inner'; -export * from './author-counts-by-year-inner'; -export * from './author-ids'; -export * from './author-parsed-longest-name'; -export * from './author-summary-stats'; -export * from './authors-list-response'; +export * from './authorAffiliationsInner'; +export * from './authorCountsByYearInner'; +export * from './authorIds'; +export * from './authorNetworkNode'; +export * from './authorParsedLongestName'; +export * from './authorPositionCount'; +export * from './authorSummaryStats'; +export * from './authorsFilterProperties'; +export * from './authorsListResponse'; export * from './authorship'; +export * from './autocompleteResponse'; +export * from './autocompleteResponseMeta'; +export * from './autocompleteResponseResultsInner'; export * from './award'; -export * from './collaboration-network'; -export * from './collaboration-network-edge'; -export * from './collaboration-network-node'; -export * from './collaboration-network-node-type'; -export * from './cost-usd'; -export * from './custom-author'; -export * from './custom-authors-list-response'; -export * from './dehydrated-author'; -export * from './dehydrated-funder'; -export * from './dehydrated-institution'; -export * from './dehydrated-source'; -export * from './filter-information'; -export * from './filter-properties'; +export * from './bodyCreateUser'; +export * from './bundProject'; +export * from './bundProjectDetails'; +export * from './bundProjectPage'; +export * from './careerMetrics'; +export * from './collaborationNetwork'; +export * from './collaborationNetworkEdge'; +export * from './collaborationNetworkNodeType'; +export * from './companyConnection'; +export * from './companyConnectionsResponse'; +export * from './cordisEuProject'; +export * from './cordisEuProjectPage'; +export * from './costUsd'; +export * from './customAuthor'; +export * from './customAuthorsListResponse'; +export * from './dehydratedAuthor'; +export * from './dehydratedFunder'; +export * from './dehydratedInstitution'; +export * from './dehydratedSource'; +export * from './dfgProjectDetails'; +export * from './dfgProjectPage'; +export * from './dfgProjectSummary'; +export * from './euOrganizationProjectSummary'; +export * from './euOrganizationProjectSummaryPage'; +export * from './filterInformation'; +export * from './filterProperties'; +export * from './funderByAuthor'; +export * from './fundersByAuthorResponse'; +export * from './fundingProject'; +export * from './fundingProjectPage'; export * from './fwci'; -export * from './group-by-result'; -export * from './http-validation-error'; -export * from './identity-grant'; -export * from './institution-information'; +export * from './groupByResult'; +export * from './hTTPValidationError'; +export * from './identityGrant'; +export * from './institution'; +export * from './institutionFunderSummary'; +export * from './institutionGeo'; +export * from './institutionIds'; +export * from './institutionInformation'; +export * from './institutionNetworkNode'; +export * from './institutionPage'; +export * from './institutionsListResponse'; export * from './item'; -export * from './item-create'; -export * from './item-page'; +export * from './itemCreate'; +export * from './itemPage'; +export * from './keywords'; +export * from './latitude'; export * from './location'; +export * from './longitude'; +export * from './matchedOfficer'; +export * from './mentionedPerson'; export * from './meta'; -export * from './model2-yr-mean-citedness'; -export * from './open-access'; -export * from './person-bio'; +export * from './model2YrMeanCitedness'; +export * from './newsArticle'; +export * from './newsArticleDetail'; +export * from './newsPage'; +export * from './openAccess'; +export * from './patentEntry'; +export * from './patentsByAuthorResponse'; +export * from './personBio'; +export * from './projectType'; +export * from './projectsFilteringProperties'; +export * from './projectsSortBy'; +export * from './publicationDetailByFunder'; +export * from './publicationIdsByAuthorPosition'; +export * from './publicationsByAuthorResponse'; +export * from './rankingResponse'; export * from './score'; -export * from './validation-error'; -export * from './validation-error-loc-inner'; +export * from './sortDirection'; +export * from './topic'; export * from './topicCount'; +export * from './topicDomain'; +export * from './topicField'; +export * from './topicIds'; +export * from './topicSubfield'; +export * from './topics'; export * from './topicsByTime'; export * from './topicsByYear'; +export * from './topicsListResponse'; +export * from './universityRanking'; +export * from './universityTopicData'; +export * from './user'; +export * from './validationError'; +export * from './validationErrorLocInner'; export * from './value'; export * from './work'; -export * from './work-biblio'; -export * from './work-citation-normalized-percentile'; -export * from './work-cited-by-percentile-year'; -export * from './work-counts-by-year-inner'; -export * from './work-has-content'; -export * from './work-ids'; -export * from './work-keyword'; -export * from './work-mesh-inner'; -export * from './work-page'; -export * from './work-sustainable-development-goals-inner'; -export * from './work-topic'; -export * from './work-topic-domain'; -export * from './work-topic-field'; -export * from './work-topic-information'; -export * from './work-topic-subfield'; -export * from './works-list-response'; +export * from './workBiblio'; +export * from './workCitationNormalizedPercentile'; +export * from './workCitedByPercentileYear'; +export * from './workCountsByYearInner'; +export * from './workHasContent'; +export * from './workIds'; +export * from './workKeyword'; +export * from './workMeshInner'; +export * from './workNetworkNode'; +export * from './workPage'; +export * from './workSustainableDevelopmentGoalsInner'; +export * from './workTopic'; +export * from './workTopicDomain'; +export * from './workTopicField'; +export * from './workTopicInformation'; +export * from './workTopicSubfield'; +export * from './worksFilterProperties'; +export * from './worksListResponse'; +export * from './yearlyData'; diff --git a/webapp/src/app/api/model/access-grant.ts b/webapp/src/app/api/model/newsArticle.ts similarity index 50% rename from webapp/src/app/api/model/access-grant.ts rename to webapp/src/app/api/model/newsArticle.ts index 9de129ac..3701eb25 100644 --- a/webapp/src/app/api/model/access-grant.ts +++ b/webapp/src/app/api/model/newsArticle.ts @@ -1,20 +1,19 @@ /** * 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 { AuthScope } from './auth-scope'; - -export interface AccessGrant { - token_type: string; - access_token: string; - expires_in: number; - scope: AuthScope; - refresh_token: string; +export interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; } - diff --git a/webapp/src/app/api/model/newsArticleDetail.ts b/webapp/src/app/api/model/newsArticleDetail.ts new file mode 100644 index 00000000..ed8903d0 --- /dev/null +++ b/webapp/src/app/api/model/newsArticleDetail.ts @@ -0,0 +1,22 @@ +/** + * 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 { MentionedPerson } from './mentionedPerson'; + +export interface NewsArticleDetail { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + full_content?: string | null; + authors?: Array; +} diff --git a/webapp/src/app/api/model/newsPage.ts b/webapp/src/app/api/model/newsPage.ts new file mode 100644 index 00000000..bbb74122 --- /dev/null +++ b/webapp/src/app/api/model/newsPage.ts @@ -0,0 +1,17 @@ +/** + * 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 { NewsArticle } from './newsArticle'; + +export interface NewsPage { + total: number; + page: number; + page_size: number; + results: Array; +} diff --git a/webapp/src/app/api/model/open-access.ts b/webapp/src/app/api/model/openAccess.ts similarity index 58% rename from webapp/src/app/api/model/open-access.ts rename to webapp/src/app/api/model/openAccess.ts index 32a4ddd9..40d7b1d0 100644 --- a/webapp/src/app/api/model/open-access.ts +++ b/webapp/src/app/api/model/openAccess.ts @@ -1,21 +1,19 @@ /** * 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. */ - /** * Open access information */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; +export interface OpenAccess { + is_oa?: boolean | null; + oa_status?: string | null; + oa_url?: string | null; + any_repository_has_fulltext?: boolean | null; } - diff --git a/webapp/src/app/api/model/patentEntry.ts b/webapp/src/app/api/model/patentEntry.ts new file mode 100644 index 00000000..a6a3619c --- /dev/null +++ b/webapp/src/app/api/model/patentEntry.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +export interface PatentEntry { + patent_id: string; + source: string; + title?: string | null; + abstract?: string | null; + publication_date?: string | null; + publication_year?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + country?: string | null; +} diff --git a/webapp/src/app/api/model/patentsByAuthorResponse.ts b/webapp/src/app/api/model/patentsByAuthorResponse.ts new file mode 100644 index 00000000..ed970c7a --- /dev/null +++ b/webapp/src/app/api/model/patentsByAuthorResponse.ts @@ -0,0 +1,17 @@ +/** + * 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 { PatentEntry } from './patentEntry'; + +export interface PatentsByAuthorResponse { + author_id: string; + author_name?: string | null; + patent_count: number; + patents: Array; +} diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/personBio.ts new file mode 100644 index 00000000..b060c9a9 --- /dev/null +++ b/webapp/src/app/api/model/personBio.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +export interface PersonBio { + /** + * The generated biography. + */ + bio: string; +} diff --git a/webapp/src/app/api/model/projectType.ts b/webapp/src/app/api/model/projectType.ts new file mode 100644 index 00000000..08df30c4 --- /dev/null +++ b/webapp/src/app/api/model/projectType.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +export const ProjectType = { + Bund: 'bund', + Eu: 'eu', + Dfg: 'dfg', +} as const; +export type ProjectType = (typeof ProjectType)[keyof typeof ProjectType]; diff --git a/webapp/src/app/api/model/projectsFilteringProperties.ts b/webapp/src/app/api/model/projectsFilteringProperties.ts new file mode 100644 index 00000000..c0cebe63 --- /dev/null +++ b/webapp/src/app/api/model/projectsFilteringProperties.ts @@ -0,0 +1,38 @@ +/** + * 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 { SortDirection } from './sortDirection'; +import { ProjectsSortBy } from './projectsSortBy'; +import { ProjectType } from './projectType'; + +export interface ProjectsFilteringProperties { + /** + * The type of projects to filter by. + */ + project_type: ProjectType; + /** + * The page number for pagination. + */ + page: number; + /** + * The page size for pagination. + */ + size: number; + raw_oa_institution_id?: string | null; + query?: string | null; + /** + * The field to sort by. + */ + sort_by?: ProjectsSortBy; + /** + * The sort direction (asc or desc). + */ + sort_direction?: SortDirection; +} +export namespace ProjectsFilteringProperties {} diff --git a/webapp/src/app/api/model/projectsSortBy.ts b/webapp/src/app/api/model/projectsSortBy.ts new file mode 100644 index 00000000..26400b22 --- /dev/null +++ b/webapp/src/app/api/model/projectsSortBy.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ + +export const ProjectsSortBy = { + Title: 'title', + FundingStart: 'funding_start', + FundingEnd: 'funding_end', + FundingAmount: 'funding_amount', +} as const; +export type ProjectsSortBy = + (typeof ProjectsSortBy)[keyof typeof ProjectsSortBy]; diff --git a/webapp/src/app/api/model/publicationDetailByFunder.ts b/webapp/src/app/api/model/publicationDetailByFunder.ts new file mode 100644 index 00000000..0fd6b7c5 --- /dev/null +++ b/webapp/src/app/api/model/publicationDetailByFunder.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ + +export interface PublicationDetailByFunder { + id: string; + title: string; + abstract?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: string | null; + authors?: Array; + funder_names?: Array; + institutions?: Array; + countries?: Array; + topics?: Array; + keywords?: Array; + grant_labels?: Array; + counts_by_year?: Array; +} diff --git a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts new file mode 100644 index 00000000..d549f8ed --- /dev/null +++ b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts @@ -0,0 +1,16 @@ +/** + * 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. + */ + +export interface PublicationIdsByAuthorPosition { + first?: Array; + middle?: Array; + last?: Array; + unknown?: Array; +} diff --git a/webapp/src/app/api/model/publicationsByAuthorResponse.ts b/webapp/src/app/api/model/publicationsByAuthorResponse.ts new file mode 100644 index 00000000..35333880 --- /dev/null +++ b/webapp/src/app/api/model/publicationsByAuthorResponse.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +export interface PublicationsByAuthorResponse { + author_id: string; + page: number; + page_size: number; + total_works: number; + total: number; + results_count: number; + results: Array; +} diff --git a/webapp/src/app/api/model/rankingResponse.ts b/webapp/src/app/api/model/rankingResponse.ts new file mode 100644 index 00000000..5be090a2 --- /dev/null +++ b/webapp/src/app/api/model/rankingResponse.ts @@ -0,0 +1,16 @@ +/** + * 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 { UniversityRanking } from './universityRanking'; +import { UniversityTopicData } from './universityTopicData'; + +export interface RankingResponse { + timeseries: Array; + rankings: Array; +} diff --git a/webapp/src/app/api/model/score.ts b/webapp/src/app/api/model/score.ts index fac39735..5b0b5935 100644 --- a/webapp/src/app/api/model/score.ts +++ b/webapp/src/app/api/model/score.ts @@ -1,14 +1,11 @@ /** * 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. */ - -export interface Score { -} - +export interface Score {} diff --git a/webapp/src/app/api/model/sortDirection.ts b/webapp/src/app/api/model/sortDirection.ts new file mode 100644 index 00000000..49933995 --- /dev/null +++ b/webapp/src/app/api/model/sortDirection.ts @@ -0,0 +1,15 @@ +/** + * 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. + */ + +export const SortDirection = { + Asc: 'asc', + Desc: 'desc', +} as const; +export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection]; diff --git a/webapp/src/app/api/model/topic.ts b/webapp/src/app/api/model/topic.ts new file mode 100644 index 00000000..eaac16f6 --- /dev/null +++ b/webapp/src/app/api/model/topic.ts @@ -0,0 +1,32 @@ +/** + * 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 { TopicDomain } from './topicDomain'; +import { TopicIds } from './topicIds'; +import { TopicSubfield } from './topicSubfield'; +import { TopicField } from './topicField'; + +/** + * A research topic automatically assigned to works + */ +export interface Topic { + id?: string | null; + display_name?: string | null; + description?: string | null; + keywords?: Array | null; + subfield?: TopicSubfield | null; + field?: TopicField | null; + domain?: TopicDomain | null; + works_count?: number | null; + cited_by_count?: number | null; + ids?: TopicIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; +} diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts index d6c3c481..1d2abe90 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topicCount.ts @@ -1,22 +1,31 @@ /** * 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. */ - -export interface TopicCount { - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; +export interface TopicCount { + id?: string | null; + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; + description?: string | null; + subfield_id?: string | null; + subfield_name?: string | null; + subfield_description?: string | null; + field_id?: string | null; + field_name?: string | null; + field_description?: string | null; + domain_id?: string | null; + domain_name?: string | null; + domain_description?: string | null; } - diff --git a/webapp/src/app/api/model/topicDomain.ts b/webapp/src/app/api/model/topicDomain.ts new file mode 100644 index 00000000..573bef0d --- /dev/null +++ b/webapp/src/app/api/model/topicDomain.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +/** + * The domain (highest level) containing this topic: + */ +export interface TopicDomain { + id?: string | null; + display_name?: string | null; +} diff --git a/webapp/src/app/api/model/topicField.ts b/webapp/src/app/api/model/topicField.ts new file mode 100644 index 00000000..cd7d08c8 --- /dev/null +++ b/webapp/src/app/api/model/topicField.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +/** + * The field (second level) containing this topic: + */ +export interface TopicField { + id?: string | null; + display_name?: string | null; +} diff --git a/webapp/src/app/api/model/topicIds.ts b/webapp/src/app/api/model/topicIds.ts new file mode 100644 index 00000000..22ca3343 --- /dev/null +++ b/webapp/src/app/api/model/topicIds.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +/** + * External identifiers: + */ +export interface TopicIds { + openalex?: string | null; + wikipedia?: string | null; +} diff --git a/webapp/src/app/api/model/topicSubfield.ts b/webapp/src/app/api/model/topicSubfield.ts new file mode 100644 index 00000000..79f3c9c7 --- /dev/null +++ b/webapp/src/app/api/model/topicSubfield.ts @@ -0,0 +1,17 @@ +/** + * 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. + */ + +/** + * The subfield (third level) containing this topic: + */ +export interface TopicSubfield { + id?: string | null; + display_name?: string | null; +} diff --git a/webapp/src/app/api/model/topics.ts b/webapp/src/app/api/model/topics.ts new file mode 100644 index 00000000..cf40ff1d --- /dev/null +++ b/webapp/src/app/api/model/topics.ts @@ -0,0 +1,11 @@ +/** + * 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. + */ + +export interface Topics {} diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 0dac04a7..007dc43d 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,25 @@ */ import { TopicsByYear } from './topicsByYear'; - -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; + /** + * True if the timeline contains only a limited subset of the author\'s publications. + */ + is_limited?: boolean; + /** + * The number of publications used to build the timeline. + */ + used_publications?: number; + /** + * The total number of publications found for this author. + */ + total_publications?: number; } - diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts index fded8da0..bb2f1820 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { TopicCount } from './topicCount'; - -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; } - diff --git a/webapp/src/app/api/model/topicsListResponse.ts b/webapp/src/app/api/model/topicsListResponse.ts new file mode 100644 index 00000000..058b45fd --- /dev/null +++ b/webapp/src/app/api/model/topicsListResponse.ts @@ -0,0 +1,21 @@ +/** + * 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 { Meta } from './meta'; +import { GroupByResult } from './groupByResult'; +import { Topic } from './topic'; + +/** + * TopicsListResponse + */ +export interface TopicsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; +} diff --git a/webapp/src/app/api/model/universityRanking.ts b/webapp/src/app/api/model/universityRanking.ts new file mode 100644 index 00000000..5c9d0d05 --- /dev/null +++ b/webapp/src/app/api/model/universityRanking.ts @@ -0,0 +1,27 @@ +/** + * 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. + */ + +export interface UniversityRanking { + rank: number; + university: string; + publications: number; + citations: number; + growth_rate: number; + trend: UniversityRanking.TrendEnum; + is_top_mover: boolean; +} +export namespace UniversityRanking { + export const TrendEnum = { + Up: 'up', + Down: 'down', + Stable: 'stable', + } as const; + export type TrendEnum = (typeof TrendEnum)[keyof typeof TrendEnum]; +} diff --git a/webapp/src/app/api/model/universityTopicData.ts b/webapp/src/app/api/model/universityTopicData.ts new file mode 100644 index 00000000..f5436445 --- /dev/null +++ b/webapp/src/app/api/model/universityTopicData.ts @@ -0,0 +1,25 @@ +/** + * 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 { YearlyData } from './yearlyData'; + +export interface UniversityTopicData { + university: string; + topic: UniversityTopicData.TopicEnum; + yearly_data: Array; +} +export namespace UniversityTopicData { + export const TopicEnum = { + ArtificialIntelligence: 'Artificial Intelligence', + QuantumComputing: 'Quantum Computing', + RenewableEnergy: 'Renewable Energy', + Biotechnology: 'Biotechnology', + } as const; + export type TopicEnum = (typeof TopicEnum)[keyof typeof TopicEnum]; +} diff --git a/webapp/src/app/api/model/user.ts b/webapp/src/app/api/model/user.ts new file mode 100644 index 00000000..7e82821c --- /dev/null +++ b/webapp/src/app/api/model/user.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ + +/** + * An entry in the user configuration file. + */ +export interface User { + /** + * The username of the user. + */ + username: string; + /** + * The password of the user. + */ + password: string; + /** + * The email of the user. + */ + email: string; + /** + * The account id of the user. + */ + account: number; + /** + * The organization id of the user. + */ + organization: number; + /** + * The organization name of the user. + */ + organization_name: string; + /** + * Indicates whether the user is a superadmin. + */ + superadmin?: boolean; +} diff --git a/webapp/src/app/api/model/validation-error.ts b/webapp/src/app/api/model/validation-error.ts deleted file mode 100644 index c71e7bfa..00000000 --- a/webapp/src/app/api/model/validation-error.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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 { ValidationErrorLocInner } from './validation-error-loc-inner'; - - -export interface ValidationError { - loc: Array; - msg: string; - type: string; -} - diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validationError.ts new file mode 100644 index 00000000..18cd1b61 --- /dev/null +++ b/webapp/src/app/api/model/validationError.ts @@ -0,0 +1,16 @@ +/** + * 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 { ValidationErrorLocInner } from './validationErrorLocInner'; + +export interface ValidationError { + loc: Array; + msg: string; + type: string; +} diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validationErrorLocInner.ts new file mode 100644 index 00000000..3c1ffa29 --- /dev/null +++ b/webapp/src/app/api/model/validationErrorLocInner.ts @@ -0,0 +1,11 @@ +/** + * 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. + */ + +export interface ValidationErrorLocInner {} diff --git a/webapp/src/app/api/model/value.ts b/webapp/src/app/api/model/value.ts index a9fc79ba..016b21cb 100644 --- a/webapp/src/app/api/model/value.ts +++ b/webapp/src/app/api/model/value.ts @@ -1,14 +1,11 @@ /** * 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. */ - -export interface Value { -} - +export interface Value {} diff --git a/webapp/src/app/api/model/work-page.ts b/webapp/src/app/api/model/work-page.ts deleted file mode 100644 index 8490c3ab..00000000 --- a/webapp/src/app/api/model/work-page.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * 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 { Work } from './work'; - - -export interface WorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; -} - diff --git a/webapp/src/app/api/model/work-topic-information.ts b/webapp/src/app/api/model/work-topic-information.ts deleted file mode 100644 index ca3b9454..00000000 --- a/webapp/src/app/api/model/work-topic-information.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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. - */ - - -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; -} - diff --git a/webapp/src/app/api/model/work-topic.ts b/webapp/src/app/api/model/work-topic.ts deleted file mode 100644 index 87f829f2..00000000 --- a/webapp/src/app/api/model/work-topic.ts +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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 { Score } from './score'; -import { WorkTopicDomain } from './work-topic-domain'; -import { WorkTopicSubfield } from './work-topic-subfield'; -import { WorkTopicField } from './work-topic-field'; - - -/** - * WorkTopic - */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; -} - diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index b84cc7b6..6c6ae99b 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -1,71 +1,69 @@ /** * 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 { DehydratedFunder } from './dehydrated-funder'; +import { DehydratedFunder } from './dehydratedFunder'; import { Authorship } from './authorship'; -import { OpenAccess } from './open-access'; -import { WorkIds } from './work-ids'; -import { WorkSustainableDevelopmentGoalsInner } from './work-sustainable-development-goals-inner'; -import { WorkTopic } from './work-topic'; -import { WorkCountsByYearInner } from './work-counts-by-year-inner'; -import { WorkKeyword } from './work-keyword'; -import { WorkCitationNormalizedPercentile } from './work-citation-normalized-percentile'; +import { OpenAccess } from './openAccess'; +import { WorkIds } from './workIds'; +import { WorkSustainableDevelopmentGoalsInner } from './workSustainableDevelopmentGoalsInner'; +import { WorkTopic } from './workTopic'; +import { WorkCountsByYearInner } from './workCountsByYearInner'; +import { WorkKeyword } from './workKeyword'; +import { WorkCitationNormalizedPercentile } from './workCitationNormalizedPercentile'; import { Award } from './award'; import { Fwci } from './fwci'; -import { WorkMeshInner } from './work-mesh-inner'; -import { WorkCitedByPercentileYear } from './work-cited-by-percentile-year'; -import { WorkHasContent } from './work-has-content'; +import { WorkMeshInner } from './workMeshInner'; +import { WorkCitedByPercentileYear } from './workCitedByPercentileYear'; +import { WorkHasContent } from './workHasContent'; import { Location } from './location'; -import { WorkBiblio } from './work-biblio'; - +import { WorkBiblio } from './workBiblio'; /** * A scholarly document (article, book, dataset, thesis, etc.) */ -export interface Work { - id?: string | null; - doi?: string | null; - title?: string | null; - display_name?: string | null; - publication_year?: number | null; - publication_date?: string | null; - type?: string | null; - language?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - is_paratext?: boolean | null; - primary_location?: Location | null; - locations?: Array | null; - best_oa_location?: Location | null; - open_access?: OpenAccess | null; - authorships?: Array | null; - ids?: WorkIds | null; - biblio?: WorkBiblio | null; - abstract_inverted_index?: object | null; - referenced_works?: Array | null; - referenced_works_count?: number | null; - related_works?: Array | null; - topics?: Array | null; - primary_topic?: WorkTopic | null; - keywords?: Array | null; - funders?: Array | null; - awards?: Array | null; - fwci?: Fwci | null; - citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; - cited_by_percentile_year?: WorkCitedByPercentileYear | null; - counts_by_year?: Array | null; - sustainable_development_goals?: Array | null; - mesh?: Array | null; - indexed_in?: Array | null; - has_content?: WorkHasContent | null; - content_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Work { + id?: string | null; + doi?: string | null; + title?: string | null; + display_name?: string | null; + publication_year?: number | null; + publication_date?: string | null; + type?: string | null; + language?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + is_paratext?: boolean | null; + primary_location?: Location | null; + locations?: Array | null; + best_oa_location?: Location | null; + open_access?: OpenAccess | null; + authorships?: Array | null; + ids?: WorkIds | null; + biblio?: WorkBiblio | null; + abstract_inverted_index?: object | null; + referenced_works?: Array | null; + referenced_works_count?: number | null; + related_works?: Array | null; + topics?: Array | null; + primary_topic?: WorkTopic | null; + keywords?: Array | null; + funders?: Array | null; + awards?: Array | null; + fwci?: Fwci | null; + citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; + cited_by_percentile_year?: WorkCitedByPercentileYear | null; + counts_by_year?: Array | null; + sustainable_development_goals?: Array | null; + mesh?: Array | null; + indexed_in?: Array | null; + has_content?: WorkHasContent | null; + content_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/work-biblio.ts b/webapp/src/app/api/model/workBiblio.ts similarity index 65% rename from webapp/src/app/api/model/work-biblio.ts rename to webapp/src/app/api/model/workBiblio.ts index f6d7079b..65c0a34b 100644 --- a/webapp/src/app/api/model/work-biblio.ts +++ b/webapp/src/app/api/model/workBiblio.ts @@ -1,21 +1,19 @@ /** * 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. */ - /** * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; +export interface WorkBiblio { + volume?: string | null; + issue?: string | null; + first_page?: string | null; + last_page?: string | null; } - diff --git a/webapp/src/app/api/model/work-citation-normalized-percentile.ts b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts similarity index 69% rename from webapp/src/app/api/model/work-citation-normalized-percentile.ts rename to webapp/src/app/api/model/workCitationNormalizedPercentile.ts index a587ddf6..4a2bc6d4 100644 --- a/webapp/src/app/api/model/work-citation-normalized-percentile.ts +++ b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Value } from './value'; - /** * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; +export interface WorkCitationNormalizedPercentile { + value?: Value | null; + is_in_top_1_percent?: boolean | null; + is_in_top_10_percent?: boolean | null; } - diff --git a/webapp/src/app/api/model/work-cited-by-percentile-year.ts b/webapp/src/app/api/model/workCitedByPercentileYear.ts similarity index 75% rename from webapp/src/app/api/model/work-cited-by-percentile-year.ts rename to webapp/src/app/api/model/workCitedByPercentileYear.ts index 5257eb3b..7bcd3c85 100644 --- a/webapp/src/app/api/model/work-cited-by-percentile-year.ts +++ b/webapp/src/app/api/model/workCitedByPercentileYear.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * Percentile rank compared to other works published in the same year. Contains `min` and `max`. */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; +export interface WorkCitedByPercentileYear { + min?: number | null; + max?: number | null; } - diff --git a/webapp/src/app/api/model/work-counts-by-year-inner.ts b/webapp/src/app/api/model/workCountsByYearInner.ts similarity index 68% rename from webapp/src/app/api/model/work-counts-by-year-inner.ts rename to webapp/src/app/api/model/workCountsByYearInner.ts index 76d97d77..496a11db 100644 --- a/webapp/src/app/api/model/work-counts-by-year-inner.ts +++ b/webapp/src/app/api/model/workCountsByYearInner.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * WorkCountsByYearInner */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; +export interface WorkCountsByYearInner { + year?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/work-has-content.ts b/webapp/src/app/api/model/workHasContent.ts similarity index 73% rename from webapp/src/app/api/model/work-has-content.ts rename to webapp/src/app/api/model/workHasContent.ts index 44fbe446..76871238 100644 --- a/webapp/src/app/api/model/work-has-content.ts +++ b/webapp/src/app/api/model/workHasContent.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * Information about downloadable full-text content: */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; +export interface WorkHasContent { + pdf?: boolean | null; + grobid_xml?: boolean | null; } - diff --git a/webapp/src/app/api/model/work-ids.ts b/webapp/src/app/api/model/workIds.ts similarity index 63% rename from webapp/src/app/api/model/work-ids.ts rename to webapp/src/app/api/model/workIds.ts index e8315250..fe562e40 100644 --- a/webapp/src/app/api/model/work-ids.ts +++ b/webapp/src/app/api/model/workIds.ts @@ -1,22 +1,20 @@ /** * 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. */ - /** * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; +export interface WorkIds { + openalex?: string | null; + doi?: string | null; + mag?: number | null; + pmid?: string | null; + pmcid?: string | null; } - diff --git a/webapp/src/app/api/model/work-keyword.ts b/webapp/src/app/api/model/workKeyword.ts similarity index 68% rename from webapp/src/app/api/model/work-keyword.ts rename to webapp/src/app/api/model/workKeyword.ts index c9c99afb..7270db25 100644 --- a/webapp/src/app/api/model/work-keyword.ts +++ b/webapp/src/app/api/model/workKeyword.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkKeyword */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkKeyword { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/work-mesh-inner.ts b/webapp/src/app/api/model/workMeshInner.ts similarity index 51% rename from webapp/src/app/api/model/work-mesh-inner.ts rename to webapp/src/app/api/model/workMeshInner.ts index 40633524..36a0c569 100644 --- a/webapp/src/app/api/model/work-mesh-inner.ts +++ b/webapp/src/app/api/model/workMeshInner.ts @@ -1,22 +1,20 @@ /** * 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. */ - /** * WorkMeshInner */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; +export interface WorkMeshInner { + descriptor_ui?: string | null; + descriptor_name?: string | null; + qualifier_ui?: string | null; + qualifier_name?: string | null; + is_major_topic?: boolean | null; } - diff --git a/webapp/src/app/api/model/workNetworkNode.ts b/webapp/src/app/api/model/workNetworkNode.ts new file mode 100644 index 00000000..445cd8ad --- /dev/null +++ b/webapp/src/app/api/model/workNetworkNode.ts @@ -0,0 +1,29 @@ +/** + * 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 { WorkTopicInformation } from './workTopicInformation'; +import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; + +export interface WorkNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; + publication_year: number | null; + work_topics_information: Set | null; +} +export namespace WorkNetworkNode {} diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts new file mode 100644 index 00000000..285d2065 --- /dev/null +++ b/webapp/src/app/api/model/workPage.ts @@ -0,0 +1,33 @@ +/** + * 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 { Work } from './work'; + +export interface WorkPage { + /** + * Total number of works matching the query + */ + total: number; + /** + * List of works on the current page + */ + elements: Array; + /** + * Offset of the current page + */ + offset: number; + /** + * Size of the current page + */ + size: number; + /** + * Indicates if the current page is the last page + */ + last_page: boolean; +} diff --git a/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts similarity index 66% rename from webapp/src/app/api/model/work-sustainable-development-goals-inner.ts rename to webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts index c9ecd00f..8bc67292 100644 --- a/webapp/src/app/api/model/work-sustainable-development-goals-inner.ts +++ b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkSustainableDevelopmentGoalsInner */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkSustainableDevelopmentGoalsInner { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts new file mode 100644 index 00000000..4b326824 --- /dev/null +++ b/webapp/src/app/api/model/workTopic.ts @@ -0,0 +1,25 @@ +/** + * 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 { Score } from './score'; +import { WorkTopicDomain } from './workTopicDomain'; +import { WorkTopicSubfield } from './workTopicSubfield'; +import { WorkTopicField } from './workTopicField'; + +/** + * WorkTopic + */ +export interface WorkTopic { + id?: string | null; + display_name?: string | null; + score?: Score | null; + subfield?: WorkTopicSubfield | null; + field?: WorkTopicField | null; + domain?: WorkTopicDomain | null; +} diff --git a/webapp/src/app/api/model/work-topic-domain.ts b/webapp/src/app/api/model/workTopicDomain.ts similarity index 72% rename from webapp/src/app/api/model/work-topic-domain.ts rename to webapp/src/app/api/model/workTopicDomain.ts index 1a9879d4..13b227df 100644 --- a/webapp/src/app/api/model/work-topic-domain.ts +++ b/webapp/src/app/api/model/workTopicDomain.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * The parent [domain](/api-reference/domains) */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; +export interface WorkTopicDomain { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/work-topic-field.ts b/webapp/src/app/api/model/workTopicField.ts similarity index 72% rename from webapp/src/app/api/model/work-topic-field.ts rename to webapp/src/app/api/model/workTopicField.ts index 1807cfc1..432b993e 100644 --- a/webapp/src/app/api/model/work-topic-field.ts +++ b/webapp/src/app/api/model/workTopicField.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * The parent [field](/api-reference/fields) */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; +export interface WorkTopicField { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts new file mode 100644 index 00000000..5dbbfc78 --- /dev/null +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; +} diff --git a/webapp/src/app/api/model/work-topic-subfield.ts b/webapp/src/app/api/model/workTopicSubfield.ts similarity index 72% rename from webapp/src/app/api/model/work-topic-subfield.ts rename to webapp/src/app/api/model/workTopicSubfield.ts index b6e7278a..49c1155b 100644 --- a/webapp/src/app/api/model/work-topic-subfield.ts +++ b/webapp/src/app/api/model/workTopicSubfield.ts @@ -1,19 +1,17 @@ /** * 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. */ - /** * The parent [subfield](/api-reference/subfields) */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; +export interface WorkTopicSubfield { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/worksFilterProperties.ts b/webapp/src/app/api/model/worksFilterProperties.ts new file mode 100644 index 00000000..fd25fd26 --- /dev/null +++ b/webapp/src/app/api/model/worksFilterProperties.ts @@ -0,0 +1,32 @@ +/** + * 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. + */ + +export interface WorksFilterProperties { + /** + * The start publication year for the works to include in the collaboration network. + */ + start_year?: number; + /** + * The end publication year for the works to include in the collaboration network. + */ + end_year?: number; + /** + * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. + */ + allowed_topics?: Array; + /** + * The minimum number of contributors required for a work to be included in the collaboration network. + */ + min_contributors?: number; + /** + * The maximum number of contributors allowed for a work to be included in the collaboration network. + */ + max_contributors?: number; +} diff --git a/webapp/src/app/api/model/works-list-response.ts b/webapp/src/app/api/model/worksListResponse.ts similarity index 60% rename from webapp/src/app/api/model/works-list-response.ts rename to webapp/src/app/api/model/worksListResponse.ts index cf03bd2e..bc21a41b 100644 --- a/webapp/src/app/api/model/works-list-response.ts +++ b/webapp/src/app/api/model/worksListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,13 @@ */ import { Meta } from './meta'; import { Work } from './work'; -import { GroupByResult } from './group-by-result'; - +import { GroupByResult } from './groupByResult'; /** * WorksListResponse */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface WorksListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/yearlyData.ts b/webapp/src/app/api/model/yearlyData.ts new file mode 100644 index 00000000..d473f13e --- /dev/null +++ b/webapp/src/app/api/model/yearlyData.ts @@ -0,0 +1,15 @@ +/** + * 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. + */ + +export interface YearlyData { + year: number; + publications: number; + citations: number; +} diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts index 78a2d20a..486c804e 100644 --- a/webapp/src/app/api/param.ts +++ b/webapp/src/app/api/param.ts @@ -8,8 +8,7 @@ export type StandardParamStyle = | 'simple' | 'spaceDelimited' | 'pipeDelimited' - | 'deepObject' - ; + | 'deepObject'; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -25,13 +24,12 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | "integer" - | "number" - | "boolean" - | "string" - | "object" - | "array" - ; + | 'integer' + | 'number' + | 'boolean' + | 'string' + | 'object' + | 'array'; /** * Standard {@link DataType}s plus your own types/classes. @@ -42,16 +40,15 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | "int32" - | "int64" - | "float" - | "double" - | "byte" - | "binary" - | "date" - | "date-time" - | "password" - ; + | 'int32' + | 'int64' + | 'float' + | 'double' + | 'byte' + | 'binary' + | 'date' + | 'date-time' + | 'password'; export type DataFormat = StandardDataFormat | string; @@ -62,7 +59,7 @@ export interface Param { name: string; value: unknown; in: ParamLocation; - style: ParamStyle, + style: ParamStyle; explode: boolean; dataType: DataType; dataFormat: DataFormat | undefined; diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts index 19c762ac..960132f8 100644 --- a/webapp/src/app/api/provide-api.ts +++ b/webapp/src/app/api/provide-api.ts @@ -1,15 +1,17 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; import { Configuration, ConfigurationParameters } from './configuration'; import { BASE_PATH } from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === "string" - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} \ No newline at end of file +export function provideApi( + configOrBasePath: string | ConfigurationParameters, +): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === 'string' + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts index 6fe58549..2277a9cc 100644 --- a/webapp/src/app/api/variables.ts +++ b/webapp/src/app/api/variables.ts @@ -2,8 +2,8 @@ import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} + csv: ',', + tsv: ' ', + ssv: ' ', + pipes: '|', +}; diff --git a/webapp/src/app/app.component.scss b/webapp/src/app/app.component.scss index 7bdb9d42..3dcc3ae0 100644 --- a/webapp/src/app/app.component.scss +++ b/webapp/src/app/app.component.scss @@ -2,34 +2,33 @@ @use '../m3-theme' as m3; mat-toolbar { - background-color: mat.get-theme-color(m3.$light-theme, primary); - @include mat.elevation(6); - z-index: 10; + background-color: mat.get-theme-color(m3.$light-theme, primary); + @include mat.elevation(6); + z-index: 10; } -mat-toolbar button, mat-toolbar span { - color: mat.get-theme-color(m3.$dark-theme, on-background); +mat-toolbar button, +mat-toolbar span { + color: mat.get-theme-color(m3.$dark-theme, on-background); } - - .main-body { - display: flex; - justify-content: center; - align-items: center; - height: 100%; + display: flex; + justify-content: center; + align-items: center; + height: 100%; } .card-container { - margin-top: 20px; - display: flex; + margin-top: 20px; + display: flex; } .card { - width: 300px; - margin-right: 20px; - display: flex; - justify-content: center; - align-items: center; - height: 100%; -} \ No newline at end of file + width: 300px; + margin-right: 20px; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index 07ccef98..0325060b 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -1,16 +1,27 @@ -import { ApplicationConfig, LOCALE_ID } from '@angular/core'; -import { provideRouter } from '@angular/router'; +import { ApplicationConfig, inject, LOCALE_ID } from '@angular/core'; +import { + NavigationError, + provideRouter, + Router, + withComponentInputBinding, + withNavigationErrorHandler, +} from '@angular/router'; import { routes } from './app.routes'; import { provideAnimationsAsync } from '@angular/platform-browser/animations/async'; -import { provideHttpClient, withInterceptors } from '@angular/common/http'; +import { + HttpErrorResponse, + provideHttpClient, + withInterceptors, +} from '@angular/common/http'; import locale from '@angular/common/locales/de'; import { registerLocaleData } from '@angular/common'; import { authenticationInterceptor } from './shared/interceptors/authentication.interceptor'; import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { PaginatorIntl } from './shared/utils/paginatorIntl'; - +import { provideEchartsCore } from 'ngx-echarts'; +import { ErrorService } from './shared/services/error.service'; registerLocaleData(locale); @@ -22,9 +33,47 @@ export const appConfig: ApplicationConfig = { useValue: { appearance: 'outline' }, }, { provide: MatPaginatorIntl, useClass: PaginatorIntl }, - provideRouter(routes), + provideRouter( + routes, + withComponentInputBinding(), + withNavigationErrorHandler((navigationError: NavigationError) => { + const router = inject(Router); + const errorService = inject(ErrorService); + + if ( + router.url.includes('/error') || + router.currentNavigation()?.extractedUrl.toString().includes('/error') + ) { + console.error( + 'Kritischer Fehler beim Laden der Fehlerseite selbst:', + navigationError, + ); + return; + } + + console.error('Fehler beim Navigieren:', navigationError); + + const error = navigationError.error; + let errorMessage: string = 'Unbekannter Fehler'; + if (error instanceof HttpErrorResponse) { + errorMessage = error.error?.message || 'Unbekannter HTTP-Fehler'; + } + + errorService.setError({ + statusCode: error.status || 500, + title: 'Daten-Fehler', + message: 'Die Daten für diese Ansicht konnten nicht geladen werden.', + errorDetails: errorMessage, + }); + + setTimeout(() => { + router.navigate(['/error'], { replaceUrl: true }); + }); + }), + ), provideHttpClient(withInterceptors([authenticationInterceptor])), // provideApi('/inse-service'), provideAnimationsAsync(), + provideEchartsCore({ echarts: () => import('echarts') }), ], }; diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index c8fe99fe..a7d8b279 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -1,8 +1,28 @@ import { Routes } from '@angular/router'; import { userGuard } from './shared/guards/user.guard'; import { collaborationNetworkResolver } from './resolvers/collaboration-network.resolver'; +import { personListResolver } from './resolvers/person-list.resolver'; +import { personBioResolver } from './resolvers/person-bio.resolver'; +import { personResolver } from './resolvers/person.resolver'; +import { institutionResolver } from './resolvers/institution.resolver'; +import { bundProjectPageResolver } from './resolvers/bund-project-page.resolver'; +import { dfgProjectsResolver } from './resolvers/dfg-projects.resolver'; +import { personNewsResolver } from './resolvers/person-news.resolver'; +import { institutionsResolver } from './resolvers/institutions.resolver'; +import { bundProjectsFundingResolver } from './resolvers/bund-projects-funding.resolver'; +import { dfgSingleProjectResolver } from './resolvers/dfg-single-project-resolver'; +import { bundSingleProjectResolver } from './resolvers/bund-single-project-resolver'; +import { cordisEuProjectPageResolver } from './resolvers/cordis-eu-project-page.resolver'; +import { cordisEuProjectsFundingResolver } from './resolvers/cordis-eu-projects-funding.resolver'; +import { fundingProjectPageResolver } from './resolvers/funding-project-page.resolver'; +import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver'; export const routes: Routes = [ + { + path: '', + pathMatch: 'full', + redirectTo: 'dashboard', + }, { path: 'login', loadComponent: () => @@ -10,6 +30,13 @@ export const routes: Routes = [ (mod) => mod.AppLoginComponent, ), }, + { + path: 'register', + loadComponent: () => + import('./modules/app-register/app-register.component').then( + (mod) => mod.AppRegisterComponent, + ), + }, { path: 'dashboard', canActivate: [userGuard], @@ -25,6 +52,83 @@ export const routes: Routes = [ import('./modules/person-list/person-list.component').then( (mod) => mod.PersonListComponent, ), + resolve: { + persons: personListResolver, + }, + runGuardsAndResolvers: (to, from) => { + const keys = [ + 'query', + 'page', + 'pageSize', + 'institutionName', + 'sortBy', + 'sortOrder', + 'yearFilterEnabled', + 'filterMode', + 'filterYear', + ]; + + // scalar params + const scalarChanged = keys.some( + (key) => to.queryParamMap.get(key) !== from.queryParamMap.get(key), + ); + + // multi-value param: topics + const toTopics = to.queryParamMap.getAll('topic'); + const fromTopics = from.queryParamMap.getAll('topic'); + + const topicsChanged = + toTopics.length !== fromTopics.length || + toTopics.some((t, i) => t !== fromTopics[i]); + + return scalarChanged || topicsChanged; + }, + }, + { + path: 'news', + canActivate: [userGuard], + loadComponent: () => + import('./modules/news/news.component').then((mod) => mod.NewsComponent), + }, + { + path: 'news/:id', + canActivate: [userGuard], + loadComponent: () => + import('./modules/news-detail/news-detail.component').then( + (mod) => mod.NewsDetailComponent, + ), + }, + { + path: 'publication/:publicationId', + canActivate: [userGuard], + loadComponent: () => + import('./modules/publication-detail/publication-detail.component').then( + (mod) => mod.PublicationDetailComponent, + ), + }, + { + path: 'projects/dfg/:id', + canActivate: [userGuard], + pathMatch: 'full', + loadComponent: () => + import('./modules/person-projects/dfg-details/dfg-details.component').then( + (mod) => mod.DfgDetailsComponent, + ), + resolve: { + dfgSingleProject: dfgSingleProjectResolver, + }, + }, + { + path: 'projects/bund/:id', + canActivate: [userGuard], + pathMatch: 'full', + loadComponent: () => + import('./modules/person-projects/bund-details/bund-details.component').then( + (mod) => mod.BundDetailsComponent, + ), + resolve: { + bundSingleProject: bundSingleProjectResolver, + }, }, { path: 'person/:id', @@ -33,6 +137,11 @@ export const routes: Routes = [ import('./modules/person/person.component').then( (mod) => mod.PersonComponent, ), + resolve: { + personData: personResolver, + personBio: personBioResolver, + }, + runGuardsAndResolvers: (from, to) => from.params['id'] !== to.params['id'], children: [ { path: '', @@ -47,29 +156,20 @@ export const routes: Routes = [ ), }, { - path: 'network', + path: 'projects', loadComponent: () => - import('./modules/person-network/person-network.component').then( - (mod) => mod.PersonNetworkComponent, + import('./modules/person-projects/person-projects.component').then( + (mod) => mod.PersonProjectsComponent, ), resolve: { - collaborationNetwork: collaborationNetworkResolver, + dfgProjectPage: dfgProjectsResolver, + personCordisEuProjectPage: personCordisEuProjectPageResolver, }, - runGuardsAndResolvers: (to, from) => { - // No need to re-run for different table view or search term - const keys = [ - 'start_year', - 'end_year', - 'minimum_collaborators', - 'maximum_collaborators', - 'minimum_collaborations', - 'maximum_collaborations', - 'institutions', - 'topics', - ]; + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction', 'search']; return keys.some( - (key) => to.queryParamMap.get(key) !== from.queryParamMap.get(key), + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), ); }, }, @@ -80,6 +180,74 @@ export const routes: Routes = [ (mod) => mod.PersonPublicationsComponent, ), }, + { + path: 'network', + loadComponent: () => + import('./modules/person-network/person-network.component').then( + (mod) => mod.PersonNetworkComponent, + ), + resolve: { + collaborationNetwork: collaborationNetworkResolver, + }, + runGuardsAndResolvers: (from, to) => { + const network = from.data['collaborationNetwork'] as + | { + filter_information?: { + min_possible_year?: number; + max_possible_year?: number; + }; + } + | undefined; + + const filterInformation = network?.filter_information; + + const defaultQueryParams: Record = { + filter_by: 'works', + start_year: filterInformation?.min_possible_year + ? String(filterInformation.min_possible_year) + : '', + end_year: filterInformation?.max_possible_year + ? String(filterInformation.max_possible_year) + : '', + min_contributors: '2', + max_contributors: '10', + min_collaborations: '1', + max_collaborations: '100', + institutions: '', + topics: '', + }; + + const keys = [ + 'filter_by', + 'start_year', + 'end_year', + 'min_contributors', + 'max_contributors', + 'min_collaborations', + 'max_collaborations', + 'institutions', + 'topics', + ]; + + return keys.some((key) => { + const fromRawValue = from.queryParamMap.get(key); + const toRawValue = to.queryParamMap.get(key); + + const fromValue = + fromRawValue === null || fromRawValue === '' + ? defaultQueryParams[key] + : fromRawValue; + + const toValue = + toRawValue === null || toRawValue === '' + ? defaultQueryParams[key] + : toRawValue; + + return fromValue !== toValue; + }); + }, + }, + { path: 'funding', loadComponent: () => @@ -87,10 +255,154 @@ export const routes: Routes = [ (mod) => mod.PersonFundingComponent, ), }, + { + path: 'news', + loadComponent: () => + import('./modules/person-news/person-news.component').then( + (mod) => mod.PersonNewsComponent, + ), + resolve: { + newsPage: personNewsResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'pageSize', 'sortOrder', 'query']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + { + path: 'patents', + loadComponent: () => + import('./modules/person-patents/person-patents.component').then( + (mod) => mod.PersonPatentsComponent, + ), + }, + { + path: 'company-connections', + loadComponent: () => + import('./modules/person-company-connections/person-company-connections.component').then( + (mod) => mod.PersonCompanyConnectionsComponent, + ), + }, ], }, + { + path: 'institutions', + canActivate: [userGuard], + loadComponent: () => + import('./modules/institutions/institutions.component').then( + (mod) => mod.InstitutionsComponent, + ), + resolve: { + institutionPage: institutionsResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['search', 'page', 'size', 'sort_by', 'sorting_order']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + { + path: 'institution/:institutionId', + canActivate: [userGuard], + loadComponent: () => + import('./modules/institution/institution.component').then( + (mod) => mod.InstitutionComponent, + ), + resolve: { + institution: institutionResolver, + }, + children: [ + { + path: '', + pathMatch: 'full', + redirectTo: 'overview', + }, + { + path: 'overview', + loadComponent: () => + import('./modules/institution-overview/institution-overview.component').then( + (mod) => mod.InstitutionOverviewComponent, + ), + }, + { + path: 'publications', + loadComponent: () => + import('./modules/institution-publications/institution-publications.component').then( + (mod) => mod.InstitutionPublicationsComponent, + ), + }, + { + path: 'projects', + loadComponent: () => { + return import('./modules/institution-projects/institution-projects.component').then( + (mod) => mod.InstitutionProjectsComponent, + ); + }, + resolve: { + bundProjectPage: bundProjectPageResolver, + bundProjectsFunding: bundProjectsFundingResolver, + cordisEuProjectPage: cordisEuProjectPageResolver, + cordisEuProjectsFunding: cordisEuProjectsFundingResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction', 'search']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + ], + }, + { + path: 'projects', + canActivate: [userGuard], + loadComponent: () => + import('./modules/projects/projects.component').then( + (mod) => mod.ProjectsComponent, + ), + resolve: { + fundingProjectPage: fundingProjectPageResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = [ + 'search', + 'page', + 'size', + 'selected_project_types', + 'sort_by', + 'sorting_order', + ]; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + { + path: 'error', + loadComponent: () => + import('./modules/error-page/error-page.component').then( + (mod) => mod.ErrorPageComponent, + ), + }, { path: '**', - redirectTo: 'login', + loadComponent: () => + import('./modules/error-page/error-page.component').then( + (mod) => mod.ErrorPageComponent, + ), + data: { + routeStatusCode: 404, + routeTitle: 'Seite nicht gefunden', + routeMessage: + 'Die gesuchte Seite existiert leider nicht oder wurde verschoben.', + }, + canActivate: [userGuard], }, ]; diff --git a/webapp/src/app/custom-directives/sk-text.directive.ts b/webapp/src/app/custom-directives/sk-text.directive.ts new file mode 100644 index 00000000..ade9c10b --- /dev/null +++ b/webapp/src/app/custom-directives/sk-text.directive.ts @@ -0,0 +1,63 @@ +import { + Directive, + OnChanges, + Input, + ElementRef, + Renderer2, +} from '@angular/core'; +import { SimpleChanges } from '@angular/core'; +@Directive({ selector: '[skText]', standalone: true }) +export class SkTextDirective implements OnChanges { + @Input() skText = false; + + private originalText = ''; + private originalColor = ''; + + constructor( + private el: ElementRef, + private renderer: Renderer2, + ) {} + + ngOnChanges(changes: SimpleChanges) { + const change = changes['skText']; + + // skip if value didn't actually change, or is undefined + if (!change) return; + + this.skText ? this.showSkeleton() : this.hideSkeleton(); + } + + private showSkeleton() { + const el: HTMLElement = this.el.nativeElement; + this.originalText = el.textContent ?? ''; + this.originalColor = el.style.color; + + // measure natural width before blanking text + const width = Math.min(Math.max(this.originalText.length * 7.5, 48), 60); + const height = 20; + this.renderer.setStyle(el, 'color', 'transparent'); + this.renderer.setStyle( + el, + 'background', + 'linear-gradient(90deg, #e2e8f0 25%, #f8fafc 50%, #e2e8f0 75%)', + ); + this.renderer.setStyle(el, 'background-size', '600px 100%'); + this.renderer.setStyle(el, 'animation', 'sk-shimmer 1.6s infinite linear'); + this.renderer.setStyle(el, 'border-radius', '4px'); + this.renderer.setStyle(el, 'min-width', `${width}px`); + this.renderer.setStyle(el, 'max-height', `${height}px`); + this.renderer.setStyle(el, 'display', 'inline-block'); + } + + private hideSkeleton() { + const el: HTMLElement = this.el.nativeElement; + this.renderer.removeStyle(el, 'color'); + this.renderer.removeStyle(el, 'background'); + this.renderer.removeStyle(el, 'background-size'); + this.renderer.removeStyle(el, 'animation'); + this.renderer.removeStyle(el, 'border-radius'); + this.renderer.removeStyle(el, 'min-width'); + this.renderer.removeStyle(el, 'max-height'); + this.renderer.removeStyle(el, 'display'); + } +} diff --git a/webapp/src/app/directives/debounce.directive.ts b/webapp/src/app/directives/debounce.directive.ts new file mode 100644 index 00000000..46da5300 --- /dev/null +++ b/webapp/src/app/directives/debounce.directive.ts @@ -0,0 +1,48 @@ +import { + Directive, + effect, + ElementRef, + inject, + input, + model, + numberAttribute, +} from '@angular/core'; + +@Directive({ + selector: 'input[debounceTime]', + standalone: true, + host: { + '(input)': 'handleInput($event)', + }, +}) +export class DebounceDirective { + private readonly el = inject(ElementRef); + #debounceTimer?: ReturnType; + + readonly debounceTime = input(0, { transform: numberAttribute }); + readonly debouncedValue = model(''); + + constructor() { + effect(() => { + const outerValue = this.debouncedValue(); + if (this.el.nativeElement.value !== outerValue) { + this.el.nativeElement.value = outerValue; + } + }); + } + + handleInput(event: Event): void { + const value = (event.target as HTMLInputElement).value; + + clearTimeout(this.#debounceTimer); + + if (!value || !this.debounceTime()) { + this.debouncedValue.set(value); + return; + } + + this.#debounceTimer = setTimeout(() => { + this.debouncedValue.set(value); + }, this.debounceTime()); + } +} diff --git a/webapp/src/app/modules/app-login/app-login.component.html b/webapp/src/app/modules/app-login/app-login.component.html index 23df2770..e7cb87a6 100644 --- a/webapp/src/app/modules/app-login/app-login.component.html +++ b/webapp/src/app/modules/app-login/app-login.component.html @@ -1,46 +1,68 @@
- -
- -

Anmeldung

-

Um auf den Dienst zuzugreifen, musst Du Deine Anmeldedaten eingeben.

- - - Login - - @if (loginForm.controls.login.hasError('required')) { - Fehler: Login erforderlich. - } @else if (loginForm.controls.login.hasError('minlength')) { - Fehler: Login ist unvollständig. - } - - - - Passwort - - @if (showPassword) { - visibility - } @else { - visibility_off - } - @if (loginForm.controls.password.hasError('required')) { - Fehler: Passwort erforderlich. - } @else if (loginForm.controls.password.hasError('minlength')) { - Fehler: Passwort ist unvollständig. - } - - -
-

- @if (credentialService.validating | async) { - Anmeldung läuft, bitte warte einen Moment. - } - @else { - @if ((credentialService.authenticated | async) && !(credentialService.superadmin | async) && !(credentialService.universityadmin | async)) { - Fehler: {{ credentialService.login.value }} ist nicht berechtigt. - } - } +

+

Anmeldung

+

+ Um auf den Dienst zuzugreifen, musst Du Deine Anmeldedaten eingeben.

-
\ No newline at end of file + + + Login + + @if (loginForm.controls.login.hasError('required')) { + Fehler: Login erforderlich. + } @else if (loginForm.controls.login.hasError('minlength')) { + Fehler: Login ist unvollständig. + } + + + + Passwort + + @if (showPassword) { + visibility + } @else { + visibility_off + } + @if (loginForm.controls.password.hasError('required')) { + Fehler: Passwort erforderlich. + } @else if (loginForm.controls.password.hasError('minlength')) { + Fehler: Passwort ist unvollständig. + } + + + +
+ +
+ +

+ @if (credentialService.validating | async) { + Anmeldung läuft, bitte warte einen Moment. + } @else { + @if ( + (credentialService.authenticated | async) && + !(credentialService.superadmin | async) && + !(credentialService.universityadmin | async) + ) { + Fehler: {{ credentialService.login.value }} ist nicht + berechtigt. + } + } +

+ diff --git a/webapp/src/app/modules/app-login/app-login.component.scss b/webapp/src/app/modules/app-login/app-login.component.scss index f280c52c..034b92ac 100644 --- a/webapp/src/app/modules/app-login/app-login.component.scss +++ b/webapp/src/app/modules/app-login/app-login.component.scss @@ -1,52 +1,54 @@ .container { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; - height: 100%; - background: linear-gradient(160deg, #f4f6fb 0%, #e8ecf7 100%); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + background: linear-gradient(160deg, #f4f6fb 0%, #e8ecf7 100%); } .form { - display: flex; - flex-direction: column; - align-items: center; - background: white; - border: none; - border-radius: 12px; - box-shadow: 0 2px 12px rgba(26, 58, 110, 0.10), 0 1px 4px rgba(0,0,0,0.06); - gap: 20px; - padding: 36px 32px 28px; + display: flex; + flex-direction: column; + align-items: center; + background: white; + border: none; + border-radius: 12px; + box-shadow: + 0 2px 12px rgba(26, 58, 110, 0.1), + 0 1px 4px rgba(0, 0, 0, 0.06); + gap: 20px; + padding: 36px 32px 28px; } .form h3 { - margin: 0 0 4px; - font-weight: 600; - color: #1a3a6e; + margin: 0 0 4px; + font-weight: 600; + color: #1a3a6e; } .button { - min-height: 48px; - min-width: 140px; - border-radius: 8px; - font-weight: 500; - letter-spacing: 0.02em; + min-height: 48px; + min-width: 140px; + border-radius: 8px; + font-weight: 500; + letter-spacing: 0.02em; } .field { - width: 300px; + width: 400px; } .progress { - padding-top: 5px; - width: 300px; - height: 2em; - text-align: center; - font-size: small; - color: #585f71; + padding-top: 5px; + width: 300px; + height: 2em; + text-align: center; + font-size: small; + color: #585f71; } .error { - color: #ba1a1a; + color: #ba1a1a; } diff --git a/webapp/src/app/modules/app-login/app-login.component.ts b/webapp/src/app/modules/app-login/app-login.component.ts index 0f0bc76f..24fd129f 100644 --- a/webapp/src/app/modules/app-login/app-login.component.ts +++ b/webapp/src/app/modules/app-login/app-login.component.ts @@ -1,5 +1,10 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { + FormControl, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -8,40 +13,60 @@ import { MatIconModule } from '@angular/material/icon'; import { CommonModule } from '@angular/common'; import { Subscription } from 'rxjs'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; -import { Router } from '@angular/router'; +import { Router, RouterLink } from '@angular/router'; @Component({ - selector: 'app-app-login', - imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule, MatSnackBarModule], - templateUrl: './app-login.component.html', - styleUrl: './app-login.component.scss', - standalone: true, + selector: 'app-app-login', + imports: [ + CommonModule, + ReactiveFormsModule, + MatFormFieldModule, + MatInputModule, + MatButtonModule, + MatIconModule, + MatSnackBarModule, + RouterLink, + ], + templateUrl: './app-login.component.html', + styleUrl: './app-login.component.scss', + standalone: true, }) export class AppLoginComponent implements OnInit, OnDestroy { - loginForm = new FormGroup({ - login: new FormControl('', [ Validators.required, Validators.minLength(4) ]), - password: new FormControl('', [ Validators.required, Validators.minLength(4) ]) + login: new FormControl('', [ + Validators.required, + Validators.minLength(4), + ]), + password: new FormControl('', [ + Validators.required, + Validators.minLength(4), + ]), }); showPassword = false; subscription?: Subscription; - - constructor(protected credentialService: CredentialService, protected router: Router, protected snackBar: MatSnackBar) { } + + constructor( + protected credentialService: CredentialService, + protected router: Router, + protected snackBar: MatSnackBar, + ) {} ngOnInit(): void { - this.subscription = this.credentialService.validating.subscribe((validating) => { - if (validating) { - this.loginForm.disable(); - } else { - this.loginForm.enable(); - this.checkEnter(); - } - }); - if (!this.credentialService.validating) { - this.checkEnter(); - } + this.subscription = this.credentialService.validating.subscribe( + (validating) => { + if (validating) { + this.loginForm.disable(); + } else { + this.loginForm.enable(); + this.checkEnter(); + } + }, + ); + if (!this.credentialService.validating) { + this.checkEnter(); + } } checkEnter(): void { @@ -51,10 +76,10 @@ export class AppLoginComponent implements OnInit, OnDestroy { } ngOnDestroy(): void { - if (this.subscription) { - this.subscription.unsubscribe(); - this.subscription = undefined; - } + if (this.subscription) { + this.subscription.unsubscribe(); + this.subscription = undefined; + } } login() { @@ -64,5 +89,4 @@ export class AppLoginComponent implements OnInit, OnDestroy { this.credentialService.loginAccount(user, pass); } } - } diff --git a/webapp/src/app/modules/app-register/app-register.component.html b/webapp/src/app/modules/app-register/app-register.component.html new file mode 100644 index 00000000..e6349bc5 --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.html @@ -0,0 +1,102 @@ +
+
+

Konto erstellen

+

Bitte gib Deine Daten ein, um Dich zu registrieren.

+ + + Benutzername + + @if (registerForm.controls['username'].hasError('required')) { + Fehler: Benutzername erforderlich. + } @else if (registerForm.controls['username'].hasError('minlength')) { + Fehler: Benutzername ist unvollständig. + } + + + + E-Mail + + @if (registerForm.controls['email'].hasError('required')) { + Fehler: E-Mail erforderlich. + } @else if (registerForm.controls['email'].hasError('email')) { + Fehler: Ungültige E-Mail Adresse. + } + + + + Passwort + + @if (showPassword) { + visibility + } @else { + visibility_off + } + @if (registerForm.controls['password'].hasError('required')) { + Fehler: Passwort erforderlich. + } @else if (registerForm.controls['password'].hasError('minlength')) { + Fehler: Passwort ist unvollständig. + } + + + + Institution + + apartment + + @if (registerForm.controls['institution'].hasError('required')) { + Fehler: Institution erforderlich. + } + + @for (institution of institutionOptions(); track institution.id) { + +
+ {{ institution.display_name }} +
+ @if (institution.hint) { + {{ institution.hint }} + } +
+ } +
+
+ +
+ Superadmin Rechte +
+ + + +
+ +
+
+

+ +

+
diff --git a/webapp/src/app/modules/app-register/app-register.component.scss b/webapp/src/app/modules/app-register/app-register.component.scss new file mode 100644 index 00000000..d1585259 --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.scss @@ -0,0 +1,56 @@ +.container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + background: linear-gradient(160deg, #f4f6fb, #e8ecf7); +} + +.form { + display: flex; + flex-direction: column; + align-items: center; + background: #fff; + border: none; + border-radius: 12px; + box-shadow: + 0 2px 12px #1a3a6e1a, + 0 1px 4px #0000000f; + gap: 20px; + padding: 36px 32px 28px; + + h3 { + margin: 0 0 4px; + font-weight: 600; + color: #1a3a6e; + } +} + +.button { + min-height: 48px; + min-width: 140px; + border-radius: 8px; + font-weight: 500; + letter-spacing: 0.02em; +} + +.field { + width: 400px; +} + +.checkbox-container { + display: flex; + align-items: center; + justify-content: flex-start; +} + +.progress { + padding-top: 5px; + width: 300px; + height: 2em; + text-align: center; + font-size: small; + color: #585f71; +} diff --git a/webapp/src/app/modules/app-register/app-register.component.ts b/webapp/src/app/modules/app-register/app-register.component.ts new file mode 100644 index 00000000..42d53887 --- /dev/null +++ b/webapp/src/app/modules/app-register/app-register.component.ts @@ -0,0 +1,173 @@ +import { + Component, + inject, + OnDestroy, + signal, + DestroyRef, + OnInit, +} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { Router, RouterLink } from '@angular/router'; +import { + FormBuilder, + FormGroup, + ReactiveFormsModule, + Validators, +} from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatIconModule } from '@angular/material/icon'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { CredentialService } from '../../shared/services/credential.service'; +import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; +import { + Subscription, + map, + switchMap, + debounceTime, + distinctUntilChanged, + catchError, + of, +} from 'rxjs'; +import { + MatAutocompleteModule, + MatAutocompleteSelectedEvent, +} from '@angular/material/autocomplete'; +import { InstitutionsService } from '../../api'; +@Component({ + selector: 'app-register', + standalone: true, + imports: [ + CommonModule, + ReactiveFormsModule, + MatButtonModule, + MatFormFieldModule, + MatInputModule, + MatIconModule, + MatCheckboxModule, + RouterLink, + MatSnackBarModule, + MatAutocompleteModule, + ], + templateUrl: './app-register.component.html', + styleUrl: './app-register.component.scss', +}) +export class AppRegisterComponent implements OnDestroy, OnInit { + private readonly fb = inject(FormBuilder); + protected readonly credentialService = inject(CredentialService); + private readonly router = inject(Router); + private readonly snackBar = inject(MatSnackBar); + private readonly destroyRef = inject(DestroyRef); + private subscription?: Subscription; + private institutionsService = inject(InstitutionsService); + registerForm: FormGroup = this.fb.group({ + username: ['', [Validators.required, Validators.minLength(4)]], + email: ['', [Validators.required, Validators.email]], + password: ['', [Validators.required, Validators.minLength(8)]], + institution: ['', [Validators.required]], + superadmin: [false], + }); + readonly institutionOptions = signal([]); + showPassword = false; + + constructor() { + this.setupInstitutionAutocomplete(); + } + ngOnInit(): void { + this.subscription = this.credentialService.validating.subscribe( + (validating) => { + if (validating) { + this.registerForm.disable(); + } else { + this.registerForm.enable(); + this.checkEnter(); + } + }, + ); + if (!this.credentialService.validating) { + this.checkEnter(); + } + } + ngOnDestroy(): void { + this.subscription?.unsubscribe(); + } + + checkEnter(): void { + if (this.credentialService.authenticated.value) { + this.router.navigate(['/dashboard']); + } + } + submit() { + if (this.registerForm.valid) { + this.credentialService.validating.next(true); + this.registerForm.disable(); + + this.subscription = this.credentialService + .registerAccount(this.registerForm.value) + .subscribe({ + next: () => { + this.credentialService.validating.next(false); + this.snackBar.open( + 'Konto erfolgreich erstellt! Du kannst Dich jetzt anmelden.', + 'OK', + { duration: 5000 }, + ); + this.router.navigate(['/login']); + }, + error: (err) => { + this.credentialService.validating.next(false); + this.registerForm.enable(); + const message = + err.error?.message || + 'Fehler bei der Registrierung. Bitte versuche es später erneut.'; + this.snackBar.open(message, 'Schließen', { + panelClass: ['error-snackbar'], + duration: 5000, + }); + }, + }); + } + } + + private setupInstitutionAutocomplete(): void { + this.registerForm.controls['institution'].valueChanges + .pipe( + debounceTime(250), + map((value) => (typeof value === 'string' ? value.trim() : '')), + distinctUntilChanged(), + switchMap((query) => { + if (query.length < 2) { + this.institutionOptions.set([]); + return of([]); + } + + return this.searchInstitutions(query).pipe( + catchError((ev) => { + console.log(ev); + return of([]); + }), + ); + }), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((options) => { + this.institutionOptions.set(options); + }); + } + + private searchInstitutions(query: string) { + return this.institutionsService + .autocompleteInstitutions(query, undefined, undefined, 10) + .pipe(map((response) => response.results ?? [])); + } + + onInstitutionSelected(event: MatAutocompleteSelectedEvent): void { + const val = event.option.value; + this.registerForm.controls['institution'].setValue(val, { + emitEvent: false, + }); + this.institutionOptions.set([]); + } +} diff --git a/webapp/src/app/modules/dashboard/dashboard.component.html b/webapp/src/app/modules/dashboard/dashboard.component.html index 8b137891..fbd76a45 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.html +++ b/webapp/src/app/modules/dashboard/dashboard.component.html @@ -1 +1,39 @@ +
+
+

University Performance Dashboard

+
+ +
+ + +
+
+
+ +
+
+ +
+ + +
+
diff --git a/webapp/src/app/modules/dashboard/dashboard.component.scss b/webapp/src/app/modules/dashboard/dashboard.component.scss index 8b137891..f9b4f56b 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.scss +++ b/webapp/src/app/modules/dashboard/dashboard.component.scss @@ -1 +1,95 @@ +// src/app/modules/university-ranking/dashboard.component.scss +.dashboard-wrapper { + padding: 2rem; + font-family: 'Inter', sans-serif; + color: #333; + .dashboard-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 2rem; + border-bottom: 1px solid #eee; + padding-bottom: 1rem; + } + + .content-grid { + display: grid; + grid-template-columns: 2fr 1fr; + gap: 2rem; + + @media (max-width: 1024px) { + grid-template-columns: 1fr; + } + } + + .controls { + display: flex; + gap: 1rem; + + select { + padding: 0.5rem; + border-radius: 4px; + border: 1px solid #ccc; + } + + .toggle-group { + button { + padding: 0.5rem 1rem; + border: 1px solid #0056b3; + background: white; + color: #0056b3; + cursor: pointer; + &:first-child { + border-radius: 4px 0 0 4px; + } + &:last-child { + border-radius: 0 4px 4px 0; + } + &.active { + background: #0056b3; + color: white; + } + } + } + } +} + +// Table styling +.ranking-table { + width: 100%; + border-collapse: collapse; + font-size: 0.9rem; + + th, + td { + padding: 0.75rem; + text-align: left; + border-bottom: 1px solid #f0f0f0; + } + + .top-tier { + background-color: #f8fbff; + font-weight: 600; + } + .positive { + color: #28a745; + } + .negative { + color: #dc3545; + } + .mover-badge { + margin-left: 4px; + font-size: 0.8rem; + } + + .trend-col { + font-weight: bold; + &[data-trend='up'] { + color: #28a745; + } + &[data-trend='down'] { + color: #dc3545; + } + } +} diff --git a/webapp/src/app/modules/dashboard/dashboard.component.ts b/webapp/src/app/modules/dashboard/dashboard.component.ts index 7d31c1db..ef967b09 100644 --- a/webapp/src/app/modules/dashboard/dashboard.component.ts +++ b/webapp/src/app/modules/dashboard/dashboard.component.ts @@ -1,10 +1,62 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { UniversityRankingService } from '../university-ranking/services/uni-ranking-service'; +import { UniversityLineChartComponent } from '../university-ranking/uni-line-chart/uni-line-chart.component'; +import { UniversityRankingTableComponent } from '../university-ranking/uni-ranking-table/uni-ranking-table.component'; +import { UniversityTopicData, UniversityRanking } from '../../api'; +export type ResearchTopic = + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology'; +export type DashboardMetric = 'publications' | 'citations'; @Component({ - selector: 'app-dashboard', - imports: [], + selector: 'dashboard', + imports: [UniversityLineChartComponent, UniversityRankingTableComponent], templateUrl: './dashboard.component.html', styleUrl: './dashboard.component.scss', - standalone: true, }) -export class DashboardComponent {} +export class DashboardComponent implements OnInit { + topics: ResearchTopic[] = [ + 'Artificial Intelligence', + 'Quantum Computing', + 'Renewable Energy', + 'Biotechnology', + ]; + selectedTopic: ResearchTopic = 'Artificial Intelligence'; + metric: DashboardMetric = 'publications'; + + rawDataSource: UniversityTopicData[] = []; + computedRankings: UniversityRanking[] = []; + isLoading = false; + + constructor(private dataService: UniversityRankingService) {} + + ngOnInit() { + this.loadData(); + } + + onTopicChange(topic: ResearchTopic) { + this.selectedTopic = topic; + this.loadData(); // Re-fetch as rankings depend on the topic + } + + setMetric(metric: DashboardMetric) { + this.metric = metric; + this.loadData(); // Re-fetch as ranking order changes based on metric + } + + private loadData() { + this.isLoading = true; + this.dataService + .getRankingData(this.selectedTopic, this.metric) + .subscribe((response) => { + // Map backend snake_case properties to frontend camelCase if necessary, + // though OpenAPI Generator usually handles this. + console.log(response); + this.rawDataSource = (response.timeseries as any) || []; + this.computedRankings = (response.rankings as any) || []; + this.isLoading = false; + }); + } +} diff --git a/webapp/src/app/modules/error-page/error-page.component.html b/webapp/src/app/modules/error-page/error-page.component.html new file mode 100644 index 00000000..126ea4fb --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.html @@ -0,0 +1,37 @@ +
+ + +
+ warning +
+ + Fehler {{ statusCode() }} +

{{ title() }}

+

{{ message() }}

+ + + + @if (errorDetails()) { + + + + ERWEITERTE DIAGNOSE + + + +
{{ errorDetails() }}
+
+ } +
+
+
diff --git a/webapp/src/app/modules/error-page/error-page.component.scss b/webapp/src/app/modules/error-page/error-page.component.scss new file mode 100644 index 00000000..b7c2bee1 --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.scss @@ -0,0 +1,87 @@ +.error-container { + min-height: 90vh; + background-color: none !important; + display: flex; + align-items: center; + justify-content: center; + padding: 1.5rem; + box-sizing: border-box; +} + +.error-card { + max-width: 450px; + width: 100%; + box-shadow: + 0 4px 6px -1px rgb(0 0 0 / 0.05), + 0 2px 4px -2px rgb(0 0 0 / 0.05) !important; +} + +.error-content { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} + +.error-icon { + height: 36px !important; + width: 36px !important; + font-size: 36px !important; +} + +.status-code { + font-size: 0.75rem; + font-weight: 600; + letter-spacing: 0.05em; + color: #94a3b8; + text-transform: uppercase; +} + +.error-title { + margin: 0.5rem 0 1rem 0; + font-size: 1.75rem; + font-weight: 700; + color: #1e293b; + letter-spacing: -0.025em; + line-height: 1.2; +} + +.error-message { + margin: 0 0 2rem 0; + font-size: 1rem; + color: #475569; + line-height: 1.6; +} + +.back-button { + margin-bottom: 1rem; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.diagnostics-panel { + width: 100%; + background: transparent !important; +} + +.diagnostics-title { + font-size: 0.75rem !important; + font-weight: 600; + color: #94a3b8; + letter-spacing: 0.05em; +} + +.diagnostics-code { + margin-top: 0.5rem; + padding: 1rem; + background-color: #0f172a; + border-radius: 8px; + font-size: 0.75rem; + color: #34d399; + overflow-x: auto; + font-family: monospace; + text-align: left; + white-space: pre-wrap; + max-height: 160px; +} diff --git a/webapp/src/app/modules/error-page/error-page.component.ts b/webapp/src/app/modules/error-page/error-page.component.ts new file mode 100644 index 00000000..26acf5ee --- /dev/null +++ b/webapp/src/app/modules/error-page/error-page.component.ts @@ -0,0 +1,58 @@ +import { Location } from '@angular/common'; +import { Component, input, OnInit, signal, inject } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatExpansionModule } from '@angular/material/expansion'; +import { MatIconModule } from '@angular/material/icon'; +import { ErrorService } from '../../shared/services/error.service'; + +@Component({ + selector: 'app-error-page', + standalone: true, + imports: [MatButtonModule, MatCardModule, MatIconModule, MatExpansionModule], + templateUrl: './error-page.component.html', + styleUrl: './error-page.component.scss', +}) +export class ErrorPageComponent implements OnInit { + routeStatusCode = input(500); + routeTitle = input('Da ist was schiefgelaufen'); + routeMessage = input( + 'Ein unerwarteter Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.', + ); + routeErrorDetails = input(undefined); + + statusCode = signal(500); + title = signal(''); + message = signal(''); + errorDetails = signal(undefined); + + isDetailsOpen = signal(false); + + private readonly location = inject(Location); + private readonly errorService = inject(ErrorService); + + ngOnInit() { + const savedError = this.errorService.getError(); + + if (savedError) { + this.statusCode.set(savedError.statusCode); + this.title.set(savedError.title); + this.message.set(savedError.message); + this.errorDetails.set(savedError.errorDetails); + this.errorService.clearError(); // Speicher aufräumen + } else { + this.statusCode.set(this.routeStatusCode()); + this.title.set(this.routeTitle()); + this.message.set(this.routeMessage()); + this.errorDetails.set(this.routeErrorDetails()); + } + } + + toggleDetails() { + this.isDetailsOpen.update((isOpen) => !isOpen); + } + + goBack() { + this.location.back(); + } +} diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.html b/webapp/src/app/modules/institution-overview/institution-overview.component.html new file mode 100644 index 00000000..486e08e8 --- /dev/null +++ b/webapp/src/app/modules/institution-overview/institution-overview.component.html @@ -0,0 +1 @@ +

institution-overview works!

diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.scss b/webapp/src/app/modules/institution-overview/institution-overview.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts b/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts new file mode 100644 index 00000000..2926265e --- /dev/null +++ b/webapp/src/app/modules/institution-overview/institution-overview.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InstitutionOverviewComponent } from './institution-overview.component'; + +describe('InstitutionOverviewComponent', () => { + let component: InstitutionOverviewComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [InstitutionOverviewComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(InstitutionOverviewComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webapp/src/app/modules/institution-overview/institution-overview.component.ts b/webapp/src/app/modules/institution-overview/institution-overview.component.ts new file mode 100644 index 00000000..13b18fa4 --- /dev/null +++ b/webapp/src/app/modules/institution-overview/institution-overview.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-institution-overview', + imports: [], + templateUrl: './institution-overview.component.html', + styleUrl: './institution-overview.component.scss', +}) +export class InstitutionOverviewComponent {} diff --git a/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.html b/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.html new file mode 100644 index 00000000..d96211ba --- /dev/null +++ b/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.html @@ -0,0 +1 @@ +
diff --git a/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.scss b/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.ts b/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.ts new file mode 100644 index 00000000..8a2e1f21 --- /dev/null +++ b/webapp/src/app/modules/institution-projects-funding-graph/institution-projects-funding-graph.component.ts @@ -0,0 +1,153 @@ +import { Component, effect, input } from '@angular/core'; + +import * as echarts from 'echarts/core'; +import { EChartsOption } from 'echarts'; + +import { GridComponent, LegendComponent } from 'echarts/components'; +import { CanvasRenderer } from 'echarts/renderers'; +import { NgxEchartsDirective } from 'ngx-echarts'; +import { InstitutionFunderSummary } from '../../api'; + +echarts.use([GridComponent, CanvasRenderer, LegendComponent]); + +type FunderData = { + funderName: string; + fundingMap: Record; +}; + +@Component({ + selector: 'app-institution-projects-funding-graph', + imports: [NgxEchartsDirective], + templateUrl: './institution-projects-funding-graph.component.html', + styleUrl: './institution-projects-funding-graph.component.scss', +}) +export class InstitutionProjectsFundingGraphComponent { + options!: EChartsOption; + + fundings = input.required(); + + constructor() { + effect(() => { + const fundings = this.fundings(); + this.generateChartOptions(fundings); + }); + } + + generateChartOptions(fundings: InstitutionFunderSummary[]): void { + const floorToTwoDecimals = (value: number): string => { + const floored = Math.floor(value * 100) / 100; + return floored.toLocaleString(undefined, { + style: 'currency', + currency: 'EUR', + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }); + }; + + const yearsSet = new Set(); + + fundings.forEach((series) => { + if (series.funding_per_year) { + Object.keys(series.funding_per_year).forEach((year) => + yearsSet.add(year), + ); + } + }); + + const xAxisYears = Array.from(yearsSet).sort( + (a, b) => Number(a) - Number(b), + ); + + const currentYearStr = new Date().getFullYear().toString(); + + const chartSeries = fundings.map((series, index) => { + const fundingMap = (series.funding_per_year || {}) as Record< + string, + number + >; + const dataPoints = xAxisYears.map((year) => fundingMap[year] ?? 0); + + const baseSeries: any = { + name: series.type.toUpperCase(), + type: 'line', + stack: 'TotalInstitutionalFunding', + areaStyle: {}, + emphasis: { focus: 'series' }, + data: dataPoints, + }; + + if (index === 0) { + baseSeries.markLine = { + symbol: ['none', 'none'], + silent: true, + label: { + show: true, + position: 'end', + formatter: 'Aktuelles Jahr', + backgroundColor: '#333', + color: '#fff', + padding: [4, 6], + borderRadius: 4, + }, + lineStyle: { + color: '#ff4d4f', + type: 'dashed', + width: 2, + }, + data: [ + { + xAxis: currentYearStr, + }, + ], + }; + } + + return baseSeries; + }); + + this.options = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'cross', + label: { backgroundColor: '#6a7985' }, + }, + valueFormatter: (value) => { + const numericValue = Array.isArray(value) ? 0 : Number(value ?? 0); + return floorToTwoDecimals(numericValue); + }, + }, + legend: { + data: fundings.map((series) => series.type.toUpperCase()), + top: '10%', + }, + grid: { + left: '4%', + right: '4%', + bottom: '5%', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + boundaryGap: false, + data: xAxisYears, + }, + ], + yAxis: [ + { + type: 'value', + axisLabel: { + formatter: (value: number) => + value.toLocaleString(undefined, { + style: 'currency', + currency: 'EUR', + maximumFractionDigits: 0, + }), + }, + }, + ], + series: chartSeries, + }; + } +} diff --git a/webapp/src/app/modules/institution-projects/institution-projects.component.html b/webapp/src/app/modules/institution-projects/institution-projects.component.html new file mode 100644 index 00000000..6da70b65 --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.html @@ -0,0 +1,95 @@ +
+

Projekte

+ +
+ + + + + + + + + + + + + + + +
+ + + Förderung über Zeit + + + + + + +
+ + + + +
+
+
+
+ + + {{ row.funding_start | date: 'dd.MM.yyyy' }} + + + {{ row.funding_end | date: 'dd.MM.yyyy' }} + + + {{ row.funding_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + + + + + open_in_new + + + + + open_in_new + + diff --git a/webapp/src/app/modules/institution-projects/institution-projects.component.scss b/webapp/src/app/modules/institution-projects/institution-projects.component.scss new file mode 100644 index 00000000..3226d421 --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.scss @@ -0,0 +1,31 @@ +.content { + padding: 16px; +} + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} + +.funding-area { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.funding-info-section { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.funding-info-cards { + display: flex; + flex-direction: row; + gap: 1rem; + + app-person-network-info-card { + width: 100%; + height: 100%; + } +} diff --git a/webapp/src/app/modules/institution-projects/institution-projects.component.ts b/webapp/src/app/modules/institution-projects/institution-projects.component.ts new file mode 100644 index 00000000..94b16f46 --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.ts @@ -0,0 +1,278 @@ +import { + Component, + computed, + effect, + input, + OnInit, + TemplateRef, + viewChild, +} from '@angular/core'; +import { ActivatedRoute, Router, RouterModule } from '@angular/router'; +import { + BundProject, + BundProjectPage, + EuOrganizationProjectSummary, + EuOrganizationProjectSummaryPage, + InstitutionFunderSummary, +} from '../../api'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs'; +import { FormsModule } from '@angular/forms'; +import { MatInputModule } from '@angular/material/input'; +import { + GenericColumn, + DataTableComponent, +} from '../../shared/ui/data-table/data-table.component'; +import { CurrencyPipe, DatePipe } from '@angular/common'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { MatIconModule } from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; +import { InstitutionProjectsFundingGraphComponent } from '../institution-projects-funding-graph/institution-projects-funding-graph.component'; +import { PersonNetworkInfoCardComponent } from '../person-network-info-card/person-network-info-card.component'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; + +type BundProjectRow = { + id: string; + topic: string; + funding_start: Date; + funding_end: Date; + funding_amount: number; + department: string; +}; + +type EuProjectRow = { + id: string; + topic: string; + funding_start: Date; + funding_end: Date; + funding_amount: number; +}; + +@Component({ + selector: 'app-institution-projects', + imports: [ + MatCardModule, + MatFormFieldModule, + MatTabsModule, + FormsModule, + MatInputModule, + DataTableComponent, + DatePipe, + CurrencyPipe, + MatIconModule, + MatButtonModule, + InstitutionProjectsFundingGraphComponent, + PersonNetworkInfoCardComponent, + RouterModule, + QueryParamPaginatorComponent, + QueryParamInputComponent, + ], + templateUrl: './institution-projects.component.html', + styleUrl: './institution-projects.component.scss', +}) +export class InstitutionProjectsComponent implements OnInit { + fundingStartTmp = viewChild.required>('fundingStartTmp'); + fundingEndTmp = viewChild.required>('fundingEndTmp'); + fundingAmountTmp = viewChild.required>('fundingAmountTmp'); + + cordisEuProjectPage = input.required(); + euProjectColumns: GenericColumn[] = []; + euProjectData: EuProjectRow[] = []; + euProjectActionsTmp = viewChild.required>( + 'euProjectActionsTmp', + ); + + bundProjectPage = input.required(); + bundProjectColumns: GenericColumn[] = []; + bundProjectData: BundProjectRow[] = []; + bundProjectActionsTmp = viewChild.required>( + 'bundProjectActionsTmp', + ); + + bundProjectsFunding = input.required(); + bundTotalFunding = computed(() => { + const funding = this.bundProjectsFunding(); + return Object.values( + funding.funding_per_year as Record, + ).reduce((sum, yearFunding) => sum + yearFunding, 0); + }); + bundAverageAnnualFunding = computed(() => { + const funding = this.bundProjectsFunding(); + return funding.annual_average_over_period ?? 0; + }); + + cordisEuProjectsFunding = input.required(); + euTotalFunding = computed(() => { + const funding = this.cordisEuProjectsFunding(); + return Object.values( + funding.funding_per_year as Record, + ).reduce((sum, yearFunding) => sum + yearFunding, 0); + }); + euAverageAnnualFunding = computed(() => { + const funding = this.cordisEuProjectsFunding(); + return funding.annual_average_over_period ?? 0; + }); + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) { + effect(() => { + const euPage = this.cordisEuProjectPage(); + if (euPage) { + this.euProjectData = euPage.elements + ? euPage.elements.map(this.transformEuRow.bind(this)) + : []; + } + }); + effect(() => { + const bundPage = this.bundProjectPage(); + if (bundPage) { + this.bundProjectData = bundPage.elements + ? bundPage.elements.map(this.transformBundRow.bind(this)) + : []; + } + }); + } + + readonly queryParams = toSignal(this.activatedRoute.queryParamMap, { + initialValue: null, + }); + + readonly displayedProjects = computed(() => { + return this.queryParams()?.get('project_tab') ?? 'eu'; + }); + + readonly selectedPage = computed(() => { + if (this.displayedProjects() === 'eu') { + return this.cordisEuProjectPage(); + } else { + return this.bundProjectPage(); + } + }); + + readonly pageTotal = computed(() => { + return this.selectedPage()?.total ?? 0; + }); + + ngOnInit(): void { + this.euProjectColumns = [ + { + id: 'title', + header: 'Titel', + type: 'accessor', + accessorKey: 'topic', + }, + { + id: 'funding_start', + header: 'Förderbeginn', + type: 'accessor', + accessorKey: 'funding_start', + cellTemplate: this.fundingStartTmp(), + }, + { + id: 'funding_end', + header: 'Förderende', + type: 'accessor', + accessorKey: 'funding_end', + cellTemplate: this.fundingEndTmp(), + }, + { + id: 'funding_amount', + header: 'Fördersumme', + type: 'accessor', + accessorKey: 'funding_amount', + cellTemplate: this.fundingAmountTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.euProjectActionsTmp(), + }, + ]; + this.bundProjectColumns = [ + { + id: 'title', + header: 'Titel', + type: 'accessor', + accessorKey: 'topic', + }, + { + id: 'funding_start', + header: 'Förderbeginn', + type: 'accessor', + accessorKey: 'funding_start', + cellTemplate: this.fundingStartTmp(), + }, + { + id: 'funding_end', + header: 'Fördersende', + type: 'accessor', + accessorKey: 'funding_end', + cellTemplate: this.fundingEndTmp(), + }, + { + id: 'funding_amount', + header: 'Fördersumme', + type: 'accessor', + accessorKey: 'funding_amount', + cellTemplate: this.fundingAmountTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.bundProjectActionsTmp(), + }, + ]; + } + + transformEuRow(project: EuOrganizationProjectSummary): EuProjectRow { + return { + id: project.project_id, + topic: project.title || '', + funding_start: project.start_date + ? new Date(project.start_date) + : new Date(0), + funding_end: project.end_date ? new Date(project.end_date) : new Date(0), + funding_amount: Number(project.ec_contribution) || 0, + }; + } + + transformBundRow(project: BundProject): BundProjectRow { + return { + id: project.funding_code || '', + topic: project.topic || '', + funding_start: project.funding_start + ? new Date(project.funding_start) + : new Date(0), + funding_end: project.funding_end + ? new Date(project.funding_end) + : new Date(0), + funding_amount: project.grant_amount || 0, + department: project.department_fullname || '', + }; + } + + readonly tabIndex = computed(() => { + switch (this.displayedProjects()) { + case 'eu': + return 0; + case 'bund': + return 1; + default: + return 0; + } + }); + + selectedTabChange(event: MatTabChangeEvent): void { + const tab = ['eu', 'bund'][event.index]; + this.router.navigate([], { + queryParams: { project_tab: tab, page: 0, size: 10 }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/institution-publications/institution-publications.component.html b/webapp/src/app/modules/institution-publications/institution-publications.component.html new file mode 100644 index 00000000..1f6b1f02 --- /dev/null +++ b/webapp/src/app/modules/institution-publications/institution-publications.component.html @@ -0,0 +1 @@ +

institution-publications works!

diff --git a/webapp/src/app/modules/institution-publications/institution-publications.component.scss b/webapp/src/app/modules/institution-publications/institution-publications.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/modules/institution-publications/institution-publications.component.ts b/webapp/src/app/modules/institution-publications/institution-publications.component.ts new file mode 100644 index 00000000..b1227d7c --- /dev/null +++ b/webapp/src/app/modules/institution-publications/institution-publications.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-institution-publications', + imports: [], + templateUrl: './institution-publications.component.html', + styleUrl: './institution-publications.component.scss', +}) +export class InstitutionPublicationsComponent {} diff --git a/webapp/src/app/modules/institution/institution.component.html b/webapp/src/app/modules/institution/institution.component.html new file mode 100644 index 00000000..2024c855 --- /dev/null +++ b/webapp/src/app/modules/institution/institution.component.html @@ -0,0 +1,28 @@ +
+

{{ institution.display_name }}

+ + +

{{ institution.homepage_url }}

+

{{ institution.display_name_alternatives }}

+

And many more useful details...

+
+
+ + +
+ + + diff --git a/webapp/src/app/modules/institution/institution.component.scss b/webapp/src/app/modules/institution/institution.component.scss new file mode 100644 index 00000000..2521fee5 --- /dev/null +++ b/webapp/src/app/modules/institution/institution.component.scss @@ -0,0 +1,6 @@ +.content { + padding: 16px; + display: flex; + flex-direction: column; + gap: 16px; +} diff --git a/webapp/src/app/modules/institution/institution.component.ts b/webapp/src/app/modules/institution/institution.component.ts new file mode 100644 index 00000000..03ffd347 --- /dev/null +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -0,0 +1,52 @@ +import { Component, OnInit } from '@angular/core'; +import { + ActivatedRoute, + RouterLink, + RouterOutlet, + RouterLinkActive, +} from '@angular/router'; +import { Institution } from '../../api'; +import { MatCardModule } from '@angular/material/card'; +import { MatTabsModule } from '@angular/material/tabs'; + +@Component({ + selector: 'app-institution', + imports: [ + MatCardModule, + MatTabsModule, + RouterLink, + RouterOutlet, + RouterLinkActive, + ], + templateUrl: './institution.component.html', + styleUrl: './institution.component.scss', +}) +export class InstitutionComponent implements OnInit { + institution!: Institution; + + links = [ + { label: 'Übersicht', path: 'overview', disabled: false }, + { label: 'Publikationen', path: 'publications', disabled: false }, + { + label: 'Projekte', + path: 'projects', + disabled: false, + queryParams: { + project_tab: 'bund', + page: 0, + size: 10, + search: '', + sort_by: 'title', + sort_direction: 'asc', + }, + }, + ]; + + constructor(private readonly activatedRoute: ActivatedRoute) {} + + ngOnInit(): void { + this.activatedRoute.data.subscribe(({ institution }) => { + this.institution = institution; + }); + } +} diff --git a/webapp/src/app/modules/institutions/institutions.component.html b/webapp/src/app/modules/institutions/institutions.component.html new file mode 100644 index 00000000..ce12b7ed --- /dev/null +++ b/webapp/src/app/modules/institutions/institutions.component.html @@ -0,0 +1,97 @@ +
+

Passende Institutionen finden

+ + + +
+ + +
+ + + +
+
+ + + + @let institutionPageValue = institutionPage(); + + @if ( + institutionPageValue.elements && institutionPageValue.elements.length > 0 + ) { +
+ @for (institution of institutionPageValue.elements; track $index) { + @let institutionId = extractInstitutionId(institution); + + + {{ getDisplayName(institution) }} + {{ institution.geo?.city }}, + {{ institution.geo?.country }} + + + + + + + + + + + + info + Übersicht + + + article + Publikationen + + + work + Projekte + + + + + } +
+ } @else { +
+

Keine passenden Institutionen gefunden.

+
+ } + + + + +
diff --git a/webapp/src/app/modules/institutions/institutions.component.scss b/webapp/src/app/modules/institutions/institutions.component.scss new file mode 100644 index 00000000..7303fdd7 --- /dev/null +++ b/webapp/src/app/modules/institutions/institutions.component.scss @@ -0,0 +1,83 @@ +.content { + display: flex; + flex-direction: column; + gap: 1rem; + padding: 1rem; +} + +.sorting { + display: flex; + justify-content: flex-end; + gap: 0.5rem; +} + +.sorting select { + padding: 0.75rem; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + font-size: 1rem; +} + +.sorting select:hover { + cursor: pointer; +} + +.cards { + display: grid; + gap: 1.5rem; + grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + padding: 0 1rem; +} + +.card { + padding: 0.5rem; + background-color: var(--sg-background); + transition: transform 0.3s ease; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.card:hover { + cursor: pointer; + transform: scale(1.05); +} + +.card-content { + display: flex; + flex-direction: column; + justify-content: flex-end; + gap: 0.5rem; + flex: 1; +} + +.card-metadata { + display: flex; + flex-direction: column; + gap: 0.2rem; + font-size: 0.9rem; + color: var(--sg-text-secondary); +} + +mat-card-actions { + padding-top: 0.5rem; + display: flex; + gap: 0.5rem; +} + +mat-card-actions a { + width: 100%; + text-decoration: none; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); +} + +.no-results { + text-align: center; + padding: 2rem; + color: var(--sg-text-secondary); +} + +.search-and-sorting { + padding: 0 1rem; +} diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts new file mode 100644 index 00000000..18eea25f --- /dev/null +++ b/webapp/src/app/modules/institutions/institutions.component.ts @@ -0,0 +1,57 @@ +import { Component, input } from '@angular/core'; +import { Institution, InstitutionPage } from '../../api'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { RouterModule } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { MatDividerModule } from '@angular/material/divider'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { + QueryParamSelectorComponent, + SelectorOption, +} from '../../shared/ui/query-param-selector/query-param-selector.component'; +import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; + +@Component({ + selector: 'app-institutions', + imports: [ + MatButtonModule, + MatCardModule, + MatIconModule, + MatDividerModule, + RouterModule, + QueryParamPaginatorComponent, + QueryParamSelectorComponent, + QueryParamInputComponent, + ], + templateUrl: './institutions.component.html', + styleUrl: './institutions.component.scss', +}) +export class InstitutionsComponent { + institutionPage = input.required(); + + sortingOptions: SelectorOption[] = [ + { value: 'relevance', display_name: 'Relevanz' }, + { value: 'name', display_name: 'Name' }, + { value: 'works_count', display_name: 'Anzahl Publikationen' }, + { value: 'citations_count', display_name: 'Anzahl Zitationen' }, + ]; + sortingDirectionOptions: SelectorOption[] = [ + { value: 'asc', display_name: 'Aufsteigend' }, + { value: 'desc', display_name: 'Absteigend' }, + ]; + + extractInstitutionId(institution: Institution): string { + return institution.id?.split('/').pop() ?? ''; + } + + getDisplayName(institution: Institution): string { + const primary = institution.display_name?.trim(); + if (primary && primary.length > 0) return primary; + + const alt = institution.display_name_alternatives?.[0]?.trim(); + if (alt && alt.length > 0) return alt; + + return 'Unbekannte Institution'; + } +} diff --git a/webapp/src/app/modules/news-detail/news-detail.component.html b/webapp/src/app/modules/news-detail/news-detail.component.html new file mode 100644 index 00000000..dc1a3fc0 --- /dev/null +++ b/webapp/src/app/modules/news-detail/news-detail.component.html @@ -0,0 +1,123 @@ +
+ + + @if (loading) { +
+ +

Nachricht wird geladen...

+
+ } @else if (notFound || !article) { +
+ search_off +

Nachricht nicht gefunden

+

Der Artikel konnte nicht geladen werden.

+ Zur Personensuche +
+ } @else { +
+
+
+
+ @if (article.author) { + {{ article.author }} + } + @if (article.date) { + {{ formatDate(article.date) }} + } +
+

{{ article.maintitle || 'Kein Titel' }}

+ + @if (article.relevant === true) { + + check_circle + Relevant + + } @else if (article.relevant === false) { + + cancel + Nicht relevant + + } @else { + + help + Relevanz nicht bestimmt + + } +
+ +
+ @if (article.full_content) { +

{{ article.full_content }}

+ } @else { +

Kein Inhalt verfügbar.

+ } +
+ + @if (article.url) { +
+ + open_in_new + Originalartikel öffnen + +
+ } +
+ + +
+ } +
diff --git a/webapp/src/app/modules/news-detail/news-detail.component.scss b/webapp/src/app/modules/news-detail/news-detail.component.scss new file mode 100644 index 00000000..82f7b1ac --- /dev/null +++ b/webapp/src/app/modules/news-detail/news-detail.component.scss @@ -0,0 +1,295 @@ +.detail-page { + max-width: 1200px; + margin: 0 auto; + padding: 28px 32px 64px; +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 6px; + background: none; + border: none; + cursor: pointer; + font-size: 14px; + color: var(--sg-text-muted); + padding: 0; + margin-bottom: 32px; + + &:hover { + color: var(--sg-text); + } + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + } +} + +.state { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 16px; + padding: 80px 0; + text-align: center; + color: var(--sg-text-muted); + + mat-icon { + font-size: 48px; + width: 48px; + height: 48px; + } + + p { + margin: 0; + } +} + +.error-state h2 { + margin: 0; +} + +.detail-layout { + display: grid; + grid-template-columns: 1fr 280px; + gap: 40px; + align-items: start; +} + +main { + min-width: 0; +} + +.hero { + margin-bottom: 32px; +} + +.eyebrow { + display: flex; + gap: 12px; + font-size: 13px; + color: var(--sg-text-muted); + margin-bottom: 12px; + + span + span::before { + content: '·'; + margin-right: 12px; + } +} + +.article-heading { + margin: 0; + font-size: 28px; + font-weight: 700; + line-height: 1.3; +} + +.relevance-badge { + display: inline-flex; + align-items: center; + gap: 6px; + margin-top: 14px; + padding: 5px 12px; + border-radius: 999px; + font-size: 13px; + font-weight: 600; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + } + + &.is-relevant { + background: #effaf3; + border: 1px solid #bdebcf; + color: #24834f; + } + + &.not-relevant { + background: var(--sg-surface-muted); + border: 1px solid #e2e2e2; + color: var(--sg-text-muted); + } + + &.undetermined { + background: #fff7e8; + border: 1px solid #ffd796; + color: #c67500; + } +} + +.article-body { + font-size: 15px; + line-height: 1.7; + color: var(--sg-text); +} + +.content { + margin: 0; + white-space: pre-wrap; +} + +.placeholder { + margin: 0; + color: var(--sg-text-muted); + font-style: italic; +} + +.article-actions { + margin-top: 32px; +} + +.sidebar { + display: flex; + flex-direction: column; + gap: 16px; + position: sticky; + top: 24px; +} + +.sidebar-card { + padding: 20px; + border: 1px solid #d7e4ff; + border-radius: 16px; + background: #ffffff; + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); + + h3 { + display: flex; + align-items: center; + gap: 8px; + margin: 0 0 14px; + font-size: 14px; + font-weight: 600; + color: var(--sg-text); + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + color: var(--sg-text-muted); + } + } +} + +.person-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.person-item { + display: grid; + grid-template-columns: 38px minmax(0, 1fr) auto; + gap: 11px; + align-items: center; + padding: 12px; + border-radius: var(--sg-radius-sm); + background: var(--sg-surface-muted); +} + +.person-item.is-link { + cursor: pointer; + text-decoration: none; + color: inherit; + transition: background 0.15s ease; +} + +.person-item.is-link:hover { + background: #e5ecfb; +} + +.person-item.is-muted { + .avatar { + background: #ececef; + color: var(--sg-text-muted); + } + + .person-name { + color: var(--sg-text-muted); + } +} + +.ude-badge { + justify-self: end; + padding: 3px 9px; + border-radius: 999px; + background: #effaf3; + border: 1px solid #bdebcf; + color: #24834f; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.03em; +} + +.avatar { + display: grid; + place-items: center; + width: 38px; + height: 38px; + border-radius: 50%; + background: #e5ecfb; + color: var(--sg-text); + font-size: 15px; + font-weight: 700; + text-transform: uppercase; +} + +.person-name { + color: var(--sg-text); + font-size: 13px; + font-weight: 700; +} + +.chip-list { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.topic-chip { + display: inline-flex; + align-items: center; + padding: 6px 12px; + border: 1px solid var(--topic-border); + border-radius: 8px; + background: var(--topic-bg); + color: var(--topic-color); + font-size: 12px; + font-weight: 500; + line-height: 1.25; +} + +.purple { + --topic-border: #d8cafe; + --topic-bg: #f6f0ff; + --topic-color: #7255d9; +} + +.blue { + --topic-border: #bdd4ff; + --topic-bg: #f0f6ff; + --topic-color: #0b63ce; +} + +.green { + --topic-border: #bdebcf; + --topic-bg: #effaf3; + --topic-color: #24834f; +} + +.orange { + --topic-border: #ffd796; + --topic-bg: #fff7e8; + --topic-color: #c67500; +} + +.pink { + --topic-border: #ffc7d7; + --topic-bg: #fff1f5; + --topic-color: #d12f61; +} diff --git a/webapp/src/app/modules/news-detail/news-detail.component.ts b/webapp/src/app/modules/news-detail/news-detail.component.ts new file mode 100644 index 00000000..bd75dc3c --- /dev/null +++ b/webapp/src/app/modules/news-detail/news-detail.component.ts @@ -0,0 +1,109 @@ +import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { Location, NgClass } from '@angular/common'; +import { HttpClient } from '@angular/common/http'; +import { ActivatedRoute, RouterLink } from '@angular/router'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; + +import { WorksService } from '../../api'; + +interface MentionedPerson { + name: string; + is_ude?: boolean; + person_id?: string | null; +} + +interface NewsArticleDetail { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + full_content?: string | null; + relevant?: boolean; + authors?: MentionedPerson[]; +} + +@Component({ + selector: 'app-news-detail', + imports: [ + MatButtonModule, + MatIconModule, + MatProgressSpinnerModule, + RouterLink, + NgClass, + ], + templateUrl: './news-detail.component.html', + styleUrl: './news-detail.component.scss', +}) +export class NewsDetailComponent implements OnInit { + private readonly destroyRef = inject(DestroyRef); + private readonly route = inject(ActivatedRoute); + private readonly httpClient = inject(HttpClient); + private readonly worksService = inject(WorksService); + private readonly location = inject(Location); + + article: NewsArticleDetail | null = null; + loading = false; + notFound = false; + + readonly relevantTopics = [ + 'Künstliche Intelligenz', + 'Maschinelles Lernen', + 'Digitalisierung', + 'Datenwissenschaft', + ]; + + private readonly chipColors = ['purple', 'blue', 'green', 'orange', 'pink']; + + chipColor(index: number): string { + return this.chipColors[index % this.chipColors.length]; + } + + ngOnInit(): void { + this.route.paramMap + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((params) => { + const id = params.get('id'); + if (id) { + this.fetchArticle(id); + } + }); + } + + navigateBack(): void { + this.location.back(); + } + + formatDate(dateStr?: string | null): string { + if (!dateStr) return '-'; + const date = new Date(dateStr); + if (isNaN(date.getTime())) return dateStr; + return new Intl.DateTimeFormat('de-DE', { + day: '2-digit', + month: 'long', + year: 'numeric', + }).format(date); + } + + private fetchArticle(id: string): void { + this.loading = true; + this.notFound = false; + const basePath = this.worksService.configuration.basePath ?? ''; + this.httpClient + .get(`${basePath}/api/news/${encodeURIComponent(id)}`) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (article) => { + this.article = article; + this.loading = false; + }, + error: () => { + this.notFound = true; + this.loading = false; + }, + }); + } +} diff --git a/webapp/src/app/modules/news/news.component.html b/webapp/src/app/modules/news/news.component.html new file mode 100644 index 00000000..aff9aadc --- /dev/null +++ b/webapp/src/app/modules/news/news.component.html @@ -0,0 +1,110 @@ +
+
+
Nachrichten
+

Aktuelle Nachrichten aus Campus-Aktuell.

+
+ +
+ + search + + + + @if (!isSearching) { + + + Neueste zuerst + Älteste zuerst + + + } +
+ +
+ @if (loading) { +
+ +
+ } + + + + + + + + + + + + + + + + + + + + + + + + +
Titel + {{ + article.maintitle || 'Kein Titel' + }} + Fundstelle + @if (article.snippet) { + + } @else { + — + } + Relevanz + @if (article.relevant === true) { + + check_circle + Relevant + + } @else if (article.relevant === false) { + + cancel + Nicht relevant + + } @else { + + help + Nicht bestimmt + + } + Datum + {{ formatDate(article.date) }} +
+ + @if (!loading && articles.length === 0) { +
+ @if (isSearching) { + Keine Ergebnisse für „{{ searchControl.value.trim() }}" gefunden. + } @else { + Keine Nachrichten gefunden. + } +
+ } +
+ + +
diff --git a/webapp/src/app/modules/news/news.component.scss b/webapp/src/app/modules/news/news.component.scss new file mode 100644 index 00000000..100dead9 --- /dev/null +++ b/webapp/src/app/modules/news/news.component.scss @@ -0,0 +1,209 @@ +.page { + padding: 28px 32px 42px; + max-width: 100%; + margin: 0 auto; +} + +h6 { + margin: 0 0 6px; + font-size: 22px; + line-height: 1.2; + font-weight: 700; +} + +.page > div:first-child p { + margin: 0; + color: var(--sg-text-muted); + font-size: 14px; +} + +.news-toolbar { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 12px; + padding-top: 10px; + padding-bottom: 25px; +} + +.search-field { + max-width: 480px; +} + +::ng-deep .news-toolbar .mat-mdc-form-field-subscript-wrapper { + display: none; +} + +::ng-deep .news-toolbar .mat-mdc-text-field-wrapper { + height: 42px; + background: #fff; + border-radius: var(--sg-radius-sm); +} + +::ng-deep .news-toolbar .mat-mdc-form-field-infix { + min-height: unset; + height: 42px; + padding: 0; + display: flex; + align-items: center; +} + +::ng-deep .news-toolbar .mdc-notched-outline__leading, +::ng-deep .news-toolbar .mdc-notched-outline__notch, +::ng-deep .news-toolbar .mdc-notched-outline__trailing { + border-color: #d9e2f0; +} + +::ng-deep .news-toolbar input.mat-mdc-input-element { + color: var(--sg-text); + font-size: 14px; +} + +::ng-deep .news-toolbar input.mat-mdc-input-element::placeholder { + color: var(--sg-text-muted); + opacity: 1; + font-size: 14px; +} + +.sort-field { + width: 180px; +} + +.table-wrap { + position: relative; + overflow-x: auto; +} + +table { + width: 100%; + min-width: 600px; + border-collapse: separate; + border-spacing: 0 10px; + background: transparent; + box-shadow: none; +} + +.article-title { + display: inline-block; + max-width: 520px; + line-height: 1.35; + color: var(--sg-text); + font-size: 14px; + font-weight: 700; + text-decoration: none; + + &:hover { + color: var(--sg-text); + text-decoration: underline; + } +} + +.loading { + position: absolute; + inset: 0; + z-index: 1; + display: grid; + place-items: center; + background: rgba(255, 255, 255, 0.65); +} + +.empty-state { + padding: 28px; + text-align: center; + color: rgba(0, 0, 0, 0.6); + background: transparent; +} + +.snippet { + color: var(--sg-text-muted); + font-size: 13px; + line-height: 1.4; +} + +::ng-deep .snippet em { + font-style: normal; + background: #fff48d; + padding: 0 3px; + border-radius: 3px; +} + +.snippet-empty { + color: var(--sg-text-muted); +} + +.relevance-badge { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 5px 12px; + border-radius: 999px; + font-size: 13px; + font-weight: 600; + line-height: 1; + white-space: nowrap; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + } + + &.is-relevant { + background: #effaf3; + border: 1px solid #bdebcf; + color: #24834f; + } + + &.not-relevant { + background: var(--sg-surface-muted); + border: 1px solid #e2e2e2; + color: var(--sg-text-muted); + } + + &.undetermined { + background: #fff7e8; + border: 1px solid #ffd796; + color: #c67500; + } +} + +::ng-deep .mat-mdc-header-cell { + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 700; +} + +::ng-deep .mat-mdc-row { + height: 72px; +} + +::ng-deep .mat-mdc-cell { + color: var(--sg-text); + border-bottom-color: var(--sg-border); + font-size: 13px; +} + +mat-paginator { + background: transparent; +} + +.table-footer { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 66px; + padding: 0 22px 0 28px; + color: var(--sg-text-muted); + font-size: 13px; +} + +@media (max-width: 600px) { + .page { + padding: 16px; + } + + .table-footer { + align-items: stretch; + flex-direction: column; + } +} diff --git a/webapp/src/app/modules/news/news.component.ts b/webapp/src/app/modules/news/news.component.ts new file mode 100644 index 00000000..3c1ff74c --- /dev/null +++ b/webapp/src/app/modules/news/news.component.ts @@ -0,0 +1,219 @@ +import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSelectModule } from '@angular/material/select'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTableModule } from '@angular/material/table'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { debounceTime, distinctUntilChanged } from 'rxjs'; + +import { WorksService } from '../../api'; +import { PaginationService } from '../../shared/services/pagination.service'; + +interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; +} + +interface NewsPage { + total: number; + page: number; + page_size: number; + results: NewsArticle[]; +} + +type SortOrder = 'desc' | 'asc'; +const DEFAULT_SORT_ORDER: SortOrder = 'desc'; + +@Component({ + selector: 'app-news', + imports: [ + MatIconModule, + MatSelectModule, + MatFormFieldModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatTableModule, + ReactiveFormsModule, + RouterLink, + ], + templateUrl: './news.component.html', + styleUrl: './news.component.scss', +}) +export class NewsComponent implements OnInit { + private readonly destroyRef = inject(DestroyRef); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly httpClient = inject(HttpClient); + private readonly worksService = inject(WorksService); + readonly paginationService = inject(PaginationService); + + readonly searchControl = new FormControl('', { nonNullable: true }); + + get displayedColumns(): string[] { + if (this.isSearching) { + return ['maintitle', 'snippet', 'relevance', 'date']; + } + return ['maintitle', 'relevance', 'date']; + } + + articles: NewsArticle[] = []; + total = 0; + loading = false; + + currentPage = 1; + sortOrder: SortOrder = DEFAULT_SORT_ORDER; + + get isSearching(): boolean { + return this.searchControl.value.trim().length > 0; + } + + ngOnInit(): void { + this.route.queryParamMap + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((params) => { + this.currentPage = this.parsePage(params.get('page')); + this.paginationService.selection = this.parsePageSize( + params.get('pageSize'), + ); + this.sortOrder = this.parseSortOrder(params.get('sortOrder')); + this.searchControl.setValue(params.get('q') ?? '', { + emitEvent: false, + }); + this.load(); + }); + + this.searchControl.valueChanges + .pipe( + debounceTime(300), + distinctUntilChanged(), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((query) => { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { q: query.trim() || null, page: 1 }, + queryParamsHandling: 'merge', + }); + }); + } + + load(): void { + this.loading = true; + const query = this.searchControl.value.trim(); + const basePath = this.worksService.configuration.basePath ?? ''; + + if (query) { + const params = new HttpParams() + .set('query', query) + .set('page', this.currentPage) + .set('pageSize', this.paginationService.selection); + + this.httpClient + .get(`${basePath}/api/news/search`, { params }) + .subscribe({ + next: (page) => { + this.articles = page.results ?? []; + this.total = page.total ?? 0; + this.loading = false; + }, + error: () => { + this.articles = []; + this.total = 0; + this.loading = false; + }, + }); + } else { + const params = new HttpParams() + .set('page', this.currentPage) + .set('pageSize', this.paginationService.selection) + .set('sortOrder', this.sortOrder); + + this.httpClient + .get(`${basePath}/api/news`, { params }) + .subscribe({ + next: (page) => { + this.articles = page.results ?? []; + this.total = page.total ?? 0; + this.loading = false; + }, + error: () => { + this.articles = []; + this.total = 0; + this.loading = false; + }, + }); + } + } + + onPage(event: PageEvent): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + page: event.pageIndex + 1, + pageSize: event.pageSize, + }, + queryParamsHandling: 'merge', + }); + } + + onSortChange(order: SortOrder): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + sortOrder: order, + page: 1, + }, + queryParamsHandling: 'merge', + }); + } + + formatDate(dateStr?: string | null): string { + if (!dateStr) return '-'; + const date = new Date(dateStr); + if (isNaN(date.getTime())) return dateStr; + return new Intl.DateTimeFormat('de-DE').format(date); + } + + articleRange(): string { + if (this.total === 0) return 'Keine Nachrichten gefunden'; + const pageSize = this.paginationService.selection; + const start = (this.currentPage - 1) * pageSize + 1; + const end = Math.min(start + this.articles.length - 1, this.total); + return `Zeige ${start} bis ${end} von ${this.total} Nachrichten`; + } + + private parsePage(value: string | null): number { + const page = Number.parseInt(value ?? '', 10); + if (Number.isNaN(page) || page < 1) { + return 1; + } + return page; + } + + private parsePageSize(value: string | null): number { + const pageSize = Number.parseInt(value ?? '', 10); + if (this.paginationService.options.includes(pageSize)) { + return pageSize; + } + return 10; + } + + private parseSortOrder(value: string | null): SortOrder { + if (value === 'asc' || value === 'desc') { + return value; + } + return DEFAULT_SORT_ORDER; + } +} diff --git a/webapp/src/app/modules/person-card/person-card.component.html b/webapp/src/app/modules/person-card/person-card.component.html new file mode 100644 index 00000000..e07bb800 --- /dev/null +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -0,0 +1,135 @@ +
+ + +
+ {{ initials() }} +
+
+
+ +
+

+ {{ person().display_name ?? '' }} +

+

+ {{ distinguishingId() }} +

+

+ {{ statsString() }} +

+

+ {{ hIndexString() }} +

+ @if (!loading()) { + @if (careerStage(); as careerStage) { +
+ Career Stage: + + {{ careerStage }} + +
+ } + } +
+
+ +
+ @if (institution(); as inst) { +
+ +
+ } + +
+ @for (topic of topics(); track topic.id) { + + } +
+
+ + +
diff --git a/webapp/src/app/modules/person-card/person-card.component.scss b/webapp/src/app/modules/person-card/person-card.component.scss new file mode 100644 index 00000000..5dd6b14c --- /dev/null +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -0,0 +1,336 @@ +:host { + display: flex; + flex-direction: column; + height: 100%; +} + +.person-card { + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + box-shadow: var(--sg-shadow-sm); + display: flex; + flex-direction: column; + height: 100%; + transition: + transform 0.15s ease, + box-shadow 0.15s ease; + + &:hover { + transform: translateY(-2px); + box-shadow: var(--sg-shadow-md); + } +} + +.card-header { + padding: 16px; + display: flex; + gap: 12px; + border-bottom: 1px solid var(--sg-surface-soft); + text-decoration: none; + color: inherit; + cursor: pointer; + + .avatar { + width: 40px; + height: 40px; + border-radius: 50%; + background: var(--sg-primary-soft); + color: var(--sg-primary); + font-size: 14px; + font-weight: 700; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + border: 1px solid var(--sg-border); + } + + .header-main { + flex-grow: 1; + min-width: 0; + } +} + +.rating-and-bookmark { + display: flex; + justify-content: space-between; + align-items: center; +} + +.suitability-badge { + font-size: 10px; + font-weight: 700; + padding: 2px 6px; + border-radius: 8px; + text-transform: uppercase; + + &.very-suitable { + background: var(--sg-success-soft); + color: var(--sg-success); + } + + &.suitable { + background: var(--sg-warning-soft); + color: var(--sg-warning); + } + + &.possible { + background: var(--sg-primary-soft); + color: var(--sg-text-muted); + } +} + +.bookmark-btn { + border: none; + background: transparent; + cursor: pointer; + padding: 2px; + color: var(--sg-text-soft); + + &:hover { + color: var(--sg-primary); + } + + &.bookmarked { + color: #e53935; + } + + mat-icon { + font-size: 18px; + width: 18px; + height: 18px; + } +} + +.person-name { + margin: 6px 0 2px; + font-size: 16px; + font-weight: 600; + color: var(--sg-text); + min-height: 24px; + line-height: 24px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.institution { + display: flex; + align-items: center; + gap: 6px; + margin: 0; + font-size: 12px; + color: var(--sg-text-muted); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.institution-tag { + background: var(--sg-primary-soft); + border: 1px solid var(--sg-primary-border, var(--sg-border)); + color: var(--sg-primary); + font-size: 10px; + font-weight: 600; + padding: 2px 6px; + border-radius: 4px; + cursor: pointer; + display: inline-flex; + align-items: center; + transition: all 0.2s ease; + max-width: 100%; + box-sizing: border-box; + margin: 0; + line-height: normal; + font-family: inherit; + + .institution-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + min-width: 0; + flex: 1; + } + + .flag-img { + flex-shrink: 0; + } + + .country-code { + display: inline-block; + flex-shrink: 0; + white-space: nowrap; + } + + &:hover, + &:focus-visible { + background: var(--sg-primary); + color: #fff; + border-color: var(--sg-primary); + outline: none; + box-shadow: + 0 0 0 2px var(--sg-background), + 0 0 0 4px var(--sg-primary); + } +} + +.flag-img { + border: 1px solid; + vertical-align: middle; +} + +.person-id { + margin: 2px 0 0; + font-size: 10px; + color: var(--sg-text-soft); + min-height: 15px; + line-height: 15px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.stats { + margin: 4px 0 0; + font-size: 10px; + color: var(--sg-text-muted); + min-height: 15px; + line-height: 15px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.career-stage-line { + display: flex; + align-items: center; + gap: 6px; + margin-top: 6px; + color: var(--sg-text-muted); + font-size: 10px; + min-height: 18px; +} + +.career-stage-label { + flex-shrink: 0; +} + +.career-stage-chip { + display: inline-flex; + align-items: center; + min-width: 0; + max-width: 100%; + padding: 2px 8px; + border: 1px solid var(--sg-border); + border-radius: 999px; + background: var(--sg-surface-muted); + color: var(--sg-primary); + font-size: 10px; + font-weight: 600; + line-height: 1.2; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: help; +} + +.card-body { + padding: 16px; + flex-grow: 1; + display: flex; + flex-direction: column; + gap: 12px; + justify-content: space-between; +} + +.topic-row { + display: flex; + flex-wrap: wrap; + gap: 4px; +} + +.topic-tag { + background: var(--sg-surface-soft); + border: 1px solid var(--sg-border); + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 600; + padding: 2px 6px; + border-radius: 4px; + cursor: pointer; + transition: all 0.2s ease; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + box-sizing: border-box; + margin: 0; + line-height: normal; + font-family: inherit; + display: inline-flex; + align-items: center; + + &:hover, + &:focus-visible { + background: var(--sg-primary-soft); + border-color: var(--sg-primary); + color: var(--sg-primary); + outline: none; + box-shadow: + 0 0 0 2px var(--sg-background), + 0 0 0 4px var(--sg-primary); + } + + &.active { + background: var(--sg-primary-soft); + border-color: var(--sg-primary); + color: var(--sg-primary); + font-weight: 700; + box-shadow: 0 0 0 1.5px var(--sg-primary); + + &:hover, + &:focus-visible { + box-shadow: + 0 0 0 2px var(--sg-background), + 0 0 0 4px var(--sg-primary); + } + } +} + +.card-footer { + padding: 10px 12px; + border-top: 1px solid var(--sg-border); + background: var(--sg-surface-muted); +} + +.action-buttons { + display: flex; + gap: 6px; +} + +.action-btn { + flex: 1; + display: flex; + align-items: center; + justify-content: center; + gap: 4px; + padding: 6px; + background: var(--sg-surface); + border: 1px solid var(--sg-border-strong); + border-radius: var(--sg-radius-sm); + color: var(--sg-text-muted); + font-size: 10px; + font-weight: 600; + text-decoration: none; + + mat-icon { + font-size: 12px; + width: 12px; + height: 12px; + } + + &:hover { + background: var(--sg-primary-soft); + color: var(--sg-primary); + } +} diff --git a/webapp/src/app/modules/person-card/person-card.component.spec.ts b/webapp/src/app/modules/person-card/person-card.component.spec.ts new file mode 100644 index 00000000..d893fb67 --- /dev/null +++ b/webapp/src/app/modules/person-card/person-card.component.spec.ts @@ -0,0 +1,29 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PersonCardComponent } from './person-card.component'; + +describe('PersonCardComponent', () => { + let component: PersonCardComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [PersonCardComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(PersonCardComponent); + component = fixture.componentInstance; + component.person = { + id: 'mock-id', + display_name: 'Test Author', + works_count: 5, + cited_by_count: 10, + topics: [], + } as any; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webapp/src/app/modules/person-card/person-card.component.ts b/webapp/src/app/modules/person-card/person-card.component.ts new file mode 100644 index 00000000..02e5a109 --- /dev/null +++ b/webapp/src/app/modules/person-card/person-card.component.ts @@ -0,0 +1,153 @@ +import { Component, input, computed, output } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { RouterLink } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api'; +import { SkTextDirective } from '../../custom-directives/sk-text.directive'; + +@Component({ + selector: 'app-person-card', + standalone: true, + imports: [ + CommonModule, + RouterLink, + MatIconModule, + SkTextDirective, + MatTooltipModule, + ], + templateUrl: './person-card.component.html', + styleUrl: './person-card.component.scss', +}) +export class PersonCardComponent { + person = input.required(); + isBookmarked = input(false); + loading = input(false); + selectedTopics = input>(new Set()); + + bookmarkToggle = output(); + topicClick = output(); + institutionClick = output(); + + initials = computed(() => { + const name = this.person().display_name; + if (!name) return 'U'; + const cleanName = name.replace(/Prof\.|Dr\.|M\.Sc\./g, '').trim(); + const parts = cleanName.split(' '); + const first = parts[0]?.[0] || ''; + const last = parts[parts.length - 1]?.[0] || ''; + return (first + last).toUpperCase(); + }); + + institution = computed(() => { + const p = this.person(); + if (p.last_known_institutions?.[0]) { + return p.last_known_institutions[0]; + } + + const affiliations = p.affiliations ?? []; + let newestInstitution: DehydratedInstitution | undefined = + affiliations[0]?.institution ?? undefined; + let newestYear = -1; + + for (const affiliation of affiliations) { + for (const jahr of affiliation.years ?? []) { + if (jahr > newestYear) { + newestYear = jahr; + newestInstitution = affiliation.institution ?? undefined; + } + } + } + + return newestInstitution; + }); + + topics = computed(() => { + return (this.person().topics ?? []) + .filter((t): t is WorkTopic => !!t.display_name) + .slice(0, 3); + }); + + distinguishingId = computed(() => { + const p = this.person(); + if (p.orcid) { + return p.orcid.replace('https://orcid.org/', ''); + } + return ''; + }); + + statsString = computed(() => { + const works = this.person().works_count; + const citations = this.person().cited_by_count; + const hasWorks = works !== undefined && works !== null; + const hasCitations = citations !== undefined && citations !== null; + + if (hasWorks && hasCitations) { + return `Publikationen: ${works} · Zitationen: ${citations}`; + } else if (hasWorks) { + return `Publikationen: ${works}`; + } else if (hasCitations) { + return `Zitationen: ${citations}`; + } + return ''; + }); + + hIndexString = computed(() => { + const hIndex = this.person().summary_stats?.h_index; + if (hIndex !== undefined && hIndex !== null) { + return `h_index: ${hIndex}`; + } + return ''; + }); + + careerStage = computed(() => { + const stage = this.person().career_metrics?.career_stage; + + if (!stage || stage === 'unknown') { + return null; + } + + return stage; + }); + + getRatingClass(rating: string | null | undefined): string { + const r = (rating || '').toLowerCase(); + if (r === 'sehr geeignet') return 'very-suitable'; + if (r === 'geeignet') return 'suitable'; + return 'possible'; + } + + getTopicTooltip(topic: WorkTopic): string { + const parts: string[] = []; + if (topic.domain?.display_name) parts.push(topic.domain.display_name); + if (topic.field?.display_name) parts.push(topic.field.display_name); + if (topic.subfield?.display_name) parts.push(topic.subfield.display_name); + + const path = parts.join(' - '); + if (topic.display_name) { + return path ? `${topic.display_name}\n(${path})` : topic.display_name; + } + return path; + } + + getCareerStageTooltip(careerStage: string): string { + const activeYears = this.person().career_metrics?.active_years ?? '-'; + + return [ + `Aktuell: ${careerStage.replace(' Researcher', '')}`, + `Aktive Publikationsjahre: ${activeYears}`, + '', + 'Einteilung:', + 'Early: 1-4 aktive Publikationsjahre', + 'Emerging: 5-9 aktive Publikationsjahre', + 'Established: 10-14 aktive Publikationsjahre', + 'Senior: ab 15 aktiven Publikationsjahren', + '', + 'Diese Einschätzung basiert ausschließlich auf OpenAlex-Publikationsdaten und ist kein offizieller akademischer Status.', + ].join('\n'); + } + + toggleBookmark(): void { + this.bookmarkToggle.emit(this.person()); + } +} diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.html b/webapp/src/app/modules/person-company-connections/person-company-connections.component.html new file mode 100644 index 00000000..f4e9453b --- /dev/null +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.html @@ -0,0 +1,269 @@ +@if (loading) { +
+ + Verbindungen zu Unternehmen werden geladen ... +
+} @else if (error) { +
+ Verbindungen zu Unternehmen konnten nicht geladen werden. +
+} @else if (data && !data.is_ude_author) { +
+

Keine Unternehmenssuche verfügbar

+

Für diese Person wird aktuell keine Suche nach Unternehmen angezeigt.

+
+} @else if (data && connections.length === 0) { +
+

Keine Treffer im Handelsregister

+

+ Für diese Person wurden keine passenden Treffer im Handelsregister + gefunden. +

+
+} @else if (data) { +
+ + + @if (data.common_name_warning) { +
+ Für diesen Namen gibt es mehrere Treffer im Handelsregister. Die + Ergebnisse sollten besonders vorsichtig interpretiert werden. +
+ } + +
+
+ @if (graphOptions) { + +
+ + +
+
+ + @if (roleLegendItems.length > 0) { +
+ @for (item of roleLegendItems; track item.role) { + + + {{ item.role }} + + } +
+ } + + @if (connections.length > 10) { +

+ Der Graph zeigt die ersten 10 Unternehmen. Die vollständige + Liste ist rechts sichtbar. +

+ } +
+ } + +

+ {{ disclaimer }} +

+
+ +
+ +
+ Unternehmen + Rolle +
+ +
+ @for (connection of connections; track getCompanyKey(connection)) { + @let officer = getPrimaryOfficer(connection); + @let companyKey = getCompanyKey(connection); + @let relatedOfficers = getRelatedOfficers(connection); + +
+
+ + {{ connection.company_name || 'Unbekanntes Unternehmen' }} + + + + {{ officer?.position || '—' }} + +
+ + @if (companyKey === selectedCompanyKey) { +
+
+
+ Register + + {{ getCompanyRegisterLabel(connection) }} + +
+ +
+ Amtsgericht + + {{ getRegistrarLabel(connection) }} + +
+ +
+ Adresse + + {{ getCompanyAddressLabel(connection) }} + +
+ +
+ Unternehmensstatus + + {{ getCompanyStatusLabel(connection.company_status) }} + +
+ +
+ Gegenstand + + {{ getGegenstandLabel() }} + +
+
+ + @if (relatedOfficers.length > 0) { + + + @if (isCompanyOfficersExpanded(connection)) { + + } + } +
+ } +
+ } +
+
+
+
+
+} diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.scss b/webapp/src/app/modules/person-company-connections/person-company-connections.component.scss new file mode 100644 index 00000000..5fe97475 --- /dev/null +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.scss @@ -0,0 +1,505 @@ +$marked-color: #5470c6; +$related-person-color: #4f8df5; +$timeline-purple: #7255d9; +$timeline-purple-bg: #f6f0ff; + +$timeline-orange-bg: #fff7e8; +$timeline-orange-border: #ffd796; +$timeline-orange-text: #c67500; + +$card-border: #dbe5f6; +$text-main: #07163d; +$text-muted: #64718f; + +:host { + display: block; +} + +.company-connections { + display: flex; + flex-direction: column; + gap: 16px; + padding: 20px 28px 32px; +} + +.page-header { + h2 { + margin: 0 0 6px; + color: $text-main; + font-size: 20px; + font-weight: 700; + line-height: 1.25; + } + + p { + margin: 0; + color: $text-muted; + font-size: 14px; + line-height: 1.4; + } +} + +.state { + display: flex; + align-items: center; + justify-content: center; + gap: 14px; + min-height: 220px; + color: $text-muted; + font-size: 14px; +} + +.state-error { + color: #b42318; +} + +.empty-state { + margin: 14px 28px; + padding: 18px 22px; + border: 1px solid $card-border; + border-radius: 16px; + background: #ffffff; + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); + + h2 { + margin: 0 0 6px; + color: $text-main; + font-size: 18px; + font-weight: 700; + line-height: 1.3; + } + + p { + margin: 0; + color: $text-muted; + font-size: 14px; + line-height: 1.4; + } +} + +.warning-box { + padding: 12px 14px; + border: 1px solid $timeline-orange-border; + border-radius: 12px; + background: $timeline-orange-bg; + color: $timeline-orange-text; + font-size: 14px; + line-height: 1.45; +} + +.main-layout { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); + gap: 18px; + height: 680px; + align-items: stretch; +} + +.graph-column, +.list-column { + min-width: 0; + min-height: 0; + display: flex; + flex-direction: column; +} + +.graph-card, +.connection-list { + border-radius: 16px; + background: #ffffff; + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); + overflow: hidden; +} + +.graph-card { + flex: 1 1 auto; + min-height: 0; + display: flex; + flex-direction: column; +} + +.graph-stage { + position: relative; + flex: 1 1 auto; + min-height: 0; + overflow: hidden; +} + +.graph-related-persons-button { + position: absolute; + top: 12px; + right: 12px; + z-index: 2; + + width: 51px; + height: 51px; + padding: 0; + + background: transparent; + color: $related-person-color; + box-shadow: none; +} + +.graph-related-persons-button:hover { + background: rgba(84, 112, 198, 0.08); +} + +.graph-related-persons-icon { + width: 51px; + height: 51px; + + font-size: 51px; + line-height: 51px; + font-variation-settings: + 'FILL' 1, + 'wght' 400, + 'GRAD' 0, + 'opsz' 48; +} + +.graph { + width: 100%; + height: 100%; + min-height: 0; + overscroll-behavior: contain; + touch-action: none; + user-select: none; + cursor: grab; +} + +.graph:active { + cursor: grabbing; +} + +.role-legend { + flex: 0 0 auto; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: center; + gap: 10px 18px; + padding: 10px 18px 6px; +} + +.role-legend-item { + display: inline-flex; + align-items: center; + gap: 8px; + min-width: 0; + color: $text-muted; + font-size: 12px; + font-weight: 600; +} + +.role-legend-line { + flex: 0 0 auto; + display: inline-block; + width: 24px; + height: 3px; + border-radius: 999px; +} + +.role-legend-text { + min-width: 0; + max-width: 260px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.graph-note { + flex: 0 0 auto; + margin: 0; + padding: 4px 18px 16px; + color: $text-muted; + font-size: 13px; + line-height: 1.35; + text-align: left; +} + +.disclaimer { + flex: 0 0 auto; + margin: 14px 0 0; + padding: 12px 14px; + border-left: 3px solid $timeline-purple; + border-radius: 8px; + background: $timeline-purple-bg; + color: $text-muted; + font-size: 13px; + line-height: 1.45; +} + +.connection-list { + flex: 1 1 auto; + min-height: 0; + display: flex; + flex-direction: column; +} + +.list-header, +.connection-row { + display: grid; + grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); + gap: clamp(10px, 1vw, 18px); + align-items: center; +} + +.list-header { + flex: 0 0 auto; + padding: 12px 16px; + border-bottom: 1px solid $card-border; + background: #fbfdff; + color: $text-muted; + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.02em; + line-height: 1.3; +} + +.list-header span, +.connection-row span { + min-width: 0; + justify-self: start; + text-align: left; +} + +.list-scroll { + flex: 1 1 auto; + min-height: 0; + overflow-y: auto; +} + +.connection-item { + border-bottom: 1px solid #edf2fb; +} + +.connection-row { + padding: 14px 16px; + color: $text-main; + font-size: 14px; + cursor: pointer; + + &:hover { + background: #f8fbff; + } + + &.selected { + background: #f0f6ff; + box-shadow: inset 3px 0 0 $marked-color; + } + + &.removed { + color: $text-muted; + } +} + +.company-name, +.role-value, +.detail-value, +.officer-name, +.officer-role { + display: block; + max-width: 100%; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.company-name { + font-weight: 700; +} + +.role-value { + width: auto; + padding-left: 8px; + border-left: 3px solid; + color: $text-main; +} + +.connection-detail { + padding: 0 16px 16px; + background: #f8fbff; +} + +.detail-grid { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 10px 18px; + padding: 14px 0 4px; + border-top: 1px solid #e5edf8; +} + +.detail-field { + min-width: 0; +} + +.detail-field--wide { + grid-column: 1 / -1; +} + +.detail-field--address .detail-value, +.detail-field--wide .detail-value { + overflow: visible; + text-overflow: unset; + white-space: normal; +} + +.detail-label { + display: block; + margin-bottom: 3px; + color: $text-muted; + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0.02em; +} + +.detail-value { + color: $text-main; + font-size: 13px; + line-height: 1.35; +} + +.detail-value.detail-status { + display: block; + margin: 0; + padding: 0; + border: 0; + border-radius: 0; + background: transparent; + font-size: 13px; + font-weight: 700; + line-height: 1.35; +} + +.detail-value.detail-status--active { + color: #218354; +} + +.detail-value.detail-status--removed { + color: #6b7280; +} + +.officers-toggle { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + margin-top: 14px; + padding: 12px 0 0; + border: 0; + border-top: 1px solid #e5edf8; + background: transparent; + color: $text-muted; + font-size: 11px; + font-weight: 700; + text-align: left; + text-transform: uppercase; + letter-spacing: 0.02em; + cursor: pointer; +} + +.officers-toggle mat-icon { + color: $text-muted; +} + +.related-officers { + display: flex; + flex-direction: column; + gap: 6px; + margin: 8px 0 0; + padding: 0; +} + +.related-officer { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) 40px; + gap: 12px; + align-items: center; + color: $text-main; + font-size: 13px; +} + +.officer-name { + color: $text-main; + font-weight: 400; +} + +.officer-role { + padding-left: 10px; + border-left: 4px solid #8a95b3; + color: $text-main; + font-weight: 600; +} + +.officer-open-link { + justify-self: center; + color: $marked-color; +} + +.officer-open-placeholder { + display: block; + width: 40px; + height: 40px; +} + +@media (max-width: 1450px) { + .main-layout { + grid-template-columns: 1fr; + height: auto; + } + + .graph-card { + height: 520px; + } + + .connection-list { + height: 520px; + } +} + +@media (max-width: 760px) { + .company-connections { + padding: 18px 16px 28px; + } + + .empty-state { + margin: 14px 16px; + } + + .graph-card { + height: 420px; + } + + .list-header { + display: none; + } + + .connection-row { + grid-template-columns: 1fr; + gap: 8px; + } + + .detail-grid { + grid-template-columns: 1fr; + } + + .related-officer { + grid-template-columns: minmax(0, 1fr) 40px; + gap: 6px 10px; + } + + .officer-role { + grid-column: 1 / 2; + } + + .officer-open-link, + .officer-open-placeholder { + grid-column: 2 / 3; + grid-row: 1 / 3; + align-self: center; + justify-self: center; + } +} diff --git a/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts new file mode 100644 index 00000000..742349e8 --- /dev/null +++ b/webapp/src/app/modules/person-company-connections/person-company-connections.component.ts @@ -0,0 +1,702 @@ +import { CommonModule, LocationStrategy } from '@angular/common'; +import { + Component, + ElementRef, + OnInit, + QueryList, + ViewChildren, + inject, +} from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltip, MatTooltipModule } from '@angular/material/tooltip'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { ActivatedRoute, Router, RouterModule } from '@angular/router'; +import { EChartsOption } from 'echarts'; +import { NgxEchartsDirective } from 'ngx-echarts'; + +import { + CompanyConnection, + CompanyConnectionsResponse, + CompanyConnectionsService, + MatchedOfficer, +} from '../../api'; + +interface RoleLegendItem { + role: string; + color: string; +} + +@Component({ + selector: 'app-person-company-connections', + imports: [ + CommonModule, + MatProgressSpinnerModule, + NgxEchartsDirective, + MatButtonModule, + MatCardModule, + MatIconModule, + MatTooltipModule, + MatTooltip, + RouterModule, + ], + templateUrl: './person-company-connections.component.html', + styleUrl: './person-company-connections.component.scss', +}) +export class PersonCompanyConnectionsComponent implements OnInit { + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly locationStrategy = inject(LocationStrategy); + private readonly companyConnectionsApi = inject(CompanyConnectionsService); + + private readonly graphCompanyLimit = 10; + + private readonly personCategoryIndex = 0; + private readonly activeCompanyCategoryIndex = 1; + private readonly removedCompanyCategoryIndex = 2; + private readonly registerPersonCategoryIndex = 3; + + private readonly personCategoryName = 'Person'; + private readonly activeCompanyCategoryName = 'Aktives Unternehmen'; + private readonly removedCompanyCategoryName = 'Gelöschtes Unternehmen'; + private readonly registerPersonCategoryName = 'Registerperson'; + + private readonly authorColor = '#7255d9'; + private readonly companyActiveColor = '#39a96b'; + private readonly companyRemovedColor = '#8a95b3'; + private readonly relatedPersonColor = '#4f8df5'; + private readonly fallbackRoleColor = '#8a95b3'; + + private readonly personIconSymbol = this.createAccountCircleSymbol( + this.authorColor, + ); + + private readonly registerPersonIconSymbol = this.createAccountCircleSymbol( + this.relatedPersonColor, + ); + + private readonly activeCompanyIconSymbol = this.createApartmentSymbol( + this.companyActiveColor, + ); + + private readonly removedCompanyIconSymbol = this.createApartmentSymbol( + this.companyRemovedColor, + ); + + private readonly roleColors: Record = { + Geschäftsführer: '#2678e8', + Prokurist: '#39a96b', + 'Persönlich haftender Gesellschafter': '#7255d9', + Liquidator: '#f59e0b', + Inhaber: '#e0527c', + Vorstand: '#0f766e', + }; + + readonly disclaimer = + 'Die angezeigten Verbindungen basieren nur auf einem Namensabgleich und können gleichnamige Personen enthalten.'; + + loading = true; + error = false; + data: CompanyConnectionsResponse | null = null; + + graphOptions: EChartsOption | null = null; + roleLegendItems: RoleLegendItem[] = []; + + selectedCompanyKey: string | null = null; + expandedOfficersCompanyKey: string | null = null; + showRelatedPersons = false; + + @ViewChildren('connectionRow', { read: ElementRef }) + private connectionRows!: QueryList>; + + get connections(): CompanyConnection[] { + return this.data?.connections ?? []; + } + + ngOnInit(): void { + this.route.parent?.paramMap.subscribe((params) => { + const authorId = params.get('id'); + + if (!authorId) { + this.loading = false; + this.error = true; + return; + } + + this.loadCompanyConnections(authorId); + }); + } + + getPrimaryOfficer(connection: CompanyConnection): MatchedOfficer | null { + return connection.matched_officers?.[0] ?? null; + } + + getRelatedOfficers(connection: CompanyConnection): MatchedOfficer[] { + const displayName = this.data?.display_name?.trim(); + + return (connection.officers ?? []).filter((officer) => { + const officerName = officer.name?.trim(); + + if (!officerName) { + return false; + } + + if (officer.is_matched_person) { + return false; + } + + return officerName !== displayName; + }); + } + + getCompanyStatusLabel(status?: string | null): string { + if (status === 'currently registered') { + return 'Aktiv'; + } + + if (status === 'removed') { + return 'Gelöscht'; + } + + return status || 'Unbekannt'; + } + + getCompanyKey(connection: CompanyConnection): string { + return ( + connection.company_number || + `${connection.company_name}-${connection.register_art}-${connection.register_nummer}` + ); + } + + getCompanyRegisterLabel(connection: CompanyConnection): string { + const parts = [connection.register_art, connection.register_nummer].filter( + Boolean, + ); + + return parts.length > 0 ? parts.join(' ') : '—'; + } + + getRegistrarLabel(connection: CompanyConnection): string { + return connection.registrar || '—'; + } + + getCompanyAddressLabel(connection: CompanyConnection): string { + return connection.registered_address || connection.registered_office || '—'; + } + + getGegenstandLabel(): string { + return 'Noch nicht verfügbar.'; + } + + getResultCountLabel(): string { + if (!this.data) { + return ''; + } + + const companyCount = this.data.company_count ?? this.connections.length; + + if (companyCount === 1) { + return '1 Treffer'; + } + + return `${companyCount} Treffer`; + } + + getRoleColor(role?: string | null): string { + if (!role) { + return this.fallbackRoleColor; + } + + return this.roleColors[role] ?? this.fallbackRoleColor; + } + + isCompanySelected(connection: CompanyConnection): boolean { + return this.selectedCompanyKey === this.getCompanyKey(connection); + } + + isCompanyOfficersExpanded(connection: CompanyConnection): boolean { + return this.expandedOfficersCompanyKey === this.getCompanyKey(connection); + } + + selectCompany(connection: CompanyConnection): void { + const companyKey = this.getCompanyKey(connection); + + if (this.selectedCompanyKey === companyKey) { + this.selectedCompanyKey = null; + this.expandedOfficersCompanyKey = null; + return; + } + + this.selectedCompanyKey = companyKey; + this.expandedOfficersCompanyKey = null; + } + + toggleCompanyOfficers(connection: CompanyConnection, event: Event): void { + event.stopPropagation(); + + const companyKey = this.getCompanyKey(connection); + + if (this.expandedOfficersCompanyKey === companyKey) { + this.expandedOfficersCompanyKey = null; + return; + } + + this.expandedOfficersCompanyKey = companyKey; + } + + onGraphClick(event: any): void { + if (event.dataType !== 'node') { + return; + } + + if (event.data?.category === this.personCategoryIndex) { + return; + } + + if (this.isCompanyNodeCategory(event.data?.category)) { + this.selectedCompanyKey = event.data.id; + this.expandedOfficersCompanyKey = null; + this.scrollSelectedCompanyIntoView(); + return; + } + + if (event.data?.category === this.registerPersonCategoryIndex) { + this.openPersonSearchInNewTab(event.data.searchName || event.data.name); + } + } + + onGraphWheel(event: WheelEvent): void { + event.preventDefault(); + } + + private isCompanyNodeCategory(category: unknown): boolean { + return ( + category === this.activeCompanyCategoryIndex || + category === this.removedCompanyCategoryIndex + ); + } + + toggleRelatedPersons(tooltip?: MatTooltip): void { + this.showRelatedPersons = !this.showRelatedPersons; + this.refreshGraph(); + + tooltip?.hide(0); + + window.setTimeout(() => { + tooltip?.show(0); + }); + } + + private loadCompanyConnections(authorId: string): void { + this.loading = true; + this.error = false; + this.data = null; + this.graphOptions = null; + this.roleLegendItems = []; + this.selectedCompanyKey = null; + this.expandedOfficersCompanyKey = null; + this.showRelatedPersons = false; + + this.companyConnectionsApi + .getCompanyConnectionsByAuthor(authorId) + .subscribe({ + next: (response) => { + this.data = response; + this.graphOptions = this.createGraphOptions(response); + this.loading = false; + }, + error: (error) => { + console.error('Failed to load company connections:', error); + this.error = true; + this.loading = false; + }, + }); + } + + private refreshGraph(): void { + if (!this.data) { + this.graphOptions = null; + this.roleLegendItems = []; + return; + } + + this.graphOptions = this.createGraphOptions(this.data); + } + + private createGraphOptions( + response: CompanyConnectionsResponse, + ): EChartsOption | null { + const connections = response.connections ?? []; + + if (!response.is_ude_author || connections.length === 0) { + return null; + } + + const graphConnections = connections.slice(0, this.graphCompanyLimit); + + this.roleLegendItems = this.createRoleLegendItems(graphConnections); + + const personNodeId = `author-${response.author_id}`; + + const nodes: any[] = [ + { + id: personNodeId, + name: response.display_name || 'Person', + category: this.personCategoryIndex, + symbol: this.personIconSymbol, + symbolSize: 42, + symbolKeepAspect: true, + itemStyle: { + color: this.authorColor, + }, + label: { + show: true, + position: 'bottom', + fontWeight: 700, + color: '#07163d', + }, + }, + ]; + + const links: any[] = []; + + for (const connection of graphConnections) { + const companyKey = this.getCompanyKey(connection); + const isRemoved = connection.company_status === 'removed'; + + nodes.push({ + id: companyKey, + name: connection.company_name || 'Unbekanntes Unternehmen', + category: isRemoved + ? this.removedCompanyCategoryIndex + : this.activeCompanyCategoryIndex, + symbol: isRemoved + ? this.removedCompanyIconSymbol + : this.activeCompanyIconSymbol, + symbolSize: 44, + symbolKeepAspect: true, + itemStyle: { + color: isRemoved ? this.companyRemovedColor : this.companyActiveColor, + }, + label: { + show: true, + position: 'bottom', + color: '#07163d', + width: 125, + overflow: 'truncate', + }, + }); + + const officer = this.getPrimaryOfficer(connection); + const role = officer?.position || 'Unbekannte Rolle'; + const color = this.getRoleColor(officer?.position); + + links.push({ + source: personNodeId, + target: companyKey, + value: role, + lineStyle: { + color, + width: 2.4, + opacity: 1, + }, + }); + + if (this.showRelatedPersons) { + const relatedOfficers = this.getRelatedOfficers(connection); + + relatedOfficers.forEach((relatedOfficer, index) => { + const relatedOfficerId = `officer-${companyKey}-${index}`; + const relatedRole = relatedOfficer.position || 'Unbekannte Rolle'; + + nodes.push({ + id: relatedOfficerId, + name: relatedOfficer.name || 'Registerperson', + searchName: relatedOfficer.name, + role: relatedRole, + category: this.registerPersonCategoryIndex, + symbol: this.registerPersonIconSymbol, + symbolSize: 30, + symbolKeepAspect: true, + itemStyle: { + color: this.relatedPersonColor, + }, + label: { + show: true, + position: 'bottom', + color: '#07163d', + width: 110, + overflow: 'truncate', + fontSize: 11, + }, + }); + + links.push({ + source: companyKey, + target: relatedOfficerId, + value: relatedRole, + lineStyle: { + color: this.getRoleColor(relatedOfficer.position), + width: 1.8, + opacity: 1, + }, + }); + }); + } + } + + const graphSeries: any = { + type: 'graph', + layout: 'force', + roam: true, + roamTrigger: 'global', + animation: false, + top: 34, + left: 20, + right: 20, + bottom: 64, + data: nodes, + links, + categories: this.createGraphCategories(), + force: { + repulsion: this.showRelatedPersons ? 760 : 620, + edgeLength: this.showRelatedPersons ? 145 : 170, + gravity: 0.08, + }, + lineStyle: { + curveness: 0.05, + opacity: 1, + }, + edgeSymbol: ['none', 'none'], + emphasis: { + focus: 'adjacency', + lineStyle: { + width: 3.5, + }, + }, + }; + + return { + legend: { + data: this.createNodeLegendData(graphConnections), + bottom: 8, + left: 'center', + orient: 'horizontal', + itemGap: 18, + itemWidth: 20, + itemHeight: 20, + selectedMode: false, + textStyle: { + color: '#3f4659', + fontSize: 13, + fontWeight: 500, + }, + }, + tooltip: { + trigger: 'item', + formatter: (params: any) => { + if (params.dataType === 'node') { + if (params.data?.category === this.registerPersonCategoryIndex) { + return params.data?.role + ? `${params.data.name}
Rolle: ${params.data.role}` + : params.data?.name; + } + + return params.data?.name ?? ''; + } + + if (params.dataType === 'edge') { + return params.data?.value + ? `Rolle: ${params.data.value}` + : 'Verbindung'; + } + + return ''; + }, + }, + series: [graphSeries], + } as EChartsOption; + } + + private createGraphCategories(): any[] { + return [ + { + name: this.personCategoryName, + symbol: this.personIconSymbol, + }, + { + name: this.activeCompanyCategoryName, + symbol: this.activeCompanyIconSymbol, + }, + { + name: this.removedCompanyCategoryName, + symbol: this.removedCompanyIconSymbol, + }, + { + name: this.registerPersonCategoryName, + symbol: this.registerPersonIconSymbol, + }, + ]; + } + + private createNodeLegendData(connections: CompanyConnection[]): any[] { + const hasActiveCompany = connections.some( + (connection) => connection.company_status !== 'removed', + ); + const hasRemovedCompany = connections.some( + (connection) => connection.company_status === 'removed', + ); + + const legendData = [ + { + name: this.personCategoryName, + icon: this.personIconSymbol, + }, + ]; + + if (hasActiveCompany) { + legendData.push({ + name: this.activeCompanyCategoryName, + icon: this.activeCompanyIconSymbol, + }); + } + + if (hasRemovedCompany) { + legendData.push({ + name: this.removedCompanyCategoryName, + icon: this.removedCompanyIconSymbol, + }); + } + + if (this.showRelatedPersons) { + legendData.push({ + name: this.registerPersonCategoryName, + icon: this.registerPersonIconSymbol, + }); + } + + return legendData; + } + + private createRoleLegendItems( + connections: CompanyConnection[], + ): RoleLegendItem[] { + const usedRoles = new Set(); + + for (const connection of connections) { + const role = this.getPrimaryOfficer(connection)?.position; + + if (role) { + usedRoles.add(role); + } + + if (this.showRelatedPersons) { + for (const officer of this.getRelatedOfficers(connection)) { + if (officer.position) { + usedRoles.add(officer.position); + } + } + } + } + + return [...usedRoles] + .sort((a, b) => a.localeCompare(b)) + .map((role) => ({ + role, + color: this.getRoleColor(role), + })); + } + + openPersonSearchInNewTab(name?: string | null): void { + const url = this.createPersonSearchUrl(name); + + if (!url) { + return; + } + + window.open(url, '_blank', 'noopener,noreferrer'); + } + + private createPersonSearchUrl(name?: string | null): string | null { + const query = name?.trim(); + + if (!query) { + return null; + } + + const urlTree = this.router.createUrlTree(['/persons'], { + queryParams: this.getPersonSearchQueryParams(query), + }); + + const internalUrl = this.router.serializeUrl(urlTree); + + return this.locationStrategy.prepareExternalUrl(internalUrl); + } + + getPersonSearchQueryParams(name?: string | null): { + query: string; + page: number; + } { + return { + query: name?.trim() ?? '', + page: 1, + }; + } + + private scrollSelectedCompanyIntoView(): void { + window.setTimeout(() => { + if (!this.selectedCompanyKey) { + return; + } + + const selectedRow = this.connectionRows.find((row) => { + return ( + row.nativeElement.dataset['companyKey'] === this.selectedCompanyKey + ); + }); + + selectedRow?.nativeElement.scrollIntoView({ + block: 'nearest', + behavior: 'smooth', + }); + }); + } + + private createAccountCircleSymbol(color: string): string { + const backgroundPath = + 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z'; + + const foregroundPath = + 'M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z'; + + const svg = ` + + + + + `; + + return this.toSvgImageSymbol(svg); + } + + private createApartmentSymbol(color: string): string { + const backgroundPath = 'M17 11V3H7v4H3v14h18V11h-4z'; + + const foregroundPath = + 'M17 11V3H7v4H3v14h18V11h-4zM7 19H5v-2h2v2zm0-4H5v-2h2v2zm0-4H5V9h2v2zm4 8H9v-2h2v2zm0-4H9v-2h2v2zm0-4H9V9h2v2zm0-4H9V5h2v2zm4 12h-2v-2h2v2zm0-4h-2v-2h2v2zm0-4h-2V9h2v2zm0-4h-2V5h2v2zm4 12h-2v-2h2v2zm0-4h-2v-2h2v2z'; + + const svg = ` + + + + + `; + + return this.toSvgImageSymbol(svg); + } + + private toSvgImageSymbol(svg: string): string { + return `image://data:image/svg+xml;utf8,${encodeURIComponent(svg.trim())}`; + } +} diff --git a/webapp/src/app/modules/person-funding/person-funding.component.html b/webapp/src/app/modules/person-funding/person-funding.component.html index ff01f61e..119b3a5a 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.html +++ b/webapp/src/app/modules/person-funding/person-funding.component.html @@ -4,32 +4,350 @@

Fehler beim Laden der Förderungen.

} @else if (funders.length === 0) {

Keine Förderungen gefunden.

+} @else if (selectedPublicationDetailId) { + @if (getSelectedPublicationDetail(); as publication) { +
+ + +
+
+
+ @if (publication.publication_year) { + {{ publication.publication_year }} + } + @if (hasTextValue(getPublicationTypeLabel(publication))) { + {{ getPublicationTypeLabel(publication) }} + } + @if (hasTextValue(getLanguageLabel(publication))) { + {{ getLanguageLabel(publication) }} + } +
+

{{ publication.title }}

+ @if (hasPublicationSource(publication)) { +

+ {{ getPublicationSourceLabel(publication) }} +

+ } +

+ {{ getPublicationAuthors(publication) }} +

+
+ @if (typeof publication.cited_by_count === 'number') { + + {{ + publication.cited_by_count + }} + Zitationen + + } + + {{ getOpenAccessBadge(publication).label }} + + + {{ getPositionLabel(publication.author_position || 'unknown') }} + +
+
+ @if (getPublicationExternalUrl(publication); as externalUrl) { + + Zur Publikation + open_in_new + + } +
+ +
+
+
+

Überblick

+

+
+ +
+

Abstract

+

+ {{ publication.abstract || 'Kein Abstract vorhanden.' }} +

+
+ + @if (publication.publication_date) { +
+

Publikationsdaten

+
+
+
Datum
+
{{ getPublicationDateLabel(publication) }}
+
+
+
+ } + + @if ( + hasTextValue(publication.primary_topic) || + hasTextValue(publication.topic_field) || + hasTextValue(publication.topic_subfield) || + hasTextValue(publication.topic_domain) || + hasListValues(publication.topics) || + hasListValues(publication.keywords) + ) { +
+

Einordnung

+
+ @if (hasTextValue(publication.primary_topic)) { +
+
Hauptthema
+
{{ publication.primary_topic }}
+
+ } + @if (hasTextValue(publication.topic_field)) { +
+
Fachgebiet
+
{{ publication.topic_field }}
+
+ } + @if (hasTextValue(publication.topic_subfield)) { +
+
Teilgebiet
+
{{ publication.topic_subfield }}
+
+ } + @if (hasTextValue(publication.topic_domain)) { +
+
Bereich
+
{{ publication.topic_domain }}
+
+ } + @if (hasListValues(publication.topics)) { +
+
Themen
+
+
    + @for (topic of publication.topics; track topic) { +
  • {{ topic }}
  • + } +
+
+
+ } + @if (hasListValues(publication.keywords)) { +
+
Keywords
+
+
    + @for (keyword of publication.keywords; track keyword) { +
  • {{ keyword }}
  • + } +
+
+
+ } +
+
+ } + + @if ( + getCitationCountsByYear(publication).length || + publication.is_retracted + ) { +
+

Wirkung

+
+ @if (getCitationCountsByYear(publication); as citationYears) { + @if (citationYears.length) { +
+
Zitiert pro Jahr
+
+ + + @for (entry of citationYears; track entry.year) { + + + + + } + +
{{ entry.year }}{{ entry.count }}
+
+
+ } + } + @if (publication.is_retracted) { +
+
Zurückgezogen
+
+ Ja, zurückgezogen +
+
+ } +
+
+ } + +
+

Zugang

+
+
+
Open Access
+
+ + {{ getOpenAccessBadge(publication).label }} + +
+
+
+
Volltext
+
+ {{ getFulltextLabel(publication) }} + @if (publication.pdf_url) { + + PDF öffnen + open_in_new + + } +
+
+ @if (hasTextValue(getLicenseLabel(publication))) { +
+
Lizenz
+
{{ getLicenseLabel(publication) }}
+
+ } +
+
+
+ + +
+
+ } } @else {
-
-

- {{ getUniquePublicationCount() }} - Einzigartige Publikationen -

-

- {{ filteredFunders.length }} - Förderer -

-
- - -
- Filter nach Position: - - - - -
-
-
+
+
+ Filter nach Position: + + + + +
+ +
@@ -41,8 +359,7 @@ @for (funder of getPagedFunders(); track funder.funder_id) { + (click)="selectFunder(funder)"> @@ -51,11 +368,18 @@
{{ funder.funder_name }} {{ getPublicationCount(funder) }}
@if (hasFunderListPagination()) {
- - Seite {{ selectedFunderListPage }} von {{ getFunderListPageCount() }} -
@@ -69,40 +393,69 @@
@if (shouldShowPosition('first')) { -
- Erstautor - {{ selectedFunder.author_position_count.first }} -
+
+ Erstautor + {{ + selectedFunder.author_position_count.first + }} +
} @if (shouldShowPosition('middle')) { -
- Mitautor - {{ selectedFunder.author_position_count.middle }} -
+
+ Mitautor + {{ + selectedFunder.author_position_count.middle + }} +
} @if (shouldShowPosition('last')) { -
- Letztautor - {{ selectedFunder.author_position_count.last }} -
+
+ Letztautor + {{ + selectedFunder.author_position_count.last + }} +
}

Publikationen

    @for (id of getSelectedPublicationIdsPage(); track id) { -
  • - {{ id }} +
  • + {{ + getPublicationTitle(id) + }} + @if (expandedPublicationId === id) { + + }
  • }
@if (hasPublicationPagination()) {
- - Seite {{ selectedPublicationPage }} von {{ getSelectedPublicationPageCount() }} -
@@ -110,10 +463,46 @@
} @else {
-

Klicke auf einen Förderer für Details.

+
+ @if (activeFilter !== 'all') { + + Filter: {{ getPositionLabel(activeFilter) }} + + } +

Förderübersicht

+

+ @if (activeFilter === 'all') { + Alle geförderten Publikationen dieser Person im Überblick. + } @else { + Nur Publikationen mit der gewählten Autorenposition. + } +

+
+
+ {{ + getUniquePublicationCount() + }} + Einzigartige Publikationen +
+
+ {{ + filteredFunders.length + }} + Förderer +
+
+
+ +

+ Wähle links einen Förderer aus, um die zugehörigen Publikationen + anzuzeigen. +

+
+
} -
} diff --git a/webapp/src/app/modules/person-funding/person-funding.component.scss b/webapp/src/app/modules/person-funding/person-funding.component.scss index b9f511c9..c9bd848e 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.scss +++ b/webapp/src/app/modules/person-funding/person-funding.component.scss @@ -23,27 +23,84 @@ button { padding: 6px 14px; - border: 1px solid #ccc; + border: 1px solid transparent; border-radius: 20px; - background: white; + background: #fff; cursor: pointer; font-size: 14px; - transition: all 0.2s; - - &:hover { - background: #f0f0f0; - } + font-weight: 500; &.active { - background: - radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.78), transparent 34%), - linear-gradient(145deg, #c8d9ff, #f7faff 48%, #88a9ee); - color: var(--sg-primary); - border-color: var(--sg-border); font-weight: 600; - box-shadow: var(--sg-shadow-sm); + border-width: 2px; + padding: 5px 13px; } } + + button:nth-child(2) { + color: #3b82c4; + border-color: #c7dcfa; + &.active { + color: #0b4f9e; + background: #e8f2ff; + border-color: #3b82c4; + } + } + + button:nth-child(3) { + color: #3d9a66; + border-color: #b8e6cb; + &.active { + color: #1a6b3f; + background: #e8f7ee; + border-color: #3d9a66; + } + } + + button:nth-child(4) { + color: #7c65d9; + border-color: #d5c8f8; + &.active { + color: #5b3fc9; + background: #f0ebff; + border-color: #7c65d9; + } + } + + button:nth-child(5) { + color: #d1435f; + border-color: #f8c4ce; + &.active { + color: #a61e3a; + background: #ffe8ec; + border-color: #d1435f; + } + } +} + +.sort-control { + display: inline-flex; + align-items: center; + gap: 6px; + width: fit-content; + padding: 10px 14px; + border-radius: 20px; + background: #f2f2f2; + color: #333; + font-size: 14px; + + span { + color: #555; + } + + select { + border: 0; + background: transparent; + color: #111827; + font: inherit; + cursor: pointer; + outline: none; + } } .funding-content { @@ -55,6 +112,19 @@ .funding-list { flex: 1; + .funding-list-toolbar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; + flex-wrap: wrap; + } + + .sort-control { + margin-left: auto; + } + table { width: 100%; border-collapse: collapse; @@ -69,12 +139,6 @@ tr { cursor: pointer; - transition: background 0.15s; - - &:hover { - background: #f5f5f5; - } - &.selected { background: #f0f0f0; } @@ -93,7 +157,7 @@ } .funding-detail { - width: 340px; + width: 440px; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; @@ -103,18 +167,26 @@ display: flex; align-items: center; justify-content: center; - color: #999; - min-height: 200px; + min-height: 280px; + padding: 24px; + background: + radial-gradient( + circle at 100% 0%, + rgba(200, 217, 255, 0.35), + transparent 45% + ), + linear-gradient(160deg, #fff 0%, #f8faff 100%); + border-color: #dbe3f2; } h3 { - margin: 0 0 16px 0; + margin: 0 0 16px; font-size: 16px; color: #333; } h4 { - margin: 16px 0 8px 0; + margin: 16px 0 8px; font-size: 14px; color: #555; } @@ -123,12 +195,13 @@ .position-stats { display: flex; gap: 12px; - margin-bottom: 16px; + margin: 0 auto 16px; + width: fit-content; .stat { - flex: 1; + min-width: 100px; text-align: center; - background: white; + background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px; @@ -149,6 +222,50 @@ } } +.stat-first, +.position-badge--first, +.hero-highlight--open, +.publication-detail-grid .access-badge--open { + background: #effaf3; +} + +.stat-first { + border-color: #bdebcf; +} + +.position-badge--first { + color: #24834f; + border: 1px solid #bdebcf; +} + +.hero-highlight--open, +.publication-detail-grid .access-badge--open { + border-color: #bdebcf; + color: #24834f; +} + +.stat-middle, +.position-badge--middle { + background: #f6f0ff; + border-color: #d8cafe; +} + +.position-badge--middle { + color: #7255d9; + border: 1px solid #d8cafe; +} + +.stat-last, +.position-badge--last { + background: #fff1f2; + border-color: #fda4af; +} + +.position-badge--last { + color: #be123c; + border: 1px solid #fda4af; +} + .publication-list { list-style: none; padding: 0; @@ -158,19 +275,8 @@ li { padding: 6px 0; - border-bottom: 1px solid #f0f0f0; + border-bottom: 1px solid #5b5555; font-size: 13px; - - a { - color: #2563eb; - text-decoration: none; - word-break: break-all; - - &:hover { - color: #1d4ed8; - text-decoration: underline; - } - } } } @@ -185,7 +291,7 @@ padding: 4px 10px; border: 1px solid #d0d0d0; border-radius: 6px; - background: white; + background: #fff; cursor: pointer; font-size: 12px; @@ -201,21 +307,413 @@ } } -.funding-summary { - margin-bottom: 16px; +.empty-overview { + width: 100%; + text-align: center; - .summary-line { - margin: 0 0 4px 0; - font-size: 14px; - color: #333; - } - - .summary-label { - color: #333; - } - - .summary-value { + &__filter { + display: inline-block; + margin-bottom: 12px; + padding: 4px 12px; + border: 1px solid #dbe3f2; + border-radius: 999px; + background: rgba(255, 255, 255, 0.9); + color: #475569; + font-size: 0.75rem; font-weight: 600; - color: #333; + text-transform: uppercase; + } + + &__title { + margin: 0 0 8px; + font-size: 1.125rem; + color: #1e3a5f; + } + + &__subtitle { + margin: 0 0 20px; + color: #64748b; + font-size: 0.875rem; + line-height: 1.5; + } + + &__stats { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 12px; + margin-bottom: 20px; + } + + &__stat { + display: flex; + flex-direction: column; + gap: 6px; + padding: 16px 12px; + border: 1px solid #e0e6f0; + border-radius: 10px; + background: rgba(255, 255, 255, 0.85); + } + + &__stat-value { + font-size: 1.75rem; + font-weight: 700; + line-height: 1.1; + color: #1e3a5f; + } + + &__stat-label { + font-size: 0.8rem; + line-height: 1.35; + color: #64748b; + } + + &__hint { + display: flex; + align-items: flex-start; + gap: 10px; + padding: 12px 14px; + border: 1px dashed #c7d5ea; + border-radius: 10px; + background: rgba(255, 255, 255, 0.7); + text-align: left; + + .material-icons { + font-size: 20px; + color: #3b82c4; + } + + p { + margin: 0; + color: #475569; + font-size: 0.875rem; + line-height: 1.45; + } + } +} + +.funding-publication-page { + padding: 16px; +} + +.publication-detail-back, +.publication-more-info { + display: inline-flex; + align-items: center; + border: 0; + background: transparent; + cursor: pointer; +} + +.publication-detail-back { + gap: 6px; +} + +.publication-more-info { + gap: 4px; + margin-top: 6px; + padding: 0; +} + +.publication-detail-hero { + display: flex; + justify-content: space-between; + gap: 20px; + align-items: flex-start; + padding: 24px; + border: 1px solid #dbe3f2; + border-radius: 12px; + margin-bottom: 16px; + background: + radial-gradient( + circle at 95% 5%, + rgba(200, 217, 255, 0.45), + transparent 35% + ), + linear-gradient(140deg, #fff 0%, #f8faff 100%); + + &__content { + min-width: 0; + flex: 1; + } + + &__meta { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-bottom: 12px; + + span { + padding: 4px 10px; + border: 1px solid #dbe3f2; + border-radius: 999px; + background: rgba(255, 255, 255, 0.9); + color: #64748b; + font-size: 0.75rem; + font-weight: 700; + text-transform: uppercase; + } + } + + h2 { + margin: 0 0 10px; + font-size: clamp(1.25rem, 2vw, 1.75rem); + line-height: 1.25; + color: #1e3a5f; + } + + &__source { + margin: 0 0 8px; + color: #334155; + font-weight: 600; + line-height: 1.4; + } + + &__authors { + margin: 0 0 16px; + color: #64748b; + line-height: 1.5; + font-size: 0.9rem; + } + + &__highlights { + display: flex; + flex-wrap: wrap; + gap: 8px; + align-items: center; + } + + &__action { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 10px 16px; + border: 1px solid #bdd4ff; + border-radius: 8px; + background: #f0f6ff; + color: #0b63ce; + font-weight: 600; + font-size: 0.875rem; + text-decoration: none; + + .material-icons { + font-size: 18px; + } + } +} + +.hero-highlight { + display: inline-flex; + flex-direction: column; + padding: 8px 12px; + border: 1px solid #e0e6f0; + border-radius: 8px; + background: rgba(255, 255, 255, 0.85); + + &__value { + font-size: 1.25rem; + font-weight: 700; + color: #1e3a5f; + line-height: 1.1; + } + + &__label { + font-size: 0.7rem; + color: #64748b; + text-transform: uppercase; + } + + &--badge { + flex-direction: row; + align-items: center; + min-width: 0; + font-size: 0.8rem; + font-weight: 600; + color: #475569; + } + + &--closed { + border-color: #e0e6f0; + background: #f8fafc; + color: #64748b; + } +} + +.position-badge { + display: inline-flex; + align-items: center; + padding: 6px 12px; + border-radius: 999px; + font-size: 0.8rem; + font-weight: 700; + + &--unknown { + background: #f1f5f9; + color: #64748b; + border: 1px solid #e2e8f0; + } +} + +$g: '.publication-detail-grid'; + +#{$g} { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); + gap: 12px; +} + +#{$g} .publication-detail-main, +#{$g} .publication-detail-side { + display: grid; + gap: 12px; + min-width: 0; +} + +#{$g} .publication-detail-section { + border: 1px solid #e0e6f0; + border-radius: 10px; + padding: 18px; + background: #fff; + + h3 { + margin: 0 0 14px; + font-size: 1rem; + color: #1e3a5f; + } +} + +#{$g} .publication-overview, +#{$g} .publication-abstract { + margin: 0; + color: #334155; + line-height: 1.65; +} + +#{$g} .publication-detail-facts { + display: grid; + gap: 12px; + margin: 0; +} + +#{$g} .publication-detail-facts div { + display: grid; + grid-template-columns: 130px minmax(0, 1fr); + gap: 12px; +} + +#{$g} .publication-detail-facts dt { + color: #64748b; + font-size: 0.875rem; +} + +#{$g} .publication-detail-facts dd { + margin: 0; + word-break: break-word; + color: #1e293b; +} + +#{$g} .tag-list { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin: 0; + padding: 0; + list-style: none; +} + +#{$g} .tag, +#{$g} .access-badge, +#{$g} .warning-badge { + display: inline-flex; + padding: 4px 10px; + border-radius: 999px; + font-size: 0.8rem; +} + +#{$g} .tag { + background: #f0f6ff; + border: 1px solid #dbeafe; + color: #1e40af; + line-height: 1.3; +} + +#{$g} .access-badge { + font-weight: 600; + background: #f1f5f9; + color: #64748b; +} + +#{$g} .access-badge--closed { + background: #f8fafc; + color: #475569; +} + +#{$g} .inline-action { + display: inline-flex; + align-items: center; + gap: 4px; + color: #0b63ce; + font-weight: 600; + font-size: 0.875rem; + text-decoration: none; + + .material-icons { + font-size: 16px; + } +} + +#{$g} .warning-badge { + background: #fef2f2; + border: 1px solid #fecaca; + color: #b91c1c; + font-weight: 600; +} + +.publication-item { + padding: 8px 0; + border-bottom: 2px solid #5b5555; + cursor: pointer; +} + +.publication-title { + font-size: 0.875rem; + color: #333; + white-space: normal; + word-break: break-word; + display: block; +} + +.mehr-infos-label, +.publication-link-icon { + color: #1976d2; +} + +.mehr-infos-label { + font-size: 0.8rem; + font-weight: 500; +} + +.publication-link-icon { + display: flex; + align-items: center; + + .material-icons { + font-size: 16px; + } +} + +@media (max-width: 720px) { + .publication-detail-hero { + flex-direction: column; + align-items: stretch; + + &__action { + justify-content: center; + } + } +} + +@media (max-width: 960px) { + #{$g} { + grid-template-columns: 1fr; } } diff --git a/webapp/src/app/modules/person-funding/person-funding.component.ts b/webapp/src/app/modules/person-funding/person-funding.component.ts index 9f7c464c..49a9cce9 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.ts +++ b/webapp/src/app/modules/person-funding/person-funding.component.ts @@ -1,8 +1,54 @@ import { Component, OnInit, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { ActivatedRoute } from '@angular/router'; import { Router } from '@angular/router'; -import { PersonsService } from '../../api'; +import { FundingService } from '../../api'; + +type SortMode = 'name' | 'top'; +type AuthorPosition = 'first' | 'middle' | 'last' | 'unknown'; + +type CitationCountByYear = { + year: number; + count: number; +}; + +type FundingPublicationDetail = { + id: string; + title: string; + abstract?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: AuthorPosition | string | null; + authors?: string[]; + funder_names?: string[]; + institutions?: string[]; + countries?: string[]; + topics?: string[]; + keywords?: string[]; + grant_labels?: string[]; + counts_by_year?: Array<{ + year?: number | null; + cited_by_count?: number | null; + }>; +}; @Component({ selector: 'app-person-funding', @@ -13,56 +59,77 @@ import { PersonsService } from '../../api'; export class PersonFundingComponent implements OnInit { private route = inject(ActivatedRoute); private router = inject(Router); - private personsApi = inject(PersonsService); + private fundingApi = inject(FundingService); + private sanitizer = inject(DomSanitizer); private initialSelectedFunderKey: string | null = null; private initialPublicationPage = 1; private initialFunderListPage = 1; + private initialPublicationDetailId: string | null = null; funders: any[] = []; filteredFunders: any[] = []; + authorName: string | null = null; selectedFunder: any = null; selectedFunderListPage = 1; selectedPublicationPage = 1; readonly funderListPageSize = 10; readonly publicationPageSize = 10; activeFilter: 'all' | 'first' | 'middle' | 'last' = 'all'; + sortMode: SortMode = 'name'; loading = true; error = false; + expandedPublicationId: string | null = null; + selectedPublicationDetailId: string | null = null; ngOnInit(): void { - this.route.parent?.paramMap.subscribe(params => { - const authorId = params.get('id') ?? ''; - const filterFromUrl = this.route.snapshot.queryParamMap.get('filter'); - this.initialSelectedFunderKey = this.route.snapshot.queryParamMap.get('funder'); - this.initialPublicationPage = this.parsePageParam( - this.route.snapshot.queryParamMap.get('publicationPage') ?? this.route.snapshot.queryParamMap.get('page') - ); - this.initialFunderListPage = this.parsePageParam(this.route.snapshot.queryParamMap.get('funderPage')); - if (this.isValidFilter(filterFromUrl)) { - this.activeFilter = filterFromUrl; - } + this.route.parent?.paramMap.subscribe((params) => { + const authorId = params.get('id') ?? ''; + const filterFromUrl = this.route.snapshot.queryParamMap.get('filter'); + const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy'); + this.initialSelectedFunderKey = + this.route.snapshot.queryParamMap.get('funder'); + this.initialPublicationDetailId = + this.route.snapshot.queryParamMap.get('publicationDetail'); + this.initialPublicationPage = this.parsePageParam( + this.route.snapshot.queryParamMap.get('publicationPage') ?? + this.route.snapshot.queryParamMap.get('page'), + ); + this.initialFunderListPage = this.parsePageParam( + this.route.snapshot.queryParamMap.get('funderPage'), + ); + if (this.isValidFilter(filterFromUrl)) { + this.activeFilter = filterFromUrl; + } + if (this.isValidSortMode(sortFromUrl)) { + this.sortMode = sortFromUrl; + } - if (authorId) { - this.personsApi.getFundersByAuthor(authorId).subscribe({ - next: (result: any) => { - this.funders = result.funders ?? []; - this.applyFilter(); - this.selectedFunderListPage = this.clampPage(this.initialFunderListPage, this.getFunderListPageCount()); - this.restoreSelectedFunderFromUrl(); - this.loading = false; - }, - error: () => { - this.error = true; - this.loading = false; - } - }); - } - }); -} + if (authorId) { + this.fundingApi.getFundersByAuthor(authorId).subscribe({ + next: (result: any) => { + this.funders = result.funders ?? []; + this.authorName = result.author_name ?? null; + this.applyFilter(); + this.selectedFunderListPage = this.clampPage( + this.initialFunderListPage, + this.getFunderListPageCount(), + ); + this.restoreSelectedFunderFromUrl(); + this.loading = false; + }, + error: () => { + this.error = true; + this.loading = false; + }, + }); + } + }); + } selectFunder(funder: any): void { this.selectedFunder = funder; this.selectedPublicationPage = 1; + this.selectedPublicationDetailId = null; this.updateQueryParams(); } @@ -72,17 +139,26 @@ export class PersonFundingComponent implements OnInit { this.updateQueryParams(); } + setSortMode(sortMode: SortMode): void { + this.sortMode = sortMode; + this.applyFilter(); + this.updateQueryParams(); + } + private applyFilter(): void { this.selectedFunder = null; + this.selectedPublicationDetailId = null; this.selectedFunderListPage = 1; this.selectedPublicationPage = 1; + let funders: any[]; if (this.activeFilter === 'all') { - this.filteredFunders = this.funders; + funders = this.funders; } else { - this.filteredFunders = this.funders.filter( - f => f.author_position_count[this.activeFilter] > 0 + funders = this.funders.filter( + (f) => f.author_position_count[this.activeFilter] > 0, ); } + this.filteredFunders = this.sortFunders(funders); } private restoreSelectedFunderFromUrl(): void { @@ -91,21 +167,32 @@ export class PersonFundingComponent implements OnInit { } const matchedFunder = this.filteredFunders.find( - (funder: any) => this.getFunderKey(funder) === this.initialSelectedFunderKey + (funder: any) => + this.getFunderKey(funder) === this.initialSelectedFunderKey, ); if (matchedFunder) { this.selectedFunder = matchedFunder; const matchedIndex = this.filteredFunders.findIndex( - (funder: any) => this.getFunderKey(funder) === this.getFunderKey(matchedFunder) + (funder: any) => + this.getFunderKey(funder) === this.getFunderKey(matchedFunder), ); if (matchedIndex >= 0) { - this.selectedFunderListPage = Math.floor(matchedIndex / this.funderListPageSize) + 1; + this.selectedFunderListPage = + Math.floor(matchedIndex / this.funderListPageSize) + 1; } this.selectedPublicationPage = this.clampPublicationPage( this.initialPublicationPage, this.getPublicationPageCountForFunder(matchedFunder), ); + if ( + this.initialPublicationDetailId && + this.getPublicationIds(matchedFunder).includes( + this.initialPublicationDetailId, + ) + ) { + this.selectedPublicationDetailId = this.initialPublicationDetailId; + } this.updateQueryParams(); } else { this.updateQueryParams(); @@ -117,12 +204,18 @@ export class PersonFundingComponent implements OnInit { relativeTo: this.route, queryParams: { filter: this.activeFilter, - funder: this.selectedFunder ? this.getFunderKey(this.selectedFunder) : null, - publicationPage: this.selectedFunder ? this.selectedPublicationPage : null, - funderPage: this.selectedFunderListPage + sortBy: this.sortMode, + funder: this.selectedFunder + ? this.getFunderKey(this.selectedFunder) + : null, + publicationPage: this.selectedFunder + ? this.selectedPublicationPage + : null, + publicationDetail: this.selectedPublicationDetailId, + funderPage: this.selectedFunderListPage, }, queryParamsHandling: 'merge', - replaceUrl: true + replaceUrl: true, }); } @@ -130,8 +223,19 @@ export class PersonFundingComponent implements OnInit { return funder.funder_id ?? funder.funder_name ?? ''; } - private isValidFilter(value: string | null): value is 'all' | 'first' | 'middle' | 'last' { - return value === 'all' || value === 'first' || value === 'middle' || value === 'last'; + private isValidFilter( + value: string | null, + ): value is 'all' | 'first' | 'middle' | 'last' { + return ( + value === 'all' || + value === 'first' || + value === 'middle' || + value === 'last' + ); + } + + private isValidSortMode(value: string | null): value is SortMode { + return value === 'name' || value === 'top'; } getPublicationCount(funder: any): number { @@ -147,15 +251,19 @@ export class PersonFundingComponent implements OnInit { ...funder.publication_ids.first, ...funder.publication_ids.middle, ...funder.publication_ids.last, - ...funder.publication_ids.unknown + ...funder.publication_ids.unknown, ]; } return funder.publication_ids[this.activeFilter] ?? []; } getPagedFunders(): any[] { - const startIndex = (this.selectedFunderListPage - 1) * this.funderListPageSize; - return this.filteredFunders.slice(startIndex, startIndex + this.funderListPageSize); + const startIndex = + (this.selectedFunderListPage - 1) * this.funderListPageSize; + return this.filteredFunders.slice( + startIndex, + startIndex + this.funderListPageSize, + ); } hasFunderListPagination(): boolean { @@ -163,11 +271,17 @@ export class PersonFundingComponent implements OnInit { } getFunderListPageCount(): number { - return Math.max(1, Math.ceil(this.filteredFunders.length / this.funderListPageSize)); + return Math.max( + 1, + Math.ceil(this.filteredFunders.length / this.funderListPageSize), + ); } setFunderListPage(page: number): void { - this.selectedFunderListPage = this.clampPage(page, this.getFunderListPageCount()); + this.selectedFunderListPage = this.clampPage( + page, + this.getFunderListPageCount(), + ); this.updateQueryParams(); } @@ -176,8 +290,12 @@ export class PersonFundingComponent implements OnInit { return []; } const allPublicationIds = this.getPublicationIds(this.selectedFunder); - const startIndex = (this.selectedPublicationPage - 1) * this.publicationPageSize; - return allPublicationIds.slice(startIndex, startIndex + this.publicationPageSize); + const startIndex = + (this.selectedPublicationPage - 1) * this.publicationPageSize; + return allPublicationIds.slice( + startIndex, + startIndex + this.publicationPageSize, + ); } hasPublicationPagination(): boolean { @@ -197,18 +315,12 @@ export class PersonFundingComponent implements OnInit { this.updateQueryParams(); } - openPublication(event: MouseEvent, publicationId: string): void { - event.preventDefault(); - const url = this.getPublicationUrl(publicationId); - window.open(url, '_blank', 'noopener'); - } - getPositionLabel(position: string): string { const labels: Record = { first: 'Erstautor', middle: 'Mitautor', last: 'Letztautor', - unknown: 'Unbekannt' + unknown: 'Unbekannt', }; return labels[position] ?? position; } @@ -225,23 +337,42 @@ export class PersonFundingComponent implements OnInit { ids.forEach((id: string) => allIds.add(id)); } } else { - (funder.publication_ids[this.activeFilter] ?? []).forEach((id: string) => - allIds.add(id), + (funder.publication_ids[this.activeFilter] ?? []).forEach( + (id: string) => allIds.add(id), ); } } return allIds.size; } - getPublicationUrl(publicationId: string): string { - return this.selectedFunder?.publication_urls?.[publicationId] ?? publicationId; - } - private getPublicationPageCountForFunder(funder: any): number { const publicationCount = this.getPublicationIds(funder).length; return Math.max(1, Math.ceil(publicationCount / this.publicationPageSize)); } + private sortFunders(funders: any[]): any[] { + const sortedFunders = [...funders]; + return sortedFunders.sort((first, second) => { + if (this.sortMode === 'top') { + const publicationCountDifference = + this.getPublicationCount(second) - this.getPublicationCount(first); + if (publicationCountDifference !== 0) { + return publicationCountDifference; + } + } + + return this.getSortableFunderName(first).localeCompare( + this.getSortableFunderName(second), + 'de', + { sensitivity: 'base' }, + ); + }); + } + + private getSortableFunderName(funder: any): string { + return funder.funder_name ?? ''; + } + private clampPublicationPage(page: number, totalPages: number): number { return this.clampPage(page, totalPages); } @@ -257,4 +388,362 @@ export class PersonFundingComponent implements OnInit { } return parsed; } + getPublicationTitle(publicationId: string): string { + const detailTitle = this.getPublicationDetail(publicationId)?.title; + if (detailTitle) return detailTitle; + const title = this.selectedFunder?.publication_titles?.[publicationId]; + if (title) return title; + const parts = publicationId.split('/'); + return parts[parts.length - 1] ?? publicationId; + } + + togglePublication(id: string): void { + this.expandedPublicationId = this.expandedPublicationId === id ? null : id; + } + + openPublicationDetail(event: MouseEvent, publicationId: string): void { + event.stopPropagation(); + this.selectedPublicationDetailId = publicationId; + this.expandedPublicationId = null; + this.updateQueryParams(); + } + + closePublicationDetail(): void { + this.selectedPublicationDetailId = null; + this.updateQueryParams(); + } + + getSelectedPublicationDetail(): FundingPublicationDetail | null { + if (!this.selectedPublicationDetailId) { + return null; + } + return this.getPublicationDetail(this.selectedPublicationDetailId); + } + + getPublicationDetail(publicationId: string): FundingPublicationDetail | null { + const detail = this.selectedFunder?.publication_details?.[publicationId]; + if (detail) { + return detail; + } + + const title = + this.selectedFunder?.publication_titles?.[publicationId] ?? + this.getShortPublicationId(publicationId); + return { + id: publicationId, + title, + publication_url: + this.selectedFunder?.publication_urls?.[publicationId] ?? publicationId, + author_position: this.getPublicationPosition(publicationId), + authors: [], + }; + } + + getShortPublicationId(publicationId: string): string { + const parts = publicationId.split('/'); + return parts[parts.length - 1] ?? publicationId; + } + + getPublicationExternalUrl( + publication: FundingPublicationDetail, + ): string | null { + return ( + publication.publication_url ?? + this.selectedFunder?.publication_urls?.[publication.id] ?? + publication.id ?? + null + ); + } + + getPublicationAuthors(publication: FundingPublicationDetail): string { + return publication.authors?.length + ? publication.authors.join(', ') + : 'Keine Angaben'; + } + + hasPublicationSource(publication: FundingPublicationDetail): boolean { + return !!publication.source_name; + } + + hasListValues(values?: string[] | null): boolean { + return !!values?.length; + } + + hasTextValue(value?: string | null): boolean { + return !!value && value !== '-' && value !== 'Keine Angaben'; + } + + getOpenAccessBadge(publication: FundingPublicationDetail): { + label: string; + tone: 'open' | 'closed' | 'unknown'; + } { + if (publication.is_open_access) { + const statusLabels: Record = { + bronze: 'Bronze', + diamond: 'Diamond', + gold: 'Gold', + green: 'Green', + hybrid: 'Hybrid', + }; + const status = publication.open_access_status + ? (statusLabels[publication.open_access_status] ?? + publication.open_access_status) + : null; + return { + label: status ? `Open Access (${status})` : 'Open Access', + tone: 'open', + }; + } + + if (publication.open_access_status === 'closed') { + return { label: 'Nicht frei zugänglich', tone: 'closed' }; + } + + return { label: 'Zugang unbekannt', tone: 'unknown' }; + } + + getPositionBadgeClass(position?: AuthorPosition | string | null): string { + const classes: Record = { + first: 'position-badge--first', + middle: 'position-badge--middle', + last: 'position-badge--last', + unknown: 'position-badge--unknown', + }; + return classes[position ?? 'unknown'] ?? classes['unknown']; + } + + getAuthorName(): string { + return this.authorName ?? 'Die Person'; + } + + getPublicationOverview(publication: FundingPublicationDetail): SafeHtml { + const yearText = publication.publication_year + ? `aus dem Jahr ${publication.publication_year}` + : 'ohne Jahresangabe'; + const authorText = publication.authors?.length + ? `von ${publication.authors.map((author) => this.escapeHtml(author)).join(', ')}` + : 'ohne Autorenangabe'; + const funderText = this.selectedFunder?.funder_name + ? `Sie ist dem Förderer ${this.escapeHtml(this.selectedFunder.funder_name)} zugeordnet` + : 'Es ist kein Förderer ausgewählt'; + const positionText = publication.author_position + ? `${this.boldAuthorName(this.getAuthorName())} ist als ${this.getPositionLabel(publication.author_position)} beteiligt` + : 'die Autorposition ist nicht bekannt'; + const sourceText = publication.source_name + ? `Erschienen ist sie in/bei ${this.escapeHtml(publication.source_name)}.` + : ''; + const citationText = + typeof publication.cited_by_count === 'number' + ? `Sie wurde ${publication.cited_by_count} Mal zitiert.` + : ''; + + const html = + `Publikation ${yearText} ${authorText}. ${sourceText} ${funderText}; ${positionText}. ${citationText}`.trim(); + return this.sanitizer.bypassSecurityTrustHtml(html); + } + + private escapeHtml(value: string): string { + return value + .replaceAll('&', '&') + .replaceAll('<', '<') + .replaceAll('>', '>'); + } + + private boldAuthorName(name: string): string { + return `${this.escapeHtml(name)}`; + } + + getPublicationDateLabel(publication: FundingPublicationDetail): string { + if (publication.publication_date) { + const date = new Date(`${publication.publication_date}T00:00:00`); + if (!Number.isNaN(date.getTime())) { + return new Intl.DateTimeFormat('de-DE').format(date); + } + return publication.publication_date; + } + + return publication.publication_year + ? String(publication.publication_year) + : '-'; + } + + getPublicationTypeLabel(publication: FundingPublicationDetail): string { + const labels: Record = { + article: 'Artikel', + book: 'Buch', + 'book-chapter': 'Buchkapitel', + dataset: 'Datensatz', + dissertation: 'Dissertation', + editorial: 'Editorial', + letter: 'Letter', + preprint: 'Preprint', + 'proceedings-article': 'Konferenzbeitrag', + report: 'Bericht', + review: 'Review', + }; + const type = publication.publication_type; + if (!type) { + return '-'; + } + + return labels[type] ?? type; + } + + getLanguageLabel(publication: FundingPublicationDetail): string { + const labels: Record = { + de: 'Deutsch', + en: 'Englisch', + es: 'Spanisch', + fr: 'Französisch', + it: 'Italienisch', + pt: 'Portugiesisch', + }; + const language = publication.language; + if (!language) { + return '-'; + } + + return labels[language] ?? language.toUpperCase(); + } + + getPublicationSourceLabel(publication: FundingPublicationDetail): string { + if (!publication.source_name) { + return 'Keine Angaben'; + } + + const sourceType = this.getSourceTypeLabel(publication.source_type); + return sourceType === '-' + ? publication.source_name + : `${publication.source_name} (${sourceType})`; + } + + getSourceTypeLabel(sourceType?: string | null): string { + const labels: Record = { + book: 'Buch', + conference: 'Konferenz', + journal: 'Journal', + repository: 'Repository', + }; + if (!sourceType) { + return '-'; + } + + return labels[sourceType] ?? sourceType; + } + + getListLabel(values?: string[] | null): string { + return values?.length ? values.join(', ') : 'Keine Angaben'; + } + + getPublicationFunderLabel(publication: FundingPublicationDetail): string { + if (publication.funder_names?.length) { + return this.getListLabel(publication.funder_names); + } + + return this.selectedFunder?.funder_name ?? 'Keine Angaben'; + } + + getCitationCountLabel(publication: FundingPublicationDetail): string { + if (typeof publication.cited_by_count !== 'number') { + return 'Keine Angaben'; + } + + return publication.cited_by_count === 1 + ? '1 Zitation' + : `${publication.cited_by_count} Zitationen`; + } + + getCitationCountsByYear( + publication: FundingPublicationDetail, + ): CitationCountByYear[] { + return (publication.counts_by_year ?? []) + .filter( + (count) => + typeof count.year === 'number' && + typeof count.cited_by_count === 'number', + ) + .map((count) => ({ + year: count.year as number, + count: count.cited_by_count as number, + })) + .sort((first, second) => second.year - first.year); + } + + getOpenAccessLabel(publication: FundingPublicationDetail): string { + const statusLabels: Record = { + bronze: 'Bronze', + closed: 'geschlossen', + diamond: 'Diamond', + gold: 'Gold', + green: 'Green', + hybrid: 'Hybrid', + }; + const status = publication.open_access_status + ? (statusLabels[publication.open_access_status] ?? + publication.open_access_status) + : null; + + if (publication.is_open_access) { + return status ? `Ja (${status})` : 'Ja'; + } + + return status === 'geschlossen' ? 'Nein' : 'Keine Angaben'; + } + + getFulltextLabel(publication: FundingPublicationDetail): string { + if (publication.pdf_url) { + return 'PDF verfügbar'; + } + if (publication.has_fulltext) { + return 'Volltext verfügbar'; + } + + return 'Kein Volltext hinterlegt'; + } + + getLicenseLabel(publication: FundingPublicationDetail): string { + return publication.license + ? publication.license.toUpperCase() + : 'Keine Angaben'; + } + + getRetractionLabel(publication: FundingPublicationDetail): string { + if (publication.is_retracted === true) { + return 'Ja, zurückgezogen'; + } + if (publication.is_retracted === false) { + return 'Nein, nicht zurückgezogen'; + } + + return 'Keine Angaben'; + } + + getGrantLabel(publication: FundingPublicationDetail): string { + return publication.grant_labels?.length + ? publication.grant_labels.join(', ') + : 'Kein Grant-Name hinterlegt'; + } + + getPublicationPosition(publicationId: string): AuthorPosition { + if (!this.selectedFunder) { + return 'unknown'; + } + + for (const position of [ + 'first', + 'middle', + 'last', + 'unknown', + ] as AuthorPosition[]) { + if ( + (this.selectedFunder.publication_ids?.[position] ?? []).includes( + publicationId, + ) + ) { + return position; + } + } + + return 'unknown'; + } } diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.html b/webapp/src/app/modules/person-interesting/person-interesting.component.html index 7f79895c..7a9e4e45 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.html +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.html @@ -1,12 +1,88 @@ diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.scss b/webapp/src/app/modules/person-interesting/person-interesting.component.scss index e80f1d41..3132b644 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.scss +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.scss @@ -1,59 +1,177 @@ :host { - display: block; + display: block; } .interest-card { - align-self: center; - padding: 24px 28px; - border-radius: var(--sg-radius-sm); - background: var(--sg-surface-muted); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); + align-self: center; + padding: 24px 28px; + border-radius: var(--sg-radius-sm); + background: var(--sg-surface-muted); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.interest-header { + display: flex; + align-items: baseline; + gap: 10px; + flex-wrap: wrap; + margin: 0 0 12px; } .interest-card h3 { - margin: 0 0 18px; - font-size: 14px; - font-weight: 700; + margin: 0; + font-size: 14px; + font-weight: 700; } .interest-tags { - display: flex; - flex-wrap: wrap; - gap: 12px; + display: flex; + flex-wrap: wrap; + gap: 12px; } -.interest-tag-button { - padding: 9px 16px; - border: 1px solid #a8c0ff; - border-radius: 7px; - background: #ffffff; - color: var(--sg-primary); - font-size: 13px; - font-weight: 600; - cursor: pointer; - outline: none; - transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease; +.interest-footnote { + display: inline-flex; + align-items: center; + gap: 4px; + color: var(--sg-text-muted); + font-size: 11px; +} - &:hover { - background-color: var(--sg-primary-light, #f0f4ff); - border-color: var(--sg-primary); - } +.interest-footnote .footnote-icon { + width: 14px; + height: 14px; + font-size: 14px; + line-height: 1; +} - &:active { - transform: scale(0.96); - } +.interest-legend { + display: flex; + align-items: flex-start; + gap: 9px; + width: fit-content; + max-width: 100%; + margin: 0 0 16px; + padding: 8px 10px; + border: 1px solid #dbe5f6; + border-radius: 8px; + background: #ffffff; + box-sizing: border-box; +} - &:focus-visible { - box-shadow: 0 0 0 2px var(--sg-primary-light, #f0f4ff), 0 0 0 4px var(--sg-primary); - } +.interest-legend-content, +.interest-legend-group, +.interest-legend-items, +.interest-legend-item { + display: inline-flex; + align-items: center; +} + +.interest-legend-info { + flex: 0 0 auto; + width: 14px; + height: 14px; + color: #7d8aa8; + font-size: 14px; + line-height: 14px; +} + +.interest-legend-content { + gap: 7px; + flex: 0 1 auto; + min-width: 0; + max-width: 100%; + flex-wrap: wrap; +} + +.interest-legend-group { + gap: 6px; + flex: 0 1 auto; + flex-wrap: wrap; + min-width: 0; + max-width: 100%; + min-height: 24px; + padding: 3px 7px; + border: 1px solid #dbe5f6; + border-radius: 999px; + background: #fbfdff; +} + +.interest-legend-field { + flex: 0 1 auto; + min-width: 0; + color: #07163d; + font-size: 10px; + font-weight: 800; + line-height: 1.2; + cursor: help; +} + +.interest-legend-items { + flex: 0 1 auto; + gap: 4px 7px; + min-width: 0; + flex-wrap: wrap; +} + +.interest-legend-item { + gap: 4px; + flex: 0 0 auto; + min-width: 0; + color: #53617e; + font-size: 10px; + font-weight: 600; + line-height: 1.2; + white-space: nowrap; + cursor: help; + + span:last-child { + overflow: visible; + text-overflow: clip; + } +} + +.interest-legend-dot { + flex: 0 0 auto; + width: 8px; + height: 8px; + border: 1px solid rgba(255, 255, 255, 0.85); + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2); +} + +.interest-legend-more { + display: inline-flex; + align-items: center; + flex: 0 0 auto; + min-height: 24px; + padding: 0 2px; + border: 0; + background: transparent; + color: var(--accent, #0057ff); + cursor: pointer; + font: inherit; + font-size: 11px; + font-weight: 700; + white-space: nowrap; + + &:hover { + text-decoration: underline; + } + + &:focus-visible { + outline: 2px solid var(--accent, #0057ff); + outline-offset: 2px; + border-radius: 4px; + } } .interest-tags .interest-empty { - padding: 9px 16px; - border: 1px solid #e2e8f0; - border-style: dashed; - border-radius: 7px; - color: var(--sg-text-muted); - font-size: 13px; - font-weight: 600; + padding: 9px 16px; + border: 1px solid #e2e8f0; + border-style: dashed; + border-radius: 7px; + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 600; } diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts index bb382718..c20e79de 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.spec.ts @@ -1,4 +1,5 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { provideRouter } from '@angular/router'; import { PersonInterestingComponent } from './person-interesting.component'; @@ -8,9 +9,9 @@ describe('PersonInterestingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [PersonInterestingComponent] - }) - .compileComponents(); + imports: [PersonInterestingComponent], + providers: [provideRouter([])], + }).compileComponents(); fixture = TestBed.createComponent(PersonInterestingComponent); component = fixture.componentInstance; diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.ts index 1f7c1966..d8d496aa 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.ts +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.ts @@ -1,36 +1,279 @@ -import { Component, input, computed } from '@angular/core'; +import { + Component, + DestroyRef, + OnInit, + computed, + inject, + input, + output, + signal, +} from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatIconModule } from '@angular/material/icon'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { CommonModule } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; -import { WorkTopic } from '../../api'; +import { TopicCount } from '../../api'; +import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; +import { topicHierarchyColor } from '../../shared/utils/topic-colors'; interface InterestTag { + id: string; label: string; - score: number; + count: number; + description: string; + color: string; + subfieldId: string; + subfieldName: string; + subfieldDescription: string; + fieldId: string; + fieldName: string; + fieldDescription: string; + domainId: string; + domainName: string; + domainDescription: string; } +interface InterestLegendGroup { + id: string; + name: string; + description: string; + domainName: string; + domainDescription: string; + tooltip: string; + items: InterestLegendItem[]; +} + +interface InterestLegendItem { + id: string; + name: string; + description: string; + color: string; + tooltip: string; +} + +const MAX_TAGS = 5; +const MAX_LEGEND_GROUPS = 3; + @Component({ selector: 'app-person-interesting', - imports: [], + imports: [CommonModule, MatIconModule, MatTooltipModule, TopicChipComponent], templateUrl: './person-interesting.component.html', styleUrl: './person-interesting.component.scss', }) -export class PersonInterestingComponent { - readonly topics = input(null); +export class PersonInterestingComponent implements OnInit { + private static readonly legendExpandedQueryParam = + 'interesting_legend_expanded'; + + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly destroyRef = inject(DestroyRef); + + readonly topics = input(null); + readonly legendExpanded = signal(false); + + readonly tagClick = output<{ id: string; name: string }>(); readonly tags = computed(() => { const topicsList = this.topics() ?? []; - const grouped = new Map(); + const tags: InterestTag[] = []; for (const topic of topicsList) { - const label = (topic.subfield?.display_name ?? '').trim(); + const label = (topic.name ?? '').trim(); if (!label) continue; - const score = typeof topic.score === 'number' ? (topic.score as number) : 0; - grouped.set(label, (grouped.get(label) ?? 0) + score); + tags.push({ + id: topic.id ?? '', + label, + count: topic.count ?? 0, + description: (topic.description ?? '').trim(), + color: topicHierarchyColor(topic), + subfieldId: topic.subfield_id ?? '', + subfieldName: (topic.subfield_name ?? '').trim(), + subfieldDescription: (topic.subfield_description ?? '').trim(), + fieldId: topic.field_id ?? '', + fieldName: (topic.field_name ?? '').trim(), + fieldDescription: (topic.field_description ?? '').trim(), + domainId: topic.domain_id ?? '', + domainName: (topic.domain_name ?? '').trim(), + domainDescription: (topic.domain_description ?? '').trim(), + }); } - return Array.from(grouped.entries()) - .map(([label, score]) => ({ label, score })) - .sort((a, b) => b.score - a.score) - .slice(0, 8); + return tags.sort((a, b) => b.count - a.count).slice(0, MAX_TAGS); }); + + readonly legendGroups = computed(() => { + const groups = new Map(); + + for (const tag of this.tags()) { + if (!tag.subfieldName) { + continue; + } + + const fieldName = tag.fieldName || 'Ohne Field'; + const fieldId = tag.fieldId || fieldName.toLowerCase(); + const subfieldId = tag.subfieldId || tag.subfieldName.toLowerCase(); + + if (!groups.has(fieldId)) { + groups.set(fieldId, { + id: fieldId, + name: fieldName, + description: tag.fieldDescription, + domainName: tag.domainName, + domainDescription: tag.domainDescription, + tooltip: this.buildLegendTooltip([ + { + label: 'Fachgebiet', + value: fieldName, + description: tag.fieldDescription, + }, + { + label: 'Wissenschaftsbereich', + value: tag.domainName, + description: tag.domainDescription, + }, + ]), + items: [], + }); + } + + const group = groups.get(fieldId); + + if (!group || group.items.some((item) => item.id === subfieldId)) { + continue; + } + + group.items.push({ + id: subfieldId, + name: tag.subfieldName, + description: tag.subfieldDescription, + color: tag.color, + tooltip: this.buildLegendTooltip([ + { + label: 'Themenbereich', + value: tag.subfieldName, + description: tag.subfieldDescription, + }, + { + label: 'Fachgebiet', + value: fieldName, + description: tag.fieldDescription, + }, + { + label: 'Wissenschaftsbereich', + value: tag.domainName, + description: tag.domainDescription, + }, + ]), + }); + } + + return [...groups.values()] + .map((group) => ({ + ...group, + items: group.items.sort((left, right) => + left.name.localeCompare(right.name), + ), + })) + .sort((left, right) => left.name.localeCompare(right.name)); + }); + + readonly visibleLegendGroups = computed(() => { + const groups = this.legendGroups(); + return this.legendExpanded() ? groups : groups.slice(0, MAX_LEGEND_GROUPS); + }); + + readonly hasHiddenLegendGroups = computed( + () => this.legendGroups().length > MAX_LEGEND_GROUPS, + ); + + readonly hiddenLegendItemCount = computed(() => + this.legendGroups() + .slice(MAX_LEGEND_GROUPS) + .reduce((count, group) => count + group.items.length, 0), + ); + + ngOnInit(): void { + this.route.queryParamMap + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((queryParams) => { + this.legendExpanded.set( + this.parseBooleanQueryParam( + queryParams.get( + PersonInterestingComponent.legendExpandedQueryParam, + ), + false, + ), + ); + }); + } + + onTagClick(tag: InterestTag): void { + if (!tag.id) return; + this.tagClick.emit({ id: tag.id, name: tag.label }); + } + + toggleLegend(): void { + const expanded = !this.legendExpanded(); + this.legendExpanded.set(expanded); + + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { + [PersonInterestingComponent.legendExpandedQueryParam]: expanded + ? 'true' + : null, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + } + + private parseBooleanQueryParam( + value: string | null, + fallback: boolean, + ): boolean { + if (value === null) { + return fallback; + } + + if (value === 'true' || value === '1') { + return true; + } + + if (value === 'false' || value === '0') { + return false; + } + + return fallback; + } + + private buildLegendTooltip( + entries: Array<{ label: string; value: string; description: string }>, + ): string { + const lines: string[] = []; + + for (const entry of entries) { + if (!entry.value && !entry.description) { + continue; + } + + if (lines.length > 0) { + lines.push(''); + } + + if (entry.value) { + lines.push(`${entry.label}: ${entry.value}`); + } + + if (entry.description) { + lines.push(''); + lines.push(`Beschreibung: ${entry.description}`); + } + } + + return lines.join('\n'); + } } 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 9867fd05..3dba668f 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -1,59 +1,79 @@
-
@if (activeFilters.length) { -
- Aktive Filter: -
- @for (filter of activeFilters; track filter.value) { - - {{ filter.label }} - + + } + - - } - +
-
}
- {{ resultRange() }} + {{ resultRange() }}
Sortierung:
- + + + + + + +
@@ -62,102 +82,46 @@
- {{ total | number: "1.0-0" }} Personen gefunden - Sortiert nach Publikationen und Zitierungen + {{ total | number: '1.0-0' }} Personen gefunden + Sortiert nach Publikationen und Zitierungen-->
- @if (loading) { -
- -
- } @else if (sortedPersons.length) { -
- @for (person of sortedPersons; track person.id) { -
-
- -
- {{ getInitials(person.display_name) }} -
-
-
- @if (person.relevance_rating) { - - {{ person.relevance_rating }} - - } - -
-

{{ person.display_name }}

-

{{ institution(person) }}

-

{{ getDistinguishingId(person) }}

-

- Works: {{ person.works_count }} · - Citations: {{ person.cited_by_count }} -

-
-
- -
-
- @for (topic of topics(person); track topic) { - {{ topic }} - } -
-
- - -
- } -
- } @else { -
- person_search -

Keine Personen gefunden

-

Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter an.

-
- } - - - @if (totalPages > 1) { -
- - -
- @for (p of pageList; track p) { - + @if (getPersons().length) { +
+ @for (person of getPersons(); track person.id) { + + }
- - -
+ } @else { +
+ person_search +

Keine Personen gefunden

+

+ Versuchen Sie einen anderen Suchbegriff oder passen Sie die Filter + an. +

+
} + + + +
@@ -174,59 +138,150 @@
search - + @if (topicSearchControl.value) { - + }
-
- @for (topic of filteredTopicsList; track topic) { - - } - - @if (topicsList.length > 5 && !topicSearchControl.value) { - - } -
+ +

Institution

- business - apartment + + + @for (institution of institutionOptions(); track institution.id) { + + {{ institution.display_name }} + @if (institution.hint) { + {{ institution.hint }} + } + + } + @if ( + !institutionLookupLoading() && + institutionOptions().length === 0 && + institutionControl.value && + institutionControl.value.trim().length >= 2 + ) { + Keine Institution gefunden + } + @if (institutionControl.value) { - + }
-
- +
+ + Zusammenarbeit nach Jahr filtern + + + @if (yearFilterEnabledControl.value) { +
+ + Genau in + Seit + + + + Jahr + + @if (filterYearControl.hasError('min')) { + Jahr muss ≥ 1900 sein + } + @if (filterYearControl.hasError('max')) { + Zukünftige Jahre sind nicht erlaubt + } + +
+ }
-
-
\ 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 097911a1..bd630cd9 100644 --- a/webapp/src/app/modules/person-list/person-list.component.scss +++ b/webapp/src/app/modules/person-list/person-list.component.scss @@ -6,24 +6,71 @@ .layout-container { display: grid; - grid-template-columns: 1fr 280px; + grid-template-columns: 1fr 360px; gap: 24px; align-items: start; - max-width: 1200px; + max-width: 1400px; margin: 0 auto; } -.results-column { +// Shared flex layouts +.page-header, +.sidebar-header, +.toolbar { + display: flex; + align-items: center; +} + +.page-header, +.toolbar { + justify-content: space-between; +} + +.sidebar-header, +.toolbar { + border-bottom: 1px solid var(--sg-border); + padding-bottom: 12px; +} + +.selection-summary, +.active-filters-row, +.chips-container, +.sort-selector, +.topic-search-wrapper { + display: flex; + align-items: center; +} + +.filter-chip { + display: inline-flex; + align-items: center; +} + +// Shared column & sidebar column layouts +.results-column, +.empty-state, +.filters-sidebar, +.filter-section { display: flex; flex-direction: column; +} + +// Shared containers styling +.selection-summary, +.active-filters-row, +.filters-sidebar { + background: var(--sg-surface); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); +} + +// Individual styles +.results-column { gap: 20px; min-width: 0; } .page-header { - display: flex; - justify-content: space-between; - align-items: center; gap: 16px; h1 { @@ -41,13 +88,8 @@ } .selection-summary { - display: flex; - align-items: center; gap: 12px; padding: 8px 12px; - background: var(--sg-surface); - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); strong { display: block; @@ -64,13 +106,8 @@ } .active-filters-row { - display: flex; - align-items: center; gap: 10px; - background: var(--sg-surface); padding: 8px 16px; - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); flex-wrap: wrap; font-size: 13px; } @@ -81,15 +118,11 @@ } .chips-container { - display: flex; - align-items: center; gap: 6px; flex-wrap: wrap; } .filter-chip { - display: inline-flex; - align-items: center; gap: 4px; padding: 2px 8px; background: var(--sg-surface-soft); @@ -98,53 +131,53 @@ font-size: 11px; font-weight: 600; color: var(--sg-text); - - button { - border: none; - background: transparent; - cursor: pointer; - padding: 0; - display: flex; - color: var(--sg-text-soft); - - &:hover { - color: var(--sg-text); - } - - mat-icon { - font-size: 12px; - width: 12px; - height: 12px; - } - } } +// Shared button resets +.filter-chip button, +.clear-topic-search, .clear-all-btn { border: none; background: transparent; cursor: pointer; +} + +.filter-chip button, +.clear-topic-search { + padding: 0; + display: flex; + color: var(--sg-text-soft); + + &:hover { + color: var(--sg-text); + } +} + +.filter-chip button mat-icon { + font-size: 12px; + width: 12px; + height: 12px; +} + +.clear-topic-search mat-icon { + font-size: 14px; + width: 14px; + height: 14px; +} + +.clear-all-btn { font-size: 11px; font-weight: 600; color: var(--sg-warning); text-decoration: underline; } -.toolbar { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid var(--sg-border); - padding-bottom: 12px; -} - .result-count { font-size: 13px; color: var(--sg-text-muted); } .sort-selector { - display: flex; - align-items: center; gap: 8px; font-size: 13px; color: var(--sg-text-muted); @@ -158,6 +191,14 @@ color: var(--sg-text); outline: none; cursor: pointer; + transition: + border-color 0.15s, + box-shadow 0.15s; + + &:focus-visible { + border-color: var(--sg-primary); + box-shadow: 0 0 0 2px var(--sg-primary-soft); + } } } @@ -167,217 +208,7 @@ gap: 20px; } -.person-card { - background: var(--sg-surface); - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); - box-shadow: var(--sg-shadow-sm); - display: flex; - flex-direction: column; - transition: transform 0.15s ease, box-shadow 0.15s ease; - - &:hover { - transform: translateY(-2px); - box-shadow: var(--sg-shadow-md); - } -} - -.card-header { - padding: 16px; - display: flex; - gap: 12px; - border-bottom: 1px solid var(--sg-surface-soft); - - .avatar { - width: 40px; - height: 40px; - border-radius: 50%; - background: var(--sg-primary-soft); - color: var(--sg-primary); - font-size: 14px; - font-weight: 700; - display: flex; - align-items: center; - justify-content: center; - flex-shrink: 0; - border: 1px solid var(--sg-border); - } - - .header-main { - flex-grow: 1; - min-width: 0; - } -} - -.rating-and-bookmark { - display: flex; - justify-content: space-between; - align-items: center; -} - -.suitability-badge { - font-size: 10px; - font-weight: 700; - padding: 2px 6px; - border-radius: 8px; - text-transform: uppercase; - - &.very-suitable { - background: var(--sg-success-soft); - color: var(--sg-success); - } - - &.suitable { - background: var(--sg-warning-soft); - color: var(--sg-warning); - } - - &.possible { - background: var(--sg-primary-soft); - color: var(--sg-text-muted); - } -} - -.bookmark-btn { - border: none; - background: transparent; - cursor: pointer; - padding: 2px; - color: var(--sg-text-soft); - - &:hover { - color: var(--sg-primary); - } - - &.bookmarked { - color: #e53935; - } - - mat-icon { - font-size: 18px; - width: 18px; - height: 18px; - } -} - -.person-name { - margin: 6px 0 2px; - font-size: 16px; - font-weight: 600; - color: var(--sg-text); -} - -.institution { - margin: 0; - font-size: 12px; - color: var(--sg-text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.person-id { - margin: 2px 0 0; - font-size: 10px; - color: var(--sg-text-soft); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.stats { - margin: 4px 0 0; - font-size: 12px; - color: var(--sg-text-muted); -} - -.card-body { - padding: 16px; - flex-grow: 1; - display: flex; - flex-direction: column; - gap: 12px; - justify-content: space-between; -} - -.experience-list { - list-style: none; - padding: 0; - margin: 0; - - li { - font-size: 12px; - color: var(--sg-text-muted); - position: relative; - padding-left: 12px; - margin-bottom: 4px; - - &::before { - content: "•"; - position: absolute; - left: 0; - color: var(--sg-text-soft); - } - } -} - -.topic-row { - display: flex; - flex-wrap: wrap; - gap: 4px; -} - -.topic-tag { - background: var(--sg-surface-soft); - border: 1px solid var(--sg-border); - color: var(--sg-text-muted); - font-size: 10px; - font-weight: 600; - padding: 2px 6px; - border-radius: 4px; -} - -.card-footer { - padding: 10px 12px; - border-top: 1px solid var(--sg-border); - background: var(--sg-surface-muted); -} - -.action-buttons { - display: flex; - gap: 6px; -} - -.action-btn { - flex: 1; - display: flex; - align-items: center; - justify-content: center; - gap: 4px; - padding: 6px; - background: var(--sg-surface); - border: 1px solid var(--sg-border-strong); - border-radius: var(--sg-radius-sm); - color: var(--sg-text-muted); - font-size: 10px; - font-weight: 600; - text-decoration: none; - - mat-icon { - font-size: 12px; - width: 12px; - height: 12px; - } - - &:hover { - background: var(--sg-primary-soft); - color: var(--sg-primary); - } -} - .empty-state { - display: flex; - flex-direction: column; align-items: center; padding: 48px 16px; background: var(--sg-surface); @@ -403,91 +234,22 @@ } } -.custom-pagination { - display: flex; - align-items: center; - justify-content: center; - gap: 12px; - padding-top: 16px; -} - -.paginator-btn { - display: flex; - align-items: center; - gap: 4px; - padding: 6px 12px; - background: var(--sg-surface); - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); +mat-paginator { + background: transparent !important; + border-top: 1px solid var(--sg-border); + margin-top: 16px; color: var(--sg-text); - font-size: 12px; - font-weight: 600; - cursor: pointer; - - mat-icon { - font-size: 16px; - width: 16px; - height: 16px; - } - - &:hover:not(:disabled) { - background: var(--sg-surface-soft); - } - - &:disabled { - opacity: 0.5; - cursor: not-allowed; - } -} - -.page-numbers { - display: flex; - gap: 4px; -} - -.page-number-btn { - width: 32px; - height: 32px; - border-radius: 50%; - border: none; - background: transparent; - color: var(--sg-text-muted); - font-size: 12px; - font-weight: 600; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - - &:hover { - background: var(--sg-surface-soft); - } - - &.active { - background: var(--sg-primary); - color: #fff; - } } .filters-sidebar { - background: var(--sg-surface); - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); padding: 16px; box-shadow: var(--sg-shadow-sm); - display: flex; - flex-direction: column; - gap: 16px; position: sticky; top: 16px; } .sidebar-header { - display: flex; - align-items: center; gap: 8px; - padding-bottom: 12px; - border-bottom: 1px solid var(--sg-border); mat-icon { color: var(--sg-primary); @@ -504,8 +266,6 @@ } .filter-section { - display: flex; - flex-direction: column; gap: 8px; } @@ -518,13 +278,18 @@ } .topic-search-wrapper { - position: relative; - display: flex; - align-items: center; background: var(--sg-surface-soft); border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); padding: 4px 8px; + transition: + border-color 0.15s, + box-shadow 0.15s; + + &:focus-within { + border-color: var(--sg-primary); + box-shadow: 0 0 0 2px var(--sg-primary-soft); + } mat-icon { font-size: 16px; @@ -542,64 +307,6 @@ flex-grow: 1; margin-left: 6px; } - - .clear-topic-search { - border: none; - background: transparent; - cursor: pointer; - display: flex; - color: var(--sg-text-soft); - - mat-icon { - font-size: 14px; - width: 14px; - height: 14px; - } - } -} - -.checkbox-list { - display: flex; - flex-direction: column; - gap: 8px; -} - -.checkbox-label { - display: flex; - align-items: center; - gap: 8px; - cursor: pointer; - - input[type="checkbox"] { - accent-color: var(--sg-primary); - width: 15px; - height: 15px; - cursor: pointer; - } - - .checkbox-text { - font-size: 12px; - color: var(--sg-text); - } -} - -.show-more-btn { - display: flex; - align-items: center; - gap: 2px; - background: transparent; - border: none; - cursor: pointer; - color: var(--sg-text-muted); - font-size: 11px; - font-weight: 700; - padding: 2px 0; - - mat-icon { - font-size: 14px; - width: 14px; - height: 14px; - } } .sidebar-footer { @@ -617,18 +324,34 @@ font-size: 13px; font-weight: 700; cursor: pointer; - transition: background 0.15s; + transition: + background 0.15s, + box-shadow 0.15s; &:hover:not(:disabled) { background: var(--sg-primary-strong); } + &:focus-visible { + outline: none; + box-shadow: + 0 0 0 2px var(--sg-background), + 0 0 0 4px var(--sg-primary); + } + &:disabled { opacity: 0.5; cursor: not-allowed; } } +::ng-deep .mat-mdc-option small { + display: block; + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.2; +} + @media (max-width: 1024px) { .layout-container { grid-template-columns: 1fr; @@ -654,4 +377,4 @@ align-items: flex-start; gap: 8px; } -} \ 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 d119bb9f..80cb2cc6 100644 --- a/webapp/src/app/modules/person-list/person-list.component.ts +++ b/webapp/src/app/modules/person-list/person-list.component.ts @@ -1,26 +1,43 @@ -import { Component, inject, signal, DestroyRef } from '@angular/core'; +import { Component, inject, signal, DestroyRef, computed } from '@angular/core'; import { Router, RouterLink, ActivatedRoute } from '@angular/router'; import { CommonModule } from '@angular/common'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { FormControl, ReactiveFormsModule } from '@angular/forms'; - +import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatIconModule } from '@angular/material/icon'; -import { MatPaginatorModule } from '@angular/material/paginator'; +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 { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatRadioModule } from '@angular/material/radio'; +import { ResolverStateService } from '../../shared/services/resolver-state.service'; -import { CustomAuthor, PersonsSearchService } from '../../api'; +import { CustomAuthor, PersonsService, InstitutionsService } from '../../api'; +import { TopicsService } from '../../api/api/topics.service'; +import { TopicHierarchyComponent } from '../topic-hierarchy/topic-hierarchy.component'; +import { PersonCardComponent } from '../person-card/person-card.component'; import { SharedStateService } from '../../shared/services/shared-state.service'; import { PaginationService } from '../../shared/services/pagination.service'; -import { finalize } from 'rxjs'; +import { + finalize, + debounceTime, + distinctUntilChanged, + switchMap, + map, + of, + catchError, +} from 'rxjs'; +import { + MatAutocompleteModule, + MatAutocompleteSelectedEvent, +} from '@angular/material/autocomplete'; +import { SkTextDirective } from '../../custom-directives/sk-text.directive'; @Component({ selector: 'app-person-list', imports: [ CommonModule, - RouterLink, ReactiveFormsModule, MatIconModule, MatPaginatorModule, @@ -28,264 +45,338 @@ import { finalize } from 'rxjs'; MatFormFieldModule, MatInputModule, MatButtonModule, + MatCheckboxModule, + MatRadioModule, + TopicHierarchyComponent, + PersonCardComponent, + SkTextDirective, + MatAutocompleteModule, ], templateUrl: './person-list.component.html', styleUrl: './person-list.component.scss', + standalone: true, }) export class PersonListComponent { private readonly router = inject(Router); private readonly route = inject(ActivatedRoute); - private readonly personsSearchService = inject(PersonsSearchService); + private readonly personsService = inject(PersonsService); + private readonly topicsService = inject(TopicsService); + private readonly institutionsService = inject(InstitutionsService); 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,relevance_rating,affiliations'; - - readonly loadingState = signal(false); + public readonly resolverStateService = inject(ResolverStateService); + readonly loadingState = computed(() => + this.resolverStateService.isResolvingInside('/persons'), + ); persons: CustomAuthor[] = []; total = 0; currentPage = 1; + readonly institutionOptions = signal([]); + readonly institutionLookupLoading = signal(false); + + defaultOrderValue = 'desc'; // Selected filter states - selectedTopics = new Set(); + readonly selectedTopics = signal>(new Set()); + readonly searchValue = signal(null); + readonly topicSearchType = signal<'hybrid' | 'semantic'>('hybrid'); - // Filter checklists - readonly defaultTopics = [ - 'Artificial Intelligence', - 'Big Data and Business Intelligence', - 'Topic Modeling', - 'Entrepreneurship Studies and Influences', - 'Complex Network Analysis Techniques', - 'Semantic Web and Ontologies', - 'Machine Learning', - 'Data Science', - 'Nachhaltigkeit', - 'Entrepreneurship' - ]; + // Applied filter states (reflecting actual URL query params) + appliedInstitutionName = ''; + appliedYearFilterEnabled = false; + appliedFilterMode: 'in' | 'from' = 'from'; + appliedFilterYear = new Date().getFullYear() - 1; // Forms - sortControl = new FormControl('relevance', { nonNullable: true }); + sortValueControl = new FormControl(null, { + nonNullable: true, + }); + sortOrderControl = new FormControl( + { value: this.defaultOrderValue, disabled: this.isRelevanceSelected() }, + { nonNullable: true }, + ); topicSearchControl = new FormControl('', { nonNullable: true }); institutionControl = new FormControl('', { nonNullable: true }); - strictControl = new FormControl(false, { nonNullable: true }); - showAllTopics = false; + yearFilterEnabledControl = new FormControl(false, { nonNullable: true }); + filterModeControl = new FormControl<'in' | 'from'>('from', { + nonNullable: true, + }); + filterYearControl = new FormControl(new Date().getFullYear() - 1, { + nonNullable: true, + validators: [ + Validators.min(1900), + Validators.max(new Date().getFullYear()), + ], + }); // Bookmarking bookmarkedIds = new Set(); - constructor() { - // Subscribe to route query parameters to trigger searches + if (!this.institutionControl.value) { + this.yearFilterEnabledControl.disable(); + } + + this.setupInstitutionAutocomplete(); + // Enable/disable the year filter checkbox based on the presence of an institution value + this.updateYearFilterState(this.institutionControl.value); + this.institutionControl.valueChanges + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((val) => { + this.updateYearFilterState(val); + }); + this.route.queryParams .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe((params) => { const query = params['query'] || ''; const page = params['page'] ? Number.parseInt(params['page'], 10) : 1; - const pageSize = params['pageSize'] ? Number.parseInt(params['pageSize'], 10) : 10; + const pageSize = params['pageSize'] + ? Number.parseInt(params['pageSize'], 10) + : 10; const institutionName = params['institutionName'] || ''; - const strict = params['strict'] === 'true'; + const sortBy = params['sortBy'] || null; + const sortOrder = params['sortOrder'] || this.defaultOrderValue; + const yearFilterEnabled = params['yearFilterEnabled'] === 'true'; + const filterMode = + params['filterMode'] === 'in' || params['filterMode'] === 'from' + ? params['filterMode'] + : 'from'; + const filterYear = params['filterYear'] + ? Number.parseInt(params['filterYear'], 10) + : new Date().getFullYear() - 1; + const topicSearch = params['topicSearch'] || ''; + const topicSearchType = + params['topicSearchType'] === 'semantic' ? 'semantic' : 'hybrid'; const topics = this.parseQueryParamArray(params['topic']); - this.selectedTopics = new Set(topics); + // restore values from query params + this.selectedTopics.set(new Set(topics)); this.currentPage = page; this.paginationService.selection = pageSize; + if (this.sortValueControl.value !== sortBy) { + this.sortValueControl.setValue(sortBy, { emitEvent: false }); + this.sortOrderControl.setValue(sortOrder, { emitEvent: false }); + this.updateSortOrderState(this.sortValueControl.value); + } + // Sync search box & institution input - if (this.state.searchValue() !== query) { - this.state.searchValue.set(query || null); + if (this.searchValue() !== query) { + this.searchValue.set(query || null); } if (this.institutionControl.value !== institutionName) { - this.institutionControl.setValue(institutionName); + this.institutionControl.setValue(institutionName, { + emitEvent: false, + }); + this.updateYearFilterState(institutionName); } - if (this.strictControl.value !== strict) { - this.strictControl.setValue(strict); + if (this.yearFilterEnabledControl.value !== yearFilterEnabled) { + this.yearFilterEnabledControl.setValue(yearFilterEnabled); } + if (this.filterModeControl.value !== filterMode) { + this.filterModeControl.setValue(filterMode); + } + if (this.filterYearControl.value !== filterYear) { + this.filterYearControl.setValue(filterYear); + } + if (this.topicSearchControl.value !== topicSearch) { + this.topicSearchControl.setValue(topicSearch, { emitEvent: false }); + } + this.topicSearchType.set(topicSearchType); - this.load(query, page, pageSize, topics, institutionName, strict); + // Update applied filter states + this.appliedInstitutionName = institutionName; + this.appliedYearFilterEnabled = yearFilterEnabled; + this.appliedFilterMode = filterMode; + this.appliedFilterYear = filterYear; }); - } - load( - query?: string, - page: number = 1, - pageSize: number = 10, - topics?: string[], - institutionName?: string, - strict: boolean = false - ): void { - this.loadingState.set(true); + // Use resolver value + this.route.data + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(({ persons }) => { + this.persons = (persons.results ?? []) as CustomAuthor[]; + this.total = persons.meta?.count; + }); - this.personsSearchService.searchPersonsList( - query || undefined, - institutionName || undefined, - topics?.length ? topics : undefined, - page, - pageSize, - this.defaultIncludes, - strict || undefined - ) + // listen for sorting selectors changes + this.sortValueControl.valueChanges + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((value) => { + if (!value) { + this.sortOrderControl.setValue(this.defaultOrderValue, { + emitEvent: false, + }); + this.sortOrderControl.disable(); + } else { + this.sortOrderControl.enable(); + } + + this.applySidebarFilters(); + }); + + this.sortOrderControl.valueChanges + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => { + this.applySidebarFilters(); + }); + + this.topicSearchControl.valueChanges .pipe( - finalize(() => this.loadingState.set(false)), - takeUntilDestroyed(this.destroyRef) + debounceTime(300), + distinctUntilChanged(), + takeUntilDestroyed(this.destroyRef), ) - .subscribe({ - next: (response) => { - this.persons = (response.results ?? []) as CustomAuthor[]; - this.total = response.meta?.count ?? 0; - }, - error: (err) => { - console.error('Error loading persons:', err); - } + .subscribe((val) => { + this.router.navigate([], { + queryParams: { + topicSearch: val || null, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); }); } - // Getters for filtered results - get sortedPersons(): CustomAuthor[] { - const sorted = [...this.persons]; - const val = this.sortControl.value; - if (val === 'works') { - return sorted.sort((a, b) => (b.works_count ?? 0) - (a.works_count ?? 0)); - } else if (val === 'citations') { - return sorted.sort((a, b) => (b.cited_by_count ?? 0) - (a.cited_by_count ?? 0)); + private updateSortOrderState(value: any) { + if (!value) { + this.sortOrderControl.setValue(this.defaultOrderValue, { + emitEvent: false, + }); + this.sortOrderControl.disable({ emitEvent: false }); + } else { + this.sortOrderControl.enable({ emitEvent: false }); } - return sorted; // relevance (Elasticsearch default order) + } + // Getters for filtered results + getPersons(): CustomAuthor[] { + return this.persons; } get loading(): boolean { return this.loadingState(); } - // Topics checklist processing - get topicsList(): string[] { - const set = new Set(this.defaultTopics); - this.persons.forEach(p => { - p.topics?.forEach(t => { - if (t.display_name) set.add(t.display_name); - }); - }); - return Array.from(set); - } - - get filteredTopicsList(): string[] { - const filter = this.topicSearchControl.value.toLowerCase().trim(); - let list = this.topicsList; - if (filter) { - list = list.filter(t => t.toLowerCase().includes(filter)); - } - return this.showAllTopics ? list : list.slice(0, 5); - } - - toggleShowAllTopics(): void { - this.showAllTopics = !this.showAllTopics; - } - // Filter selection checks isTopicSelected(topic: string): boolean { - return this.selectedTopics.has(topic); + return this.selectedTopics().has(topic); + } + + isRelevanceSelected(): boolean { + return !this.sortValueControl.value; } toggleTopic(topic: string): void { - if (this.selectedTopics.has(topic)) { - this.selectedTopics.delete(topic); - } else { - this.selectedTopics.add(topic); - } + this.selectedTopics.update((set) => { + const next = new Set(set); + if (next.has(topic)) { + next.delete(topic); + } else { + next.add(topic); + } + return next; + }); this.applySidebarFilters(); } // Active filters tags row - get activeFilters(): Array<{ category: string, value: string, label: string }> { - const list: Array<{ category: string, value: string, label: string }> = []; - this.selectedTopics.forEach(t => { - list.push({ category: 'topic', value: t, label: t }); + get activeFilters(): Array<{ + category: string; + value: string; + label: string; + }> { + const list: Array<{ category: string; value: string; label: string }> = []; + this.selectedTopics().forEach((t) => { + list.push({ category: 'topic', value: t, label: `Thema: ${t}` }); }); - if (this.institutionControl.value) { - const label = `Institution: ${this.institutionControl.value}${this.strictControl.value ? ' (Strict)' : ''}`; + if (this.appliedInstitutionName) { + let label = `Institution: ${this.appliedInstitutionName}`; + if (this.appliedYearFilterEnabled) { + const modeLabel = this.appliedFilterMode === 'in' ? 'in' : 'from'; + label += ` (${modeLabel} ${this.appliedFilterYear})`; + } list.push({ category: 'institutionName', - value: this.institutionControl.value, - label: label + value: this.appliedInstitutionName, + label: label, }); } return list; } - removeFilter(filter: { category: string, value: string }): void { + removeFilter(filter: { category: string; value: string }): void { if (filter.category === 'topic') { - this.selectedTopics.delete(filter.value); + this.selectedTopics.update((set) => { + const next = new Set(set); + next.delete(filter.value); + return next; + }); } else if (filter.category === 'institutionName') { - this.institutionControl.setValue(''); - this.strictControl.setValue(false); + this.institutionControl.setValue('', { emitEvent: false }); + this.updateYearFilterState(''); + this.institutionOptions.set([]); + this.yearFilterEnabledControl.setValue(false); + this.filterModeControl.setValue('from'); + this.filterYearControl.setValue(new Date().getFullYear() - 1); } this.applySidebarFilters(); } clearAllFilters(): void { - this.selectedTopics.clear(); - this.institutionControl.setValue(''); - this.strictControl.setValue(false); + this.selectedTopics.set(new Set()); + this.institutionControl.setValue('', { emitEvent: false }); + this.updateYearFilterState(''); + this.institutionOptions.set([]); + this.yearFilterEnabledControl.setValue(false); + this.filterModeControl.setValue('from'); + this.filterYearControl.setValue(new Date().getFullYear() - 1); this.applySidebarFilters(); } applySidebarFilters(): void { + if (this.yearFilterEnabledControl.value && this.filterYearControl.invalid) { + return; + } this.router.navigate([], { queryParams: { - topic: this.selectedTopics.size ? Array.from(this.selectedTopics) : null, + topic: this.selectedTopics().size + ? Array.from(this.selectedTopics()) + : null, + topicSearch: this.topicSearchControl.value || null, + topicSearchType: + this.topicSearchType() === 'semantic' ? 'semantic' : null, institutionName: this.institutionControl.value || null, - strict: this.strictControl.value ? 'true' : null, + sortBy: this.sortValueControl.value || null, + sortOrder: this.sortOrderControl.value || null, + yearFilterEnabled: + this.institutionControl.value && this.yearFilterEnabledControl.value + ? 'true' + : null, + filterMode: + this.institutionControl.value && this.yearFilterEnabledControl.value + ? this.filterModeControl.value + : null, + filterYear: + this.institutionControl.value && this.yearFilterEnabledControl.value + ? this.filterYearControl.value + : null, + strict: null, page: 1, }, queryParamsHandling: 'merge', }); } - // Pagination custom calculation - get totalPages(): number { - return Math.max(1, Math.ceil(this.total / this.paginationService.selection)); - } - - get pageList(): number[] { - const list: number[] = []; - const maxPagesToShow = 5; - let start = Math.max(1, this.currentPage - 2); - let end = Math.min(this.totalPages, start + maxPagesToShow - 1); - - if (end - start + 1 < maxPagesToShow) { - start = Math.max(1, end - maxPagesToShow + 1); - } - - for (let i = start; i <= end; i++) { - list.push(i); - } - return list; - } - - isFirstPage(): boolean { - return this.currentPage === 1; - } - - isLastPage(): boolean { - return this.currentPage >= this.totalPages; - } - - prevPage(): void { - if (!this.isFirstPage()) { - this.goToPage(this.currentPage - 1); - } - } - - nextPage(): void { - if (!this.isLastPage()) { - this.goToPage(this.currentPage + 1); - } - } - - goToPage(p: number): void { + onPageChange(event: PageEvent): void { + this.paginationService.selection = event.pageSize; this.router.navigate([], { - queryParams: { page: p }, - queryParamsHandling: 'merge' + queryParams: { + page: event.pageIndex + 1, + pageSize: event.pageSize, + }, + queryParamsHandling: 'merge', }); } @@ -296,38 +387,6 @@ export class PersonListComponent { return `${start}-${end} von ${this.total} Personen`; } - // Model parsing / UI Helpers - institution(person: CustomAuthor): string { - return ( - person.affiliations?.[0]?.institution?.display_name || - person.last_known_institutions?.[0]?.display_name || - 'Unbekannte Institution' - ); - } - - topics(person: CustomAuthor): string[] { - return (person.topics ?? []) - .map((t) => t.display_name) - .filter((name): name is string => !!name) - .slice(0, 3); - } - - getInitials(name: string | null | undefined): string { - if (!name) return 'U'; - const cleanName = name.replace(/Prof\.|Dr\.|M\.Sc\./g, '').trim(); - const parts = cleanName.split(' '); - const first = parts[0]?.[0] || ''; - const last = parts[parts.length - 1]?.[0] || ''; - return (first + last).toUpperCase(); - } - - getRatingClass(rating: string | null | undefined): string { - const r = (rating || '').toLowerCase(); - if (r === 'sehr geeignet') return 'very-suitable'; - if (r === 'geeignet') return 'suitable'; - return 'possible'; - } - // Bookmarks toggleBookmark(person: CustomAuthor): void { if (!person.id) return; @@ -338,27 +397,93 @@ export class PersonListComponent { } } + onTopicSelectionChange(newSelection: Set): void { + this.selectedTopics.set(newSelection); + this.applySidebarFilters(); + } + + onTopicSearchTypeChange(type: 'hybrid' | 'semantic'): void { + this.topicSearchType.set(type); + this.applySidebarFilters(); + } + + onCardTopicClick(topic: string): void { + this.toggleTopic(topic); + } + + onCardInstitutionClick(institutionName: string): void { + this.institutionControl.setValue(institutionName, { emitEvent: false }); + this.updateYearFilterState(institutionName); + this.institutionOptions.set([]); + this.applySidebarFilters(); + } + isBookmarked(person: CustomAuthor): boolean { return !!person.id && this.bookmarkedIds.has(person.id); } clearSearch(): void { - this.state.searchValue.set(null); + this.searchValue.set(null); this.router.navigate([], { queryParams: { query: null, page: 1 }, queryParamsHandling: 'merge', }); } - getDistinguishingId(person: CustomAuthor): string { - if (!person) return ''; - if (person.orcid) { - return person.orcid.replace('https://orcid.org/', ''); + private setupInstitutionAutocomplete(): void { + this.institutionControl.valueChanges + .pipe( + debounceTime(250), + map((value) => (typeof value === 'string' ? value.trim() : '')), + distinctUntilChanged(), + switchMap((query) => { + if (query.length < 2) { + this.institutionOptions.set([]); + return of([]); + } + this.institutionLookupLoading.set(true); + return this.searchInstitutions(query).pipe( + catchError(() => of([])), + finalize(() => { + this.institutionLookupLoading.set(false); + }), + ); + }), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((options) => { + this.institutionOptions.set(options); + }); + } + + private searchInstitutions(query: string) { + return this.institutionsService + .autocompleteInstitutions(query, undefined, undefined, 10) + .pipe(map((response) => response.results ?? [])); + } + + updateYearFilterState(val: string): void { + if (!val) { + this.yearFilterEnabledControl.disable(); + this.yearFilterEnabledControl.setValue(false); + } else { + this.yearFilterEnabledControl.enable(); } - if (person.id) { - return person.id.replace('https://openalex.org/', ''); - } - return ''; + } + + clearInstitutionFilter(): void { + this.institutionControl.setValue('', { emitEvent: false }); + this.updateYearFilterState(''); + this.institutionOptions.set([]); + this.applySidebarFilters(); + } + + onInstitutionSelected(event: MatAutocompleteSelectedEvent): void { + const val = event.option.value; + this.institutionControl.setValue(val, { emitEvent: false }); + this.updateYearFilterState(val); + this.institutionOptions.set([]); + this.applySidebarFilters(); } private parseQueryParamArray(val: any): string[] { diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html deleted file mode 100644 index 174e3857..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html +++ /dev/null @@ -1,55 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - -
ID{{ element.id }}Name - {{ element.name }} - Häufigkeit - {{ element.works.length }} - - -
-
- - -
-
    - @for (work of element.works; track $index) { -
  • - {{ work.title }} - ({{ work.id }}) -
  • - } -
-
-
diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss deleted file mode 100644 index efec585e..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss +++ /dev/null @@ -1,79 +0,0 @@ -.content { - display: flex; - flex-direction: row; - padding: 40px; - gap: 20px; - max-height: 1000px; -} - -.graph { - width: 75vh; - height: 75vh; -} - -.table { - overflow: auto; - width: 100%; - max-height: 1000px; - height: 1200px; -} - -.table table { - width: 100%; -} - -.table-area { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; -} - -.scroll-viewport-container { - width: 100%; - height: 100%; -} - -.form-controls { - display: flex; - flex-direction: row; - align-items: flex-start; - gap: 10px; -} - -.form-field-full { - width: 100%; -} - -.right-card { - width: 100%; -} - -.toggle-group { - margin-bottom: 20px; -} - -.toggle-group .mat-button-toggle { - text-transform: none; -} - -.element-row { - position: relative; -} - -.element-row:not(.expanded) { - cursor: pointer; -} - -.element-row:not(.expanded):hover { - background: #f5f5f5; -} - -.element-row.expanded { - border-bottom-color: transparent; -} - -.detail-row { - width: 100%; - -} \ No newline at end of file diff --git a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts b/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts deleted file mode 100644 index 6138705f..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { - AfterViewInit, - Component, - input, - effect, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { RouterModule } from '@angular/router'; - -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; - -type Work = { - id: string; - title: string; -}; - -type Collaborator = { - id: string; - name: string; - category: string; - works: Work[]; -}; - -@Component({ - selector: 'app-person-network-collaborators', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - MatButtonModule, - RouterModule, - CdkDetailRowDirective, - ], - templateUrl: './person-network-collaborators.component.html', - styleUrl: './person-network-collaborators.component.scss', -}) -export class PersonNetworkCollaboratorsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['id', 'name', 'count', 'actions']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Collaborator) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - this.dataSource = this.buildCollaboratorsDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'count') { - return item.works.length; - } - return (item as Record)[property] as string | number; - }; - this.dataSource.filterPredicate = (data, filter) => { - const value = filter.trim().toLowerCase(); - return ( - data.id.toLowerCase().includes(value) || - data.name.toLowerCase().includes(value) - ); - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - const currentSearchTerm = this.searchTerm().trim().toLowerCase(); - this.dataSource.filter = currentSearchTerm; - }); - - effect(() => { - const searchTerm = this.searchTerm(); - const normalizedTerm = searchTerm.trim().toLowerCase(); - this.dataSource.filter = normalizedTerm; - }); - } - - ngAfterViewInit() { - this.dataSource.sort = this.sort; - } - - private setDefaultSort(): void { - this.sort.active = 'name'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'name', direction: 'asc' }); - } - - buildCollaboratorsDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - // key: collaborator id, value: set of work ids - const worksByCollaborator: Record> = {}; - // key: work id, value: work - const works: Record = {}; - - const allWorks: Record = collaborationNetwork.nodes - .filter((node) => node.category === 'work') - .map((node) => ({ - id: node.raw_id, - title: node.display_name, - })) - .reduce( - (acc, work) => { - acc[work.id] = work; - return acc; - }, - {} as Record, - ); - - const allAuthors: Record = collaborationNetwork.nodes - .filter((node) => node.category === 'author') - .map((node) => ({ - id: node.raw_id, - name: node.display_name, - category: node.category, - works: [], - })) - .reduce( - (acc, author) => { - acc[author.id] = author; - return acc; - }, - {} as Record, - ); - - collaborationNetwork.edges.forEach((edge) => { - if ( - edge.raw_source_id.toUpperCase().startsWith('A') && - edge.raw_target_id.toUpperCase().startsWith('W') - ) { - allAuthors[edge.raw_source_id]?.works.push( - allWorks[edge.raw_target_id], - ); - } - }); - - return new MatTableDataSource( - Object.values(allAuthors).filter( - (author) => - author.works.length > 0 && - author.id !== collaborationNetwork.raw_person_id, - ), - ); - } -} diff --git a/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.html b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.html new file mode 100644 index 00000000..c70f4d97 --- /dev/null +++ b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.html @@ -0,0 +1,108 @@ +

Netzwerkfilter

+ + + + +
+
+ + Startjahr (inklusive) + + + + Endjahr (inklusive) + + +
+ + Minimale Anzahl von Kollaborierenden (inklusiv) + + + + Maximale Anzahl von Kollaborierenden (exklusiv) + + + + Themen + + @for ( + topic of collaborationNetwork.filter_information.topics; + track topic.raw_topic_id + ) { + + {{ topic.display_name }} + + } + + +
+
+ +
+ + Minimale Anzahl von Kollaborationen (inklusiv) + + + + Maximale Anzahl von Kollaborationen (inklusiv) + + + + + Institutionen + + @for ( + institution of collaborationNetwork.filter_information + .institutions; + track institution.raw_id + ) { + + {{ institution.display_name }} + + } + + +
+
+
+
+ + + + diff --git a/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.scss b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.scss new file mode 100644 index 00000000..1bc86176 --- /dev/null +++ b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.scss @@ -0,0 +1,29 @@ +form { + padding-top: 20px; + display: flex; + flex-direction: column; + min-width: 500px; + min-height: 350px; +} + +.form-field-full { + width: 100%; +} + +.toggle-group { + margin-bottom: 20px; +} + +.toggle-group .mat-button-toggle { + text-transform: none; + width: 100%; +} + +.pair-field { + display: flex; + gap: 20px; +} + +.pair-field > mat-form-field { + width: 100%; +} diff --git a/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.ts b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.ts new file mode 100644 index 00000000..c11ecf73 --- /dev/null +++ b/webapp/src/app/modules/person-network-filter-dialog/person-network-filter-dialog.component.ts @@ -0,0 +1,121 @@ +import { Component, inject, OnInit, signal } from '@angular/core'; +import { + FormControl, + FormGroup, + FormsModule, + ReactiveFormsModule, +} from '@angular/forms'; +import { + MAT_DIALOG_DATA, + MatDialogModule, + MatDialogRef, +} from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CollaborationNetwork } from '../../api'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; +import { MatButtonModule } from '@angular/material/button'; +import { MatTabsModule } from '@angular/material/tabs'; + +export interface PersonNetworkFilterDialogData { + collaborationNetwork: CollaborationNetwork; + filterBy: 'works' | 'authors'; + + startYear: number; + endYear: number; + topics: string[]; + minContributors: number; + maxContributors: number; + + minCollaborations: number; + maxCollaborations: number; + institutions: string[]; +} + +@Component({ + selector: 'app-person-network-filter-dialog', + imports: [ + FormsModule, + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatDialogModule, + MatInputModule, + MatButtonModule, + MatTabsModule, + ], + templateUrl: './person-network-filter-dialog.component.html', + styleUrl: './person-network-filter-dialog.component.scss', +}) +export class PersonNetworkFilterDialogComponent implements OnInit { + readonly dialogRef = inject(MatDialogRef); + readonly data = inject(MAT_DIALOG_DATA); + + readonly collaborationNetwork = this.data.collaborationNetwork; + + worksFilterForm = new FormGroup({ + startYear: new FormControl(this.data.startYear), + endYear: new FormControl(this.data.endYear), + topics: new FormControl(this.data.topics), + minContributors: new FormControl(this.data.minContributors), + maxContributors: new FormControl(this.data.maxContributors), + }); + + authorsFilterForm = new FormGroup({ + minCollaborations: new FormControl(this.data.minCollaborations), + maxCollaborations: new FormControl(this.data.maxCollaborations), + institutions: new FormControl(this.data.institutions), + }); + + selectedTabIndex = signal(0); + + ngOnInit() { + console.log('Received data:', this.data); + + if (this.data.filterBy === 'works') { + this.selectedTabIndex.set(0); + } else if (this.data.filterBy === 'authors') { + this.selectedTabIndex.set(1); + } + + this.authorsFilterForm.patchValue({ + minCollaborations: this.data.minCollaborations, + maxCollaborations: this.data.maxCollaborations, + institutions: this.data.institutions, + }); + + this.worksFilterForm.patchValue({ + startYear: this.data.startYear, + endYear: this.data.endYear, + topics: this.data.topics, + minContributors: this.data.minContributors, + maxContributors: this.data.maxContributors, + }); + } + + onCancel() { + this.dialogRef.close(); + } + + onApply() { + const filterData = { + filterBy: this.filterBy(), + worksFilterProperties: this.worksFilterForm.value, + authorsFilterProperties: this.authorsFilterForm.value, + }; + this.dialogRef.close(filterData); + } + + filterBy() { + return this.selectedTabIndex() === 0 ? 'works' : 'authors'; + } + + onTabChange(event: any) { + this.selectedTabIndex.set(event.index); + if (event.index === 0) { + console.log('Switched to Works tab'); + } else if (event.index === 1) { + console.log('Switched to Authors tab'); + } + } +} diff --git a/webapp/src/app/modules/person-network-graph/person-network-graph.component.html b/webapp/src/app/modules/person-network-graph/person-network-graph.component.html index 8a37053e..b232e490 100644 --- a/webapp/src/app/modules/person-network-graph/person-network-graph.component.html +++ b/webapp/src/app/modules/person-network-graph/person-network-graph.component.html @@ -1,16 +1,23 @@ - - Kollaborations Netzwerk von {{ authorDisplayName }} - -
+ @if (isEmptyGraph()) { +
+ warning +

Das Netzwerk ist leer.

+
+ } @else if (!isValidGraph()) { +
+ warning +

Das Netzwerk ist zu groß für eine detaillierte Darstellung.

+
+ } @else { +
+ }
diff --git a/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss b/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss index ebdd5e69..f1ae7054 100644 --- a/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss +++ b/webapp/src/app/modules/person-network-graph/person-network-graph.component.scss @@ -7,12 +7,14 @@ mat-card { display: flex; flex-direction: column; width: 100%; - background: transparent; + background-color: var(--sg-background); } -mat-card-content { +mat-card > mat-card-content { flex: 1 1 auto; min-height: 0; + align-items: center; + padding: 0px; } .graph { @@ -24,3 +26,12 @@ mat-card-content { user-select: none; cursor: grab; } + +.warning-container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 16px; + padding: 24px; +} diff --git a/webapp/src/app/modules/person-network-graph/person-network-graph.component.ts b/webapp/src/app/modules/person-network-graph/person-network-graph.component.ts index c31f74d2..ae82076c 100644 --- a/webapp/src/app/modules/person-network-graph/person-network-graph.component.ts +++ b/webapp/src/app/modules/person-network-graph/person-network-graph.component.ts @@ -1,28 +1,68 @@ -import { Component, effect, input } from '@angular/core'; +import { Component, computed, effect, input, output } from '@angular/core'; import { MatCardModule } from '@angular/material/card'; import { CollaborationNetwork } from '../../api'; import { NgxEchartsDirective } from 'ngx-echarts'; import { EChartsCoreOption } from 'echarts/types/dist/core'; import * as echarts from 'echarts/core'; -import { GridComponent, TitleComponent } from 'echarts/components'; +import { + GridComponent, + LegendComponent, + TitleComponent, +} from 'echarts/components'; import { CanvasRenderer } from 'echarts/renderers'; import { GraphChart } from 'echarts/charts'; -echarts.use([GridComponent, CanvasRenderer, GraphChart, TitleComponent]); +import { MatIconModule } from '@angular/material/icon'; +echarts.use([ + GridComponent, + CanvasRenderer, + GraphChart, + TitleComponent, + LegendComponent, +]); + +export type NodeCategory = 'author' | 'collaborator' | 'work' | 'institution'; + +export interface NodeClickEvent { + id: string; + name: string; + category: NodeCategory; +} @Component({ selector: 'app-person-network-graph', - imports: [MatCardModule, NgxEchartsDirective], + imports: [MatCardModule, MatIconModule, NgxEchartsDirective], templateUrl: './person-network-graph.component.html', - styleUrl: './person-network-graph.component.scss', + styleUrls: ['./person-network-graph.component.scss'], }) export class PersonNetworkGraphComponent { collaborationNetwork = input(); + handleNodeClick = output(); + authorDisplayName: string = ''; options!: EChartsCoreOption; + readonly isEmptyGraph = computed(() => { + const network = this.collaborationNetwork(); + return ( + network === undefined || + network.author_nodes.length === 0 || + network.collaboration_edges.length === 0 + ); + }); + + readonly isValidGraph = computed(() => { + const network = this.collaborationNetwork(); + return ( + network !== undefined && + network.author_nodes.length > 0 && + network.author_nodes.length < 1000 && + network.collaboration_edges.length > 0 + ); + }); + constructor() { effect(() => { const network = this.collaborationNetwork(); @@ -37,45 +77,85 @@ export class PersonNetworkGraphComponent { event.preventDefault(); } + categoryLabels: Record = { + author: 'Autor', + collaborator: 'Kollaborierender', + institution: 'Institution', + work: 'Publikation', + }; + + onChartEvent(event: any, type: string) { + if (type !== 'chartClick') { + return; + } + const id = event?.data?.id; + const name = event?.data?.name; + const category = event?.data?.category; + if (!id || !name || !category) { + return; + } + this.handleNodeClick.emit({ id, name, category }); + } + private updateGraphOptions(collaborationNetwork: CollaborationNetwork): void { if (!collaborationNetwork) { return; } + const frequencies = + this.calculateOccurenceFrequencies(collaborationNetwork); + + const freqValues = Object.values(frequencies); + const minFrequency = freqValues.length ? Math.min(...freqValues) : 0; + const maxFrequency = freqValues.length ? Math.max(...freqValues) : 0; + const freqDenominator = + maxFrequency === minFrequency ? 1 : maxFrequency - minFrequency; + const datas = [ { - nodes: collaborationNetwork.nodes.map((node) => { - const category = (() => { - if (node.category === 'institution') { - return 'institution'; - } - if (node.category === 'work') { - return 'work'; - } - if (node.raw_id === collaborationNetwork.raw_person_id) { - return 'author'; - } - return 'collaborator'; - })(); + nodes: [ + collaborationNetwork.work_nodes, + collaborationNetwork.author_nodes, + collaborationNetwork.institution_nodes, + ] + .flat() + .map((node) => { + const category = (() => { + if (node.category === 'institution') { + return 'institution'; + } + if (node.category === 'work') { + return 'work'; + } + if (node.raw_id === collaborationNetwork.raw_person_id) { + return 'author'; + } + return 'collaborator'; + })(); + + const baseId = node.raw_id + ''; + const nodeFreq = frequencies[node.raw_id] || 0; + const computedSymbolSize = + 25 + ((nodeFreq - minFrequency) / freqDenominator) * 30; - if (node.category === 'work') { return { - id: node.raw_id + '', + id: baseId, name: node.display_name, category, + label: { + show: node.category !== 'work', + formatter: '{b}', + }, + emphasis: { + label: { + show: true, + formatter: '{b}', + }, + }, + symbolSize: node.category === 'work' ? 15 : computedSymbolSize, }; - } - - return { - id: node.raw_id + '', - name: node.display_name, - category, - label: { - show: true, - }, - }; - }), - links: collaborationNetwork.edges.map((edge) => { + }), + links: collaborationNetwork.collaboration_edges.map((edge) => { return [edge.raw_source_id + '', edge.raw_target_id + '']; }), categories: [ @@ -95,26 +175,32 @@ export class PersonNetworkGraphComponent { }, ]; - this.authorDisplayName = - collaborationNetwork.nodes.find( - (node) => node.raw_id === collaborationNetwork.raw_person_id, - )?.display_name || 'Unknown Author'; + const legendData = datas.length + ? datas[0].categories.map((c) => c.name) + : []; this.options = { + legend: { + data: legendData, + bottom: 0, + orient: 'horizontal', + formatter: (name: string) => this.categoryLabels[name] || name, + itemGap: 20, + }, series: datas.map((item) => { return { - name: this.authorDisplayName, type: 'graph', layout: 'force', - symbolSize: 20, + symbolSize: 15, animation: false, data: item.nodes, roam: true, force: { repulsion: 10000, - edgeLength: 125, + friction: 0.9, gravity: 0.2, }, + zoom: 0.1, links: item.links.map((e) => { return { source: e[0] + '', @@ -133,4 +219,16 @@ export class PersonNetworkGraphComponent { }), }; } + calculateOccurenceFrequencies( + network: CollaborationNetwork, + ): Record { + const frequencies: Record = {}; + network.collaboration_edges.forEach((edge) => { + frequencies[edge.raw_source_id] = + (frequencies[edge.raw_source_id] || 0) + 1; + frequencies[edge.raw_target_id] = + (frequencies[edge.raw_target_id] || 0) + 1; + }); + return frequencies; + } } diff --git a/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.html b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.html new file mode 100644 index 00000000..29c0ea8b --- /dev/null +++ b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.html @@ -0,0 +1,9 @@ + + + {{ icon() }} +
+ {{ value() }} + {{ description() }} +
+
+
diff --git a/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.scss b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.scss new file mode 100644 index 00000000..13a84cc6 --- /dev/null +++ b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.scss @@ -0,0 +1,34 @@ +.info-card { + --info-card-icon-size: 40px; + + background-color: var(--sg-background); + padding: 10px 20px; +} +.info-card mat-card-content { + display: flex; + align-items: start; + gap: 10px; +} + +.info-card mat-icon { + width: var(--info-card-icon-size); + height: var(--info-card-icon-size); + font-size: var(--info-card-icon-size); + color: var(--sg-blue-highlight); +} + +.info-card div { + display: flex; + flex-direction: column; + gap: 4px; +} + +.info-card .number { + font-weight: var(--sg-default-bold-weight); + font-size: 1.5em; +} + +.info-card .description { + color: var(--sg-text-muted); + font-size: 0.9em; +} diff --git a/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.ts b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.ts new file mode 100644 index 00000000..fe5c3913 --- /dev/null +++ b/webapp/src/app/modules/person-network-info-card/person-network-info-card.component.ts @@ -0,0 +1,15 @@ +import { Component, input } from '@angular/core'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; + +@Component({ + selector: 'app-person-network-info-card', + imports: [MatIconModule, MatCardModule], + templateUrl: './person-network-info-card.component.html', + styleUrl: './person-network-info-card.component.scss', +}) +export class PersonNetworkInfoCardComponent { + readonly icon = input(); + readonly value = input(); + readonly description = input(); +} diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.html b/webapp/src/app/modules/person-network-publications/person-network-publications.component.html deleted file mode 100644 index a8c4c24b..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.html +++ /dev/null @@ -1,57 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - -
ID{{ element.id }}Titel - {{ element.title }} - Mitwirkende - {{ element.collaborators.length }} - - -
-
- - -
-
    - @for (collaborator of element.collaborators; track $index) { -
  • - {{ collaborator.name }} - ({{ - collaborator.id - }}) -
  • - } -
-
-
diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss b/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss deleted file mode 100644 index b6462c61..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss +++ /dev/null @@ -1,78 +0,0 @@ -.content { - display: flex; - flex-direction: row; - padding: 40px; - gap: 20px; - max-height: 1000px; -} - -.graph { - width: 75vh; - height: 75vh; -} - -.table { - overflow: auto; - width: 100%; - max-height: 1000px; - height: 1200px; -} - -.table table { - width: 100%; -} - -.table-area { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; -} - -.scroll-viewport-container { - width: 100%; - height: 100%; -} - -.form-controls { - display: flex; - flex-direction: row; - align-items: flex-start; - gap: 10px; -} - -.form-field-full { - width: 100%; -} - -.right-card { - width: 100%; -} - -.toggle-group { - margin-bottom: 20px; -} - -.toggle-group .mat-button-toggle { - text-transform: none; -} - -.element-row { - position: relative; -} - -.element-row:not(.expanded) { - cursor: pointer; -} - -.element-row:not(.expanded):hover { - background: #f5f5f5; -} - -.element-row.expanded { - border-bottom-color: transparent; -} - -.detail-row { - width: 100%; -} diff --git a/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts b/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts deleted file mode 100644 index 271906b9..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { - AfterViewInit, - Component, - input, - effect, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { RouterModule } from '@angular/router'; - -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; - -type Collaborator = { - id: string; - name: string; - category: string; -}; - -type Work = { - id: string; - title: string; - collaborators: Collaborator[]; -}; - -@Component({ - selector: 'app-person-network-publications', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - RouterModule, - CdkDetailRowDirective, - MatButtonModule, - ], - templateUrl: './person-network-publications.component.html', - styleUrl: './person-network-publications.component.scss', -}) -export class PersonNetworkPublicationsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['id', 'title', 'contributors', 'actions']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Work) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - if (!collaborationNetwork) { - return; - } - - this.dataSource = this.buildWorksDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'contributors') { - return item.collaborators.length; - } - return (item as Record)[property] as string | number; - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - }); - - effect(() => { - const searchTerm = this.searchTerm(); - this.dataSource.filter = searchTerm.trim().toLowerCase(); - }); - } - - ngAfterViewInit() { - this.dataSource.sort = this.sort; - } - - private setDefaultSort(): void { - this.sort.active = 'title'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'title', direction: 'asc' }); - } - - buildWorksDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - const allWorks: Record = collaborationNetwork.nodes - .filter((node) => node.category === 'work') - .map((node) => ({ - id: node.raw_id, - title: node.display_name, - collaborators: [], - })) - .reduce( - (acc, work) => { - acc[work.id] = work; - return acc; - }, - {} as Record, - ); - - const allAuthors: Record = collaborationNetwork.nodes - .filter((node) => node.category === 'author') - .map((node) => ({ - id: node.raw_id, - name: node.display_name, - category: - node.raw_id === collaborationNetwork.raw_person_id - ? 'author' - : 'collaborator', - })) - .reduce( - (acc, person) => { - acc[person.id] = person; - return acc; - }, - {} as Record, - ); - - collaborationNetwork.edges.forEach((edge) => { - if ( - edge.raw_source_id.toUpperCase().startsWith('A') && - edge.raw_target_id.toUpperCase().startsWith('W') - ) { - allWorks[edge.raw_target_id]?.collaborators.push( - allAuthors[edge.raw_source_id], - ); - } - }); - - return new MatTableDataSource( - Object.values(allWorks).filter((work) => work.collaborators.length > 0), - ); - } -} diff --git a/webapp/src/app/modules/person-network/person-network.component.html b/webapp/src/app/modules/person-network/person-network.component.html index 33475766..f6a27bce 100644 --- a/webapp/src/app/modules/person-network/person-network.component.html +++ b/webapp/src/app/modules/person-network/person-network.component.html @@ -1,170 +1,166 @@
- +
+
Netzwerk
+

Zusammenarbeit und Verbindungen im wissenschaftlichen Netzwerk.

+
-
-
- - - Filter - -
- - Startjahr (inklusive) - - - - Endjahr (inklusive) - - -
-
- - Minimale Anzahl von Kollaborierenden (inklusiv) - - - - Maximale Anzahl von Kollaborierenden (exklusiv) - - -
-
- - Minimale Anzahl von Kollaborationen (inklusiv) - - - - Maximale Anzahl von Kollaborationen (inklusiv) - - -
+
+ -
- - Institutionen - + +
+ + + Kollaborierende + + Publikationen - @for ( - institution of collaborationNetwork.filter_information - .institutions; - track institution.raw_id - ) { - - {{ institution.display_name }} - - } - - - - Themen - - @for ( - topic of collaborationNetwork.filter_information.topics; - track topic.raw_topic_id - ) { - - {{ topic.display_name }} - - } - - + + Institutionen + + +
- + + {{ this.searchTermLabel() }} + + search + + + - - - Kollaborierende - - Publikationen - - - {{ - this.displayedTable() === "collaborators" - ? "Suche Kollaborierende nach Name oder ID" - : "Suche Publikationen nach Titel oder ID" - }} - - search - - - -
- -
- @if (this.displayedTable() === "collaborators") { - - } @else if (this.displayedTable() === "publications") { - - } -
+ + @if (this.displayedTable() === 'collaborators') { + + } @else if (this.displayedTable() === 'publications') { + + } @else if (this.displayedTable() === 'institutions') { + + }
+ +
+ @for (summary of this.summaryCards(); track $index) { + + } +
+ + + + open_in_new + + + + + {{ element.works.length }} + + + +
+ +
+
+ + + + open_in_new + + + + + {{ element.collaborators.length }} + + + +
+ +
+
+ + + + open_in_new + + + + + {{ element.collaborators.length }} + + + +
+ +
diff --git a/webapp/src/app/modules/person-network/person-network.component.scss b/webapp/src/app/modules/person-network/person-network.component.scss index 234fc412..74a4778c 100644 --- a/webapp/src/app/modules/person-network/person-network.component.scss +++ b/webapp/src/app/modules/person-network/person-network.component.scss @@ -1,57 +1,39 @@ .content { display: flex; - flex-direction: row; - padding: 40px; + flex-direction: column; + padding: 30px; gap: 20px; - align-items: stretch; +} + +.description-container { + display: flex; + flex-direction: column; +} + +.cards { + display: flex; + flex-direction: row; + gap: 20px; + max-height: 80vh; +} + +form > div { + display: flex; + flex-direction: row; + gap: 20px; +} + +form > div > button, +form > div > mat-button-toggle-group { + margin-top: 20px; + margin-bottom: 20px; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); } .content > app-person-network-graph, .right-card { flex: 1 1 0; - min-width: 0; -} - -.table { - overflow: auto; - width: 100%; - max-height: 70vh; - height: 100%; -} - -.table table { - width: 100%; -} - -.table-area { - width: 100%; - height: 100%; - display: flex; - flex-direction: column; -} - -.scroll-viewport-container { - width: 100%; - height: 100%; -} - -.form-controls { - display: flex; - flex-direction: row; - align-items: flex-start; - gap: 10px; -} - -.form-field-full { - width: 100%; -} - -.right-card { - width: 100%; -} - -.toggle-group { - margin-bottom: 20px; } .toggle-group .mat-button-toggle { @@ -59,11 +41,31 @@ width: 100%; } -.pair-field { +.summary-container { display: flex; + flex-direction: row; gap: 20px; } -.pair-field > mat-form-field { - width: 100%; +.summary-container app-person-network-info-card { + flex: 1 1 0; +} + +.scroll-viewport-container { + height: 50vh; + max-height: 50vh; +} + +mat-card { + background-color: var(--sg-background); +} + +.person-link, +.work-link { + color: var(--sg-primary); + text-decoration: none; +} +.person-link:hover, +.work-link:hover { + text-decoration: underline; } diff --git a/webapp/src/app/modules/person-network/person-network.component.ts b/webapp/src/app/modules/person-network/person-network.component.ts index 45986862..ebceeec9 100644 --- a/webapp/src/app/modules/person-network/person-network.component.ts +++ b/webapp/src/app/modules/person-network/person-network.component.ts @@ -1,17 +1,23 @@ import { toSignal } from '@angular/core/rxjs-interop'; -import { Component, computed, OnInit } from '@angular/core'; +import { + Component, + computed, + effect, + input, + OnInit, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; import { ActivatedRoute, Router, RouterModule } from '@angular/router'; import { MatCardModule } from '@angular/material/card'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatRippleModule } from '@angular/material/core'; import { provideEchartsCore } from 'ngx-echarts'; import * as echarts from 'echarts/core'; -import { MatTableModule } from '@angular/material/table'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { ScrollingModule } from '@angular/cdk/scrolling'; import { MatFormFieldModule } from '@angular/material/form-field'; import { FormControl, @@ -20,60 +26,211 @@ import { ReactiveFormsModule, } from '@angular/forms'; import { MatInputModule } from '@angular/material/input'; -import { MatSliderModule } from '@angular/material/slider'; -import { MatSortModule } from '@angular/material/sort'; import { CollaborationNetwork } from '../../api'; -import { PersonNetworkCollaboratorsComponent } from '../person-network-collaborators/person-network-collaborators.component'; -import { PersonNetworkPublicationsComponent } from '../person-network-publications/person-network-publications.component'; import { debounceTime } from 'rxjs'; -import { PersonNetworkGraphComponent } from '../person-network-graph/person-network-graph.component'; +import { + NodeCategory, + NodeClickEvent, + PersonNetworkGraphComponent, +} from '../person-network-graph/person-network-graph.component'; import { MatSelectModule } from '@angular/material/select'; import { MatExpansionModule } from '@angular/material/expansion'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { PersonNetworkFilterDialogComponent } from '../person-network-filter-dialog/person-network-filter-dialog.component'; +import { PersonNetworkInfoCardComponent } from '../person-network-info-card/person-network-info-card.component'; +import { + GenericColumn, + DataTableComponent, +} from '../../shared/ui/data-table/data-table.component'; + +type CWork = { + id: string; + title: string; +}; + +type CCollaborator = { + id: string; + name: string; + category: string; + works: CWork[]; +}; + +type PCollaborator = { + id: string; + name: string; + category: string; +}; + +type PWork = { + id: string; + title: string; + collaborators: PCollaborator[]; +}; + +type ICollaborator = { + id: string; + name: string; +}; + +type IInstitution = { + id: string; + name: string; + collaborators: ICollaborator[]; +}; @Component({ selector: 'app-person-network', imports: [ MatCardModule, - MatTableModule, MatButtonModule, MatIconModule, - ScrollingModule, MatButtonToggleModule, MatFormFieldModule, FormsModule, MatInputModule, - MatSortModule, - MatRippleModule, RouterModule, - PersonNetworkCollaboratorsComponent, - PersonNetworkPublicationsComponent, - MatSliderModule, ReactiveFormsModule, FormsModule, PersonNetworkGraphComponent, MatSelectModule, MatExpansionModule, + MatDialogModule, + PersonNetworkInfoCardComponent, + DataTableComponent, ], templateUrl: './person-network.component.html', styleUrl: './person-network.component.scss', providers: [provideEchartsCore({ echarts })], }) export class PersonNetworkComponent implements OnInit { - collaborationNetwork!: CollaborationNetwork; + collaborationNetwork = input.required(); + + collaboratorsColumns: GenericColumn[] = []; + collaboratorsData: CCollaborator[] = []; + collaboratorsActionTmp = viewChild.required>( + 'collaboratorsActionTmp', + ); + collaboratorsFrequencyTmp = viewChild.required>( + 'collaboratorsFrequencyTmp', + ); + collaboratorsDetailRow = viewChild.required>( + 'collaboratorsDetailRow', + ); + + publicationsColumns: GenericColumn[] = []; + publicationsData: PWork[] = []; + publicationsActionTmp = viewChild.required>( + 'publicationsActionTmp', + ); + publicationsCollaborationFrequencyTmp = viewChild.required>( + 'publicationsCollaborationFrequencyTmp', + ); + publicationsDetailRow = viewChild.required>( + 'publicationsDetailRow', + ); + + institutionsColumns: GenericColumn[] = []; + institutionsData: IInstitution[] = []; + institutionsActionTmp = viewChild.required>( + 'institutionsActionTmp', + ); + institutionsFrequencyTmp = viewChild.required>( + 'institutionsFrequencyTmp', + ); + institutionsDetailRow = viewChild.required>( + 'institutionsDetailRow', + ); filterForm = new FormGroup({ searchTerm: new FormControl(''), + filterBy: new FormControl<'works' | 'authors'>('works'), + displayedTable: new FormControl('collaborators'), + startYear: new FormControl(2000), endYear: new FormControl(2025), - minimumCollaborators: new FormControl(2), - maximumCollaborators: new FormControl(10), - minimumCollaborations: new FormControl(1), - maximumCollaborations: new FormControl(100), - institutions: new FormControl([]), topics: new FormControl([]), - displayedTable: new FormControl('collaborators'), + minContributors: new FormControl(2), + maxContributors: new FormControl(10), + + minCollaborations: new FormControl(1), + maxCollaborations: new FormControl(100), + institutions: new FormControl([]), }); + persons = signal(0); + institutions = signal(0); + publications = signal(0); + + connections = signal(0); + + searchTermLabel = computed(() => { + const displayedTable = this.displayedTable(); + switch (displayedTable) { + case 'collaborators': + return 'Suche Kollaborierende nach Name'; + case 'publications': + return 'Suche Publikationen nach Titel'; + case 'institutions': + return 'Suche Institutionen nach Name'; + default: + return 'Suchbegriff'; + } + }); + + private readonly categoryTableMap: Record = { + author: 'collaborators', + collaborator: 'collaborators', + work: 'publications', + institution: 'institutions', + }; + + latestNodeId = signal(null); + + handleNodeClick = ({ id, name, category }: NodeClickEvent): void => { + if (this.latestNodeId() === id) { + this.clearSearch(); + return; + } + + this.latestNodeId.set(id); + if (category === 'author') { + return; + } + + this.filterForm.patchValue({ + displayedTable: this.categoryTableMap[category], + searchTerm: name, + }); + }; + + clearSearch() { + this.latestNodeId.set(null); + this.filterForm.patchValue({ searchTerm: '' }); + } + + readonly summaryCards = computed(() => [ + { + icon: 'person', + value: this.persons(), + description: 'Personen', + }, + { + icon: 'apartment', + value: this.institutions(), + description: 'Institutionen', + }, + { + icon: 'menu_book', + value: this.publications(), + description: 'Gemeinsame Publikationen', + }, + { + icon: 'share', + value: this.connections(), + description: 'Verbindungen im Netzwerk', + }, + ]); + readonly formValue = toSignal(this.filterForm.valueChanges); readonly debouncedFormValue = toSignal( this.filterForm.valueChanges.pipe(debounceTime(300)), @@ -84,68 +241,200 @@ export class PersonNetworkComponent implements OnInit { }); readonly searchTerm = computed(() => { - console.log('Search term computed:', this.debouncedFormValue()?.searchTerm); return this.debouncedFormValue()?.searchTerm || ''; }); readonly activatedRouteData = toSignal(this.activatedRoute.data); - formatYearLabel = (value: number) => `${value}`; - constructor( private readonly activatedRoute: ActivatedRoute, private readonly router: Router, - ) {} + private readonly dialog: MatDialog, + ) { + effect(() => { + this.collaboratorsData = this.buildCollaboratorsDataSource( + this.collaborationNetwork(), + ); - ngOnInit(): void { - this.activatedRoute.data.subscribe(({ collaborationNetwork }) => { - this.collaborationNetwork = collaborationNetwork; + this.publicationsData = this.buildWorksDataSource( + this.collaborationNetwork(), + ); + + this.institutionsData = this.buildInstitutionsDataSource( + this.collaborationNetwork(), + ); + + this.calculateSummary(this.collaborationNetwork()); const currentParams = this.activatedRoute.snapshot.queryParams; - const initialStartYear = - Number(currentParams['start_year']) || - this.collaborationNetwork.filter_information.min_possible_year; - const initialEndYear = - Number(currentParams['end_year']) || - this.collaborationNetwork.filter_information.max_possible_year; this.filterForm.setValue({ searchTerm: currentParams['search_term'] || '', - startYear: initialStartYear, - endYear: initialEndYear, - minimumCollaborators: - Number(currentParams['minimum_collaborators']) || 2, - maximumCollaborators: - Number(currentParams['maximum_collaborators']) || 10, - minimumCollaborations: - this.filterForm.get('minimumCollaborations')?.value ?? 1, - maximumCollaborations: - this.filterForm.get('maximumCollaborations')?.value ?? 100, + filterBy: currentParams['filter_by'] || 'works', displayedTable: currentParams['table'] || 'collaborators', - institutions: currentParams['institutions'] - ? currentParams['institutions'].split(',') - : [], + + startYear: + Number(currentParams['start_year']) || + this.collaborationNetwork().filter_information.min_possible_year, + endYear: + Number(currentParams['end_year']) || + this.collaborationNetwork().filter_information.max_possible_year, topics: currentParams['topics'] ? currentParams['topics'].split(',') : [], + minContributors: Number(currentParams['min_contributors']) || 2, + maxContributors: Number(currentParams['max_contributors']) || 10, + + minCollaborations: Number(currentParams['min_collaborations']) || 1, + maxCollaborations: Number(currentParams['max_collaborations']) || 100, + + institutions: currentParams['institutions'] + ? currentParams['institutions'].split(',') + : [], }); }); + } + + openFilterDialog() { + console.log('Form value when opening dialog:', this.filterForm.value); + const dialogRef = this.dialog.open(PersonNetworkFilterDialogComponent, { + data: { + collaborationNetwork: this.collaborationNetwork(), + filterBy: this.filterForm.get('filterBy')?.value || 'works', + startYear: this.filterForm.get('startYear')?.value, + + endYear: this.filterForm.get('endYear')?.value, + topics: this.filterForm.get('topics')?.value, + minContributors: this.filterForm.get('minContributors')!.value, + maxContributors: this.filterForm.get('maxContributors')?.value, + + minCollaborations: this.filterForm.get('minCollaborations')?.value, + maxCollaborations: this.filterForm.get('maxCollaborations')?.value, + institutions: this.filterForm.get('institutions')?.value, + }, + }); + + dialogRef.afterClosed().subscribe((result) => { + console.log('Dialog closed with result:', result); + console.log(result.filterBy); + console.log(result.worksFilterProperties); + console.log(result.authorsFilterProperties); + if (result) { + this.filterForm.patchValue({ + filterBy: result.filterBy, + + startYear: result.worksFilterProperties.startYear, + endYear: result.worksFilterProperties.endYear, + topics: result.worksFilterProperties.topics, + minContributors: result.worksFilterProperties.minContributors, + maxContributors: result.worksFilterProperties.maxContributors, + + minCollaborations: result.authorsFilterProperties.minCollaborations, + maxCollaborations: result.authorsFilterProperties.maxCollaborations, + institutions: result.authorsFilterProperties.institutions, + }); + } + }); + } + + calculateSummary(collaborationNetwork: CollaborationNetwork) { + this.persons.set(collaborationNetwork.author_nodes.length); + this.institutions.set(collaborationNetwork.institution_nodes.length); + this.publications.set(collaborationNetwork.work_nodes.length); + this.connections.set(collaborationNetwork.collaboration_edges.length); + } + + ngOnInit(): void { + this.collaboratorsColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', + }, + { + id: 'works', + header: 'Häufigkeit', + type: 'display', + cellTemplate: this.collaboratorsFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.collaboratorsActionTmp(), + }, + ]; + this.publicationsColumns = [ + { + id: 'title', + header: 'Titel', + type: 'accessor', + accessorKey: 'title', + }, + { + id: 'collaborators', + header: 'Mitwirkende', + type: 'display', + cellTemplate: this.publicationsCollaborationFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.publicationsActionTmp(), + }, + ]; + this.institutionsColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', + }, + { + id: 'collaborators', + header: 'Mitwirkende', + type: 'display', + cellTemplate: this.institutionsFrequencyTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.institutionsActionTmp(), + }, + ]; this.filterForm.valueChanges.pipe(debounceTime(300)).subscribe((value) => { + const queryParams = { + table: value.displayedTable ?? 'collaborators', + search_term: value.searchTerm ?? '', + filter_by: value.filterBy ?? 'works', + start_year: value.startYear ?? '', + end_year: value.endYear ?? '', + min_contributors: value.minContributors ?? 2, + max_contributors: value.maxContributors ?? 10, + min_collaborations: value.minCollaborations ?? 1, + max_collaborations: value.maxCollaborations ?? 100, + institutions: value.institutions?.join(',') ?? '', + topics: value.topics?.join(',') ?? '', + }; + + const currentQueryParams = this.activatedRoute.snapshot.queryParams; + + const hasChanged = Object.entries(queryParams).some(([key, value]) => { + return String(currentQueryParams[key] ?? '') !== String(value ?? ''); + }); + + if (!hasChanged) { + return; + } + this.router.navigate([], { relativeTo: this.activatedRoute, - queryParams: { - table: value.displayedTable, - search_term: value.searchTerm, - start_year: value.startYear, - end_year: value.endYear, - minimum_collaborators: value.minimumCollaborators, - maximum_collaborators: value.maximumCollaborators, - minimum_collaborations: value.minimumCollaborations, - maximum_collaborations: value.maximumCollaborations, - institutions: value.institutions?.join(','), - topics: value.topics?.join(','), - }, + queryParams, + replaceUrl: true, }); }); } @@ -157,4 +446,151 @@ export class PersonNetworkComponent implements OnInit { } this.filterForm.get('displayedTable')?.setValue(value); } + + buildCollaboratorsDataSource( + collaborationNetwork: CollaborationNetwork, + ): CCollaborator[] { + // key: collaborator id, value: set of work ids + const worksByCollaborator: Record> = {}; + // key: work id, value: work + const works: Record = {}; + + const allWorks: Record = collaborationNetwork.work_nodes + .map((node) => ({ + id: node.raw_id, + title: node.display_name, + })) + .reduce( + (acc, work) => { + acc[work.id] = work; + return acc; + }, + {} as Record, + ); + + const allAuthors: Record = + collaborationNetwork.author_nodes + .map((node) => ({ + id: node.raw_id, + name: node.display_name, + category: node.category, + works: [], + })) + .reduce( + (acc, author) => { + acc[author.id] = author; + return acc; + }, + {} as Record, + ); + + collaborationNetwork.collaboration_edges.forEach((edge) => { + if ( + edge.raw_source_id.toUpperCase().startsWith('A') && + edge.raw_target_id.toUpperCase().startsWith('W') + ) { + allAuthors[edge.raw_source_id]?.works.push( + allWorks[edge.raw_target_id], + ); + } + }); + + Object.values(allAuthors).forEach((author) => { + author.works.sort((a, b) => a.title.localeCompare(b.title)); + }); + + return Object.values(allAuthors).filter( + (author) => + author.works.length > 0 && + author.id !== collaborationNetwork.raw_person_id, + ); + } + + buildWorksDataSource(collaborationNetwork: CollaborationNetwork): PWork[] { + const allWorks: Record = collaborationNetwork.work_nodes + .map((node) => ({ + id: node.raw_id, + title: node.display_name, + collaborators: [], + })) + .reduce( + (acc, work) => { + acc[work.id] = work; + return acc; + }, + {} as Record, + ); + + const allAuthors: Record = + collaborationNetwork.author_nodes + .map((node) => ({ + id: node.raw_id, + name: node.display_name, + category: + node.raw_id === collaborationNetwork.raw_person_id + ? 'author' + : 'collaborator', + })) + .reduce( + (acc, person) => { + acc[person.id] = person; + return acc; + }, + {} as Record, + ); + + collaborationNetwork.collaboration_edges.forEach((edge) => { + if ( + edge.raw_source_id.toUpperCase().startsWith('A') && + edge.raw_target_id.toUpperCase().startsWith('W') + ) { + allWorks[edge.raw_target_id]?.collaborators.push( + allAuthors[edge.raw_source_id], + ); + } + }); + + Object.values(allWorks).forEach((work) => { + work.collaborators.sort((a, b) => a.name.localeCompare(b.name)); + }); + + return Object.values(allWorks).filter( + (work) => work.collaborators.length > 0, + ); + } + + buildInstitutionsDataSource( + collaborationNetwork: CollaborationNetwork, + ): IInstitution[] { + const institutionsMap: Record = {}; + + for (const node of collaborationNetwork.institution_nodes) { + institutionsMap[node.raw_id] = { + id: node.raw_id, + name: node.display_name, + collaborators: [], + }; + } + + for (const edge of collaborationNetwork.collaboration_edges) { + if (edge.raw_target_id in institutionsMap) { + const institution = institutionsMap[edge.raw_target_id]; + institution.collaborators.push({ + id: edge.raw_source_id, + name: + collaborationNetwork.author_nodes.find( + (node) => node.raw_id === edge.raw_source_id, + )?.display_name || 'Unbekannt', + }); + } + } + + for (const institution of Object.values(institutionsMap)) { + institution.collaborators.sort((a, b) => + a.name.localeCompare(b.name, 'de', { sensitivity: 'base' }), + ); + } + + return Object.values(institutionsMap); + } } diff --git a/webapp/src/app/modules/person-news/person-news.component.html b/webapp/src/app/modules/person-news/person-news.component.html new file mode 100644 index 00000000..b4f717db --- /dev/null +++ b/webapp/src/app/modules/person-news/person-news.component.html @@ -0,0 +1,82 @@ +
+
+
Nachrichten
+

Aktuelle Nachrichten zu dieser Person.

+
+ +
+ + search + + + + + + Neueste zuerst + Älteste zuerst + + +
+ +
+ @if (loading) { +
+ +
+ } + + + + + + + + + + + + + + + + + + + +
Titel + {{ + article.maintitle || 'Kein Titel' + }} + Autor + {{ article.author || '-' }} + Datum + {{ formatDate(article.date) }} +
+ + @if (!loading && articles.length === 0) { +
+ @if (isSearching) { + Keine Ergebnisse für „{{ searchControl.value.trim() }}" gefunden. + } @else { + Keine Nachrichten gefunden. + } +
+ } +
+ + +
diff --git a/webapp/src/app/modules/person-news/person-news.component.scss b/webapp/src/app/modules/person-news/person-news.component.scss new file mode 100644 index 00000000..68a1899f --- /dev/null +++ b/webapp/src/app/modules/person-news/person-news.component.scss @@ -0,0 +1,156 @@ +.page { + padding: 28px 32px 42px; + max-width: 100%; + margin: 0 auto; +} + +h6 { + margin: 0 0 6px; + font-size: 22px; + line-height: 1.2; + font-weight: 700; +} + +.page > div:first-child p { + margin: 0; + color: var(--sg-text-muted); + font-size: 14px; +} + +.news-toolbar { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 12px; + padding-top: 10px; + padding-bottom: 25px; +} + +.search-field { + max-width: 480px; +} + +::ng-deep .news-toolbar .mat-mdc-form-field-subscript-wrapper { + display: none; +} + +::ng-deep .news-toolbar .mat-mdc-text-field-wrapper { + height: 42px; + background: #fff; + border-radius: var(--sg-radius-sm); +} + +::ng-deep .news-toolbar .mat-mdc-form-field-infix { + min-height: unset; + height: 42px; + padding: 0; + display: flex; + align-items: center; +} + +::ng-deep .news-toolbar .mdc-notched-outline__leading, +::ng-deep .news-toolbar .mdc-notched-outline__notch, +::ng-deep .news-toolbar .mdc-notched-outline__trailing { + border-color: #d9e2f0; +} + +::ng-deep .news-toolbar input.mat-mdc-input-element { + color: var(--sg-text); + font-size: 14px; +} + +::ng-deep .news-toolbar input.mat-mdc-input-element::placeholder { + color: var(--sg-text-muted); + opacity: 1; + font-size: 14px; +} + +.sort-field { + width: 180px; +} + +.table-wrap { + position: relative; + overflow-x: auto; +} + +table { + width: 100%; + min-width: 600px; + border-collapse: separate; + border-spacing: 0 10px; + background: transparent; + box-shadow: none; +} + +.article-title { + display: inline-block; + max-width: 520px; + line-height: 1.35; + color: var(--sg-text); + font-size: 14px; + font-weight: 700; + text-decoration: none; + + &:hover { + color: var(--sg-text); + text-decoration: underline; + } +} + +.loading { + position: absolute; + inset: 0; + z-index: 1; + display: grid; + place-items: center; + background: rgba(255, 255, 255, 0.65); +} + +.empty-state { + padding: 28px; + text-align: center; + color: rgba(0, 0, 0, 0.6); + background: transparent; +} + +::ng-deep .mat-mdc-header-cell { + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 700; +} + +::ng-deep .mat-mdc-row { + height: 72px; +} + +::ng-deep .mat-mdc-cell { + color: var(--sg-text); + border-bottom-color: var(--sg-border); + font-size: 13px; +} + +mat-paginator { + background: transparent; +} + +.table-footer { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 66px; + padding: 0 22px 0 28px; + color: var(--sg-text-muted); + font-size: 13px; +} + +@media (max-width: 600px) { + .page { + padding: 16px; + } + + .table-footer { + align-items: stretch; + flex-direction: column; + } +} diff --git a/webapp/src/app/modules/person-news/person-news.component.ts b/webapp/src/app/modules/person-news/person-news.component.ts new file mode 100644 index 00000000..b0e6356b --- /dev/null +++ b/webapp/src/app/modules/person-news/person-news.component.ts @@ -0,0 +1,139 @@ +import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { FormControl, ReactiveFormsModule } from '@angular/forms'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSelectModule } from '@angular/material/select'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTableModule } from '@angular/material/table'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { debounceTime, distinctUntilChanged } from 'rxjs'; + +import { PaginationService } from '../../shared/services/pagination.service'; +import { ResolverStateService } from '../../shared/services/resolver-state.service'; +import { NewsArticle, NewsPage } from '../../resolvers/person-news.resolver'; + +@Component({ + selector: 'app-person-news', + imports: [ + MatIconModule, + MatSelectModule, + MatFormFieldModule, + MatInputModule, + MatPaginatorModule, + MatProgressSpinnerModule, + MatTableModule, + ReactiveFormsModule, + RouterLink, + ], + templateUrl: './person-news.component.html', + styleUrl: './person-news.component.scss', +}) +export class PersonNewsComponent implements OnInit { + private readonly destroyRef = inject(DestroyRef); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + readonly paginationService = inject(PaginationService); + private readonly resolverStateService = inject(ResolverStateService); + + readonly searchControl = new FormControl('', { nonNullable: true }); + + displayedColumns = ['maintitle', 'author', 'date']; + articles: NewsArticle[] = []; + total = 0; + currentPageIndex = 0; + sortOrder: 'desc' | 'asc' = 'desc'; + + get loading(): boolean { + return this.resolverStateService.isResolving(); + } + + get isSearching(): boolean { + return this.searchControl.value.trim().length > 0; + } + + ngOnInit(): void { + this.route.data + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(({ newsPage }) => { + const page = newsPage as NewsPage; + this.articles = page.results ?? []; + this.total = page.total ?? 0; + }); + + this.route.queryParamMap + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((params) => { + const page = params.get('page') + ? Number.parseInt(params.get('page')!, 10) + : 1; + const pageSize = params.get('pageSize') + ? Number.parseInt(params.get('pageSize')!, 10) + : 10; + const sortOrder = params.get('sortOrder'); + const query = params.get('query') ?? ''; + + this.currentPageIndex = page - 1; + this.paginationService.selection = pageSize; + this.sortOrder = sortOrder === 'asc' ? 'asc' : 'desc'; + this.searchControl.setValue(query, { emitEvent: false }); + }); + + this.searchControl.valueChanges + .pipe( + debounceTime(300), + distinctUntilChanged(), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((value) => { + this.updateQueryParams({ + query: value.trim() || null, + page: 1, + }); + }); + } + + onPage(event: PageEvent): void { + this.paginationService.selection = event.pageSize; + this.updateQueryParams({ + page: event.pageIndex + 1, + pageSize: event.pageSize, + }); + } + + onSortChange(order: 'desc' | 'asc'): void { + this.updateQueryParams({ + sortOrder: order, + page: 1, + }); + } + + formatDate(dateStr?: string | null): string { + if (!dateStr) return '-'; + const date = new Date(dateStr); + if (isNaN(date.getTime())) return dateStr; + return new Intl.DateTimeFormat('de-DE').format(date); + } + + articleRange(): string { + if (this.total === 0) return 'Keine Nachrichten gefunden'; + const start = this.currentPageIndex * this.paginationService.selection + 1; + const end = Math.min( + start + this.paginationService.selection - 1, + this.total, + ); + return `Zeige ${start} bis ${end} von ${this.total} Nachrichten`; + } + + private updateQueryParams( + overrides: Record, + ): void { + void this.router.navigate([], { + relativeTo: this.route, + queryParams: overrides, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html index cfd25c2e..dd8801dc 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html @@ -6,27 +6,127 @@ Entwicklung der Forschungsthemen im Zeitverlauf (basierend auf Publikationen)

+ +
+
+
+ Farben nach Themenbereich + + info_outline + +
+ + +
+ +
+
+ {{ group.name }} + + + + + {{ item.name }} + + +
+ + +
+
+ + + Frühere Jahre konnten nicht geladen werden. +
+ +
-
+
Zeitraum @@ -34,8 +134,7 @@ type="button" class="reset-range-button" [disabled]="!canResetYearRange" - (click)="resetYearRange()" - > + (click)="resetYearRange()"> Zurücksetzen
@@ -49,8 +148,7 @@
+ [style.--range-end]="rangeEndPercent">
+ aria-label="Startjahr" /> + aria-label="Endjahr" />
@@ -81,169 +177,356 @@
-
- Forschungstimeline wird geladen ... -
- -
- Forschungstimeline konnte nicht geladen werden. -
- - - - -
-
- - -
-
- {{ item.year }} - -
-
- -
-
-

{{ getMainTopic(item) }}

- - - {{ item.publication_count }} - {{ item.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - - -
- - - {{ topic.name }} - {{ topic.count }} - - - - - - Keine weiteren Topics - - -
-
-
-
-
-
- - -
-
-
- - -
- {{ getPhaseYearLabel(phase) }} -

{{ phase.primaryTopicName }}

- - {{ phase.publication_count }} - {{ phase.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - -
-
- -
- - - {{ topic.name }} - {{ topic.count }} - - - - - - Keine weiteren Topics - - -
- - - -
-
-
- {{ year.year }} - - {{ year.publication_count }} - {{ year.publication_count === 1 ? 'Publikation' : 'Publikationen' }} - -
- -
- - - {{ topic.name }} - {{ topic.count }} - - - - - - Keine weiteren Topics - - -
-
-
-
-
-
- -
- - - Hauptforschungsschwerpunkte im jeweiligen Zeitraum - -
-
+ + - -
- Keine Timeline-Daten vorhanden. + +
+ + Forschungstimeline wird geladen ...
+ +
+ Forschungstimeline konnte nicht geladen werden. +
+ + + + +
+
+ + +
+
+ + +
+ +
+ + +
+
+ +
+
+

+ +

+ + + Laden fehlgeschlagen. + +
+ +
+

+ +

+ + + +
+ + + + + + + Keine weiteren Topics + +
+
+
+
+
+
+ + +
+ +
+ +
+
+
+ + +
+
+ + + +
+ +

+ +

+
+
+ +
+ + + + + + + Keine weiteren Topics + +
+ + + +
+
+
+ + + +
+ +
+ + + + + + + Keine weiteren Topics + +
+
+
+
+
+
+ +
+ + Hauptforschungsschwerpunkte im jeweiligen Zeitraum +
+
+
- \ No newline at end of file + + +
Keine Timeline-Daten vorhanden.
+
+ diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index 16ca7935..b9c0fe2d 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -1,4 +1,6 @@ .research-timeline-card { + --accent: #0057ff; + width: 100%; padding: 24px 28px; border: 1px solid #d7e4ff; @@ -6,11 +8,34 @@ background: #ffffff; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); box-sizing: border-box; + + button { + font-family: inherit; + border: 0; + background: transparent; + padding: 0; + cursor: pointer; + } + + button:hover:not(:disabled) { + color: var(--accent); + text-decoration: underline; + } + + button:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + border-radius: 3px; + } + + button:disabled { + cursor: default; + } } .timeline-header { display: grid; - grid-template-columns: minmax(260px, 1fr) auto minmax(260px, 1fr); + grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: flex-start; gap: 24px; margin-bottom: 28px; @@ -39,6 +64,160 @@ } } +.subfield-legend { + width: min(760px, 100%); + box-sizing: border-box; + margin-top: 16px; + padding: 13px 16px; + border: 1px solid #dbe5f6; + border-radius: 8px; + background: #ffffff; +} + +.subfield-legend-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; +} + +.subfield-legend-title, +.subfield-legend-visibility-toggle, +.subfield-legend-content, +.subfield-legend-group, +.subfield-legend-items, +.subfield-legend-item { + display: flex; + align-items: center; +} + +.subfield-legend-title { + gap: 5px; + color: #07163d; + font-size: 12px; + font-weight: 800; + line-height: 1.25; +} + +.subfield-legend-info { + width: 14px; + height: 14px; + color: #7d8aa8; + font-size: 14px; + line-height: 14px; +} + +.subfield-legend-visibility-toggle { + flex: 0 0 auto; + gap: 4px; + color: var(--accent); + font-size: 11px; + font-weight: 700; + line-height: 1.2; + + mat-icon { + width: 14px; + height: 14px; + font-size: 14px; + line-height: 14px; + } + + &:hover { + text-decoration: none; + } +} + +.subfield-legend-content { + flex-wrap: wrap; + gap: 8px; + margin-top: 17px; +} + +.subfield-legend-group { + gap: 9px; + max-width: 100%; + min-width: 0; + min-height: 28px; + padding: 5px 9px; + border: 1px solid #dbe5f6; + border-radius: 999px; + background: #fbfdff; +} + +.subfield-legend-field { + flex: 0 0 auto; + color: #07163d; + font-size: 11px; + font-weight: 800; + line-height: 1.2; + cursor: help; +} + +.subfield-legend-items { + flex-wrap: wrap; + gap: 6px 11px; + min-width: 0; +} + +.subfield-legend-item { + gap: 5px; + min-width: 0; + color: #53617e; + font-size: 11px; + font-weight: 600; + line-height: 1.25; + cursor: help; +} + +.subfield-legend-dot { + flex: 0 0 auto; + width: 9px; + height: 9px; + border: 1px solid rgba(255, 255, 255, 0.85); + border-radius: 50%; + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2); +} + +.subfield-legend-more-toggle { + flex: 0 0 auto; + color: var(--accent); + font-size: 11px; + font-weight: 700; + + &:hover { + text-decoration: none; + } +} + +.view-toggle { + justify-self: center; + display: flex; + gap: 4px; + padding: 4px; + border: 1px solid #dbe5f6; + border-radius: 10px; + background: #ffffff; + + button { + border-radius: 8px; + padding: 9px 18px; + color: #3f4b66; + font-size: 14px; + transition: all 0.2s ease; + + &:hover { + background: #f2f6ff; + text-decoration: none; + } + + &.active { + background: #eef4ff; + color: var(--accent); + box-shadow: inset 0 0 0 1px #3d7cff; + } + } +} + .year-filter { justify-self: end; width: min(285px, 100%); @@ -46,13 +225,24 @@ border: 1px solid #dbe5f6; border-radius: 10px; background: #fbfdff; + box-sizing: border-box; +} + +.year-filter-top, +.year-filter-values, +.year-filter-bounds, +.phase-meta-row { + display: flex; + align-items: center; +} + +.year-filter-top, +.phase-meta-row { + justify-content: space-between; + gap: 10px; } .year-filter-top { - display: flex; - align-items: center; - justify-content: space-between; - gap: 10px; margin-bottom: 4px; } @@ -63,22 +253,15 @@ } .reset-range-button { - border: none; - background: transparent; - color: #0057ff; + color: var(--accent); font-size: 11px; - cursor: pointer; - padding: 0; &:disabled { color: #9aa5bc; - cursor: default; } } .year-filter-values { - display: flex; - align-items: center; justify-content: center; gap: 7px; margin-bottom: 5px; @@ -87,13 +270,19 @@ font-weight: 600; } +.year-filter-bounds { + justify-content: space-between; + margin-top: 1px; + color: #7c88a3; + font-size: 10px; +} + .year-range-slider { --range-start: 0%; --range-end: 100%; position: relative; height: 22px; - margin: 0; } .range-track { @@ -104,36 +293,29 @@ height: 5px; transform: translateY(-50%); border-radius: 999px; - background: - linear-gradient( - to right, - #d8e2f4 0%, - #d8e2f4 var(--range-start), - #0057ff var(--range-start), - #0057ff var(--range-end), - #d8e2f4 var(--range-end), - #d8e2f4 100% - ); + background: linear-gradient( + to right, + #d8e2f4 0%, + #d8e2f4 var(--range-start), + var(--accent) var(--range-start), + var(--accent) var(--range-end), + #d8e2f4 var(--range-end), + #d8e2f4 100% + ); } .range-input { position: absolute; - top: 0; - left: 0; + inset: 0; width: 100%; - margin: 0; height: 22px; + margin: 0; appearance: none; background: transparent; pointer-events: none; } -.range-input::-webkit-slider-runnable-track { - height: 5px; - background: transparent; - border: none; -} - +.range-input::-webkit-slider-runnable-track, .range-input::-moz-range-track { height: 5px; background: transparent; @@ -147,8 +329,10 @@ margin-top: -5px; border: 2px solid #ffffff; border-radius: 50%; - background: #0057ff; - box-shadow: 0 0 0 1px #9ab7ff, 0 2px 6px rgba(0, 87, 255, 0.22); + background: var(--accent); + box-shadow: + 0 0 0 1px #9ab7ff, + 0 2px 6px rgba(0, 87, 255, 0.22); cursor: pointer; pointer-events: auto; } @@ -158,22 +342,14 @@ height: 15px; border: 2px solid #ffffff; border-radius: 50%; - background: #0057ff; - box-shadow: 0 0 0 1px #9ab7ff, 0 2px 6px rgba(0, 87, 255, 0.22); + background: var(--accent); + box-shadow: + 0 0 0 1px #9ab7ff, + 0 2px 6px rgba(0, 87, 255, 0.22); cursor: pointer; pointer-events: auto; } -.range-input:focus-visible::-webkit-slider-thumb { - outline: 2px solid #07163d; - outline-offset: 2px; -} - -.range-input:focus-visible::-moz-range-thumb { - outline: 2px solid #07163d; - outline-offset: 2px; -} - .range-input-start { z-index: 2; } @@ -182,45 +358,6 @@ z-index: 3; } -.year-filter-bounds { - display: flex; - justify-content: space-between; - margin-top: 1px; - color: #7c88a3; - font-size: 10px; -} - -.view-toggle { - justify-self: center; - display: flex; - gap: 4px; - padding: 4px; - border: 1px solid #dbe5f6; - border-radius: 10px; - background: #ffffff; - - button { - border: none; - border-radius: 8px; - padding: 9px 18px; - background: transparent; - color: #3f4b66; - font-size: 14px; - cursor: pointer; - transition: all 0.2s ease; - - &:hover { - background: #f2f6ff; - } - - &.active { - background: #eef4ff; - color: #0057ff; - box-shadow: inset 0 0 0 1px #3d7cff; - } - } -} - .timeline-wrapper { width: 100%; overflow-x: auto; @@ -240,18 +377,16 @@ right: 34px; height: 2px; background: #23395d; -} -.timeline-axis::after { - content: ""; - position: absolute; - top: -5px; - right: -10px; - width: 0; - height: 0; - border-top: 6px solid transparent; - border-bottom: 6px solid transparent; - border-left: 12px solid #23395d; + &::after { + content: ''; + position: absolute; + top: -5px; + right: -10px; + border-top: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 12px solid #23395d; + } } .timeline-points { @@ -268,7 +403,7 @@ align-items: center; min-width: 0; - .year { + .year-button { margin-bottom: 9px; color: #15213f; font-size: 14px; @@ -278,20 +413,39 @@ } .dot { - width: 13px; - height: 13px; + width: 18px; + height: 18px; border: 3px solid #ffffff; border-radius: 50%; - box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16); + background: var(--timeline-color); + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.24); } } .timeline-content { display: grid; - gap: 0; margin-top: 8px; } +.timeline-load-more-point { + --timeline-color: #b8c7e6; + + .year-button { + color: var(--accent); + font-size: 18px; + } +} + +.research-timeline-card .load-more-action-button { + padding: 7px 12px; + border: 1px solid #bdd4ff; + border-radius: 999px; + background: #f0f6ff; + color: var(--accent); + font-size: 12px; + font-weight: 700; +} + .timeline-item { min-width: 0; padding: 0 16px; @@ -315,6 +469,18 @@ font-size: 12px; } +.publication-count-button { + width: fit-content; + margin: 0 auto 14px; +} + +.main-topic-button { + color: inherit; + font: inherit; + font-weight: inherit; + line-height: inherit; +} + .topic-list { display: flex; flex-direction: column; @@ -322,39 +488,9 @@ gap: 8px; } -.topic-chip { - display: inline-flex; - align-items: center; - justify-content: center; - gap: 7px; - width: fit-content; +app-topic-chip.timeline-topic-chip { + width: 100%; max-width: 210px; - min-height: 34px; - padding: 6px 10px; - border-radius: 8px; - font-size: 12px; - font-weight: 500; - line-height: 1.25; -} - -.topic-name { - min-width: 0; - overflow-wrap: anywhere; -} - -.topic-count { - display: inline-flex; - flex: 0 0 auto; - align-items: center; - justify-content: center; - min-width: 18px; - height: 18px; - padding: 0 5px; - border-radius: 999px; - background: rgba(255, 255, 255, 0.78); - color: inherit; - font-size: 11px; - font-weight: 700; } .no-topics { @@ -362,6 +498,11 @@ font-size: 12px; } +.compact-load-more-row { + display: flex; + margin: 6px 0 28px; +} + .compact-phase-list { display: flex; flex-wrap: wrap; @@ -376,7 +517,7 @@ box-sizing: border-box; padding: 15px 16px; border: 1px solid #dbe5f6; - border-left-width: 4px; + border-left: 4px solid var(--timeline-color); border-radius: 14px; background: #fbfdff; } @@ -388,20 +529,21 @@ } .phase-marker { - flex: 0 0 auto; - width: 11px; - height: 11px; - margin-top: 5px; + width: 16px; + height: 16px; + margin-top: 3px; border: 3px solid #ffffff; border-radius: 50%; - box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14); + background: var(--timeline-color); + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.22); } .phase-title-block { + flex: 1; min-width: 0; h3 { - margin: 3px 0 4px; + margin: 10px 0 0; color: #07163d; font-size: 15px; font-weight: 700; @@ -415,14 +557,22 @@ padding: 2px 8px; border-radius: 999px; background: #eef4ff; - color: #0057ff; + color: var(--accent); font-size: 12px; font-weight: 700; } -.phase-publications { +.phase-years-button:hover { + background: #dfeaff; +} + +.phase-publications-button { + display: inline-flex; + width: fit-content; color: #68748f; font-size: 12px; + font-weight: 600; + text-align: left; } .phase-topics { @@ -430,44 +580,31 @@ flex-wrap: wrap; gap: 7px; margin-top: 14px; + + app-topic-chip.phase-topic-chip { + flex: 0 0 calc((100% - 7px) / 2); + width: calc((100% - 7px) / 2); + max-width: none; + } } .phase-toggle { margin-top: 13px; - border: none; - background: transparent; - color: #0057ff; + color: var(--accent); font-size: 12px; font-weight: 700; - cursor: pointer; - padding: 0; } .phase-year-details { display: flex; flex-direction: column; + max-height: 320px; margin-top: 13px; padding-top: 4px; padding-right: 6px; border-top: 1px solid #dbe5f6; - max-height: 320px; overflow-y: auto; overflow-x: hidden; - scrollbar-gutter: stable; - overscroll-behavior: contain; -} - -.phase-year-details::-webkit-scrollbar { - width: 8px; -} - -.phase-year-details::-webkit-scrollbar-thumb { - border-radius: 999px; - background: #c8d4e8; -} - -.phase-year-details::-webkit-scrollbar-track { - background: transparent; } .phase-year-row { @@ -476,10 +613,10 @@ gap: 10px; align-items: start; padding: 10px 0; -} -.phase-year-row + .phase-year-row { - border-top: 1px solid #e4ebf7; + & + & { + border-top: 1px solid #e4ebf7; + } } .phase-year-meta { @@ -487,15 +624,24 @@ flex-direction: column; gap: 2px; - strong { + .phase-year-button { + width: fit-content; color: #07163d; font-size: 13px; + font-weight: 700; + text-align: left; } - span { + span, + .phase-year-publication-button { color: #68748f; font-size: 11px; } + + .phase-year-publication-button { + width: fit-content; + text-align: left; + } } .phase-year-topics { @@ -504,113 +650,6 @@ gap: 6px; } -.mini-topic-chip { - display: inline-flex; - align-items: center; - gap: 5px; - max-width: 100%; - padding: 4px 7px; - border-radius: 7px; - background: #f2f6ff; - color: #40506f; - font-size: 11px; - line-height: 1.25; - - span { - overflow-wrap: anywhere; - } - - strong { - color: #0057ff; - font-size: 10px; - } -} - -.purple { - .dot, - .phase-marker { - background: #7255d9; - } -} - -.blue { - .dot, - .phase-marker { - background: #2678e8; - } -} - -.green { - .dot, - .phase-marker { - background: #39a96b; - } -} - -.orange { - .dot, - .phase-marker { - background: #f59e0b; - } -} - -.pink { - .dot, - .phase-marker { - background: #e0527c; - } -} - -.phase-card.purple { - border-left-color: #7255d9; -} - -.phase-card.blue { - border-left-color: #2678e8; -} - -.phase-card.green { - border-left-color: #39a96b; -} - -.phase-card.orange { - border-left-color: #f59e0b; -} - -.phase-card.pink { - border-left-color: #e0527c; -} - -.topic-chip.purple { - border: 1px solid #d8cafe; - background: #f6f0ff; - color: #7255d9; -} - -.topic-chip.blue { - border: 1px solid #bdd4ff; - background: #f0f6ff; - color: #0b63ce; -} - -.topic-chip.green { - border: 1px solid #bdebcf; - background: #effaf3; - color: #24834f; -} - -.topic-chip.orange { - border: 1px solid #ffd796; - background: #fff7e8; - color: #c67500; -} - -.topic-chip.pink { - border: 1px solid #ffc7d7; - background: #fff1f5; - color: #d12f61; -} - .timeline-note { display: flex; justify-content: center; @@ -623,13 +662,30 @@ } .note-dot { - width: 10px; - height: 10px; + width: 12px; + height: 12px; border: 3px solid #dce5f5; border-radius: 50%; background: #52627f; } +.load-more-content { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 7px; +} + +.timeline-title .reset-range-button { + display: inline-flex; + margin-top: 8px; +} + +.timeline-title > .no-topics { + display: block; + margin-top: 6px; +} + .timeline-state { display: flex; min-height: 140px; @@ -641,6 +697,11 @@ text-align: center; } +.timeline-state-loading { + flex-direction: column; + gap: 10px; +} + .timeline-state-error { color: #b42318; } @@ -686,4 +747,4 @@ .phase-year-row { grid-template-columns: 1fr; } -} \ No newline at end of file +} diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts index 56ec4486..fa29012f 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -1,16 +1,36 @@ import { CommonModule } from '@angular/common'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { + AfterViewChecked, Component, + ElementRef, EventEmitter, Input, OnChanges, Output, SimpleChanges, + ViewChild, } from '@angular/core'; +import { TopicChipComponent } from '../../../../shared/ui/topic-chip/topic-chip.component'; +import { topicHierarchyColor } from '../../../../shared/utils/topic-colors'; +import { buildTopicHierarchyTooltip } from '../../../../shared/utils/topic-tooltip'; export interface TopicTimelineTopic { + id?: string; name: string; count: number; + description?: string; + subfield_id?: string; + subfield_name?: string; + subfield_description?: string; + field_id?: string; + field_name?: string; + field_description?: string; + domain_id?: string; + domain_name?: string; + domain_description?: string; } export interface TopicTimelineElement { @@ -20,18 +40,24 @@ export interface TopicTimelineElement { primary_topics?: TopicTimelineTopic[]; } -export type TimelineViewMode = 'years' | 'compact'; +export type TimelineViewMode = 'years' | 'compact' | 'wordcloud'; export interface TimelineYearRange { startYear: number; endYear: number; } +export interface TimelineTopicSelection { + topic: TopicTimelineTopic; + years: number[]; +} + interface ResearchTimelinePhase { id: string; startYear: number; endYear: number; publication_count: number; + primaryTopic: TopicTimelineTopic; primaryTopicName: string; years: TopicTimelineElement[]; topics: TopicTimelineTopic[]; @@ -41,27 +67,70 @@ interface WorkingResearchTimelinePhase { startYear: number; endYear: number; publication_count: number; + primaryTopic: TopicTimelineTopic; primaryTopicName: string; years: TopicTimelineElement[]; } +interface TimelineScrollAnchor { + year: number; + offsetLeft: number; + scrollLeft: number; +} + +interface TopicSubfieldLegendItem { + id: string; + name: string; + description: string; + color: string; + tooltip: string; +} + +interface TopicFieldLegendGroup { + id: string; + name: string; + description: string; + domainName: string; + domainDescription: string; + tooltip: string; + items: TopicSubfieldLegendItem[]; +} + @Component({ selector: 'app-research-timeline', standalone: true, - imports: [CommonModule], + imports: [ + CommonModule, + MatIconModule, + MatProgressSpinnerModule, + MatTooltipModule, + TopicChipComponent, + ], templateUrl: './research-timeline.component.html', styleUrl: './research-timeline.component.scss', }) -export class ResearchTimelineComponent implements OnChanges { +export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { + @ViewChild('timelineWrapper') + private timelineWrapper?: ElementRef; @Input() elements: TopicTimelineElement[] = []; @Input() loading = false; @Input() loadFailed = false; + @Input() canLoadEarlierYears = false; + @Input() loadingEarlierYears = false; + @Input() earlierYearsLoadFailed = false; @Input() viewMode: TimelineViewMode = 'years'; @Input() startYear: number | undefined; @Input() endYear: number | undefined; + @Input() subfieldLegendVisible = true; + @Input() subfieldLegendExpanded = false; @Output() viewModeChange = new EventEmitter(); @Output() yearRangeChange = new EventEmitter(); + @Output() topicSelect = new EventEmitter(); + @Output() yearSelect = new EventEmitter(); + @Output() loadEarlierYears = new EventEmitter(); + @Output() subfieldLegendVisibleChange = new EventEmitter(); + @Output() subfieldLegendExpandedChange = new EventEmitter(); timelineViewMode: TimelineViewMode = 'years'; @@ -70,13 +139,20 @@ export class ResearchTimelineComponent implements OnChanges { selectedStartYear = 0; selectedEndYear = 0; - private readonly colors = ['purple', 'blue', 'green', 'orange', 'pink']; private readonly columnWidth = 240; private readonly displayedTopicLimit = 3; private readonly displayedPhaseTopicLimit = 4; + private readonly collapsedSubfieldLegendGroupLimit = 3; + private readonly scrollRestoreThreshold = 24; private readonly expandedPhaseIds = new Set(); + private pendingTimelineScrollAnchor: TimelineScrollAnchor | undefined; + ngOnChanges(changes: SimpleChanges): void { + if (changes['elements']) { + this.captureTimelineScrollAnchor(); + } + if (changes['viewMode']) { this.timelineViewMode = this.isTimelineViewMode(this.viewMode) ? this.viewMode @@ -92,9 +168,29 @@ export class ResearchTimelineComponent implements OnChanges { } } + ngAfterViewChecked(): void { + if (!this.pendingTimelineScrollAnchor) { + return; + } + + const scrollAnchor = this.pendingTimelineScrollAnchor; + this.pendingTimelineScrollAnchor = undefined; + + if (typeof requestAnimationFrame === 'function') { + requestAnimationFrame(() => + this.restoreTimelineScrollAnchor(scrollAnchor), + ); + return; + } + + setTimeout(() => this.restoreTimelineScrollAnchor(scrollAnchor)); + } + get timelineItems(): TopicTimelineElement[] { return this.sortedElements.filter((item) => { - return item.year >= this.selectedStartYear && item.year <= this.selectedEndYear; + return ( + item.year >= this.selectedStartYear && item.year <= this.selectedEndYear + ); }); } @@ -102,12 +198,57 @@ export class ResearchTimelineComponent implements OnChanges { return this.buildCompactPhases(this.timelineItems); } + get subfieldLegendGroups(): TopicFieldLegendGroup[] { + const groups = this.allSubfieldLegendGroups; + + if (this.subfieldLegendExpanded) { + return groups; + } + + return groups.slice(0, this.collapsedSubfieldLegendGroupLimit); + } + + get hiddenSubfieldLegendItemCount(): number { + if (this.subfieldLegendExpanded) { + return 0; + } + + return this.allSubfieldLegendGroups + .slice(this.collapsedSubfieldLegendGroupLimit) + .reduce((count, group) => count + group.items.length, 0); + } + + get showSubfieldLegendToggle(): boolean { + return ( + this.subfieldLegendExpanded || this.hiddenSubfieldLegendItemCount > 0 + ); + } + get hasYearRange(): boolean { return this.minYear > 0 && this.maxYear > 0 && this.minYear < this.maxYear; } get canResetYearRange(): boolean { - return this.selectedStartYear !== this.minYear || this.selectedEndYear !== this.maxYear; + return ( + this.selectedStartYear !== this.minYear || + this.selectedEndYear !== this.maxYear + ); + } + + get showEarlierYearsControl(): boolean { + return this.canLoadEarlierYears || this.loadingEarlierYears; + } + + get earlierYearsLabel(): string { + if (this.loadingEarlierYears) { + return 'Frühere Jahre werden geladen ...'; + } + + if (this.earlierYearsLoadFailed) { + return 'Frühere Jahre erneut laden'; + } + + return 'Frühere Jahre anzeigen'; } get rangeStartPercent(): string { @@ -119,15 +260,31 @@ export class ResearchTimelineComponent implements OnChanges { } get gridTemplateColumns(): string { - const count = Math.max(this.timelineItems.length, 1); + const count = Math.max( + this.timelineItems.length + this.earlierYearsColumnCount, + 1, + ); + return `repeat(${count}, minmax(${this.columnWidth}px, 1fr))`; } get timelineMinWidth(): number { - const count = Math.max(this.timelineItems.length, 1); + const count = Math.max( + this.timelineItems.length + this.earlierYearsColumnCount, + 1, + ); + return Math.max(count * this.columnWidth, 1000); } + requestEarlierYears(): void { + if (!this.canLoadEarlierYears || this.loadingEarlierYears) { + return; + } + + this.loadEarlierYears.emit(); + } + setTimelineViewMode(mode: TimelineViewMode): void { if (this.timelineViewMode === mode) { return; @@ -167,12 +324,37 @@ export class ResearchTimelineComponent implements OnChanges { this.emitYearRangeChange(); } + selectTopic(topic: TopicTimelineTopic | undefined, years: number[]): void { + if (!topic?.id || years.length === 0) { + return; + } + + this.topicSelect.emit({ + topic, + years: this.normalizeSelectedYears(years), + }); + } + + selectYears(years: number[]): void { + const selectedYears = this.normalizeSelectedYears(years); + + if (selectedYears.length === 0) { + return; + } + + this.yearSelect.emit(selectedYears); + } + getPrimaryTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { return (item.primary_topics ?? [])[0]; } getMainTopic(item: TopicTimelineElement): string { - return this.getPrimaryTopic(item)?.name ?? this.getFirstTopic(item)?.name ?? 'Keine Topics'; + return this.getMainTopicItem(item)?.name ?? 'Keine Topics'; + } + + getMainTopicItem(item: TopicTimelineElement): TopicTimelineTopic | undefined { + return this.getPrimaryTopic(item) ?? this.getFirstTopic(item); } getDisplayedTopics(item: TopicTimelineElement): TopicTimelineTopic[] { @@ -198,6 +380,86 @@ export class ResearchTimelineComponent implements OnChanges { return `${phase.startYear}–${phase.endYear}`; } + getPhaseYears(phase: ResearchTimelinePhase): number[] { + return phase.years.map((year) => year.year); + } + + getYearPublicationTooltip(item: TopicTimelineElement): string { + return this.getPublicationTooltip( + item.publication_count, + `im Jahr ${item.year}`, + ); + } + + getPhasePublicationTooltip(phase: ResearchTimelinePhase): string { + return this.getPublicationTooltip( + phase.publication_count, + this.getPhasePublicationTooltipPeriod(phase), + ); + } + + getTopicDescription(topic: TopicTimelineTopic | undefined): string { + return (topic?.description ?? '').trim(); + } + + getTopicTooltip(topic: TopicTimelineTopic | undefined): string { + return buildTopicHierarchyTooltip({ + topicName: topic?.name, + description: topic?.description, + subfieldName: topic?.subfield_name, + fieldName: topic?.field_name, + domainName: topic?.domain_name, + }); + } + + hasTopicTooltip(topic: TopicTimelineTopic | undefined): boolean { + return this.getTopicTooltip(topic).length > 0; + } + + buildLegendTooltip( + entries: Array<{ label: string; value: string; description: string }>, + ): string { + const lines: string[] = []; + + for (const entry of entries) { + if (!entry.value && !entry.description) { + continue; + } + + if (lines.length > 0) { + lines.push(''); + } + + if (entry.value) { + lines.push(`${entry.label}: ${entry.value}`); + } + + if (entry.description) { + lines.push(''); + lines.push(`Beschreibung: ${entry.description}`); + } + } + + return lines.join('\n'); + } + + getYearTopicCountTooltip( + topic: TopicTimelineTopic, + item: TopicTimelineElement, + ): string { + return this.getTopicCountTooltip(topic, `im Jahr ${item.year}`); + } + + getPhaseTopicCountTooltip( + topic: TopicTimelineTopic, + phase: ResearchTimelinePhase, + ): string { + return this.getTopicCountTooltip( + topic, + this.getPhasePublicationTooltipPeriod(phase), + ); + } + togglePhase(phase: ResearchTimelinePhase): void { if (this.expandedPhaseIds.has(phase.id)) { this.expandedPhaseIds.delete(phase.id); @@ -211,8 +473,26 @@ export class ResearchTimelineComponent implements OnChanges { return this.expandedPhaseIds.has(phase.id); } - getColorClass(index: number): string { - return this.colors[index % this.colors.length]; + getTopicColor(topic: TopicTimelineTopic | undefined): string { + return topicHierarchyColor(topic); + } + + toggleSubfieldLegend(): void { + this.subfieldLegendExpanded = !this.subfieldLegendExpanded; + this.subfieldLegendExpandedChange.emit(this.subfieldLegendExpanded); + } + + toggleSubfieldLegendVisibility(): void { + this.subfieldLegendVisible = !this.subfieldLegendVisible; + this.subfieldLegendVisibleChange.emit(this.subfieldLegendVisible); + } + + trackByLegendGroup(_: number, group: TopicFieldLegendGroup): string { + return group.id; + } + + trackByLegendItem(_: number, item: TopicSubfieldLegendItem): string { + return item.id; } trackByYear(_: number, item: TopicTimelineElement): number { @@ -227,8 +507,249 @@ export class ResearchTimelineComponent implements OnChanges { return phase.id; } + private captureTimelineScrollAnchor(): void { + if (this.timelineViewMode !== 'years') { + return; + } + + const wrapper = this.timelineWrapper?.nativeElement; + + if (!wrapper || wrapper.scrollLeft <= this.scrollRestoreThreshold) { + return; + } + + const scrollAnchor = this.findVisibleTimelineAnchor(wrapper); + + if (!scrollAnchor) { + return; + } + + this.pendingTimelineScrollAnchor = scrollAnchor; + } + + private restoreTimelineScrollAnchor( + scrollAnchor: TimelineScrollAnchor, + ): void { + if (this.timelineViewMode !== 'years') { + return; + } + + const wrapper = this.timelineWrapper?.nativeElement; + + if (!wrapper) { + return; + } + + const anchorElement = wrapper.querySelector( + `.timeline-content .timeline-item[data-timeline-year="${scrollAnchor.year}"]`, + ); + + if (!anchorElement) { + wrapper.scrollLeft = scrollAnchor.scrollLeft; + return; + } + + const wrapperRect = wrapper.getBoundingClientRect(); + const anchorRect = anchorElement.getBoundingClientRect(); + const nextOffsetLeft = anchorRect.left - wrapperRect.left; + + wrapper.scrollLeft += nextOffsetLeft - scrollAnchor.offsetLeft; + } + + private findVisibleTimelineAnchor( + wrapper: HTMLDivElement, + ): TimelineScrollAnchor | undefined { + const wrapperRect = wrapper.getBoundingClientRect(); + const yearElements = Array.from( + wrapper.querySelectorAll( + '.timeline-content .timeline-item[data-timeline-year]', + ), + ); + + let bestAnchor: TimelineScrollAnchor | undefined; + let bestDistance = Number.POSITIVE_INFINITY; + + for (const element of yearElements) { + const year = Number(element.dataset['timelineYear']); + + if (!Number.isFinite(year)) { + continue; + } + + const elementRect = element.getBoundingClientRect(); + const isVisible = + elementRect.right > wrapperRect.left && + elementRect.left < wrapperRect.right; + + if (!isVisible) { + continue; + } + + const offsetLeft = elementRect.left - wrapperRect.left; + const distanceFromLeftEdge = Math.abs(offsetLeft); + + if (distanceFromLeftEdge >= bestDistance) { + continue; + } + + bestDistance = distanceFromLeftEdge; + bestAnchor = { + year, + offsetLeft, + scrollLeft: wrapper.scrollLeft, + }; + } + + return bestAnchor; + } + + private getPublicationTooltip(count: number, period: string): string { + const publicationLabel = + count === 1 ? 'Publikation wurde' : 'Publikationen wurden'; + + return `Insgesamt ${count} ${publicationLabel} ${period} veröffentlicht.`; + } + + private getTopicCountTooltip( + topic: TopicTimelineTopic, + period: string, + ): string { + const publicationLabel = + topic.count === 1 ? 'Publikation' : 'Publikationen'; + const verb = topic.count === 1 ? 'hat' : 'haben'; + + return `${topic.count} ${publicationLabel} ${period} ${verb} das Topic ${topic.name}.`; + } + + private getPhasePublicationTooltipPeriod( + phase: ResearchTimelinePhase, + ): string { + if (phase.startYear === phase.endYear) { + return `im Jahr ${phase.startYear}`; + } + + return `im Zeitraum ${this.getPhaseYearLabel(phase)}`; + } + + private get earlierYearsColumnCount(): number { + return this.showEarlierYearsControl ? 1 : 0; + } + private get sortedElements(): TopicTimelineElement[] { - return [...(this.elements ?? [])].sort((left, right) => left.year - right.year); + return [...(this.elements ?? [])].sort( + (left, right) => left.year - right.year, + ); + } + + private get allSubfieldLegendGroups(): TopicFieldLegendGroup[] { + if ( + this.loading || + this.loadFailed || + this.timelineViewMode === 'wordcloud' + ) { + return []; + } + + const groups = new Map(); + + for (const topic of this.visibleLegendTopics) { + const subfieldName = topic.subfield_name?.trim(); + + if (!subfieldName) { + continue; + } + + const fieldName = topic.field_name?.trim() || 'Ohne Field'; + const fieldKey = topic.field_id ?? this.normalizeTopicName(fieldName); + const subfieldKey = + topic.subfield_id ?? this.normalizeTopicName(subfieldName); + + if (!groups.has(fieldKey)) { + groups.set(fieldKey, { + id: fieldKey, + name: fieldName, + description: topic.field_description?.trim() ?? '', + domainName: topic.domain_name?.trim() ?? '', + domainDescription: topic.domain_description?.trim() ?? '', + tooltip: this.buildLegendTooltip([ + { + label: 'Fachgebiet', + value: fieldName, + description: topic.field_description?.trim() ?? '', + }, + { + label: 'Wissenschaftsbereich', + value: topic.domain_name?.trim() ?? '', + description: topic.domain_description?.trim() ?? '', + }, + ]), + items: [], + }); + } + + const group = groups.get(fieldKey); + + if (!group || group.items.some((item) => item.id === subfieldKey)) { + continue; + } + + group.items.push({ + id: subfieldKey, + name: subfieldName, + description: topic.subfield_description?.trim() ?? '', + color: this.getTopicColor(topic), + tooltip: this.buildLegendTooltip([ + { + label: 'Themenbereich', + value: subfieldName, + description: topic.subfield_description?.trim() ?? '', + }, + { + label: 'Fachgebiet', + value: fieldName, + description: topic.field_description?.trim() ?? '', + }, + { + label: 'Wissenschaftsbereich', + value: topic.domain_name?.trim() ?? '', + description: topic.domain_description?.trim() ?? '', + }, + ]), + }); + } + + return [...groups.values()] + .map((group) => ({ + ...group, + items: group.items.sort((left, right) => + left.name.localeCompare(right.name), + ), + })) + .sort((left, right) => left.name.localeCompare(right.name)); + } + + private get visibleLegendTopics(): TopicTimelineTopic[] { + if (this.timelineViewMode === 'compact') { + return this.compactPhases.flatMap((phase) => [ + phase.primaryTopic, + ...phase.topics, + ...(this.isPhaseExpanded(phase) + ? phase.years.flatMap((year) => + this.getDisplayedTopicsForPrimaryTopic( + year, + phase.primaryTopicName, + ), + ) + : []), + ]); + } + + return this.timelineItems + .flatMap((item) => [ + this.getMainTopicItem(item), + ...this.getDisplayedTopics(item), + ]) + .filter((topic): topic is TopicTimelineTopic => Boolean(topic)); } private initializeYearBounds(): void { @@ -267,7 +788,9 @@ export class ResearchTimelineComponent implements OnChanges { this.selectedEndYear = Math.max(clampedStartYear, clampedEndYear); } - private buildCompactPhases(items: TopicTimelineElement[]): ResearchTimelinePhase[] { + private buildCompactPhases( + items: TopicTimelineElement[], + ): ResearchTimelinePhase[] { const phases: ResearchTimelinePhase[] = []; let currentPhase: WorkingResearchTimelinePhase | undefined; @@ -276,7 +799,10 @@ export class ResearchTimelineComponent implements OnChanges { if (candidates.length === 0) { this.pushWorkingPhase(phases, currentPhase); - currentPhase = this.createWorkingPhase(item, this.getMainTopic(item)); + currentPhase = this.createWorkingPhase( + item, + this.getMainTopicItem(item) ?? { name: 'Keine Topics', count: 0 }, + ); continue; } @@ -299,7 +825,7 @@ export class ResearchTimelineComponent implements OnChanges { } this.pushWorkingPhase(phases, currentPhase); - currentPhase = this.createWorkingPhase(item, candidates[0].name); + currentPhase = this.createWorkingPhase(item, candidates[0]); } this.pushWorkingPhase(phases, currentPhase); @@ -309,13 +835,14 @@ export class ResearchTimelineComponent implements OnChanges { private createWorkingPhase( item: TopicTimelineElement, - primaryTopicName: string, + primaryTopic: TopicTimelineTopic, ): WorkingResearchTimelinePhase { return { startYear: item.year, endYear: item.year, publication_count: item.publication_count, - primaryTopicName, + primaryTopic, + primaryTopicName: primaryTopic.name, years: [item], }; } @@ -328,21 +855,128 @@ export class ResearchTimelineComponent implements OnChanges { return; } + const primaryTopic = this.aggregatePhasePrimaryTopic( + workingPhase.years, + workingPhase.primaryTopic, + ); + phases.push({ ...workingPhase, + primaryTopic, + primaryTopicName: primaryTopic.name, id: `${workingPhase.startYear}-${workingPhase.endYear}-${this.normalizeTopicName( - workingPhase.primaryTopicName, + primaryTopic.name, )}`, - topics: this.aggregatePhaseTopics(workingPhase.years, workingPhase.primaryTopicName), + topics: this.aggregatePhaseTopics(workingPhase.years, primaryTopic.name), }); } + private aggregatePhasePrimaryTopic( + years: TopicTimelineElement[], + primaryTopic: TopicTimelineTopic, + ): TopicTimelineTopic { + const primaryTopicName = primaryTopic.name; + let count = 0; + let id = primaryTopic.id; + let description = primaryTopic.description; + let subfieldId = primaryTopic.subfield_id; + let subfieldName = primaryTopic.subfield_name; + let subfieldDescription = primaryTopic.subfield_description; + let fieldId = primaryTopic.field_id; + let fieldName = primaryTopic.field_name; + let fieldDescription = primaryTopic.field_description; + let domainId = primaryTopic.domain_id; + let domainName = primaryTopic.domain_name; + let domainDescription = primaryTopic.domain_description; + + for (const year of years) { + for (const topic of year.primary_topics ?? []) { + if (!this.isSameTopic(topic.name, primaryTopicName)) { + continue; + } + + count += topic.count; + + if (!id && topic.id) { + id = topic.id; + } + + if (!description && topic.description) { + description = topic.description; + } + + if (!subfieldId && topic.subfield_id) { + subfieldId = topic.subfield_id; + } + + if (!subfieldName && topic.subfield_name) { + subfieldName = topic.subfield_name; + } + + if (!subfieldDescription && topic.subfield_description) { + subfieldDescription = topic.subfield_description; + } + + if (!fieldId && topic.field_id) { + fieldId = topic.field_id; + } + + if (!fieldName && topic.field_name) { + fieldName = topic.field_name; + } + + if (!fieldDescription && topic.field_description) { + fieldDescription = topic.field_description; + } + + if (!domainId && topic.domain_id) { + domainId = topic.domain_id; + } + + if (!domainName && topic.domain_name) { + domainName = topic.domain_name; + } + + if (!domainDescription && topic.domain_description) { + domainDescription = topic.domain_description; + } + } + } + + return { + id, + name: primaryTopicName, + count: count > 0 ? count : primaryTopic.count, + description, + subfield_id: subfieldId, + subfield_name: subfieldName, + subfield_description: subfieldDescription, + field_id: fieldId, + field_name: fieldName, + field_description: fieldDescription, + domain_id: domainId, + domain_name: domainName, + domain_description: domainDescription, + }; + } + private aggregatePhaseTopics( years: TopicTimelineElement[], primaryTopicName: string, ): TopicTimelineTopic[] { const counts = new Map(); const originalNames = new Map(); + const ids = new Map(); + const descriptions = new Map(); + const subfieldIds = new Map(); + const subfieldNames = new Map(); + const subfieldDescriptions = new Map(); + const fieldIds = new Map(); + const fieldNames = new Map(); + const fieldDescriptions = new Map(); + const domainIds = new Map(); + const domainNames = new Map(); + const domainDescriptions = new Map(); for (const year of years) { for (const topic of year.topics ?? []) { @@ -353,14 +987,73 @@ export class ResearchTimelineComponent implements OnChanges { const normalizedName = this.normalizeTopicName(topic.name); originalNames.set(normalizedName, topic.name); - counts.set(normalizedName, (counts.get(normalizedName) ?? 0) + topic.count); + + if (topic.id) { + ids.set(normalizedName, topic.id); + } + + if (topic.description) { + descriptions.set(normalizedName, topic.description); + } + + if (topic.subfield_id) { + subfieldIds.set(normalizedName, topic.subfield_id); + } + + if (topic.subfield_name) { + subfieldNames.set(normalizedName, topic.subfield_name); + } + + if (topic.subfield_description) { + subfieldDescriptions.set(normalizedName, topic.subfield_description); + } + + if (topic.field_id) { + fieldIds.set(normalizedName, topic.field_id); + } + + if (topic.field_name) { + fieldNames.set(normalizedName, topic.field_name); + } + + if (topic.field_description) { + fieldDescriptions.set(normalizedName, topic.field_description); + } + + if (topic.domain_id) { + domainIds.set(normalizedName, topic.domain_id); + } + + if (topic.domain_name) { + domainNames.set(normalizedName, topic.domain_name); + } + + if (topic.domain_description) { + domainDescriptions.set(normalizedName, topic.domain_description); + } + + counts.set( + normalizedName, + (counts.get(normalizedName) ?? 0) + topic.count, + ); } } return Array.from(counts.entries()) .map(([normalizedName, count]) => ({ + id: ids.get(normalizedName), name: originalNames.get(normalizedName) ?? normalizedName, count, + description: descriptions.get(normalizedName), + subfield_id: subfieldIds.get(normalizedName), + subfield_name: subfieldNames.get(normalizedName), + subfield_description: subfieldDescriptions.get(normalizedName), + field_id: fieldIds.get(normalizedName), + field_name: fieldNames.get(normalizedName), + field_description: fieldDescriptions.get(normalizedName), + domain_id: domainIds.get(normalizedName), + domain_name: domainNames.get(normalizedName), + domain_description: domainDescriptions.get(normalizedName), })) .sort((left, right) => { if (right.count !== left.count) { @@ -372,7 +1065,15 @@ export class ResearchTimelineComponent implements OnChanges { .slice(0, this.displayedPhaseTopicLimit); } - private getDominantPrimaryTopicCandidates(item: TopicTimelineElement): TopicTimelineTopic[] { + private normalizeSelectedYears(years: number[]): number[] { + return Array.from(new Set(years)) + .filter((year) => Number.isFinite(year)) + .sort((left, right) => left - right); + } + + private getDominantPrimaryTopicCandidates( + item: TopicTimelineElement, + ): TopicTimelineTopic[] { const primaryTopics = item.primary_topics ?? []; if (primaryTopics.length === 0) { @@ -384,16 +1085,24 @@ export class ResearchTimelineComponent implements OnChanges { return primaryTopics.filter((topic) => topic.count === maxCount); } - private getFirstTopic(item: TopicTimelineElement): TopicTimelineTopic | undefined { + private getFirstTopic( + item: TopicTimelineElement, + ): TopicTimelineTopic | undefined { return (item.topics ?? [])[0]; } - private isSameTopic(topicName: string, primaryTopicName: string | undefined): boolean { + private isSameTopic( + topicName: string, + primaryTopicName: string | undefined, + ): boolean { if (!primaryTopicName) { return false; } - return this.normalizeTopicName(topicName) === this.normalizeTopicName(primaryTopicName); + return ( + this.normalizeTopicName(topicName) === + this.normalizeTopicName(primaryTopicName) + ); } private normalizeTopicName(topicName: string): string { @@ -430,7 +1139,7 @@ export class ResearchTimelineComponent implements OnChanges { } private isTimelineViewMode(value: string): value is TimelineViewMode { - return value === 'years' || value === 'compact'; + return value === 'years' || value === 'compact' || value === 'wordcloud'; } private isValidYear(value: number | undefined): value is number { @@ -443,4 +1152,4 @@ export class ResearchTimelineComponent implements OnChanges { endYear: this.selectedEndYear, }); } -} \ No newline at end of file +} diff --git a/webapp/src/app/modules/person-overview/person-overview.component.html b/webapp/src/app/modules/person-overview/person-overview.component.html index 363ee7f6..ae891993 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -3,10 +3,33 @@ [elements]="topicTimelineElements" [loading]="loadingTimeline" [loadFailed]="timelineLoadFailed" + [canLoadEarlierYears]="timelineCanLoadEarlierYears" + [loadingEarlierYears]="timelineLoadingEarlierYears" + [earlierYearsLoadFailed]="timelineEarlierYearsLoadFailed" [viewMode]="timelineViewMode" [startYear]="timelineStartYear" [endYear]="timelineEndYear" + [subfieldLegendVisible]="timelineLegendVisible" + [subfieldLegendExpanded]="timelineLegendExpanded" (viewModeChange)="onTimelineViewModeChange($event)" (yearRangeChange)="onTimelineYearRangeChange($event)" - > - \ No newline at end of file + (subfieldLegendVisibleChange)="onTimelineLegendVisibleChange($event)" + (subfieldLegendExpandedChange)="onTimelineLegendExpandedChange($event)" + (topicSelect)="onTimelineTopicSelect($event)" + (yearSelect)="onTimelineYearSelect($event)" + (loadEarlierYears)="onTimelineLoadEarlierYears()"> +
+ @if (loadingWordCloud) { +
Forschungsthemen werden geladen ...
+ } @else if (wordCloudOptions) { +
+ } @else if (wordCloudEmpty) { +

Keine Forschungsthemen gefunden.

+ } +
+ + diff --git a/webapp/src/app/modules/person-overview/person-overview.component.scss b/webapp/src/app/modules/person-overview/person-overview.component.scss index 52461a52..7e0732ce 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.scss +++ b/webapp/src/app/modules/person-overview/person-overview.component.scss @@ -1,4 +1,28 @@ .person-overview { width: 100%; display: block; -} \ No newline at end of file + padding: 1.5rem 1.5rem 0; + box-sizing: border-box; +} + +.word-cloud-view { + min-height: 420px; +} + +.word-cloud-chart { + width: 100%; + height: 420px; + cursor: pointer; +} + +.word-cloud-state, +.word-cloud-empty { + margin: 0; + min-height: 420px; + display: flex; + align-items: center; + justify-content: center; + color: var(--sg-text-muted); + font-size: 14px; + text-align: center; +} diff --git a/webapp/src/app/modules/person-overview/person-overview.component.ts b/webapp/src/app/modules/person-overview/person-overview.component.ts index 883d017d..3d30ee16 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -3,12 +3,16 @@ import { Component, DestroyRef, OnInit, inject } from '@angular/core'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { combineLatest, distinctUntilChanged, map } from 'rxjs'; +import { NgxEchartsDirective } from 'ngx-echarts'; +import type { EChartsOption } from 'echarts'; +import 'echarts-wordcloud'; import { TopicCount, TopicsByYear, WorksService } from '../../api'; import { ResearchTimelineComponent, TimelineViewMode, TimelineYearRange, + TimelineTopicSelection, TopicTimelineElement, TopicTimelineTopic, } from './components/research-timeline/research-timeline.component'; @@ -16,7 +20,7 @@ import { @Component({ selector: 'app-person-overview', standalone: true, - imports: [CommonModule, ResearchTimelineComponent], + imports: [CommonModule, ResearchTimelineComponent, NgxEchartsDirective], templateUrl: './person-overview.component.html', styleUrl: './person-overview.component.scss', }) @@ -24,19 +28,43 @@ export class PersonOverviewComponent implements OnInit { private static readonly timelineViewQueryParam = 'timeline_view'; private static readonly timelineStartYearQueryParam = 'timeline_start_year'; private static readonly timelineEndYearQueryParam = 'timeline_end_year'; + private static readonly timelineLegendVisibleQueryParam = + 'timeline_legend_visible'; + private static readonly timelineLegendExpandedQueryParam = + 'timeline_legend_expanded'; + private static readonly timelineTopicCountLimit = 4; + private static readonly initialTimelineTargetPublications = 250; private readonly route = inject(ActivatedRoute); private readonly router = inject(Router); private readonly worksService = inject(WorksService); private readonly destroyRef = inject(DestroyRef); + private currentAuthorId = ''; + private timelineLoadId = 0; + topicTimelineElements: TopicTimelineElement[] = []; loadingTimeline = false; timelineLoadFailed = false; + timelineCanLoadEarlierYears = false; + timelineLoadingEarlierYears = false; + timelineEarlierYearsLoadFailed = false; timelineViewMode: TimelineViewMode = 'years'; timelineStartYear: number | undefined; timelineEndYear: number | undefined; + timelineLegendVisible = true; + timelineLegendExpanded = false; + + wordCloudOptions: EChartsOption | null = null; + loadingWordCloud = false; + wordCloudEmpty = false; + + private rawTopicOccurrences: Array<{ + name: string; + topicId: string; + year: number | undefined; + }> = []; ngOnInit(): void { combineLatest(this.route.pathFromRoot.map((route) => route.paramMap)) @@ -47,6 +75,7 @@ export class PersonOverviewComponent implements OnInit { ) .subscribe((authorId) => { this.loadTopicTimeline(authorId); + this.loadWordCloud(authorId); }); this.route.queryParamMap @@ -61,6 +90,18 @@ export class PersonOverviewComponent implements OnInit { this.timelineEndYear = this.parseOptionalYear( queryParams.get(PersonOverviewComponent.timelineEndYearQueryParam), ); + this.timelineLegendVisible = this.parseBooleanQueryParam( + queryParams.get( + PersonOverviewComponent.timelineLegendVisibleQueryParam, + ), + true, + ); + this.timelineLegendExpanded = this.parseBooleanQueryParam( + queryParams.get( + PersonOverviewComponent.timelineLegendExpandedQueryParam, + ), + false, + ); }); } @@ -78,6 +119,7 @@ export class PersonOverviewComponent implements OnInit { onTimelineYearRangeChange(range: TimelineYearRange): void { this.timelineStartYear = range.startYear; this.timelineEndYear = range.endYear; + this.rebuildWordCloud(); this.updateTimelineQueryParams( { @@ -88,6 +130,90 @@ export class PersonOverviewComponent implements OnInit { ); } + onTimelineLegendVisibleChange(visible: boolean): void { + this.timelineLegendVisible = visible; + + this.updateTimelineQueryParams( + { + [PersonOverviewComponent.timelineLegendVisibleQueryParam]: visible + ? null + : 'false', + }, + true, + ); + } + + onTimelineLegendExpandedChange(expanded: boolean): void { + this.timelineLegendExpanded = expanded; + + this.updateTimelineQueryParams( + { + [PersonOverviewComponent.timelineLegendExpandedQueryParam]: expanded + ? 'true' + : null, + }, + true, + ); + } + + onTimelineTopicSelect(selection: TimelineTopicSelection): void { + if (!selection.topic.id) { + return; + } + + void this.router.navigate(['../publications'], { + relativeTo: this.route, + queryParams: { + publicationPage: 1, + publicationYear: selection.years, + publicationTopicId: selection.topic.id, + publicationTopicName: selection.topic.name, + }, + }); + } + + onTimelineYearSelect(years: number[]): void { + if (years.length === 0) { + return; + } + + void this.router.navigate(['../publications'], { + relativeTo: this.route, + queryParams: { + publicationPage: 1, + publicationYear: years, + }, + }); + } + + onTimelineLoadEarlierYears(): void { + if ( + !this.currentAuthorId || + this.currentAuthorId === '0' || + this.timelineLoadingEarlierYears || + !this.timelineCanLoadEarlierYears + ) { + return; + } + + this.loadCompleteTopicTimeline(this.currentAuthorId); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + onWordClick(event: any): void { + const topicId = event?.data?.topicId; + const topicName = event?.data?.name; + if (!topicId) return; + void this.router.navigate(['../publications'], { + relativeTo: this.route, + queryParams: { + publicationPage: 1, + publicationTopicId: topicId, + publicationTopicName: topicName, + }, + }); + } + private findAuthorId(paramMaps: readonly ParamMap[]): string { return ( paramMaps @@ -97,36 +223,244 @@ export class PersonOverviewComponent implements OnInit { } private loadTopicTimeline(authorId: string): void { + const loadId = ++this.timelineLoadId; + this.currentAuthorId = authorId; + if (!authorId || authorId === '0') { - this.topicTimelineElements = []; - this.loadingTimeline = false; - this.timelineLoadFailed = false; + this.resetTimelineState(); return; } + this.topicTimelineElements = []; this.loadingTimeline = true; this.timelineLoadFailed = false; - - const topicCountLimit = 4; + this.timelineCanLoadEarlierYears = false; + this.timelineLoadingEarlierYears = false; + this.timelineEarlierYearsLoadFailed = false; this.worksService - .getTopicsByTimeByAuthor(authorId, topicCountLimit) + .getTopicsByTimeByAuthor( + authorId, + PersonOverviewComponent.timelineTopicCountLimit, + PersonOverviewComponent.initialTimelineTargetPublications, + false, + ) .pipe(takeUntilDestroyed(this.destroyRef)) .subscribe({ next: (response) => { - this.topicTimelineElements = this.mapTimelineElements(response.elements); + if (!this.isCurrentTimelineLoad(loadId, authorId)) { + return; + } + + const timelineElements = this.mapTimelineElements(response.elements); + + this.topicTimelineElements = timelineElements; this.loadingTimeline = false; this.timelineLoadFailed = false; + this.timelineCanLoadEarlierYears = + response.is_limited ?? + this.isLikelyLimitedTimeline(timelineElements); }, error: (error) => { + if (!this.isCurrentTimelineLoad(loadId, authorId)) { + return; + } + console.error('Topic timeline could not be loaded.', error); this.topicTimelineElements = []; this.loadingTimeline = false; this.timelineLoadFailed = true; + this.timelineCanLoadEarlierYears = false; + this.timelineLoadingEarlierYears = false; + this.timelineEarlierYearsLoadFailed = false; }, }); } + private loadCompleteTopicTimeline(authorId: string): void { + const loadId = this.timelineLoadId; + + this.timelineLoadingEarlierYears = true; + this.timelineEarlierYearsLoadFailed = false; + + this.worksService + .getTopicsByTimeByAuthor( + authorId, + PersonOverviewComponent.timelineTopicCountLimit, + undefined, + true, + ) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (response) => { + if (!this.isCurrentTimelineLoad(loadId, authorId)) { + return; + } + + const completeTimelineElements = this.mapTimelineElements( + response.elements, + ); + + this.topicTimelineElements = this.mergeTimelineElements( + this.topicTimelineElements, + completeTimelineElements, + ); + this.timelineCanLoadEarlierYears = false; + this.timelineLoadingEarlierYears = false; + this.timelineEarlierYearsLoadFailed = false; + }, + error: (error) => { + if (!this.isCurrentTimelineLoad(loadId, authorId)) { + return; + } + + console.error('Complete topic timeline could not be loaded.', error); + this.timelineCanLoadEarlierYears = true; + this.timelineLoadingEarlierYears = false; + this.timelineEarlierYearsLoadFailed = true; + }, + }); + } + + private resetTimelineState(): void { + this.topicTimelineElements = []; + this.loadingTimeline = false; + this.timelineLoadFailed = false; + this.timelineCanLoadEarlierYears = false; + this.timelineLoadingEarlierYears = false; + this.timelineEarlierYearsLoadFailed = false; + } + + private readonly timelineColors = [ + '#7255d9', + '#2678e8', + '#39a96b', + '#f59e0b', + '#e0527c', + ]; + + private loadWordCloud(authorId: string): void { + if (!authorId || authorId === '0') { + this.wordCloudOptions = null; + this.wordCloudEmpty = false; + this.loadingWordCloud = false; + this.rawTopicOccurrences = []; + return; + } + + this.loadingWordCloud = true; + this.wordCloudEmpty = false; + this.wordCloudOptions = null; + + this.worksService + .getAuthorWorks(authorId, 1, 100) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe({ + next: (page) => { + this.rawTopicOccurrences = []; + page.elements?.forEach((work) => { + const year = work.publication_year ?? undefined; + work.topics?.forEach((topic) => { + if (topic.display_name && topic.id) { + this.rawTopicOccurrences.push({ + name: topic.display_name, + topicId: topic.id, + year, + }); + } + }); + }); + + this.loadingWordCloud = false; + + if (this.rawTopicOccurrences.length === 0) { + this.wordCloudEmpty = true; + return; + } + + setTimeout(() => this.rebuildWordCloud()); + }, + error: (error) => { + console.error('Word cloud could not be loaded.', error); + this.loadingWordCloud = false; + this.wordCloudEmpty = true; + }, + }); + } + + private rebuildWordCloud(): void { + const start = this.timelineStartYear; + const end = this.timelineEndYear; + const counts = new Map(); + const nameToId = new Map(); + + for (const occ of this.rawTopicOccurrences) { + if (start !== undefined && (occ.year === undefined || occ.year < start)) + continue; + if (end !== undefined && (occ.year === undefined || occ.year > end)) + continue; + counts.set(occ.name, (counts.get(occ.name) ?? 0) + 1); + if (!nameToId.has(occ.name)) nameToId.set(occ.name, occ.topicId); + } + + if (counts.size === 0) { + this.wordCloudOptions = null; + this.wordCloudEmpty = true; + return; + } + + this.wordCloudEmpty = false; + + const allValues = Array.from(counts.values()); + const minVal = Math.min(...allValues); + const maxVal = Math.max(...allValues); + const computeSize = (v: number): number => + maxVal === minVal + ? 22 + : Math.round(12 + ((v - minVal) / (maxVal - minVal)) * (32 - 12)); + + const sorted = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]); + + const data = sorted.slice(0, 30).map(([name, value], i) => { + const fontSize = computeSize(value); + const color = this.timelineColors[i % this.timelineColors.length]; + return { + name, + value, + topicId: nameToId.get(name), + textStyle: { color, fontSize }, + emphasis: { + textStyle: { + fontSize: Math.round(fontSize * 1.1), + color, + shadowBlur: 16, + shadowColor: 'rgba(0, 87, 255, 0.35)', + }, + }, + }; + }); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + this.wordCloudOptions = { + series: [ + { + type: 'wordCloud', + rotationRange: [0, 0], + rotationStep: 0, + gridSize: 4, + width: '100%', + height: '100%', + drawOutOfBound: false, + textStyle: { + fontFamily: 'Open Sans, sans-serif', + fontWeight: 'bold', + }, + data, + }, + ], + } as any; + } + private mapTimelineElements( elements: TopicsByYear[] | undefined, ): TopicTimelineElement[] { @@ -138,15 +472,64 @@ export class PersonOverviewComponent implements OnInit { })); } - private mapTopicCounts(topics: TopicCount[] | undefined): TopicTimelineTopic[] { - return (topics ?? []).map((topic) => ({ + private mapTopicCounts( + topics: TopicCount[] | undefined, + ): TopicTimelineTopic[] { + return (topics ?? []).map((topic: TopicCount & { id?: string | null }) => ({ + id: topic.id ?? undefined, name: topic.name, count: topic.count ?? 0, + description: topic.description ?? undefined, + subfield_id: topic.subfield_id ?? undefined, + subfield_name: topic.subfield_name ?? undefined, + subfield_description: topic.subfield_description ?? undefined, + field_id: topic.field_id ?? undefined, + field_name: topic.field_name ?? undefined, + field_description: topic.field_description ?? undefined, + domain_id: topic.domain_id ?? undefined, + domain_name: topic.domain_name ?? undefined, + domain_description: topic.domain_description ?? undefined, })); } + private mergeTimelineElements( + currentElements: TopicTimelineElement[], + completeElements: TopicTimelineElement[], + ): TopicTimelineElement[] { + const elementsByYear = new Map(); + + for (const element of currentElements) { + elementsByYear.set(element.year, element); + } + + for (const element of completeElements) { + elementsByYear.set(element.year, element); + } + + return [...elementsByYear.values()].sort( + (left, right) => left.year - right.year, + ); + } + + private isLikelyLimitedTimeline(elements: TopicTimelineElement[]): boolean { + return ( + elements.reduce( + (total, element) => total + element.publication_count, + 0, + ) >= PersonOverviewComponent.initialTimelineTargetPublications + ); + } + + private isCurrentTimelineLoad(loadId: number, authorId: string): boolean { + return loadId === this.timelineLoadId && authorId === this.currentAuthorId; + } + private parseTimelineViewMode(value: string | null): TimelineViewMode { - return value === 'compact' ? 'compact' : 'years'; + if (value === 'compact' || value === 'wordcloud') { + return value; + } + + return 'years'; } private parseOptionalYear(value: string | null): number | undefined { @@ -163,8 +546,27 @@ export class PersonOverviewComponent implements OnInit { return year; } + private parseBooleanQueryParam( + value: string | null, + fallback: boolean, + ): boolean { + if (value === null) { + return fallback; + } + + if (value === 'true' || value === '1') { + return true; + } + + if (value === 'false' || value === '0') { + return false; + } + + return fallback; + } + private updateTimelineQueryParams( - queryParams: Record, + queryParams: Record, replaceUrl: boolean, ): void { void this.router.navigate([], { @@ -174,4 +576,4 @@ export class PersonOverviewComponent implements OnInit { replaceUrl, }); } -} \ No newline at end of file +} diff --git a/webapp/src/app/modules/person-patents/person-patents.component.html b/webapp/src/app/modules/person-patents/person-patents.component.html new file mode 100644 index 00000000..054163c2 --- /dev/null +++ b/webapp/src/app/modules/person-patents/person-patents.component.html @@ -0,0 +1,179 @@ +@if (loading) { +

Lade Patente...

+} @else if (error) { +

Fehler beim Laden der Patente.

+} @else if (patents.length === 0) { +

Keine Patente gefunden.

+} @else { +
+
+

+ {{ filteredPatents.length }} + Patente +

+

+ {{ getEpoCount() }} + EPO +

+

+ {{ getUsptoCount() }} + USPTO +

+
+ + @if (showDetail && selectedPatent) { + + } + +
+ @if (showDetail && selectedPatent) { +
+

{{ selectedPatent.title ?? selectedPatent.patent_id }}

+ + @if (selectedPatent.abstract) { +
+

Abstract

+

{{ selectedPatent.abstract }}

+
+ } + +
+

Erfinder

+
    + @for (inventor of selectedPatent.inventors; track inventor) { +
  • {{ inventor }}
  • + } +
+
+ + @if (hasAsignees(selectedPatent)) { +
+

Anmelder

+
    + @for (assignee of selectedPatent.assignees; track assignee) { +
  • {{ assignee }}
  • + } +
+
+ } + + @if (hasIpcs(selectedPatent)) { +
+

Klassifikation (IPC)

+
    + @for (ipc of selectedPatent.ipc; track ipc) { +
  • {{ ipc }}
  • + } +
+
+ } +
+ } + +
+
+ + +
+ + + + + + + + + + + @for (patent of getPagedPatents(); track patent.patent_id) { + + + + + + } + +
PatentQuelleJahr
+ {{ patent.title ?? patent.patent_id }} + + + {{ patent.source }} + + {{ patent.publication_year ?? '-' }}
+ + @if (hasPagination()) { + + } +
+ + @if (selectedPatent) { +
+

{{ selectedPatent.title ?? selectedPatent.patent_id }}

+
+
+ Quelle + + + {{ selectedPatent.source }} + + +
+
+ Patent-Nr. + {{ selectedPatent.patent_id }} +
+
+ Datum + {{ + formatDate(selectedPatent.publication_date || '') + }} +
+
+
+ } @else { +
+

Klicke auf ein Patent für Details.

+
+ } +
+
+} diff --git a/webapp/src/app/modules/person-patents/person-patents.component.scss b/webapp/src/app/modules/person-patents/person-patents.component.scss new file mode 100644 index 00000000..59079610 --- /dev/null +++ b/webapp/src/app/modules/person-patents/person-patents.component.scss @@ -0,0 +1,306 @@ +.message { + padding: 16px; + color: #666; +} + +.patents-container { + padding: 16px; + display: flex; + flex-direction: column; + gap: 16px; +} + +.patents-summary { + margin-bottom: 8px; + display: flex; + gap: 24px; + + .summary-line { + margin: 0; + font-size: 14px; + color: #333; + } + + .summary-label { + color: #333; + } + + .summary-value { + font-weight: 600; + color: #333; + } +} + +.sort-control { + display: inline-flex; + align-items: center; + gap: 6px; + width: fit-content; + padding: 10px 14px; + border-radius: 20px; + background: #f2f2f2; + color: #333; + font-size: 14px; + + span { + color: #555; + } + + select { + border: 0; + background: transparent; + color: #111827; + font: inherit; + cursor: pointer; + outline: none; + } +} + +.patents-content { + display: flex; + gap: 24px; + align-items: flex-start; +} + +.patents-list { + flex: 1; + + &.hidden { + display: none; + } + + .patents-list-toolbar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; + flex-wrap: wrap; + } + + table { + width: 100%; + border-collapse: collapse; + + th { + text-align: left; + padding: 10px 12px; + border-bottom: 2px solid #e0e0e0; + font-weight: 600; + color: #333; + } + + tr { + cursor: pointer; + + &:hover { + background: #f5f5f5; + } + + &.selected { + background: #f0f0f0; + } + } + + td { + padding: 10px 12px; + border-bottom: 1px solid #f0f0f0; + } + + .patent-title { + color: #333; + font-weight: 500; + max-width: 400px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} + +.source-badge { + display: inline-flex; + align-items: center; + padding: 3px 10px; + border-radius: 999px; + font-size: 0.75rem; + font-weight: 700; + + &--epo { + background: #effaf3; + color: #24834f; + border: 1px solid #bdebcf; + } + + &--uspto { + background: #f0f6ff; + color: #0b63ce; + border: 1px solid #bdd4ff; + } +} + +.patent-detail { + width: 440px; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 20px; + background: #fafafa; + + &.empty { + display: flex; + align-items: center; + justify-content: center; + color: #999; + min-height: 200px; + } + + h3 { + margin: 0 0 16px 0; + font-size: 16px; + color: #333; + line-height: 1.4; + } +} + +.detail-stats { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + + .stat { + background: white; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 10px; + text-align: center; + + .stat-label { + display: block; + font-size: 11px; + color: #666; + margin-bottom: 4px; + text-transform: uppercase; + letter-spacing: 0.03em; + } + + .stat-value { + display: block; + font-size: 15px; + font-weight: bold; + color: #333; + } + } +} + +.stat--clickable { + cursor: pointer; + transition: + border-color 0.15s, + background 0.15s; + + &:hover { + border-color: #0b63ce; + background: #f0f6ff; + } +} + +.patent-full-detail { + flex: 1; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 20px; + background: #fafafa; + + h3 { + margin: 0 0 16px 0; + font-size: 16px; + color: #333; + line-height: 1.4; + } + + h4 { + margin: 16px 0 8px 0; + font-size: 14px; + color: #555; + font-weight: 600; + } + + p { + font-size: 13px; + color: #444; + line-height: 1.6; + margin: 0; + } +} + +.back-btn { + border: none; + background: none; + color: #333; + cursor: pointer; + font-size: 14px; + font-weight: 400; + padding: 0; + align-self: flex-start; // NEU + + &:hover { + text-decoration: underline; + } +} + +.detail-section { + margin-top: 12px; + padding-top: 12px; + border-top: 1px solid #eee; +} + +.tag-list { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin: 0; + padding: 0; + list-style: none; + + &--compact .tag { + font-size: 0.75rem; + padding: 3px 8px; + } +} + +.tag { + padding: 4px 10px; + border-radius: 999px; + background: #f0f6ff; + border: 1px solid #dbeafe; + color: #1e40af; + font-size: 0.8rem; + line-height: 1.3; +} + +.pagination { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + margin-top: 12px; + + button { + padding: 4px 10px; + border: 1px solid #d0d0d0; + border-radius: 6px; + background: white; + cursor: pointer; + font-size: 12px; + + &:disabled { + opacity: 0.5; + cursor: default; + } + } + + span { + font-size: 12px; + color: #666; + } +} diff --git a/webapp/src/app/modules/person-patents/person-patents.component.ts b/webapp/src/app/modules/person-patents/person-patents.component.ts new file mode 100644 index 00000000..f0c80153 --- /dev/null +++ b/webapp/src/app/modules/person-patents/person-patents.component.ts @@ -0,0 +1,174 @@ +import { Component, OnInit, inject } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; +import { PatentsService } from '../../api/api/patents.service'; +import { PatentEntry } from '../../api'; + +type SortMode = 'date' | 'title'; +type SourceFilter = 'all' | 'EPO' | 'USPTO'; + +@Component({ + selector: 'app-person-patents', + imports: [CommonModule], + templateUrl: './person-patents.component.html', + styleUrl: './person-patents.component.scss', +}) +export class PersonPatentsComponent implements OnInit { + private route = inject(ActivatedRoute); + private router = inject(Router); + private patentsApi = inject(PatentsService); + + patents: PatentEntry[] = []; + filteredPatents: PatentEntry[] = []; + authorName: string | null = null; + selectedPatent: PatentEntry | null = null; + showDetail = false; + + loading = true; + error = false; + + activeFilter: SourceFilter = 'all'; + sortMode: SortMode = 'date'; + + selectedPage = 1; + readonly pageSize = 10; + + hasAsignees(selectedPatent: PatentEntry | null): boolean { + return !!selectedPatent?.assignees && selectedPatent.assignees.length > 0; + } + + hasIpcs(selectedPatent: PatentEntry | null): boolean { + return !!selectedPatent?.ipc && selectedPatent.ipc.length > 0; + } + + ngOnInit(): void { + this.route.parent?.paramMap.subscribe((params) => { + const authorId = params.get('id') ?? ''; + + const filterFromUrl = this.route.snapshot.queryParamMap.get('filter'); + const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy'); + + if (this.isValidFilter(filterFromUrl)) { + this.activeFilter = filterFromUrl; + } + if (this.isValidSortMode(sortFromUrl)) { + this.sortMode = sortFromUrl; + } + + if (authorId) { + this.patentsApi.getPatentsByAuthor(authorId, 'body').subscribe({ + next: (result) => { + this.patents = result.patents ?? []; + this.authorName = result.author_name ?? null; + this.applyFilter(); + this.loading = false; + }, + error: () => { + this.error = true; + this.loading = false; + }, + }); + } + }); + } + + setFilter(filter: SourceFilter): void { + this.activeFilter = filter; + this.selectedPage = 1; + this.selectedPatent = null; + this.showDetail = false; + this.applyFilter(); + this.updateQueryParams(); + } + + setSortMode(sortMode: SortMode): void { + this.sortMode = sortMode; + this.applyFilter(); + this.updateQueryParams(); + } + + selectPatent(patent: PatentEntry): void { + this.selectedPatent = patent; + this.showDetail = false; + this.updateQueryParams(); + } + + openDetail(): void { + this.showDetail = true; + } + + private applyFilter(): void { + let patents = this.patents; + + if (this.activeFilter !== 'all') { + patents = patents.filter((p) => p.source === this.activeFilter); + } + + this.filteredPatents = this.sortPatents(patents); + } + + private sortPatents(patents: PatentEntry[]): PatentEntry[] { + return [...patents].sort((a, b) => { + if (this.sortMode === 'date') { + return (b.publication_date ?? '').localeCompare( + a.publication_date ?? '', + ); + } + return (a.title ?? '').localeCompare(b.title ?? '', 'de', { + sensitivity: 'base', + }); + }); + } + + private updateQueryParams(): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + filter: this.activeFilter, + sortBy: this.sortMode, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + } + + private isValidFilter(value: string | null): value is SourceFilter { + return value === 'all' || value === 'EPO' || value === 'USPTO'; + } + + private isValidSortMode(value: string | null): value is SortMode { + return value === 'date' || value === 'title'; + } + + getPagedPatents(): PatentEntry[] { + const start = (this.selectedPage - 1) * this.pageSize; + return this.filteredPatents.slice(start, start + this.pageSize); + } + + getPageCount(): number { + return Math.max(1, Math.ceil(this.filteredPatents.length / this.pageSize)); + } + + hasPagination(): boolean { + return this.getPageCount() > 1; + } + + setPage(page: number): void { + this.selectedPage = Math.min(Math.max(page, 1), this.getPageCount()); + this.updateQueryParams(); + } + + formatDate(date: string | null): string { + if (!date) return '-'; + const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); + return new Intl.DateTimeFormat('de-DE').format(new Date(d)); + } + + getEpoCount(): number { + return this.patents.filter((p) => p.source === 'EPO').length; + } + + getUsptoCount(): number { + return this.patents.filter((p) => p.source === 'USPTO').length; + } +} diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.html b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.html new file mode 100644 index 00000000..9b0df147 --- /dev/null +++ b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.html @@ -0,0 +1,385 @@ +
+ + + @if (bundProject) { +
+
+
+ Bund Projekt + ID: {{ bundProject.funding_reference }} + +
+

{{ bundProject.title || 'Ohne Titel' }}

+ @if (bundProject.funding_reference) { +

+ {{ bundProject.funding_type }} +

+ } +
+ + +
+
+ +
+
+ calendar_today +
+ {{ getStartDate() || 'N/A' }} + Startdatum +
+
+
+ event_busy +
+ {{ getFundingStatus(getEndDate()) }} + Enddatum +
+
+ @if (bundProject.funding_amount) { +
+ paid +
+ {{ getFundingAmountDisplay() }} + Fördersumme +
+
+ } + @if (bundProject.funding_profile) { +
+ assignment +
+ {{ bundProject.funding_profile }} + Förderprofil +
+
+ } +
+
+ + @if (bundProject.description) { + +
+ description +

Beschreibung

+
+

{{ bundProject.description }}

+
+ } + +
+
+ + @if (getAssociatedPersons().length > 0) { + +
+ people +

Beteiligte Personen

+ {{ + getAssociatedPersons().length + }} +
+
+ @for (person of getAssociatedPersons(); track person) { +
+
{{ getInitials(person) }}
+
{{ person }}
+
+ } +
+
+ } + + + @if (getInstitutions().length > 0) { + +
+ business +

Beteiligte Institutionen

+ {{ getInstitutions().length }} +
+
+ @for (institution of getInstitutions(); track institution) { +
+ apartment + {{ institution }} +
+ } +
+
+ } + + + + @if ( + bundProject.executing_agency || + bundProject.funding_recipient || + bundProject.project_agency || + bundProject.department || + bundProject.division + ) { + +
+ organization +

Organisation

+
+
+ @if (bundProject.executing_agency) { +
+
Ausführende Stelle
+
+ {{ bundProject.executing_agency }} +
+
+ } + @if (bundProject.funding_recipient) { +
+
Förderempfänger
+
{{ bundProject.funding_recipient }}
+
+ } + @if (bundProject.project_agency) { +
+
Projektagentur
+
+ {{ + bundProject.project_agency_fullname || + bundProject.project_agency + }} +
+
+ } + @if (bundProject.department) { +
+
Abteilung
+
+ {{ + bundProject.department_fullname || bundProject.department + }} +
+
+ } + @if (bundProject.division) { +
+
Division
+
{{ bundProject.division }}
+
+ } +
+
+ } + + + @if ( + bundProject.location || + bundProject.municipality || + bundProject.state || + bundProject.country + ) { + +
+ location_on +

Standort

+
+
+ @if (bundProject.location) { +
+
Standort
+
+ {{ bundProject.location }} +
+
+ } + @if (bundProject.municipality) { +
+
Gemeinde
+
{{ bundProject.municipality }}
+
+ } + @if (bundProject.state) { +
+
Bundesland
+
+ {{ bundProject.state }} +
+
+ } + @if (bundProject.country) { +
+
Land
+
{{ bundProject.country }}
+
+ } + @if (bundProject.municipality_code) { +
+
Gemeindeschlüssel
+
{{ bundProject.municipality_code }}
+
+ } +
+
+ } + + + @if ( + bundProject.performance_plan_code || + bundProject.performance_plan_fullname || + bundProject.publication_date || + bundProject.record_date + ) { + +
+ more_info +

Weitere Informationen

+
+
+ @if (bundProject.performance_plan_code) { +
+
Leistungsplancode
+
{{ bundProject.performance_plan_code }}
+
+ } + @if (bundProject.performance_plan_fullname) { +
+
Leistungsplan
+
{{ bundProject.performance_plan_fullname }}
+
+ } + @if (bundProject.publication_date) { +
+
Veröffentlichungsdatum
+
{{ bundProject.publication_date }}
+
+ } + @if (bundProject.record_date) { +
+
Datensatzdatum
+
{{ bundProject.record_date }}
+
+ } +
+
+ } +
+ + +
+ } @else { +
+
+ error_outline +

Bund Projekt nicht gefunden.

+
+
+ } +
diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.scss b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.scss new file mode 100644 index 00000000..839a4ea7 --- /dev/null +++ b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.scss @@ -0,0 +1,527 @@ +// Complete SCSS with all styles including clickable elements + +.detail-page { + padding: 28px 32px 42px; + max-width: 100%; + margin: 0 auto; +} + +.page-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-bottom: 24px; +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + cursor: pointer; + font-size: 14px; + transition: all 0.2s; +} + +.back-link:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.back-link mat-icon { + width: 20px; + height: 20px; + font-size: 20px; +} + +.breadcrumb { + display: flex; + align-items: center; + gap: 6px; + color: var(--sg-text-muted); + font-size: 13px; +} + +.breadcrumb mat-icon { + width: 18px; + height: 18px; + font-size: 18px; +} + +.breadcrumb span:last-child { + color: var(--sg-text); + font-weight: 500; +} + +.project-hero { + background: #f8fafc; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-md); + padding: 28px 32px; + margin-bottom: 28px; +} + +.hero-content { + margin-bottom: 24px; +} + +.eyebrow { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 12px; + flex-wrap: wrap; +} + +.project-badge { + display: inline-block; + padding: 4px 12px; + background: #e8edf5; + color: var(--sg-text); + border-radius: var(--sg-radius-sm); + font-size: 12px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.project-id { + color: var(--sg-text-muted); + font-size: 13px; +} + +.new-badge { + display: inline-block; + padding: 2px 10px; + background: #27ae60; + color: #fff; + border-radius: var(--sg-radius-sm); + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +h1 { + margin: 0 0 8px; + font-size: 26px; + line-height: 1.3; + font-weight: 700; + color: var(--sg-text); +} + +.project-reference { + margin: 0 0 16px; + color: var(--sg-text-muted); + font-size: 14px; +} + +.hero-actions { + display: flex; + flex-wrap: wrap; + gap: 10px; +} + +.agency-info, +.funding-type-info { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 16px; + background: #fff; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + font-size: 14px; + cursor: pointer; + transition: all 0.2s; +} + +.agency-info:hover, +.funding-type-info:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.agency-info mat-icon, +.funding-type-info mat-icon { + color: var(--sg-text-muted); + width: 20px; + height: 20px; + font-size: 20px; +} + +.metrics-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 16px; + padding-top: 20px; + border-top: 1px solid #d9e2f0; +} + +.metric-item { + display: flex; + align-items: center; + gap: 12px; +} + +.metric-item mat-icon { + color: var(--sg-text-muted); + width: 24px; + height: 24px; + font-size: 24px; +} + +.metric-content { + display: flex; + flex-direction: column; +} + +.metric-content strong { + font-size: 15px; + color: var(--sg-text); + line-height: 1.3; +} + +.metric-content span { + font-size: 12px; + color: var(--sg-text-muted); +} + +.card { + margin-bottom: 24px; + border-color: #d9e2f0 !important; + border-radius: var(--sg-radius-md) !important; +} + +.card ::ng-deep .mat-mdc-card-content { + padding: 0; +} + +.section-header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px 20px 12px; + border-bottom: 1px solid #f0f2f5; +} + +.section-header mat-icon { + color: var(--sg-text-muted); + width: 22px; + height: 22px; + font-size: 22px; +} + +.section-header h2 { + margin: 0; + font-size: 16px; + font-weight: 600; + color: var(--sg-text); +} + +.count-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 24px; + height: 24px; + padding: 0 8px; + margin-left: auto; + background: #e8edf5; + border-radius: 12px; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 500; +} + +.description-text { + padding: 16px 20px 20px; + margin: 0; + color: var(--sg-text); + font-size: 14px; + line-height: 1.6; +} + +.content-grid { + display: grid; + grid-template-columns: 2fr 1fr; + gap: 24px; +} + +.main-content { + display: flex; + flex-direction: column; + gap: 24px; +} + +.sidebar { + display: flex; + flex-direction: column; + gap: 24px; +} + +.person-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); + gap: 12px; + padding: 16px 20px 20px; +} + +.person-item { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + cursor: pointer; + transition: all 0.2s; +} + +.person-item:hover { + background: #f8fafc; + border-color: #b8c5d6; + transform: translateY(-1px); +} + +.avatar { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border-radius: 50%; + background: #e8edf5; + color: var(--sg-text); + font-size: 13px; + font-weight: 600; + flex-shrink: 0; +} + +.person-name { + font-size: 13px; + font-weight: 500; + color: var(--sg-text); +} + +.institution-grid { + display: grid; + grid-template-columns: 1fr; + gap: 8px; + padding: 16px 20px 20px; +} + +.institution-item { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + font-size: 13px; + color: var(--sg-text); + cursor: pointer; + transition: all 0.2s; +} + +.institution-item:hover { + background: #f8fafc; + border-color: #b8c5d6; +} + +.institution-item mat-icon { + color: var(--sg-text-muted); + width: 20px; + height: 20px; + font-size: 20px; + flex-shrink: 0; +} + +.joint-project-content { + display: flex; + align-items: center; + gap: 12px; + padding: 16px 20px 20px; + color: var(--sg-text); + font-size: 14px; +} + +.joint-project-content mat-icon { + color: var(--sg-text-muted); + width: 24px; + height: 24px; + font-size: 24px; + flex-shrink: 0; +} + +.details-list { + margin: 0; + padding: 16px 20px 20px; +} + +.detail-row { + display: grid; + grid-template-columns: 140px 1fr; + gap: 24px; + padding: 8px 0; + border-bottom: 1px solid #f0f2f5; +} + +.detail-row:last-child { + border-bottom: none; +} + +.detail-row dt { + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 500; +} + +.detail-row dd { + margin: 0; + color: var(--sg-text); + font-size: 13px; + word-break: break-word; + display: flex; + align-items: center; + gap: 6px; +} + +.detail-row dd.clickable { + cursor: pointer; + transition: color 0.2s; +} + +.detail-row dd.clickable:hover { + color: var(--sg-primary, #0066cc); +} + +.detail-row dd.clickable:hover .search-icon { + opacity: 1; +} + +.search-icon { + width: 16px; + height: 16px; + font-size: 16px; + opacity: 0; + transition: opacity 0.2s; + color: var(--sg-text-muted); +} + +.detail-row dd:hover .search-icon { + opacity: 1; +} + +.empty-state { + padding: 20px; + text-align: center; + color: var(--sg-text-muted); + font-size: 14px; +} + +.error-container { + display: flex; + align-items: center; + justify-content: center; + min-height: 400px; +} + +.error-state { + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + color: var(--sg-text-muted); +} + +.error-state mat-icon { + width: 48px; + height: 48px; + font-size: 48px; + color: #e74c3c; +} + +.error-state p { + margin: 0; + font-size: 16px; +} + +// Clickable external link styling +.external-link { + color: var(--sg-primary, #0066cc); + text-decoration: none; +} + +.external-link:hover { + text-decoration: underline; +} + +@media (max-width: 992px) { + .content-grid { + grid-template-columns: 1fr; + gap: 20px; + } +} + +@media (max-width: 768px) { + .detail-page { + padding: 16px; + } + + .page-header { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } + + .project-hero { + padding: 20px; + } + + .metrics-grid { + grid-template-columns: 1fr 1fr; + gap: 12px; + } + + h1 { + font-size: 22px; + } + + .detail-row { + grid-template-columns: 1fr; + gap: 4px; + } + + .person-grid { + grid-template-columns: 1fr; + } + + .eyebrow { + gap: 8px; + } +} + +@media (max-width: 480px) { + .metrics-grid { + grid-template-columns: 1fr; + } + + .hero-actions { + flex-direction: column; + } + + .agency-info, + .funding-type-info { + width: 100%; + justify-content: center; + } +} diff --git a/webapp/src/app/modules/person-projects/bund-details/bund-details.component.ts b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.ts new file mode 100644 index 00000000..5ad9007b --- /dev/null +++ b/webapp/src/app/modules/person-projects/bund-details/bund-details.component.ts @@ -0,0 +1,163 @@ +import { Component, OnInit, inject } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { BundProjectDetails } from '../../../api/model/bundProjectDetails'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-bund-details', + standalone: true, + imports: [CommonModule, MatCardModule, MatIconModule], + templateUrl: './bund-details.component.html', + styleUrl: './bund-details.component.scss', +}) +export class BundDetailsComponent implements OnInit { + private route = inject(ActivatedRoute); + bundProject: BundProjectDetails | undefined; + + constructor(private router: Router) {} + + ngOnInit(): void { + this.route.data.subscribe(({ bundSingleProject }) => { + console.log('Bund Project:', bundSingleProject); + this.bundProject = bundSingleProject; + }); + } + + getInitials(name: string | null | undefined): string { + if (!name) return ''; + const parts = name.trim().split(/\s+/); + if (parts.length > 1) { + return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase(); + } + return parts[0][0].toUpperCase(); + } + + getFundingStatus(fundingEndDate: string | null | undefined): string { + if (!fundingEndDate) return 'N/A'; + if (fundingEndDate === '2999') return 'laufend'; + const year = parseInt(fundingEndDate, 10); + if (isNaN(year)) return fundingEndDate; + return year >= new Date().getFullYear() + ? `${fundingEndDate} (laufend)` + : `${fundingEndDate} (abgeschlossen)`; + } + + formatCurrency(amount: number | null | undefined): string { + if (amount === null || amount === undefined) return 'N/A'; + + // Format as Euro with thousands separators + return new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + minimumFractionDigits: 0, + maximumFractionDigits: 0, + }).format(amount); + } + + searchForPersonName(personName: string): void { + this.router.navigate(['/persons'], { + queryParams: { + query: personName, + }, + }); + } + + searchForInstitutionName(institutionName: string): void { + this.router.navigate(['/institutions'], { + queryParams: { + search: institutionName, + }, + }); + } + + // searchForLocation(location: string): void { + // this.router.navigate(['/bund-projects'], { + // queryParams: { + // location: location + // } + // }); + // } + + // searchForState(state: string): void { + // this.router.navigate(['/bund-projects'], { + // queryParams: { + // state: state + // } + // }); + // } + + // searchForFundingType(fundingType: string): void { + // this.router.navigate(['/bund-projects'], { + // queryParams: { + // fundingType: fundingType + // } + // }); + // } + + // searchForAgency(agency: string): void { + // this.router.navigate(['/bund-projects'], { + // queryParams: { + // agency: agency + // } + // }); + // } + private formatGermanDate(dateString: string): string { + if (!dateString) return ''; + + return new Intl.DateTimeFormat('de-DE', { + day: 'numeric', + month: 'long', + year: 'numeric', + }).format(new Date(dateString)); + } + /** + * All associated persons as a simple list. + */ + getAssociatedPersons(): string[] { + return this.bundProject?.associated_persons || []; + } + getStartDate(): string { + return this.formatGermanDate(this.bundProject?.funding_start_date ?? ''); + } + + getEndDate(): string { + return this.formatGermanDate(this.bundProject?.funding_end_date ?? ''); + } + + getDuration(): string { + const start = this.bundProject?.funding_start_date; + const end = this.bundProject?.funding_end_date; + + if (!start || !end) return ''; + + return `von ${this.formatGermanDate(start)} bis ${this.formatGermanDate(end)}`; + } + /** + * All institutions as a simple list. + */ + getInstitutions(): string[] { + return this.bundProject?.institutions || []; + } + + /** + * Check if project is new + */ + isNewProject(): boolean { + return this.bundProject?.is_new === true; + } + + /** + * Get display name for funding amount + */ + getFundingAmountDisplay(): string { + if (!this.bundProject?.funding_amount) return 'N/A'; + return this.formatCurrency(this.bundProject.funding_amount); + } + + goBack(): void { + window.history.back(); + } +} diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.html b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.html new file mode 100644 index 00000000..81947db7 --- /dev/null +++ b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.html @@ -0,0 +1,245 @@ +
+ + + @if (dfgProject) { +
+
+
+ DFG Projekt + ID: {{ dfgProject.id }} +
+

{{ dfgProject.title }}

+ @if (dfgProject.project_identifier) { +

+ {{ dfgProject.project_identifier.split('-')[0] }} +

+ } +
+ @if (dfgProject.link) { + + open_in_new + Zum Projekt + + } + @if (dfgProject.website) { + + language + Webseite + + } +
+
+ +
+
+ calendar_today +
+ {{ dfgProject.funding_start_date || 'N/A' }} + Fördersbeginn +
+
+
+ event_busy +
+ {{ getFundingStatus(dfgProject.funding_end_date) }} + Fördersende +
+
+ + @if (dfgProject.dfg_procedure) { +
+ gavel +
+ {{ dfgProject.dfg_procedure }} + DFG Verfahren +
+
+ } + + @if (dfgProject.international_reference) { +
+ public +
+ {{ dfgProject.international_reference }} + Internationaler Bezug +
+
+ } +
+
+ + @if (dfgProject.description) { + +
+ description +

Beschreibung

+
+

{{ dfgProject.description }}

+
+ } + +
+
+ + +
+ people +

Beteiligte Personen

+ {{ getAssociatedPersons().length }} +
+ @if (getAssociatedPersons().length > 0) { +
+ @for (person of getAssociatedPersons(); track person) { +
+
{{ getInitials(person) }}
+
{{ person }}
+
+ } +
+ } @else { +
Keine Personen gefunden.
+ } +
+ + + +
+ business +

Beteiligte Institutionen

+ {{ getInstitutions().length }} +
+ @if (getInstitutions().length > 0) { +
+ @for (institution of getInstitutions(); track institution) { +
+ apartment + {{ institution }} +
+ } +
+ } @else { +
Keine Institutionen gefunden.
+ } +
+ + +
+ + +
+ } @else { +
+
+ error_outline +

DFG Projekt nicht gefunden.

+
+
+ } +
diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.scss b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.scss new file mode 100644 index 00000000..08fbf9e7 --- /dev/null +++ b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.scss @@ -0,0 +1,467 @@ +.detail-page { + padding: 28px 32px 42px; + max-width: 100%; + margin: 0 auto; +} + +.page-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 18px; + margin-bottom: 24px; +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 16px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + cursor: pointer; + font-size: 14px; + transition: all 0.2s; +} + +.back-link:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.back-link mat-icon { + width: 20px; + height: 20px; + font-size: 20px; +} + +.breadcrumb { + display: flex; + align-items: center; + gap: 6px; + color: var(--sg-text-muted); + font-size: 13px; +} + +.breadcrumb mat-icon { + width: 18px; + height: 18px; + font-size: 18px; +} + +.breadcrumb span:last-child { + color: var(--sg-text); + font-weight: 500; +} + +.project-hero { + background: #f8fafc; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-md); + padding: 28px 32px; + margin-bottom: 28px; +} + +.hero-content { + margin-bottom: 24px; +} + +.eyebrow { + display: flex; + align-items: center; + gap: 12px; + margin-bottom: 12px; +} + +.project-badge { + display: inline-block; + padding: 4px 12px; + background: #e8edf5; + color: var(--sg-text); + border-radius: var(--sg-radius-sm); + font-size: 12px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.project-id { + color: var(--sg-text-muted); + font-size: 13px; +} + +h1 { + margin: 0 0 8px; + font-size: 26px; + line-height: 1.3; + font-weight: 700; + color: var(--sg-text); +} + +.project-identifier { + margin: 0 0 16px; + color: var(--sg-text-muted); + font-size: 14px; +} + +.hero-actions { + display: flex; + flex-wrap: wrap; + gap: 10px; +} + +.primary-action, +.secondary-action { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 10px 20px; + border-radius: var(--sg-radius-sm); + text-decoration: none; + font-size: 14px; + font-weight: 500; + transition: all 0.2s; +} + +.primary-action { + background: var(--sg-primary, #0066cc); + color: #fff; + border: none; +} + +.primary-action:hover { + background: var(--sg-primary-dark, #0052a3); +} + +.secondary-action { + background: #fff; + color: var(--sg-text); + border: 1px solid #d9e2f0; +} + +.secondary-action:hover { + background: #f5f7fa; + border-color: #b8c5d6; +} + +.primary-action mat-icon, +.secondary-action mat-icon { + width: 20px; + height: 20px; + font-size: 20px; +} + +.metrics-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 16px; + padding-top: 20px; + border-top: 1px solid #d9e2f0; +} + +.metric-item { + display: flex; + align-items: center; + gap: 12px; +} + +.metric-item mat-icon { + color: var(--sg-text-muted); + width: 24px; + height: 24px; + font-size: 24px; +} + +.metric-content { + display: flex; + flex-direction: column; +} + +.metric-content strong { + font-size: 15px; + color: var(--sg-text); + line-height: 1.3; +} + +.metric-content span { + font-size: 12px; + color: var(--sg-text-muted); +} + +.card { + margin-bottom: 24px; + border-color: #d9e2f0 !important; + border-radius: var(--sg-radius-md) !important; +} + +.card ::ng-deep .mat-mdc-card-content { + padding: 0; +} + +.section-header { + display: flex; + align-items: center; + gap: 10px; + padding: 16px 20px 12px; + border-bottom: 1px solid #f0f2f5; +} + +.section-header mat-icon { + color: var(--sg-text-muted); + width: 22px; + height: 22px; + font-size: 22px; +} + +.section-header h2 { + margin: 0; + font-size: 16px; + font-weight: 600; + color: var(--sg-text); +} + +.count-badge { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 24px; + height: 24px; + padding: 0 8px; + margin-left: auto; + background: #e8edf5; + border-radius: 12px; + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 500; +} + +.description-text { + padding: 16px 20px 20px; + margin: 0; + color: var(--sg-text); + font-size: 14px; + line-height: 1.6; +} + +.content-grid { + display: grid; + grid-template-columns: 2fr 1fr; + gap: 24px; +} + +.main-content { + display: flex; + flex-direction: column; + gap: 24px; +} + +.sidebar { + display: flex; + flex-direction: column; + gap: 24px; +} + +.person-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 12px; + padding: 16px 20px 20px; +} + +.person-item { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + transition: all 0.2s; +} + +.person-item:hover { + cursor: pointer; + background: #f8fafc; + border-color: #b8c5d6; +} + +.avatar { + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border-radius: 50%; + background: #e8edf5; + color: var(--sg-text); + font-size: 13px; + font-weight: 600; + flex-shrink: 0; +} + +.person-name { + cursor: pointer; + font-size: 13px; + font-weight: 500; + color: var(--sg-text); +} + +.institution-grid { + cursor: pointer; + display: grid; + grid-template-columns: 1fr; + gap: 8px; + padding: 16px 20px 20px; +} + +.institution-item { + display: flex; + align-items: center; + gap: 10px; + padding: 8px 12px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + font-size: 13px; + color: var(--sg-text); +} + +.institution-item mat-icon { + color: var(--sg-text-muted); + width: 20px; + height: 20px; + font-size: 20px; + flex-shrink: 0; +} + +.details-list { + margin: 0; + padding: 16px 20px 20px; +} + +.detail-row { + display: grid; + grid-template-columns: 140px 1fr; + gap: 12px; + padding: 8px 0; + border-bottom: 1px solid #f0f2f5; +} + +.detail-row:last-child { + border-bottom: none; +} + +.detail-row dt { + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 500; +} + +.detail-row dd { + margin: 0; + color: var(--sg-text); + font-size: 13px; + word-break: break-word; +} + +.external-link { + color: var(--sg-primary, #0066cc); + text-decoration: none; +} + +.external-link:hover { + text-decoration: underline; +} + +.empty-state { + padding: 20px; + text-align: center; + color: var(--sg-text-muted); + font-size: 14px; +} + +.error-container { + display: flex; + align-items: center; + justify-content: center; + min-height: 400px; +} + +.error-state { + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + color: var(--sg-text-muted); +} + +.error-state mat-icon { + width: 48px; + height: 48px; + font-size: 48px; + color: #e74c3c; +} + +.error-state p { + margin: 0; + font-size: 16px; +} + +@media (max-width: 992px) { + .content-grid { + grid-template-columns: 1fr; + gap: 20px; + } +} + +@media (max-width: 768px) { + .detail-page { + padding: 16px; + } + + .page-header { + flex-direction: column; + align-items: flex-start; + gap: 12px; + } + + .project-hero { + padding: 20px; + } + + .metrics-grid { + grid-template-columns: 1fr 1fr; + gap: 12px; + } + + h1 { + font-size: 22px; + } + + .detail-row { + grid-template-columns: 1fr; + gap: 4px; + } + + .person-grid { + grid-template-columns: 1fr; + } +} + +@media (max-width: 480px) { + .metrics-grid { + grid-template-columns: 1fr; + } + + .hero-actions { + flex-direction: column; + } + + .primary-action, + .secondary-action { + width: 100%; + justify-content: center; + } +} diff --git a/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.ts b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.ts new file mode 100644 index 00000000..ab8ca4ea --- /dev/null +++ b/webapp/src/app/modules/person-projects/dfg-details/dfg-details.component.ts @@ -0,0 +1,77 @@ +import { Component, OnInit, inject } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { CommonModule } from '@angular/common'; +import { MatCardModule } from '@angular/material/card'; +import { MatIconModule } from '@angular/material/icon'; +import { DfgProjectDetails } from '../../../api'; +import { Router } from '@angular/router'; +@Component({ + selector: 'app-dfg-details', + standalone: true, + imports: [CommonModule, MatCardModule, MatIconModule], + templateUrl: './dfg-details.component.html', + styleUrl: './dfg-details.component.scss', +}) +export class DfgDetailsComponent implements OnInit { + private route = inject(ActivatedRoute); + dfgProject: DfgProjectDetails | undefined; + + constructor(private router: Router) {} + + ngOnInit(): void { + this.route.data.subscribe(({ dfgSingleProject }) => { + console.log('DFG Project:', dfgSingleProject); + this.dfgProject = dfgSingleProject; + }); + } + + getInitials(name: string | null | undefined): string { + if (!name) return ''; + const parts = name.trim().split(/\s+/); + if (parts.length > 1) { + return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase(); + } + return parts[0][0].toUpperCase(); + } + + getFundingStatus(fundingEndDate: string | null | undefined): string { + if (!fundingEndDate) return 'N/A'; + if (fundingEndDate === '2999') return 'laufend'; + const year = parseInt(fundingEndDate, 10); + if (isNaN(year)) return fundingEndDate; + return year >= new Date().getFullYear() + ? `${fundingEndDate} (laufend)` + : `${fundingEndDate} (abgeschlossen)`; + } + searchForPersonName(personName: string): void { + this.router.navigate(['/persons'], { + queryParams: { + query: personName, + }, + }); + } + searchForInstitutionName(institutionName: string): void { + this.router.navigate(['/institutions'], { + queryParams: { + search: institutionName, + }, + }); + } + /** + * All associated persons as a simple list (no role grouping). + */ + getAssociatedPersons(): string[] { + return this.dfgProject?.associated_persons || []; + } + + /** + * All institutions as a simple list. + */ + getInstitutions(): string[] { + return this.dfgProject?.institutions || []; + } + + goBack(): void { + window.history.back(); + } +} diff --git a/webapp/src/app/modules/person-projects/person-projects.component.html b/webapp/src/app/modules/person-projects/person-projects.component.html new file mode 100644 index 00000000..ed14000b --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.html @@ -0,0 +1,82 @@ +
+
+
Projekte
+

Übersicht der durchgeführten Projekte.

+
+ + + + + + + + + + + + + + +
+ + + + open_in_new + + + + + {{ element.funding_end == '2999' ? 'laufend' : element.funding_end }} + + + +
+
    + @for ( + name of element.names.sort((a, b) => a.localeCompare(b)); + track $index + ) { +
  • + {{ name }} +
  • + } +
+
+
+ + + {{ element.startDate | date: 'dd.MM.yyyy' }} + + + + {{ element.endDate | date: 'dd.MM.yyyy' }} + + + + {{ element.ecMaxContribution | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + + + + + open_in_new + + diff --git a/webapp/src/app/modules/person-projects/person-projects.component.scss b/webapp/src/app/modules/person-projects/person-projects.component.scss new file mode 100644 index 00000000..9bd15288 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.scss @@ -0,0 +1,13 @@ +.person-projects { + padding: 2rem; +} + +.description-container { + display: flex; + flex-direction: column; +} + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} diff --git a/webapp/src/app/modules/person-projects/person-projects.component.ts b/webapp/src/app/modules/person-projects/person-projects.component.ts new file mode 100644 index 00000000..563c00ce --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.ts @@ -0,0 +1,160 @@ +import { + Component, + computed, + effect, + input, + OnInit, + TemplateRef, + viewChild, +} from '@angular/core'; +import { + CordisEuProject, + CordisEuProjectPage, + DfgProjectPage, + DfgProjectSummary, +} from '../../api'; +import { + DataTableComponent, + GenericColumn, +} from '../../shared/ui/data-table/data-table.component'; +import { MatIconModule } from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCardModule } from '@angular/material/card'; +import { MatTabsModule } from '@angular/material/tabs'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { Router, RouterModule } from '@angular/router'; +import { CurrencyPipe, DatePipe } from '@angular/common'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; + +@Component({ + selector: 'app-person-projects', + imports: [ + DataTableComponent, + MatIconModule, + MatButtonModule, + MatCardModule, + MatTabsModule, + MatFormFieldModule, + MatInputModule, + RouterModule, + DatePipe, + CurrencyPipe, + QueryParamPaginatorComponent, + QueryParamInputComponent, + ], + templateUrl: './person-projects.component.html', + styleUrl: './person-projects.component.scss', +}) +export class PersonProjectsComponent implements OnInit { + dfgProjectPage = input.required(); + dfgProjectColumns: GenericColumn[] = []; + dfgProjectData: DfgProjectSummary[] = []; + + dfgProjectFundingEndTmp = viewChild.required>( + 'dfgProjectFundingEndTmp', + ); + dfgProjectActionsTmp = viewChild.required>( + 'dfgProjectActionsTmp', + ); + dfgProjectDetailRowTmp = viewChild.required>( + 'dfgProjectDetailRowTmp', + ); + + personCordisEuProjectPage = input.required(); + personCordisEuProjectColumns: GenericColumn[] = []; + personCordisEuProjectData: CordisEuProject[] = []; + + euProjectsFundingStartTmp = viewChild.required>( + 'euProjectsFundingStartTmp', + ); + euProjectsFundingEndTmp = viewChild.required>( + 'euProjectsFundingEndTmp', + ); + euProjectsFundingAmountTmp = viewChild.required>( + 'euProjectsFundingAmountTmp', + ); + euProjectsActionsTmp = viewChild.required>( + 'euProjectsActionsTmp', + ); + + readonly pageTotal = computed(() => { + return this.dfgProjectPage()?.total ?? 0; + }); + + constructor(private readonly router: Router) { + effect(() => { + this.dfgProjectData = this.dfgProjectPage().elements || []; + }); + + effect(() => { + this.personCordisEuProjectData = + this.personCordisEuProjectPage().elements || []; + }); + } + + ngOnInit(): void { + this.dfgProjectColumns = [ + { id: 'title', header: 'Titel', type: 'accessor', accessorKey: 'title' }, + { + id: 'funding_start', + header: 'Förderbeginn', + type: 'accessor', + accessorKey: 'funding_start', + }, + { + id: 'funding_end', + header: 'Förderende', + type: 'accessor', + accessorKey: 'funding_end', + cellTemplate: this.dfgProjectFundingEndTmp(), + }, + { + id: 'professional_classification', + header: 'Fachliche Zuordnung', + type: 'accessor', + accessorKey: 'professional_classification', + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.dfgProjectActionsTmp(), + }, + ]; + + this.personCordisEuProjectColumns = [ + { + id: 'title', + header: 'Titel', + type: 'accessor', + accessorKey: 'title', + }, + { + id: 'startDate', + header: 'Startdatum', + type: 'display', + cellTemplate: this.euProjectsFundingStartTmp(), + }, + { + id: 'endDate', + header: 'Enddatum', + type: 'display', + cellTemplate: this.euProjectsFundingEndTmp(), + }, + { + id: 'ecMaxContribution', + header: 'Förderbetrag (EU)', + type: 'display', + cellTemplate: this.euProjectsFundingAmountTmp(), + }, + { + id: 'actions', + header: '', + type: 'display', + cellTemplate: this.euProjectsActionsTmp(), + }, + ]; + } +} diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index 96c5df8d..6da7971d 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -1,17 +1,16 @@
-
-
-
Publikationen
-

Übersicht der wissenschaftlichen Veröffentlichungen.

-
+
+
Publikationen
+

Übersicht der wissenschaftlichen Veröffentlichungen.

+
+
- Jahr + (selectionChange)="applyFilters()"> @for (year of publicationYearOptions; track year) { {{ year }} } @@ -19,12 +18,11 @@ - Typ + (selectionChange)="applyFilters()"> @for (type of typeOptions; track type.value) { {{ type.label }} } @@ -32,12 +30,11 @@ - Sprache + (selectionChange)="applyFilters()"> @for (language of languageOptions; track language.value) { {{ language.label @@ -46,11 +43,101 @@ -
+ + @if (selectedInstitutions.length || selectedTopics.length) { +
+ @for (institution of selectedInstitutions; track institution.id) { + + {{ institution.display_name }} + + + } + @for (topic of selectedTopics; track topic.id) { + + {{ topic.display_name }} + + + } +
+ }
@@ -64,21 +151,18 @@ Titel - @if (doiUrl(publication.doi); as url) { - - {{ publication.title || "Ohne Titel" }} - - } @else { -
{{ publication.title || "Ohne Titel" }}
- } -
Becker, A.; Müller, T.; Zhang, L.
+ + {{ publication.title || 'Ohne Titel' }} +
Jahr - {{ publication.publication_year || "-" }} + {{ publication.publication_year || '-' }} @@ -98,7 +182,33 @@ Sprache / Quelle - {{ publication.language || "-" }} + {{ publication.language || '-' }} + + + + + Institutionen + + @let publicationInstitutions = institutions(publication); +
+ @for ( + institution of publicationInstitutions.slice(0, 3); + track institution.id + ) { + + {{ institution.name }} + + } @empty { + - + } + @if (publicationInstitutions.length > 3) { + + +{{ publicationInstitutions.length - 3 }} + + } +
@@ -112,14 +222,20 @@ Themen + @let publicationTopics = publication.topics ?? [];
- @for (topic of (publication.topics ?? []).slice(0, 3); track topic.id) { - + @for (topic of publicationTopics.slice(0, 3); track topic.id) { + {{ topic.display_name }} - + } @empty { - } + @if (publicationTopics.length > 3) { + + +{{ publicationTopics.length - 3 }} + + }
@@ -140,8 +256,7 @@ [pageIndex]="currentPageIndex" [pageSize]="paginationService.selection" [pageSizeOptions]="paginationService.options" - (page)="onPage($event)" - > + (page)="onPage($event)">
diff --git a/webapp/src/app/modules/person-publications/person-publications.component.scss b/webapp/src/app/modules/person-publications/person-publications.component.scss index 0f05c502..e6d4fe76 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.scss +++ b/webapp/src/app/modules/person-publications/person-publications.component.scss @@ -6,10 +6,10 @@ .section-heading { display: flex; - align-items: flex-start; + align-items: center; justify-content: space-between; - gap: 24px; - margin-bottom: 22px; + gap: 18px; + margin-bottom: 18px; } h2 { @@ -25,11 +25,20 @@ h2 { font-size: 14px; } +.publication-filter-stack { + display: flex; + align-items: flex-start; + flex-direction: column; + gap: 8px; + padding-top: 10px; + padding-bottom: 25px; +} + .publication-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; - align-items: flex-start; + align-items: center; gap: 10px; } @@ -37,17 +46,117 @@ h2 { width: 150px; } -.publication-filters button { +.publication-filters .institution-filter, +.publication-filters .topic-filter { + width: 320px; +} + +.publication-filters .reset-filter-btn { + min-width: 132px; height: 42px; - border-color: var(--sg-border); + padding: 0 14px; + border-color: #d9e2f0; border-radius: var(--sg-radius-sm); color: var(--sg-text); + background: #fff; +} + +.publication-filters .reset-filter-btn mat-icon { + margin-right: 6px; + width: 20px; + height: 20px; + font-size: 20px; } ::ng-deep .publication-filters .mat-mdc-form-field-subscript-wrapper { display: none; } +::ng-deep .publication-filters .mat-mdc-text-field-wrapper { + height: 42px; + background: #fff; + border-radius: var(--sg-radius-sm); +} + +::ng-deep .publication-filters .mat-mdc-form-field-infix { + min-height: 42px; + padding-top: 11px; + padding-bottom: 9px; +} + +::ng-deep .publication-filters .mdc-notched-outline__leading, +::ng-deep .publication-filters .mdc-notched-outline__notch, +::ng-deep .publication-filters .mdc-notched-outline__trailing { + border-color: #d9e2f0; +} + +::ng-deep .publication-filters .mat-mdc-select-value, +::ng-deep .publication-filters input.mat-mdc-input-element { + color: var(--sg-text); + font-size: 14px; +} + +::ng-deep .publication-filters .mat-mdc-select-placeholder, +::ng-deep .publication-filters input.mat-mdc-input-element::placeholder { + color: var(--sg-text-muted); + opacity: 1; + font-size: 14px; +} + +::ng-deep .publication-filters .mat-mdc-form-field-icon-suffix, +::ng-deep .publication-filters .mat-mdc-select-arrow-wrapper { + transform: none; +} + +::ng-deep .mat-mdc-option small { + display: block; + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.2; +} + +.selected-filter-chips { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: 6px; + max-width: 900px; + margin: 0; +} + +.selected-filter-chip { + display: inline-flex; + align-items: center; + max-width: 320px; + min-height: 26px; + padding: 3px 4px 3px 9px; + border: 1px solid #d9e2f0; + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + font-size: 11px; + line-height: 1.2; +} + +.selected-filter-chip button { + display: inline-grid; + place-items: center; + width: 20px; + height: 20px; + margin-left: 3px; + padding: 0; + border: 0; + background: transparent; + color: var(--sg-text-muted); + cursor: pointer; +} + +.selected-filter-chip mat-icon { + width: 14px; + height: 14px; + font-size: 14px; +} + .table-wrap { position: relative; overflow-x: auto; @@ -55,7 +164,7 @@ h2 { table { width: 100%; - min-width: 980px; + min-width: 1120px; border-collapse: separate; border-spacing: 0 10px; overflow: hidden; @@ -111,6 +220,63 @@ a.title:hover { max-width: 320px; } +.publication-topic-tag, +.publication-topic-more { + display: inline-flex; + align-items: center; + max-width: 180px; + min-height: 24px; + padding: 3px 8px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + font-size: 11px; + line-height: 1.2; +} + +.publication-topic-tag { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.publication-topic-more { + color: var(--sg-text-muted); +} + +.institution-tags { + display: flex; + flex-wrap: wrap; + gap: 6px; + max-width: 280px; +} + +.publication-institution-tag, +.publication-institution-more { + display: inline-flex; + align-items: center; + max-width: 180px; + min-height: 24px; + padding: 3px 8px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + font-size: 11px; + line-height: 1.2; +} + +.publication-institution-tag { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.publication-institution-more { + color: var(--sg-text-muted); +} + ::ng-deep .mat-mdc-header-cell { color: var(--sg-text-muted); font-size: 12px; @@ -155,12 +321,27 @@ mat-paginator { flex-direction: column; } + .publication-filter-stack { + align-items: stretch; + } + .publication-filters { justify-content: stretch; + max-width: none; } .publication-filters mat-form-field, .publication-filters button { width: 100%; } + + .publication-filters .institution-filter, + .publication-filters .topic-filter { + width: 100%; + } + + .selected-filter-chips { + justify-content: flex-start; + max-width: none; + } } diff --git a/webapp/src/app/modules/person-publications/person-publications.component.ts b/webapp/src/app/modules/person-publications/person-publications.component.ts index 1350a65b..8ab1923f 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.ts +++ b/webapp/src/app/modules/person-publications/person-publications.component.ts @@ -1,6 +1,17 @@ -import { Component, OnInit, ViewChild } from '@angular/core'; +import { + Component, + DestroyRef, + OnInit, + ViewChild, + inject, +} from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, ParamMap, Router, RouterLink } from '@angular/router'; +import { + MatAutocompleteModule, + MatAutocompleteSelectedEvent, +} from '@angular/material/autocomplete'; import { MatIconModule } from '@angular/material/icon'; import { MatPaginator, @@ -12,46 +23,115 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { + catchError, + combineLatest, + debounceTime, + distinctUntilChanged, + finalize, + map, + of, + switchMap, +} from 'rxjs'; import { Work, WorksService } from '../../api'; import { PaginationService } from '../../shared/services/pagination.service'; import { createLoadError } from '../../shared/utils/errorHandler'; import { ChipComponent } from '../../shared/ui/chip/chip.component'; +interface InstitutionAutocompleteOption { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; +} + +interface InstitutionAutocompleteResponse { + results?: InstitutionAutocompleteOption[] | null; +} + +interface TopicAutocompleteOption { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; +} + +interface TopicAutocompleteResponse { + results?: TopicAutocompleteOption[] | null; +} + +interface PublicationFilterQueryState { + pageIndex: number; + pageSize: number; + publicationYears: number[]; + types: string[]; + languages: string[]; + institutions: InstitutionAutocompleteOption[]; + topics: TopicAutocompleteOption[]; +} + @Component({ selector: 'app-person-publications', imports: [ MatButtonModule, + MatAutocompleteModule, ChipComponent, MatIconModule, MatFormFieldModule, + MatInputModule, MatPaginatorModule, MatProgressSpinnerModule, MatSelectModule, MatSnackBarModule, MatTableModule, ReactiveFormsModule, + RouterLink, ], templateUrl: './person-publications.component.html', styleUrl: './person-publications.component.scss', }) export class PersonPublicationsComponent implements OnInit { @ViewChild(MatPaginator) paginator?: MatPaginator; + private readonly destroyRef = inject(DestroyRef); displayedColumns: string[] = [ 'title', 'type', 'year', 'language', + 'institutions', 'topics', 'citations', ]; publications: Work[] = []; total = 0; loading = false; + institutionLookupLoading = false; + topicLookupLoading = false; authorId = ''; currentPageIndex = 0; + institutionOptions: InstitutionAutocompleteOption[] = []; + selectedInstitutions: InstitutionAutocompleteOption[] = []; + topicOptions: TopicAutocompleteOption[] = []; + selectedTopics: TopicAutocompleteOption[] = []; + readonly institutionSearchControl = new FormControl< + string | InstitutionAutocompleteOption + >('', { nonNullable: true }); + readonly topicSearchControl = new FormControl< + string | TopicAutocompleteOption + >('', { + nonNullable: true, + }); readonly filterForm = new FormGroup({ publicationYears: new FormControl([], { nonNullable: true }), @@ -61,6 +141,18 @@ export class PersonPublicationsComponent implements OnInit { readonly publicationYearOptions = this.createPublicationYearOptions(); + private readonly queryParamKeys = { + page: 'publicationPage', + pageSize: 'publicationPageSize', + years: 'publicationYear', + types: 'publicationType', + languages: 'publicationLanguage', + institutionIds: 'publicationInstitutionId', + institutionNames: 'publicationInstitutionName', + topicIds: 'publicationTopicId', + topicNames: 'publicationTopicName', + } as const; + readonly typeOptions = [ { value: 'article', label: 'article' }, { value: 'book', label: 'book' }, @@ -90,16 +182,28 @@ export class PersonPublicationsComponent implements OnInit { constructor( private readonly route: ActivatedRoute, + private readonly router: Router, private readonly workService: WorksService, + private readonly httpClient: HttpClient, public readonly paginationService: PaginationService, private readonly snackBar: MatSnackBar, ) {} ngOnInit(): void { - this.route.parent?.paramMap.subscribe((params) => { - this.authorId = params.get('id') ?? ''; - this.resetAndLoad(); - }); + this.setupInstitutionAutocomplete(); + this.setupTopicAutocomplete(); + + const parentParamMap = this.route.parent?.paramMap; + if (!parentParamMap) return; + + combineLatest([parentParamMap, this.route.queryParamMap]) + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(([params, queryParams]) => { + this.authorId = params.get('id') ?? ''; + const queryState = this.parsePublicationFilterQueryParams(queryParams); + this.applyPublicationFilterQueryState(queryState); + this.load(queryState.pageIndex, queryState.pageSize); + }); } load(pageIndex = 0, pageSize = this.paginationService.selection): void { @@ -116,6 +220,8 @@ export class PersonPublicationsComponent implements OnInit { this.filters().publicationYears, this.filters().types, this.filters().languages, + this.selectedInstitutionIds(), + this.selectedTopicIds(), ) .subscribe({ next: (page) => { @@ -137,13 +243,19 @@ export class PersonPublicationsComponent implements OnInit { onPage(event: PageEvent): void { this.paginationService.selection = event.pageSize; this.currentPageIndex = event.pageIndex; - this.load(event.pageIndex, event.pageSize); + this.updatePublicationFilterQueryParams({ + [this.queryParamKeys.page]: event.pageIndex + 1, + [this.queryParamKeys.pageSize]: event.pageSize, + }); } - resetAndLoad(): void { + applyFilters(): void { this.currentPageIndex = 0; this.paginator?.firstPage(); - this.load(0, this.paginationService.selection); + this.updatePublicationFilterQueryParams({ + [this.queryParamKeys.page]: 1, + [this.queryParamKeys.pageSize]: this.paginationService.selection, + }); } clearFilters(): void { @@ -152,7 +264,67 @@ export class PersonPublicationsComponent implements OnInit { types: [], languages: [], }); - this.resetAndLoad(); + this.selectedInstitutions = []; + this.selectedTopics = []; + this.institutionOptions = []; + this.topicOptions = []; + this.institutionSearchControl.setValue('', { emitEvent: false }); + this.topicSearchControl.setValue('', { emitEvent: false }); + this.updatePublicationFilterQueryParams({ + [this.queryParamKeys.page]: 1, + [this.queryParamKeys.pageSize]: this.paginationService.selection, + [this.queryParamKeys.years]: null, + [this.queryParamKeys.types]: null, + [this.queryParamKeys.languages]: null, + [this.queryParamKeys.institutionIds]: null, + [this.queryParamKeys.institutionNames]: null, + [this.queryParamKeys.topicIds]: null, + [this.queryParamKeys.topicNames]: null, + }); + } + + displayInstitution(option: string | InstitutionAutocompleteOption): string { + return typeof option === 'string' ? option : (option.display_name ?? ''); + } + + selectInstitution(event: MatAutocompleteSelectedEvent): void { + const institution = event.option.value as InstitutionAutocompleteOption; + if (!institution.id) return; + if (!this.selectedInstitutions.some((item) => item.id === institution.id)) { + this.selectedInstitutions = [...this.selectedInstitutions, institution]; + this.applyFilters(); + } + this.institutionSearchControl.setValue('', { emitEvent: false }); + this.institutionOptions = []; + } + + removeInstitution(institution: InstitutionAutocompleteOption): void { + this.selectedInstitutions = this.selectedInstitutions.filter( + (item) => item.id !== institution.id, + ); + this.applyFilters(); + } + + displayTopic(option: string | TopicAutocompleteOption): string { + return typeof option === 'string' ? option : (option.display_name ?? ''); + } + + selectTopic(event: MatAutocompleteSelectedEvent): void { + const topic = event.option.value as TopicAutocompleteOption; + if (!topic.id) return; + if (!this.selectedTopics.some((item) => item.id === topic.id)) { + this.selectedTopics = [...this.selectedTopics, topic]; + this.applyFilters(); + } + this.topicSearchControl.setValue('', { emitEvent: false }); + this.topicOptions = []; + } + + removeTopic(topic: TopicAutocompleteOption): void { + this.selectedTopics = this.selectedTopics.filter( + (item) => item.id !== topic.id, + ); + this.applyFilters(); } doiUrl(doi: string | null | undefined): string | null { @@ -160,6 +332,12 @@ export class PersonPublicationsComponent implements OnInit { return doi.startsWith('http') ? doi : `https://doi.org/${doi}`; } + publicationKey(publication: Work): string { + const id = + publication.id ?? publication.ids?.openalex ?? publication.doi ?? ''; + return id.split('/').filter(Boolean).pop() ?? id; + } + publicationRange(): string { if (this.total === 0 || this.publications.length === 0) { return 'Keine Publikationen'; @@ -175,6 +353,24 @@ export class PersonPublicationsComponent implements OnInit { return 'info'; } + institutions(publication: Work): Array<{ id: string; name: string }> { + const institutionsById = new Map(); + + for (const authorship of publication.authorships ?? []) { + for (const institution of authorship.institutions ?? []) { + if (!institution.id || !institution.display_name) continue; + if (!institutionsById.has(institution.id)) { + institutionsById.set(institution.id, { + id: institution.id, + name: institution.display_name, + }); + } + } + } + + return Array.from(institutionsById.values()); + } + private filters() { return { publicationYears: this.filterForm.controls.publicationYears.value, @@ -183,6 +379,218 @@ export class PersonPublicationsComponent implements OnInit { }; } + private setupInstitutionAutocomplete(): void { + this.institutionSearchControl.valueChanges + .pipe( + debounceTime(250), + map((value) => (typeof value === 'string' ? value.trim() : '')), + distinctUntilChanged(), + switchMap((query) => { + if (query.length < 2) { + this.institutionOptions = []; + return of([]); + } + this.institutionLookupLoading = true; + return this.searchInstitutions(query).pipe( + catchError(() => of([])), + finalize(() => { + this.institutionLookupLoading = false; + }), + ); + }), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((options) => { + const selectedIds = new Set(this.selectedInstitutionIds()); + this.institutionOptions = options.filter( + (option) => !!option.id && !selectedIds.has(option.id), + ); + }); + } + + private setupTopicAutocomplete(): void { + this.topicSearchControl.valueChanges + .pipe( + debounceTime(250), + map((value) => (typeof value === 'string' ? value.trim() : '')), + distinctUntilChanged(), + switchMap((query) => { + if (query.length < 2) { + this.topicOptions = []; + return of([]); + } + this.topicLookupLoading = true; + return this.searchTopics(query).pipe( + catchError(() => of([])), + finalize(() => { + this.topicLookupLoading = false; + }), + ); + }), + takeUntilDestroyed(this.destroyRef), + ) + .subscribe((options) => { + const selectedIds = new Set(this.selectedTopicIds()); + this.topicOptions = options.filter( + (option) => !!option.id && !selectedIds.has(option.id), + ); + }); + } + + private searchInstitutions(query: string) { + const params = new HttpParams().set('query', query).set('limit', '10'); + + const basePath = this.workService.configuration.basePath ?? ''; + return this.httpClient + .get( + `${basePath}/api/institutions/autocomplete`, + { + params, + }, + ) + .pipe(map((response) => response.results ?? [])); + } + + private searchTopics(query: string) { + const params = new HttpParams().set('query', query).set('limit', '10'); + + const basePath = this.workService.configuration.basePath ?? ''; + return this.httpClient + .get(`${basePath}/api/topics/autocomplete`, { + params, + }) + .pipe(map((response) => response.results ?? [])); + } + + private selectedInstitutionIds(): string[] { + return this.selectedInstitutions + .map((institution) => institution.id) + .filter((id): id is string => !!id); + } + + private selectedTopicIds(): string[] { + return this.selectedTopics + .map((topic) => topic.id) + .filter((id): id is string => !!id); + } + + private updatePublicationFilterQueryParams( + overrides: Record | null>, + ): void { + const filters = this.filters(); + const institutionIds = this.selectedInstitutionIds(); + const institutionNames = this.selectedInstitutions + .map((institution) => institution.display_name) + .filter((name): name is string => !!name); + const topicIds = this.selectedTopicIds(); + const topicNames = this.selectedTopics + .map((topic) => topic.display_name) + .filter((name): name is string => !!name); + + void this.router.navigate([], { + relativeTo: this.route, + queryParams: { + [this.queryParamKeys.years]: filters.publicationYears.length + ? filters.publicationYears + : null, + [this.queryParamKeys.types]: filters.types.length + ? filters.types + : null, + [this.queryParamKeys.languages]: filters.languages.length + ? filters.languages + : null, + [this.queryParamKeys.institutionIds]: institutionIds.length + ? institutionIds + : null, + [this.queryParamKeys.institutionNames]: institutionNames.length + ? institutionNames + : null, + [this.queryParamKeys.topicIds]: topicIds.length ? topicIds : null, + [this.queryParamKeys.topicNames]: topicNames.length ? topicNames : null, + ...overrides, + }, + queryParamsHandling: 'merge', + }); + } + + private parsePublicationFilterQueryParams( + queryParams: ParamMap, + ): PublicationFilterQueryState { + const institutionIds = queryParams.getAll( + this.queryParamKeys.institutionIds, + ); + const institutionNames = queryParams.getAll( + this.queryParamKeys.institutionNames, + ); + const topicIds = queryParams.getAll(this.queryParamKeys.topicIds); + const topicNames = queryParams.getAll(this.queryParamKeys.topicNames); + + return { + pageIndex: + this.parsePositiveInteger( + queryParams.get(this.queryParamKeys.page), + 1, + ) - 1, + pageSize: this.parsePositiveInteger( + queryParams.get(this.queryParamKeys.pageSize), + this.paginationService.selection, + ), + publicationYears: this.parseNumberParams( + queryParams.getAll(this.queryParamKeys.years), + ), + types: this.parseStringParams( + queryParams.getAll(this.queryParamKeys.types), + ), + languages: this.parseStringParams( + queryParams.getAll(this.queryParamKeys.languages), + ), + institutions: institutionIds.filter(Boolean).map((id, index) => ({ + id, + display_name: institutionNames[index] || id, + })), + topics: topicIds.filter(Boolean).map((id, index) => ({ + id, + display_name: topicNames[index] || id, + })), + }; + } + + private applyPublicationFilterQueryState( + queryState: PublicationFilterQueryState, + ): void { + this.currentPageIndex = queryState.pageIndex; + this.paginationService.selection = queryState.pageSize; + this.selectedInstitutions = queryState.institutions; + this.selectedTopics = queryState.topics; + this.filterForm.setValue( + { + publicationYears: queryState.publicationYears, + types: queryState.types, + languages: queryState.languages, + }, + { emitEvent: false }, + ); + } + + private parseStringParams(values: string[]): string[] { + return values.map((value) => value.trim()).filter(Boolean); + } + + private parseNumberParams(values: string[]): number[] { + return values + .map((value) => Number(value)) + .filter((value) => Number.isInteger(value)); + } + + private parsePositiveInteger(value: string | null, fallback: number): number { + const parsedValue = Number(value); + if (!Number.isInteger(parsedValue) || parsedValue < 1) { + return fallback; + } + + return parsedValue; + } + private createPublicationYearOptions(): number[] { const currentYear = new Date().getFullYear(); return Array.from({ length: 90 }, (_, index) => currentYear - index); diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index a5245a5e..0dea7f11 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -1,84 +1,116 @@ -@if (!isPersonLoading()){ - - -
-
-
{{ initials() }}
-
-
- Person -

{{ displayName() }}

-
-

{{ institution() }}

- @if (countryCode()) { - {{ countryCode() }} - } - @if (worksCount() !== null || citedByCount() !== null) { - - @if (worksCount() !== null) { - {{ worksCount() }} Publikationen - } - @if (worksCount() !== null && citedByCount() !== null) { - · - } - @if (citedByCount() !== null) { - {{ citedByCount() }} Zitationen - } - - } -
-
-
- mail - uni-email@uni-due.de -
- - @if (openAlexId()) { -
- person - {{ openAlexId() }} +@if (!isPersonLoading()) { +
+
+
{{ initials() }}
+
+
+ Person +

{{ displayName() }}

- } - - @if (orcid()) { -
- verified - {{ orcid() }} +

{{ institution() }}

+ @if (countryCode()) { + {{ countryCode() }} + } + @if (worksCount() !== null || citedByCount() !== null) { + + @if (worksCount() !== null) { + {{ worksCount() }} Publikationen + } + @if (worksCount() !== null && citedByCount() !== null) { + · + } + @if (citedByCount() !== null) { + {{ citedByCount() }} Zitationen + } + + + @if (h_index() !== null) { + h_index: {{ h_index() }} + } + + } + @if (displayCareerStage()) { +
+ Career Stage: + + {{ displayCareerStage() }} + +
+ }
- } -
- language - - ude.de/anna-becker - +
+
+ mail + uni-email@uni-due.de +
+ @if (orcid()) { +
+ verified + {{ + orcid() + }} +
+ } +
-
- - -
- + + +
+ } @else { -
- -
+
+ + Person wird geladen... + +
} - - \ No newline at end of file + @if (isNetworkResolving()) { + + } @else { + + } + diff --git a/webapp/src/app/modules/person/person.component.scss b/webapp/src/app/modules/person/person.component.scss index 2e5d744b..e232d508 100644 --- a/webapp/src/app/modules/person/person.component.scss +++ b/webapp/src/app/modules/person/person.component.scss @@ -7,8 +7,8 @@ display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 500px); grid-template-areas: - "profile bio" - "interesting bio"; + 'profile bio' + 'interesting bio'; align-items: start; gap: 24px 40px; padding: 28px 32px 24px; @@ -35,7 +35,11 @@ height: 112px; border-radius: 50%; background: - radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.78), transparent 34%), + radial-gradient( + circle at 50% 30%, + rgba(255, 255, 255, 0.78), + transparent 34% + ), linear-gradient(145deg, #c8d9ff, #f7faff 48%, #88a9ee); border: 1px solid var(--sg-border); box-shadow: var(--sg-shadow-sm); @@ -81,6 +85,33 @@ font-size: 13px; } +.career-stage-line { + display: flex; + align-items: center; + gap: 8px; + color: var(--sg-text-muted); + font-size: 13px; +} + +.career-stage-label { + color: var(--sg-text-muted); +} + +.career-stage-chip { + display: inline-flex; + align-items: center; + min-height: 24px; + padding: 2px 10px; + border: 1px solid var(--sg-border); + border-radius: 999px; + background: var(--sg-surface-muted); + color: var(--sg-primary); + font-size: 13px; + font-weight: 600; + line-height: 1.2; + cursor: help; +} + .profile-contact { display: grid; gap: 16px; @@ -181,11 +212,11 @@ .person-hero { grid-template-columns: 1fr; grid-template-areas: - "profile" - "bio" - "interesting"; + 'profile' + 'bio' + 'interesting'; } - + .sidebar { height: auto; } @@ -220,3 +251,44 @@ overflow-x: auto; } } + +.loading-container { + display: flex; + flex-direction: column; + align-items: center; + gap: 16px; + padding: 48px 0; +} + +.spinner-container { + --spinner-size: 60px; + + position: relative; + width: var(--spinner-size); + height: var(--spinner-size); +} + +.spinner-icon { + position: absolute; + inset: 0; + margin: auto; + + font-size: calc(var(--spinner-size) * 0.4); + width: calc(var(--spinner-size) * 0.4); + height: calc(var(--spinner-size) * 0.4); + + animation: pulse 1.2s ease-in-out infinite; +} + +@keyframes pulse { + 0%, + 100% { + transform: scale(1); + opacity: 1; + } + + 50% { + transform: scale(1.2); + opacity: 0.7; + } +} diff --git a/webapp/src/app/modules/person/person.component.ts b/webapp/src/app/modules/person/person.component.ts index f8b61e2c..866762e7 100644 --- a/webapp/src/app/modules/person/person.component.ts +++ b/webapp/src/app/modules/person/person.component.ts @@ -1,91 +1,117 @@ import { Component, computed, inject, signal, DestroyRef } from '@angular/core'; -import { toSignal, toObservable } from '@angular/core/rxjs-interop'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { + toSignal, + toObservable, + takeUntilDestroyed, +} from '@angular/core/rxjs-interop'; import { MatIconModule } from '@angular/material/icon'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { MatTabsModule } from '@angular/material/tabs'; -import { ActivatedRoute, RouterModule, RouterOutlet } from '@angular/router'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { + ActivatedRoute, + ResolveEnd, + ResolveStart, + Router, + RouterEvent, + RouterModule, + RouterOutlet, +} from '@angular/router'; import { of, switchMap, finalize, map, catchError } from 'rxjs'; import { PersonInterestingComponent } from '../person-interesting/person-interesting.component'; -import { PersonsService } from '../../api'; - -const PERSON_INCLUDE_TAGS = - 'topics_full,topic_share,summary_stats,ids,last_known_institutions,' + - 'sources,counts_by_year,works_api_url,dates,cited_by_count_boost'; +import { WorksService } from '../../api'; +import { LoadingComponent } from '../../shared/ui/loading/loading.component'; +import { PersonBioResolved } from '../../resolvers/person-bio.resolver'; @Component({ selector: 'app-person', imports: [ MatIconModule, MatTabsModule, + MatTooltipModule, PersonInterestingComponent, RouterOutlet, RouterModule, MatProgressSpinner, + LoadingComponent, ], templateUrl: './person.component.html', styleUrl: './person.component.scss', }) export class PersonComponent { - private route = inject(ActivatedRoute); - private readonly personsApi = inject(PersonsService); + private readonly router = inject(Router); + private readonly activatedRoute = inject(ActivatedRoute); + + private readonly worksApi = inject(WorksService); private readonly destroyRef = inject(DestroyRef); - + readonly params = toSignal(this.activatedRoute.paramMap); + readonly routerEvents = toSignal(this.router.events); + + readonly currentUrl = computed(() => this.router.url); + // derive authorID directly from route private readonly authorId = toSignal( - this.route.paramMap.pipe( + this.activatedRoute.paramMap.pipe( map((params) => params.get('id') ?? null), - takeUntilDestroyed(this.destroyRef) - ) + takeUntilDestroyed(this.destroyRef), + ), ); - // loading states + readonly isNetworkResolving = computed(() => { + const event = this.routerEvents(); + + if ( + !(event instanceof RouterEvent) || + !this.isResolverEvent(event) || + !this.isNetworkRouterEvent(event) + ) { + return false; + } + + if (event instanceof ResolveStart) { + return true; + } + + return false; + }); + + isResolverEvent(event: RouterEvent): boolean { + return event instanceof ResolveStart || event instanceof ResolveEnd; + } + + isNetworkRouterEvent(event: RouterEvent): boolean { + return event.url.startsWith(`/person/${this.authorId()}/network`); + } + readonly isPersonLoading = signal(false); readonly isBioLoading = signal(false); readonly person = toSignal( - toObservable(this.authorId).pipe( - switchMap((id) => { - if (!id) return of(null); - this.isPersonLoading.set(true); - return this.personsApi.searchPersons(id, PERSON_INCLUDE_TAGS).pipe( - map((result) => result.results?.[0] ?? null), - catchError((err) => { - console.error('Failed to load person:', err); - return of(null); - }), - finalize(() => this.isPersonLoading.set(false)) - ); - }) + this.activatedRoute.data.pipe( + map(({ personData }) => { + return personData?.results[0] ?? null; + }), ), - { initialValue: null } + { initialValue: null }, ); - // bio data -readonly personBio = toSignal( - toObservable(this.authorId).pipe( - switchMap((id) => { - if (!id) { - this.isBioLoading.set(false); - return of(null); - } - this.isBioLoading.set(true); - return this.personsApi.generatePersonBio(id).pipe( - map((result) => { - this.isBioLoading.set(false); - return result.bio ?? null; - }), - catchError((err) => { - console.error('Failed to load bio:', err); + + readonly personBio = toSignal( + this.activatedRoute.data.pipe( + switchMap((data) => { + const resolved = data['personBio'] as PersonBioResolved | undefined; + if (!resolved) { this.isBioLoading.set(false); return of(null); - }) - ); - }) - ), - { initialValue: null } -); + } + this.isBioLoading.set(true); + return resolved.bio$.pipe(finalize(() => this.isBioLoading.set(false))); + }), + ), + { initialValue: null }, + ); + readonly displayName = computed( () => this.person()?.display_name ?? 'Unbekannte Person', ); @@ -93,14 +119,65 @@ readonly personBio = toSignal( readonly primaryAffiliation = computed( () => this.person()?.affiliations?.[0] ?? null, ); + readonly lastAffiliation = computed(() => { + const affiliations = this.person()?.affiliations ?? []; + let newestAffiliation = affiliations[0] ?? null; + let newestYear = -1; + + for (const affiliation of affiliations) { + for (const jahr of affiliation.years ?? []) { + if (jahr > newestYear) { + newestYear = jahr; + newestAffiliation = affiliation; + } + } + } + + return newestAffiliation; + }); readonly institution = computed( - () => this.primaryAffiliation()?.institution?.display_name ?? 'Unbekannte Institution', + () => + this.lastAffiliation()?.institution?.display_name ?? + 'Unbekannte Institution', ); readonly countryCode = computed( - () => this.primaryAffiliation()?.institution?.country_code ?? null, + () => this.lastAffiliation()?.institution?.country_code ?? null, ); readonly worksCount = computed(() => this.person()?.works_count ?? null); readonly citedByCount = computed(() => this.person()?.cited_by_count ?? null); + readonly h_index = computed( + () => this.person()?.summary_stats?.h_index ?? null, + ); + readonly displayCareerStage = computed(() => { + const stage = this.person()?.career_metrics?.career_stage; + + if (!stage || stage === 'unknown') { + return null; + } + + return stage; + }); + readonly careerStageTooltip = computed(() => { + const stage = this.displayCareerStage(); + if (!stage) { + return ''; + } + + const activeYears = this.person()?.career_metrics?.active_years ?? '-'; + + return [ + `Aktuell: ${stage.replace(' Researcher', '')}`, + `Aktive Publikationsjahre: ${activeYears}`, + '', + 'Einteilung:', + 'Early: 1\u20134 aktive Publikationsjahre', + 'Emerging: 5\u20139 aktive Publikationsjahre', + 'Established: 10\u201314 aktive Publikationsjahre', + 'Senior: ab 15 aktiven Publikationsjahren', + '', + 'Diese Einschätzung basiert ausschließlich auf OpenAlex-Publikationsdaten und ist kein offizieller akademischer Status.', + ].join('\n'); + }); readonly orcid = computed(() => { const rawOrcid = this.getId('orcid'); if (!rawOrcid) { @@ -112,20 +189,57 @@ 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 ?? [], + readonly primaryTopicCounts = toSignal( + toObservable(this.authorId).pipe( + switchMap((id) => { + if (!id) return of([]); + return this.worksApi.getPrimaryTopicCountsByAuthor(id).pipe( + catchError((err) => { + console.error('Failed to load primary topic counts:', err); + return of([]); + }), + ); + }), + ), + { initialValue: [] }, ); + links = [ { label: 'Übersicht', path: 'overview', disabled: false }, - { label: 'Projekte', path: 'projects', disabled: true }, + { + label: 'Projekte', + path: 'projects', + queryParams: { + page: 0, + size: 10, + sort_by: 'title', + sort_direction: 'asc', + search: '', + }, + disabled: false, + }, { label: 'Publikationen', path: 'publications', disabled: false }, { label: 'Netzwerk', path: 'network', disabled: false }, - { label: 'Gründungen', path: 'foundings', disabled: true }, + { label: 'Unternehmen', path: 'company-connections', disabled: false }, { label: 'Förderungen', path: 'funding', disabled: false }, + { label: 'Nachrichten', path: 'news', disabled: false }, + { label: 'Patente', path: 'patents', disabled: false }, ]; + onInterestingTagClick(selection: { id: string; name: string }): void { + if (!selection.id) return; + + void this.router.navigate(['publications'], { + relativeTo: this.activatedRoute, + queryParams: { + publicationPage: 1, + publicationTopicId: selection.id, + publicationTopicName: selection.name, + }, + }); + } + private getId(key: string): string | null { const ids = this.person()?.ids as Record | undefined; if (!ids) { diff --git a/webapp/src/app/modules/projects/projects.component.html b/webapp/src/app/modules/projects/projects.component.html new file mode 100644 index 00000000..0ae1e25c --- /dev/null +++ b/webapp/src/app/modules/projects/projects.component.html @@ -0,0 +1,97 @@ +
+

Passende Projekte finden

+ + + +
+ + + +
+ + EU + BUND + DFG + + +
+ + + +
+
+
+ + + + @let fundingProjectPageValue = fundingProjectPage(); + + @if ( + fundingProjectPageValue.elements && + fundingProjectPageValue.elements.length > 0 + ) { +
+ @for (fundingProject of fundingProjectPageValue.elements; track $index) { + + + {{ fundingProject.title }} + {{ + fundingProject.type | uppercase + }} + + + + + + + + + + + + info + Übersicht + + + + + } +
+ } @else { +
+

Keine passenden Projekte gefunden.

+
+ } + + + + +
diff --git a/webapp/src/app/modules/projects/projects.component.scss b/webapp/src/app/modules/projects/projects.component.scss new file mode 100644 index 00000000..32a0f31e --- /dev/null +++ b/webapp/src/app/modules/projects/projects.component.scss @@ -0,0 +1,87 @@ +.content { + display: flex; + flex-direction: column; + gap: 1rem; + padding: 1rem; +} + +.sorting { + display: flex; + justify-content: flex-end; + gap: 0.5rem; +} + +.sorting select { + padding: 0.75rem; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + font-size: 1rem; +} + +.sorting select:hover { + cursor: pointer; +} + +.cards { + display: grid; + gap: 1.5rem; + grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + padding: 0 1rem; +} + +mat-paginator { + background-color: var(--sg-background); +} + +.card { + padding: 0.5rem; + background-color: var(--sg-background); + transition: transform 0.3s ease; + display: flex; + flex-direction: column; + gap: 0.5rem; +} + +.card:hover { + cursor: pointer; + transform: scale(1.05); +} + +.card-content { + display: flex; + flex-direction: column; + justify-content: flex-end; + gap: 0.5rem; + flex: 1; +} + +.card-metadata { + display: flex; + flex-direction: column; + gap: 0.2rem; + font-size: 0.9rem; + color: var(--sg-text-secondary); +} + +mat-card-actions { + padding-top: 0.5rem; + display: flex; + gap: 0.5rem; +} + +mat-card-actions a { + width: 100%; + text-decoration: none; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); +} + +.no-results { + text-align: center; + padding: 2rem; + color: var(--sg-text-secondary); +} + +.mat-mdc-standard-chip { + border-radius: var(--sg-radius-sm); +} diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts new file mode 100644 index 00000000..effdc3f4 --- /dev/null +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -0,0 +1,82 @@ +import { Component, input, signal } from '@angular/core'; +import { FundingProject, FundingProjectPage, ProjectType } from '../../api'; +import { MatDividerModule } from '@angular/material/divider'; +import { MatIconModule } from '@angular/material/icon'; +import { MatCardModule } from '@angular/material/card'; +import { ActivatedRoute, Router, RouterModule } from '@angular/router'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatButtonModule } from '@angular/material/button'; +import { DatePipe, UpperCasePipe } from '@angular/common'; +import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips'; +import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { + QueryParamSelectorComponent, + SelectorOption, +} from '../../shared/ui/query-param-selector/query-param-selector.component'; + +@Component({ + selector: 'app-projects', + imports: [ + MatDividerModule, + MatIconModule, + MatCardModule, + RouterModule, + MatButtonModule, + UpperCasePipe, + DatePipe, + MatChipsModule, + QueryParamInputComponent, + QueryParamPaginatorComponent, + QueryParamSelectorComponent, + ], + templateUrl: './projects.component.html', + styleUrl: './projects.component.scss', +}) +export class ProjectsComponent { + fundingProjectPage = input.required(); + + urlChips = signal(['eu', 'bund', 'dfg']); + + sortingOptions: SelectorOption[] = [{ value: 'title', display_name: 'Name' }]; + sortingDirectionOptions: SelectorOption[] = [ + { value: 'asc', display_name: 'Aufsteigend' }, + { value: 'desc', display_name: 'Absteigend' }, + ]; + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) { + this.activatedRoute.queryParams + .pipe(takeUntilDestroyed()) + .subscribe((params) => { + this.urlChips.set( + (params['selected_project_types'] || 'eu,bund,dfg').split(','), + ); + }); + } + + handleChipBoxChange(change: MatChipListboxChange): void { + const selectedValues = change.value as string[]; + + this.router.navigate([], { + queryParams: { + selected_project_types: selectedValues.length + ? selectedValues.join(',') + : null, + }, + queryParamsHandling: 'merge', + }); + } + + getDetaiLink(fundingProject: FundingProject): string | null { + if (fundingProject.type === 'bund') { + return '/projects/bund/' + fundingProject.id; + } else if (fundingProject.type === 'dfg') { + return '/projects/dfg/' + fundingProject.id; + } else { + return null; + } + } +} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html new file mode 100644 index 00000000..7e9001cb --- /dev/null +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -0,0 +1,350 @@ +
+ + + @if (loading) { +
+ +

Publikation wird geladen...

+
+ } @else if (notFound || !publication) { +
+ search_off +

Publikation nicht gefunden

+

Die Publikation konnte nicht geladen werden.

+ Zur Personensuche +
+ } @else { +
+
+
+ @if (publication.type) { + {{ publication.type }} + } + @if (publication.publication_year) { + {{ publication.publication_year }} + } + @if (publication.language) { + {{ publication.language | uppercase }} + } +
+

+ {{ publication.title || publication.display_name || 'Ohne Titel' }} +

+

+ @for ( + authorship of authors(); + track authorship.author?.id; + let last = $last + ) { + {{ + authorship.author?.display_name || + authorship.raw_author_name || + 'Unbekannt' + }} + @if (!last) { + , + } + } @empty { + Autorinnen und Autoren nicht angegeben + } +

+
+ @for ( + link of externalLinks().slice(0, 3); + track link.url; + let first = $first + ) { + + {{ link.label }} + open_in_new + + } +
+
+ +
+
+ format_quote + {{ publication.cited_by_count ?? 0 | number }} + Zitationen +
+
+ menu_book + {{ + publication.referenced_works_count ?? 0 | number + }} + Referenzen +
+
+ {{ + publication.open_access?.is_oa ? 'lock_open' : 'lock' + }} + {{ publication.open_access?.is_oa ? 'Ja' : 'Nein' }} + Open Access +
+
+
+ + @if (publication.is_retracted) { +
+ warning + Diese Publikation wurde zurückgezogen. +
+ } + +
+
+ @if (abstractText(); as abstract) { +
+
+ subject +

Abstract

+
+

{{ abstract }}

+
+ } + +
+
+ group +

Autorinnen und Autoren

+ {{ authors().length }} +
+
+ @for (authorship of authors(); track authorship.author?.id) { + + } @empty { +

Keine Angaben vorhanden.

+ } +
+
+ + @if (publication.topics?.length || publication.keywords?.length) { +
+
+ interests +

Themen und Keywords

+
+
+ @for (topic of publication.topics ?? []; track topic.id) { + + {{ topic.display_name }} + + } + @for (keyword of publication.keywords ?? []; track keyword.id) { + {{ keyword.display_name }} + } +
+
+ } + + @if (sources().length) { +
+
+ library_books +

Quellen und Versionen

+
+
+ @for ( + location of sources(); + track location.source?.id || location.landing_page_url + ) { +
+
+ {{ + location.source?.display_name || 'Externe Quelle' + }} +

+ {{ + location.version || + location.source?.type || + 'Veröffentlichte Version' + }} + @if (location.license) { + · {{ location.license }} + } +

+
+
+ @if (location.is_oa) { + Open Access + } + @if ( + location.pdf_url || location.landing_page_url; + as sourceUrl + ) { + + open_in_new + + } +
+
+ } +
+
+ } +
+ + +
+ } +
diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.scss b/webapp/src/app/modules/publication-detail/publication-detail.component.scss new file mode 100644 index 00000000..ae20315b --- /dev/null +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.scss @@ -0,0 +1,440 @@ +:host { + display: block; + background: var(--sg-background); +} + +.detail-page { + max-width: 1500px; + margin: 0 auto; + padding: 26px 32px 56px; +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 7px; + margin-bottom: 22px; + padding: 0; + border: 0; + background: transparent; + color: var(--sg-text-muted); + font-size: 13px; + font-weight: 600; + text-decoration: none; + cursor: pointer; +} + +.back-link mat-icon { + width: 18px; + height: 18px; + font-size: 18px; +} + +.hero { + display: grid; + grid-template-columns: minmax(0, 1fr) 420px; + gap: 42px; + padding: 38px 42px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-lg); + background: + radial-gradient( + circle at 90% 10%, + rgba(200, 217, 255, 0.75), + transparent 35% + ), + linear-gradient(140deg, #fff 0%, #f8faff 100%); + box-shadow: var(--sg-shadow-sm); +} + +.eyebrow, +.tags, +.hero-actions { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.eyebrow span { + padding: 5px 10px; + border: 1px solid var(--sg-border); + border-radius: 999px; + background: rgba(255, 255, 255, 0.85); + color: var(--sg-text-muted); + font-size: 11px; + font-weight: 700; + text-transform: uppercase; +} + +h1 { + max-width: 920px; + margin: 20px 0 13px; + font-size: clamp(27px, 3vw, 42px); + line-height: 1.13; +} + +.author-line { + max-width: 900px; + margin: 0; + color: var(--sg-text-muted); + font-size: 14px; + line-height: 1.7; +} + +.hero-actions { + margin-top: 26px; +} + +.hero-actions a { + display: inline-flex; + align-items: center; + gap: 8px; + min-height: 42px; + padding: 9px 16px; + border: 1px solid var(--sg-border-strong); + border-radius: var(--sg-radius-sm); + background: #fff; + color: var(--sg-text); + font-weight: 700; + text-decoration: none; +} + +.hero-actions a.primary-action { + border-color: var(--sg-primary); + background: var(--sg-primary); + color: #fff; +} + +.hero-actions mat-icon { + width: 17px; + height: 17px; + font-size: 17px; +} + +.metrics { + display: grid; + grid-template-columns: repeat(3, 1fr); + align-self: center; + overflow: hidden; + border: 1px solid rgba(199, 211, 232, 0.8); + border-radius: var(--sg-radius-md); + background: rgba(255, 255, 255, 0.8); +} + +.metrics div { + display: flex; + align-items: center; + flex-direction: column; + gap: 5px; + padding: 22px 10px; + text-align: center; +} + +.metrics div + div { + border-left: 1px solid var(--sg-border); +} + +.metrics mat-icon { + color: var(--sg-text-soft); +} + +.metrics .positive mat-icon { + color: var(--sg-success); +} + +.metrics strong { + color: var(--sg-text); + font-family: 'Montserrat', 'Open Sans', sans-serif; + font-size: 22px; +} + +.metrics span { + color: var(--sg-text-muted); + font-size: 11px; +} + +.warning { + display: flex; + align-items: center; + gap: 10px; + margin-top: 20px; + padding: 14px 18px; + border: 1px solid #f1c6cc; + border-radius: var(--sg-radius-sm); + background: #fff4f5; + color: #9c2637; + font-weight: 700; +} + +.content-grid { + display: grid; + grid-template-columns: minmax(0, 1fr) 380px; + gap: 24px; + margin-top: 24px; +} + +main, +aside { + display: flex; + flex-direction: column; + gap: 24px; +} + +.card { + padding: 26px 28px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-md); + background: var(--sg-surface); + box-shadow: var(--sg-shadow-sm); +} + +.section-title { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 20px; +} + +.section-title mat-icon { + color: var(--sg-text-muted); +} + +.section-title h2 { + margin: 0; + font-size: 16px; +} + +.section-title span { + margin-left: auto; + color: var(--sg-text-muted); + font-size: 12px; +} + +.abstract-card p { + margin: 0; + color: var(--sg-text); + font-size: 14px; + line-height: 1.8; +} + +.author-list { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 12px; +} + +.author-list article { + display: grid; + grid-template-columns: 38px minmax(0, 1fr); + gap: 11px; + align-items: center; + padding: 12px; + border-radius: var(--sg-radius-sm); + background: var(--sg-surface-muted); +} + +.avatar { + display: grid; + place-items: center; + width: 38px; + height: 38px; + border-radius: 50%; + background: #e5ecfb; + color: var(--sg-text); + font-weight: 700; + text-transform: uppercase; +} + +.author-list a, +.author-list strong { + color: var(--sg-text); + font-size: 13px; + font-weight: 700; + text-decoration: none; +} + +.author-list p, +.source-list p { + margin: 3px 0 0; + color: var(--sg-text-muted); + font-size: 11px; +} + +.tags span { + padding: 7px 10px; + border: 1px solid var(--sg-border); + border-radius: 999px; + color: var(--sg-text-muted); + font-size: 11px; +} + +.tags .topic-tag { + border-color: #cbd8f1; + background: #f5f8ff; + color: var(--sg-text); +} + +.source-list, +.compact-list, +.link-list { + display: grid; + gap: 10px; +} + +.source-list article, +.compact-list div { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + padding: 13px 0; + border-bottom: 1px solid var(--sg-border); +} + +.source-list article:last-child, +.compact-list div:last-child { + border-bottom: 0; +} + +.source-actions { + display: flex; + align-items: center; + gap: 10px; +} + +.source-actions a { + height: 24px; +} + +.source-actions mat-icon { + width: 20px; + height: 20px; + font-size: 20px; +} + +.oa-badge { + padding: 4px 8px; + border-radius: 999px; + background: var(--sg-success-soft); + color: var(--sg-success); + font-size: 10px; + font-weight: 700; +} + +dl { + margin: 0; +} + +dl div { + display: grid; + grid-template-columns: 115px minmax(0, 1fr); + gap: 12px; + padding: 10px 0; + border-bottom: 1px solid var(--sg-border); +} + +dl div:last-child { + border-bottom: 0; +} + +dt { + color: var(--sg-text-muted); + font-size: 12px; +} + +dd { + margin: 0; + overflow-wrap: anywhere; + color: var(--sg-text); + font-size: 12px; + font-weight: 600; + text-align: right; +} + +.compact-list div { + align-items: flex-start; + flex-direction: column; + gap: 3px; +} + +.compact-list strong { + font-size: 12px; +} + +.compact-list span { + color: var(--sg-text-muted); + font-size: 11px; +} + +.link-list a { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 0; + border-bottom: 1px solid var(--sg-border); + color: var(--sg-text); + font-size: 12px; + font-weight: 700; + text-decoration: none; +} + +.link-list a:last-child { + border-bottom: 0; +} + +.link-list mat-icon { + width: 16px; + height: 16px; + color: var(--sg-text-muted); + font-size: 16px; +} + +.state { + display: grid; + place-items: center; + min-height: 380px; + color: var(--sg-text-muted); + text-align: center; +} + +.error-state mat-icon { + width: 46px; + height: 46px; + font-size: 46px; +} + +.empty { + color: var(--sg-text-muted); +} + +@media (max-width: 1150px) { + .hero, + .content-grid { + grid-template-columns: 1fr; + } + + .metrics { + width: 100%; + } +} + +@media (max-width: 700px) { + .detail-page { + padding: 18px 16px 40px; + } + + .hero, + .card { + padding: 22px 20px; + } + + .metrics, + .author-list { + grid-template-columns: 1fr; + } + + .metrics div + div { + border-top: 1px solid var(--sg-border); + border-left: 0; + } +} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts new file mode 100644 index 00000000..2eeb7feb --- /dev/null +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -0,0 +1,197 @@ +import { DatePipe, DecimalPipe, UpperCasePipe } from '@angular/common'; +import { Location } from '@angular/common'; +import { Component, DestroyRef, OnInit, inject } from '@angular/core'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { HttpClient } from '@angular/common/http'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { ActivatedRoute, RouterLink } from '@angular/router'; +import { finalize } from 'rxjs'; + +import { + Authorship, + Location as ApiLocation, + Work, + WorksService, +} from '../../api'; + +interface DetailLink { + label: string; + url: string; +} + +interface InstitutionDetail { + id: string; + name: string; + country?: string | null; + type?: string | null; +} + +@Component({ + selector: 'app-publication-detail', + imports: [ + DatePipe, + DecimalPipe, + MatButtonModule, + MatIconModule, + MatProgressSpinnerModule, + RouterLink, + UpperCasePipe, + ], + templateUrl: './publication-detail.component.html', + styleUrl: './publication-detail.component.scss', +}) +export class PublicationDetailComponent implements OnInit { + private readonly destroyRef = inject(DestroyRef); + private readonly route = inject(ActivatedRoute); + private readonly httpClient = inject(HttpClient); + private readonly location = inject(Location); + private readonly worksService = inject(WorksService); + + publication: Work | null = null; + loading = true; + notFound = false; + + ngOnInit(): void { + this.route.paramMap + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe((params) => { + const publicationId = params.get('publicationId'); + if (!publicationId) { + this.loading = false; + this.notFound = true; + return; + } + + this.loadPublication(publicationId); + }); + } + + navigateBack(): void { + this.location.back(); + } + + abstractText(): string | null { + const index = this.publication?.abstract_inverted_index; + if (!index || typeof index !== 'object') return null; + + const words: Array<{ word: string; position: number }> = []; + for (const [word, rawPositions] of Object.entries(index)) { + if (!Array.isArray(rawPositions)) continue; + for (const position of rawPositions) { + if (typeof position === 'number') words.push({ word, position }); + } + } + + return ( + words + .sort((first, second) => first.position - second.position) + .map(({ word }) => word) + .join(' ') || null + ); + } + + authors(): Authorship[] { + return this.publication?.authorships ?? []; + } + + institutions(): InstitutionDetail[] { + const institutions = new Map(); + for (const authorship of this.authors()) { + for (const institution of authorship.institutions ?? []) { + if (!institution.id || !institution.display_name) continue; + institutions.set(institution.id, { + id: institution.id, + name: institution.display_name, + country: institution.country_code, + type: institution.type, + }); + } + } + return Array.from(institutions.values()); + } + + sources(): ApiLocation[] { + const locations = [ + this.publication?.primary_location, + this.publication?.best_oa_location, + ...(this.publication?.locations ?? []), + ].filter((location): location is ApiLocation => !!location); + const unique = new Map(); + for (const location of locations) { + const key = + location.source?.id ?? + location.landing_page_url ?? + location.pdf_url ?? + JSON.stringify(location); + unique.set(key, location); + } + return Array.from(unique.values()); + } + + externalLinks(): DetailLink[] { + if (!this.publication) return []; + const links: DetailLink[] = []; + this.addLink(links, 'Open Access', this.publication.open_access?.oa_url); + this.addLink(links, 'DOI', this.doiUrl(this.publication.doi)); + return links.filter( + (link, index) => + links.findIndex((candidate) => candidate.url === link.url) === index, + ); + } + + pages(): string | null { + const first = this.publication?.biblio?.first_page; + const last = this.publication?.biblio?.last_page; + if (first && last) return `${first}-${last}`; + return first ?? last ?? null; + } + + openAccessLabel(): string { + if (this.publication?.open_access?.is_oa) { + return this.publication.open_access.oa_status + ? `Open Access (${this.publication.open_access.oa_status})` + : 'Open Access'; + } + return 'Kein Open Access'; + } + + private loadPublication(publicationId: string): void { + this.loading = true; + this.notFound = false; + this.publication = null; + + const basePath = this.worksService.configuration.basePath ?? ''; + this.httpClient + .get( + `${basePath}/api/works/detail/${encodeURIComponent(publicationId)}`, + ) + .pipe(finalize(() => (this.loading = false))) + .subscribe({ + next: (publication) => { + this.publication = publication; + }, + error: () => { + this.notFound = true; + }, + }); + } + + private doiUrl(doi: string | null | undefined): string | null { + if (!doi) return null; + return doi.startsWith('http') ? doi : `https://doi.org/${doi}`; + } + + private addLink( + links: DetailLink[], + label: string, + value: string | null | undefined, + ) { + if (!value) return; + links.push({ + label, + url: value.startsWith('http') ? value : `https://${value}`, + }); + } +} diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html new file mode 100644 index 00000000..330b076f --- /dev/null +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html @@ -0,0 +1,186 @@ +
+ @if (searchQuery()) { +
+ Modus: + + + Ähnlich + + + Genau + + +
+ } + @if (loading()) { +
+ + Lade Themen... +
+ } @else { + @if (searchQuery()) { + +
+ {{ filteredFlatTopics.length }} Treffer +
+ @for (topic of filteredFlatTopics; track topic.id) { +
+ + {{ topic.name }} + + {{ + topic.path + }} +
+ } @empty { + + } +
+
+ } @else { + +
+ @for (domain of domains; track domain.name) { + +
+ + + @if (expandedDomains.has(domain.name)) { +
+ @for (field of domain.fields; track field.name) { + +
+ + + @if (expandedFields.has(field.name)) { +
+ @for ( + subfield of field.subfields; + track subfield.name + ) { + +
+ + + @if (expandedSubfields.has(subfield.name)) { +
+ @for ( + topic of subfield.topics; + track topic.id + ) { + +
+ + {{ + topic.name + }} + +
+ } +
+ } +
+ } +
+ } +
+ } +
+ } +
+ } +
+ } + } +
diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss new file mode 100644 index 00000000..abfa99bc --- /dev/null +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss @@ -0,0 +1,227 @@ +.hierarchy-container { + width: 100%; + max-height: 400px; + overflow-y: auto; + overflow-x: hidden; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + background: var(--sg-background); + padding: 4px 8px 4px 4px; + margin-top: 4px; + box-sizing: border-box; +} + +.loading-state { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 16px; + color: var(--sg-text-muted); + font-size: 12px; +} + +/* Flat Search Results Styles */ +.search-results { + display: flex; + flex-direction: column; + gap: 4px; + padding: 4px; +} + +.results-meta { + font-size: 11px; + font-weight: 600; + color: var(--sg-text-muted); + text-transform: uppercase; + padding-left: 4px; +} + +.flat-list { + display: flex; + flex-direction: column; + gap: 4px; +} + +.flat-row { + display: flex; + flex-direction: column; + padding: 6px; + border-bottom: 1px solid var(--sg-border-soft); + + &:last-child { + border-bottom: none; + } + + .topic-name { + font-size: 12px; + color: var(--sg-text); + font-weight: 500; + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .topic-path { + font-size: 10px; + color: var(--sg-text-soft); + padding-left: 28px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + } +} + +.empty-search { + padding: 16px; + font-size: 12px; + color: var(--sg-text-muted); + text-align: center; +} + +/* Hierarchy Tree Styles */ +.tree-root { + display: flex; + flex-direction: column; + gap: 2px; +} + +.tree-node { + display: flex; + flex-direction: column; +} + +.node-header { + display: flex; + align-items: center; + width: 100%; + background: transparent; + border: none; + padding: 4px; + text-align: left; + cursor: pointer; + border-radius: 4px; + color: var(--sg-text); + + &:hover { + background: var(--sg-surface-soft); + } + + .toggle-icon { + font-size: 16px; + width: 16px; + height: 16px; + color: var(--sg-text-soft); + margin-right: 2px; + } + + .folder-icon { + font-size: 14px; + width: 14px; + height: 14px; + color: var(--sg-primary-soft); + margin-right: 4px; + } + + .node-title { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + min-width: 0; + } +} + +.domain-header { + padding-top: 6px; + padding-bottom: 6px; + + .domain-title { + font-size: 12px; + font-weight: 600; + color: var(--sg-text); + } +} + +.field-header { + .field-title { + font-size: 11.5px; + font-weight: 500; + color: var(--sg-text-muted); + } +} + +.subfield-header { + .subfield-title { + font-size: 11px; + color: var(--sg-text-muted); + } +} + +.node-children { + display: flex; + flex-direction: column; + gap: 2px; +} + +.domain-children { + padding-left: 10px; + border-left: 1px solid var(--sg-border-soft); + margin-left: 12px; + margin-bottom: 4px; +} + +.field-children { + padding-left: 10px; + border-left: 1px solid var(--sg-border-soft); + margin-left: 12px; +} + +.subfield-children { + padding-left: 10px; + border-left: 1px dashed var(--sg-border-soft); + margin-left: 12px; + margin-bottom: 2px; +} + +.tree-leaf { + padding: 2px 4px; + width: 100%; + box-sizing: border-box; +} + +.topic-node { + width: 100%; + box-sizing: border-box; + + .topic-label { + font-size: 11px; + color: var(--sg-text); + display: block; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +mat-checkbox { + display: block !important; + width: 100% !important; + + ::ng-deep { + .mdc-form-field { + width: 100% !important; + display: flex !important; + align-items: center; + } + + .mdc-label { + flex: 1 !important; + min-width: 0 !important; + overflow: hidden; + padding-left: 8px !important; + } + } +} diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.spec.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.spec.ts new file mode 100644 index 00000000..04185b1e --- /dev/null +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.spec.ts @@ -0,0 +1,22 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { TopicHierarchyComponent } from './topic-hierarchy.component'; + +describe('TopicHierarchyComponent', () => { + let component: TopicHierarchyComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [TopicHierarchyComponent], + }).compileComponents(); + + fixture = TestBed.createComponent(TopicHierarchyComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts new file mode 100644 index 00000000..eb7af86a --- /dev/null +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts @@ -0,0 +1,200 @@ +import { Component, input, model, output, OnInit, signal } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatIconModule } from '@angular/material/icon'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TopicsService } from '../../api/api/topics.service'; +import { combineLatest, of } from 'rxjs'; +import { toObservable } from '@angular/core/rxjs-interop'; +import { + debounceTime, + distinctUntilChanged, + switchMap, + catchError, +} from 'rxjs/operators'; + +export interface TopicItem { + id: string; + name: string; +} + +export interface SubfieldNode { + name: string; + topics: TopicItem[]; +} + +export interface FieldNode { + name: string; + subfields: SubfieldNode[]; +} + +export interface DomainNode { + name: string; + fields: FieldNode[]; +} + +interface FlatTopic { + id: string; + name: string; + path: string; +} + +@Component({ + selector: 'app-topic-hierarchy', + standalone: true, + imports: [ + CommonModule, + MatCheckboxModule, + MatIconModule, + MatProgressSpinnerModule, + MatRadioModule, + MatTooltipModule, + ], + templateUrl: './topic-hierarchy.component.html', + styleUrl: './topic-hierarchy.component.scss', +}) +export class TopicHierarchyComponent implements OnInit { + selectedTopics = input>(new Set()); + searchQuery = input(''); + searchType = model<'hybrid' | 'semantic'>('hybrid'); + + selectionChange = output>(); + + domains: DomainNode[] = []; + flatTopics: FlatTopic[] = []; + filteredFlatTopics: FlatTopic[] = []; + loading = signal(true); + + // Set of names of expanded nodes (lazy content rendering) + expandedDomains = new Set(); + expandedFields = new Set(); + expandedSubfields = new Set(); + + constructor(private topicsService: TopicsService) { + combineLatest([ + toObservable(this.searchQuery), + toObservable(this.searchType), + ]) + .pipe( + debounceTime(300), + distinctUntilChanged( + (prev, curr) => prev[0] === curr[0] && prev[1] === curr[1], + ), + switchMap(([query, searchType]) => { + if (!query || query.length < 2) { + this.filteredFlatTopics = []; + return of({ results: [] }); + } + this.loading.set(true); + return this.topicsService + .vectorSearchTopics(query, 50, searchType) + .pipe( + catchError((err) => { + console.error('Error in semantic topic search:', err); + // Fallback to local filtering + const q = query.toLowerCase(); + this.filteredFlatTopics = this.flatTopics.filter( + (t) => + t.name.toLowerCase().includes(q) || + t.path.toLowerCase().includes(q), + ); + return of({ results: [] }); + }), + ); + }), + ) + .subscribe((response) => { + this.loading.set(false); + if (response && response.results) { + this.filteredFlatTopics = response.results.map((topic) => { + const parts = []; + if (topic.domain?.display_name) + parts.push(topic.domain.display_name); + if (topic.field?.display_name) parts.push(topic.field.display_name); + if (topic.subfield?.display_name) + parts.push(topic.subfield.display_name); + return { + id: topic.id || '', + name: topic.display_name || '', + path: + parts.length > 0 ? parts.join(' > ') : topic.description || '', + }; + }); + } + }); + } + + ngOnInit(): void { + this.topicsService.getTopicHierarchy().subscribe({ + next: (res: any) => { + this.domains = res.domains || []; + this.flattenTopics(this.domains); + this.loading.set(false); + }, + error: (err) => { + console.error('Error fetching topic hierarchy:', err); + this.loading.set(false); + }, + }); + } + + flattenTopics(domains: DomainNode[]): void { + const flat: FlatTopic[] = []; + domains.forEach((domain) => { + domain.fields?.forEach((field) => { + field.subfields?.forEach((subfield) => { + subfield.topics?.forEach((topic) => { + if (topic.name && topic.id) { + flat.push({ + id: topic.id, + name: topic.name, + path: `${domain.name} > ${field.name} > ${subfield.name}`, + }); + } + }); + }); + }); + }); + this.flatTopics = flat; + } + + onSearchTypeChange(type: 'hybrid' | 'semantic'): void { + this.searchType.set(type); + } + + toggleTopic(name: string): void { + const nextSelection = new Set(this.selectedTopics()); + if (nextSelection.has(name)) { + nextSelection.delete(name); + } else { + nextSelection.add(name); + } + this.selectionChange.emit(nextSelection); + } + + toggleDomain(name: string): void { + if (this.expandedDomains.has(name)) { + this.expandedDomains.delete(name); + } else { + this.expandedDomains.add(name); + } + } + + toggleField(name: string): void { + if (this.expandedFields.has(name)) { + this.expandedFields.delete(name); + } else { + this.expandedFields.add(name); + } + } + + toggleSubfield(name: string): void { + if (this.expandedSubfields.has(name)) { + this.expandedSubfields.delete(name); + } else { + this.expandedSubfields.add(name); + } + } +} diff --git a/webapp/src/app/modules/university-ranking/services/uni-ranking-service.ts b/webapp/src/app/modules/university-ranking/services/uni-ranking-service.ts new file mode 100644 index 00000000..ece71b78 --- /dev/null +++ b/webapp/src/app/modules/university-ranking/services/uni-ranking-service.ts @@ -0,0 +1,29 @@ +// src/app/modules/university-ranking/services/university-data.service.ts +import { inject, Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; +import { InstitutionsService, RankingResponse } from '../../../api'; +export type ResearchTopic = + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology'; +export type DashboardMetric = 'publications' | 'citations'; + +@Injectable({ providedIn: 'root' }) +export class UniversityRankingService { + private apiService = inject(InstitutionsService); + + /** + * Fetches ranking and timeseries data directly from the backend. + * Calculations for growth and trends are now handled server-side. + */ + getRankingData( + topic: ResearchTopic, + metric: DashboardMetric, + ): Observable { + return this.apiService.getRankingsApiInseServiceUniversityRankingsGet( + topic, + metric, + ); + } +} diff --git a/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.html b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.html new file mode 100644 index 00000000..41931384 --- /dev/null +++ b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.html @@ -0,0 +1,5 @@ +
diff --git a/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.scss b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.scss new file mode 100644 index 00000000..f51d8c68 --- /dev/null +++ b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.scss @@ -0,0 +1,4 @@ +.chart-container { + height: 500px; + width: 100%; +} diff --git a/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.ts b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.ts new file mode 100644 index 00000000..799ad08f --- /dev/null +++ b/webapp/src/app/modules/university-ranking/uni-line-chart/uni-line-chart.component.ts @@ -0,0 +1,64 @@ +// src/app/modules/university-ranking/components/line-chart/university-line-chart.component.ts +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { EChartsOption } from 'echarts'; +import { NgxEchartsDirective } from 'ngx-echarts'; +import { UniversityTopicData, YearlyData } from '../../../api'; +export type ResearchTopic = + | 'Artificial Intelligence' + | 'Quantum Computing' + | 'Renewable Energy' + | 'Biotechnology'; +export type DashboardMetric = 'publications' | 'citations'; + +@Component({ + selector: 'app-university-line-chart', + templateUrl: './uni-line-chart.component.html', + styleUrl: './uni-line-chart.component.scss', + imports: [NgxEchartsDirective], + standalone: true, +}) +export class UniversityLineChartComponent implements OnChanges { + @Input() data: UniversityTopicData[] = []; + @Input() metric: DashboardMetric = 'publications'; + + chartOption: EChartsOption = { + title: { + text: 'Research Output Over Time', + left: 'center', + textStyle: { fontWeight: 'lighter' }, + }, + tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, + legend: { bottom: 0 }, + grid: { left: '3%', right: '4%', bottom: '15%', containLabel: true }, + xAxis: { type: 'category', boundaryGap: false, data: [] }, + yAxis: { type: 'value', name: 'Volume' }, + dataZoom: [{ type: 'slider', show: true, bottom: 40 }], + series: [], + }; + + mergeOption: EChartsOption = {}; + + ngOnChanges(changes: SimpleChanges): void { + if (this.data.length > 0) { + this.updateChart(); + console.log('CHANGES!'); + } + } + + private updateChart() { + const years = this.data[0].yearly_data.map((d) => d.year); + const series = this.data.map((uni) => ({ + name: uni.university, + type: 'line', + smooth: true, + emphasis: { focus: 'series' }, + animationDuration: 2000, + data: uni.yearly_data.map((d) => d[this.metric]), + })); + + this.mergeOption = { + xAxis: { data: years.map(String) }, + series: series as any, + }; + } +} diff --git a/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.html b/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.html new file mode 100644 index 00000000..99da5bcb --- /dev/null +++ b/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.html @@ -0,0 +1,42 @@ +
+

Topic Rankings

+ @if (loading) { +
Loading rankings...
+ } @else { + + + + + + + + + + + + @for (row of rankings; track $index) { + + + + + + + + } + +
RankUniversityLatest5Y GrowthTrend
#{{ row.rank }} + {{ row.university }} + @if (row.is_top_mover) { + 🔥 + } + {{ row.publications | number }} + {{ row.growth_rate | number: '1.0-1' }}% + + {{ getTrendIcon(row.trend) }} +
+ } +
diff --git a/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.scss b/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.ts b/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.ts new file mode 100644 index 00000000..05db1334 --- /dev/null +++ b/webapp/src/app/modules/university-ranking/uni-ranking-table/uni-ranking-table.component.ts @@ -0,0 +1,21 @@ +// src/app/modules/university-ranking/components/ranking-table/university-ranking-table.component.ts +import { Component, Input } from '@angular/core'; +import { UniversityRanking } from '../../../api'; +import { DecimalPipe } from '@angular/common'; + +@Component({ + selector: 'app-university-ranking-table', + templateUrl: './uni-ranking-table.component.html', + styleUrls: ['./uni-ranking-table.component.scss'], + imports: [DecimalPipe], +}) +export class UniversityRankingTableComponent { + @Input() rankings: UniversityRanking[] = []; + @Input() loading: boolean = false; + + getTrendIcon(trend: string): string { + if (trend === 'up') return '↑'; + if (trend === 'down') return '↓'; + return '→'; + } +} diff --git a/webapp/src/app/resolvers/bund-project-page.resolver.ts b/webapp/src/app/resolvers/bund-project-page.resolver.ts new file mode 100644 index 00000000..548cbb34 --- /dev/null +++ b/webapp/src/app/resolvers/bund-project-page.resolver.ts @@ -0,0 +1,38 @@ +import { ResolveFn } from '@angular/router'; +import { + BundProjectPage, + ProjectsService, + ProjectsSortBy, + SortDirection, +} from '../api'; +import { inject } from '@angular/core'; + +export const bundProjectPageResolver: ResolveFn = ( + route, + state, +) => { + console.log('bundProjectPageResolver called with route:', route); + const page = route.queryParamMap.get('page') ?? '0'; + const size = route.queryParamMap.get('size') ?? '10'; + let institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + institutionId = route.parent?.paramMap.get('institutionId') ?? null; + } + + const sortBy = (route.queryParamMap.get('sort_by') || + 'title') as ProjectsSortBy; + const sortDirection = (route.queryParamMap.get('sort_direction') || + 'asc') as SortDirection; + + const search = route.queryParamMap.get('search'); + + return inject(ProjectsService).searchBundProjects({ + project_type: 'bund', + page: Number(page), + size: Number(size), + raw_oa_institution_id: institutionId, + query: search, + sort_by: sortBy, + sort_direction: sortDirection, + }); +}; diff --git a/webapp/src/app/resolvers/bund-projects-funding.resolver.ts b/webapp/src/app/resolvers/bund-projects-funding.resolver.ts new file mode 100644 index 00000000..27f188c5 --- /dev/null +++ b/webapp/src/app/resolvers/bund-projects-funding.resolver.ts @@ -0,0 +1,15 @@ +import { ResolveFn } from '@angular/router'; +import { InstitutionFunderSummary, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const bundProjectsFundingResolver: ResolveFn< + InstitutionFunderSummary +> = (route, state) => { + let institutionId = route.parent?.paramMap.get('institutionId') ?? null; + if (!institutionId) { + institutionId = route.parent?.paramMap.get('institutionId') ?? null; + } + return inject(ProjectsService).getInstitutionBundProjectsFundingOverTime( + institutionId!, + ); +}; diff --git a/webapp/src/app/resolvers/bund-single-project-resolver.ts b/webapp/src/app/resolvers/bund-single-project-resolver.ts new file mode 100644 index 00000000..c41d0816 --- /dev/null +++ b/webapp/src/app/resolvers/bund-single-project-resolver.ts @@ -0,0 +1,16 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { ProjectsService } from '../api/api/projects.service'; +import { BundProjectDetails } from '../api/model/bundProjectDetails'; + +export const bundSingleProjectResolver: ResolveFn = ( + route, + state, +) => { + const projectsService = inject(ProjectsService); + const projectId = route.paramMap.get('id'); + if (!projectId) { + throw new Error('BUND Project ID is required'); + } + return projectsService.getSingleBundProject(projectId); +}; diff --git a/webapp/src/app/resolvers/collaboration-network.resolver.ts b/webapp/src/app/resolvers/collaboration-network.resolver.ts index e09b8747..4a8c1f9f 100644 --- a/webapp/src/app/resolvers/collaboration-network.resolver.ts +++ b/webapp/src/app/resolvers/collaboration-network.resolver.ts @@ -1,11 +1,18 @@ import { ResolveFn } from '@angular/router'; import { inject } from '@angular/core'; import { + AuthorsFilterProperties, CollaborationNetwork, FilterProperties, PersonNetworkService, + WorksFilterProperties, } from '../api'; +const DEFAULT_MIN_CONTRIBUTORS = 2; +const DEFAULT_MAX_CONTRIBUTORS = 10; +const DEFAULT_MIN_COLLABORATIONS = 1; +const DEFAULT_MAX_COLLABORATIONS = 100; + export const collaborationNetworkResolver: ResolveFn = ( route, state, @@ -16,37 +23,50 @@ export const collaborationNetworkResolver: ResolveFn = ( } const startYear = route.queryParamMap.get('start_year'); const endYear = route.queryParamMap.get('end_year'); - const minimumCollaborators = route.queryParamMap.get('minimum_collaborators'); - const maximumCollaborators = route.queryParamMap.get('maximum_collaborators'); - const minimumCollaborations = route.queryParamMap.get( - 'minimum_collaborations', - ); - const maximumCollaborations = route.queryParamMap.get( - 'maximum_collaborations', - ); + const minContributors = route.queryParamMap.get('min_contributors'); + const maxContributors = route.queryParamMap.get('max_contributors'); + const minCollaborations = route.queryParamMap.get('min_collaborations'); + const maxCollaborations = route.queryParamMap.get('max_collaborations'); const institutions = route.queryParamMap.get('institutions'); const topics = route.queryParamMap.get('topics'); + const filterBy = route.queryParamMap.get('filter_by') || 'works'; + + if (filterBy !== 'works' && filterBy !== 'authors') { + throw new Error("Invalid filter_by value. Expected 'works' or 'authors'."); + } + + let worksFilterProperties: WorksFilterProperties | null = null; + let authorsFilterProperties: AuthorsFilterProperties | null = null; + if (filterBy === 'works') { + worksFilterProperties = { + start_year: startYear ? Number.parseInt(startYear, 10) : undefined, + end_year: endYear ? Number.parseInt(endYear, 10) : undefined, + min_contributors: minContributors + ? Number.parseInt(minContributors, 10) + : DEFAULT_MIN_CONTRIBUTORS, + max_contributors: maxContributors + ? Number.parseInt(maxContributors, 10) + : DEFAULT_MAX_CONTRIBUTORS, + allowed_topics: topics ? topics.split(',') : undefined, + }; + } + if (filterBy === 'authors') { + authorsFilterProperties = { + min_collaborations: minCollaborations + ? Number.parseInt(minCollaborations, 10) + : DEFAULT_MIN_COLLABORATIONS, + max_collaborations: maxCollaborations + ? Number.parseInt(maxCollaborations, 10) + : DEFAULT_MAX_COLLABORATIONS, + allowed_institutions: institutions ? institutions.split(',') : undefined, + }; + } - console.log('Resolving collaboration network for author ID:', rawAuthorId); const filterProperties: FilterProperties = { - start_year: startYear ? Number.parseInt(startYear, 10) : null, - end_year: endYear ? Number.parseInt(endYear, 10) : null, - min_collaborators: minimumCollaborators - ? Number.parseInt(minimumCollaborators, 10) - : 2, - max_collaborators: maximumCollaborators - ? Number.parseInt(maximumCollaborators, 10) - : 10, - min_collaborations: minimumCollaborations - ? Number.parseInt(minimumCollaborations, 10) - : 1, - max_collaborations: maximumCollaborations - ? Number.parseInt(maximumCollaborations, 10) - : null, - allowed_institutions: institutions ? institutions.split(',') : null, - allowed_topics: topics ? topics.split(',') : null, + filter_by: filterBy, + works_filter_properties: worksFilterProperties, + authors_filter_properties: authorsFilterProperties, }; - console.log('Using filter properties:', filterProperties); return inject(PersonNetworkService).getCollaborationNetwork( rawAuthorId, diff --git a/webapp/src/app/resolvers/cordis-eu-project-page.resolver.ts b/webapp/src/app/resolvers/cordis-eu-project-page.resolver.ts new file mode 100644 index 00000000..3e8facdc --- /dev/null +++ b/webapp/src/app/resolvers/cordis-eu-project-page.resolver.ts @@ -0,0 +1,35 @@ +import { ResolveFn } from '@angular/router'; +import { + EuOrganizationProjectSummaryPage, + ProjectsService, + ProjectsSortBy, + SortDirection, +} from '../api'; +import { inject } from '@angular/core'; + +export const cordisEuProjectPageResolver: ResolveFn< + EuOrganizationProjectSummaryPage +> = (route, state) => { + const page = route.queryParamMap.get('page') ?? '1'; + const size = route.queryParamMap.get('size') ?? '10'; + let institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + institutionId = route.parent?.paramMap.get('institutionId') ?? null; + } + + const sortBy = (route.queryParamMap.get('sort_by') || + 'title') as ProjectsSortBy; + const sortDirection = (route.queryParamMap.get('sort_direction') || + 'asc') as SortDirection; + const search = route.queryParamMap.get('search'); + + return inject(ProjectsService).searchCordisEuProjects({ + project_type: 'eu', + page: Number(page), + size: Number(size), + raw_oa_institution_id: institutionId, + query: search, + sort_by: sortBy, + sort_direction: sortDirection, + }); +}; diff --git a/webapp/src/app/resolvers/cordis-eu-projects-funding.resolver.ts b/webapp/src/app/resolvers/cordis-eu-projects-funding.resolver.ts new file mode 100644 index 00000000..4b1e5385 --- /dev/null +++ b/webapp/src/app/resolvers/cordis-eu-projects-funding.resolver.ts @@ -0,0 +1,17 @@ +import { ResolveFn } from '@angular/router'; +import { InstitutionFunderSummary, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const cordisEuProjectsFundingResolver: ResolveFn< + InstitutionFunderSummary +> = (route, state) => { + let institutionId = route.parent?.paramMap.get('institutionId') ?? null; + if (!institutionId) { + throw new Error( + 'Institution ID is required to resolve Cordis EU projects funding', + ); + } + return inject(ProjectsService).getInstitutionCordisEuProjectsFundingOverTime( + institutionId, + ); +}; diff --git a/webapp/src/app/resolvers/dfg-projects.resolver.ts b/webapp/src/app/resolvers/dfg-projects.resolver.ts new file mode 100644 index 00000000..f5414f57 --- /dev/null +++ b/webapp/src/app/resolvers/dfg-projects.resolver.ts @@ -0,0 +1,28 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { DfgProjectPage, ProjectsService } from '../api'; + +export const dfgProjectsResolver: ResolveFn = ( + route, + state, +) => { + const page = route.queryParamMap.get('page') ?? '0'; + const size = route.queryParamMap.get('size') ?? '10'; + const rawAuthorId = route.parent?.params['id']; + if (!rawAuthorId) { + throw new Error('Author ID is required to resolve collaboration network'); + } + + const searchTerm = route.queryParamMap.get('search'); + const sortBy = route.queryParamMap.get('sort_by') || 'title'; + const sortDirection = route.queryParamMap.get('sort_direction') || 'asc'; + + return inject(ProjectsService).getDfgProjects( + rawAuthorId, + searchTerm ?? undefined, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; diff --git a/webapp/src/app/resolvers/dfg-single-project-resolver.ts b/webapp/src/app/resolvers/dfg-single-project-resolver.ts new file mode 100644 index 00000000..2d0ae08f --- /dev/null +++ b/webapp/src/app/resolvers/dfg-single-project-resolver.ts @@ -0,0 +1,16 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { ProjectsService } from '../api/api/projects.service'; +import { DfgProjectDetails } from '../api'; + +export const dfgSingleProjectResolver: ResolveFn = ( + route, + state, +) => { + const projectsService = inject(ProjectsService); + const projectId = route.paramMap.get('id'); + if (!projectId) { + throw new Error('DFG Project ID is required'); + } + return projectsService.getSingleDfgProject(projectId); +}; diff --git a/webapp/src/app/resolvers/funding-project-page.resolver.ts b/webapp/src/app/resolvers/funding-project-page.resolver.ts new file mode 100644 index 00000000..496e7958 --- /dev/null +++ b/webapp/src/app/resolvers/funding-project-page.resolver.ts @@ -0,0 +1,37 @@ +import { ResolveFn } from '@angular/router'; +import { + FundingProjectPage, + ProjectsService, + ProjectsSortBy, + ProjectType, + SortDirection, +} from '../api'; +import { inject } from '@angular/core'; + +export const fundingProjectPageResolver: ResolveFn = ( + route, + state, +) => { + const page = Number(route.queryParamMap.get('page') || '0'); + const size = Number(route.queryParamMap.get('size') || '10'); + const sortBy = (route.queryParamMap.get('sort_by') ?? + 'title') as ProjectsSortBy; + const sortOrder = (route.queryParamMap.get('sorting_order') ?? + 'asc') as SortDirection; + const title = route.queryParamMap.get('search') ?? undefined; + const selectedProjectTypes = route.queryParamMap.get('selected_project_types') + ? new Set( + route.queryParamMap + .get('selected_project_types')! + .split(',') as ProjectType[], + ) + : undefined; + return inject(ProjectsService).searchProjects( + page, + size, + selectedProjectTypes, + title, + sortBy, + sortOrder, + ); +}; diff --git a/webapp/src/app/resolvers/institution.resolver.ts b/webapp/src/app/resolvers/institution.resolver.ts new file mode 100644 index 00000000..716fa075 --- /dev/null +++ b/webapp/src/app/resolvers/institution.resolver.ts @@ -0,0 +1,14 @@ +import { ResolveFn } from '@angular/router'; +import { Institution, InstitutionsService } from '../api'; +import { inject } from '@angular/core'; + +export const institutionResolver: ResolveFn = (route, state) => { + const institutionId = route.paramMap.get('institutionId'); + if (!institutionId) { + throw new Error( + 'Institution ID is required to resolve institution details', + ); + } + + return inject(InstitutionsService).getInstitutionById(institutionId); +}; diff --git a/webapp/src/app/resolvers/institutions.resolver.ts b/webapp/src/app/resolvers/institutions.resolver.ts new file mode 100644 index 00000000..a0657fab --- /dev/null +++ b/webapp/src/app/resolvers/institutions.resolver.ts @@ -0,0 +1,29 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { InstitutionPage, InstitutionsService } from '../api'; + +export const institutionsResolver: ResolveFn = ( + route, + state, +) => { + const queryParamMap = route.queryParamMap; + const query = queryParamMap.get('search') ?? ''; + const page = Number(queryParamMap.get('page') ?? '0'); + const pageSize = Number(queryParamMap.get('size') ?? '10'); + const sortBy = (queryParamMap.get('sort_by') ?? 'works_count') as + | 'relevance' + | 'name' + | 'works_count' + | 'citations_count'; + const sortOrder = (queryParamMap.get('sorting_order') ?? 'desc') as + | 'asc' + | 'desc'; + + return inject(InstitutionsService).searchInstitutionsByName( + query, + page, + pageSize, + sortBy, + sortOrder, + ); +}; diff --git a/webapp/src/app/resolvers/person-bio.resolver.ts b/webapp/src/app/resolvers/person-bio.resolver.ts new file mode 100644 index 00000000..298fbe9b --- /dev/null +++ b/webapp/src/app/resolvers/person-bio.resolver.ts @@ -0,0 +1,27 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { Observable, of, map, catchError } from 'rxjs'; +import { PersonsService } from '../api'; + +export interface PersonBioResolved { + bio$: Observable; +} + +export const personBioResolver: ResolveFn = (route) => { + const authorId = route.paramMap.get('id'); + const personsApi = inject(PersonsService); + + if (!authorId) { + return { bio$: of(null) }; + } + + const bio$ = personsApi.generatePersonBio(authorId).pipe( + map((result) => result.bio ?? null), + catchError((err) => { + console.error('Failed to load bio:', err); + return of(null); + }), + ); + + return { bio$ }; +}; diff --git a/webapp/src/app/resolvers/person-cordis-eu-project-page.resolver.ts b/webapp/src/app/resolvers/person-cordis-eu-project-page.resolver.ts new file mode 100644 index 00000000..90427263 --- /dev/null +++ b/webapp/src/app/resolvers/person-cordis-eu-project-page.resolver.ts @@ -0,0 +1,13 @@ +import { ResolveFn } from '@angular/router'; +import { CordisEuProjectPage, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const personCordisEuProjectPageResolver: ResolveFn< + CordisEuProjectPage +> = (route, state) => { + const rawAuthorId = route.parent?.params['id']; + if (!rawAuthorId) { + throw new Error('Author ID is required to resolve collaboration network'); + } + return inject(ProjectsService).getEuProjectsForAuthor(rawAuthorId); +}; diff --git a/webapp/src/app/resolvers/person-list.resolver.ts b/webapp/src/app/resolvers/person-list.resolver.ts new file mode 100644 index 00000000..926dd58c --- /dev/null +++ b/webapp/src/app/resolvers/person-list.resolver.ts @@ -0,0 +1,62 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { PersonsService, CustomAuthorsListResponse } from '../api'; + +export const personListResolver: ResolveFn = ( + route, + state, +) => { + const parseQueryParamArray = (val: any): string[] => { + if (!val) return []; + if (Array.isArray(val)) return val; + return [val]; + }; + const defaultIncludes = + 'display_name,works_count,cited_by_count,summary_stats,topics,orcid,relevance_rating,last_known_institutions,affiliations,career_metrics'; + const params = route.queryParamMap; + + const query = params.get('query') || undefined; + + const page = params.get('page') + ? Number.parseInt(params.get('page')!, 10) + : 1; + + const pageSize = params.get('pageSize') + ? Number.parseInt(params.get('pageSize')!, 10) + : 10; + + const institutionName = params.get('institutionName') || undefined; + const sortBy = params.get('sortBy') || undefined; + const sortOrder = params.get('sortOrder') || undefined; + + const topicsParam = params.getAll('topic'); + + const topics = parseQueryParamArray(topicsParam); + const yearFilterEnabled = params.get('yearFilterEnabled') === 'true'; + + const filterModeRaw = params.get('filterMode'); + const filterMode = + filterModeRaw === 'in' || filterModeRaw === 'from' + ? filterModeRaw + : undefined; + + const filterYear = params.get('filterYear') + ? Number.parseInt(params.get('filterYear')!, 10) + : undefined; + + const personsService = inject(PersonsService); + + return personsService.searchPersonsList( + query, + institutionName, + sortBy, + sortOrder, + topics, + page, + pageSize, + defaultIncludes, + yearFilterEnabled ? true : undefined, + yearFilterEnabled ? filterMode : undefined, + yearFilterEnabled ? filterYear : undefined, + ); +}; diff --git a/webapp/src/app/resolvers/person-news.resolver.ts b/webapp/src/app/resolvers/person-news.resolver.ts new file mode 100644 index 00000000..9d361534 --- /dev/null +++ b/webapp/src/app/resolvers/person-news.resolver.ts @@ -0,0 +1,57 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; +import { of } from 'rxjs'; + +import { WorksService } from '../api'; + +export interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; +} + +export interface NewsPage { + total: number; + page: number; + page_size: number; + results: NewsArticle[]; +} + +export const personNewsResolver: ResolveFn = (route) => { + const httpClient = inject(HttpClient); + const worksService = inject(WorksService); + + const authorId = route.parent?.paramMap.get('id'); + if (!authorId) { + return of({ total: 0, page: 1, page_size: 0, results: [] }); + } + + const queryParams = route.queryParamMap; + + const page = queryParams.get('page') + ? Number.parseInt(queryParams.get('page')!, 10) + : 1; + + const pageSize = queryParams.get('pageSize') + ? Number.parseInt(queryParams.get('pageSize')!, 10) + : 10; + + const sortOrder = queryParams.get('sortOrder') || 'desc'; + const query = queryParams.get('query') || ''; + + let params = new HttpParams() + .set('authorId', authorId) + .set('page', page) + .set('pageSize', pageSize) + .set('sortOrder', sortOrder); + + if (query) { + params = params.set('query', query); + } + + const basePath = worksService.configuration.basePath ?? ''; + return httpClient.get(`${basePath}/api/news/by-author`, { params }); +}; diff --git a/webapp/src/app/resolvers/person.resolver.ts b/webapp/src/app/resolvers/person.resolver.ts new file mode 100644 index 00000000..b8175a50 --- /dev/null +++ b/webapp/src/app/resolvers/person.resolver.ts @@ -0,0 +1,23 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { CustomAuthorsListResponse, PersonsService } from '../api'; + +export const personResolver: ResolveFn = ( + route, + state, +) => { + const PERSON_INCLUDE_TAGS = + 'display_name,works_count,cited_by_count,summary_stats,ids,' + + 'last_known_institutions,affiliations,topics,orcid,' + + 'topics_full,topic_share,sources,counts_by_year,works_api_url,' + + 'dates,cited_by_count_boost,career_metrics'; + + const authorId = route.paramMap.get('id') || undefined; + const personsService = inject(PersonsService); + + if (!authorId) { + return { results: [] }; + } + + return personsService.getPersonByID(authorId, PERSON_INCLUDE_TAGS); +}; diff --git a/webapp/src/app/shared/guards/admin.guard.ts b/webapp/src/app/shared/guards/admin.guard.ts index 1dd277f0..b5b48337 100644 --- a/webapp/src/app/shared/guards/admin.guard.ts +++ b/webapp/src/app/shared/guards/admin.guard.ts @@ -6,18 +6,18 @@ import { Observable, of, switchMap, takeWhile } from 'rxjs'; export const adminGuard: CanActivateFn = (route, state) => { let credentialService = inject(CredentialService); let router = inject(Router); - return new Observable(subscriber => { - credentialService.validating.pipe(takeWhile(validating => validating)).subscribe({ - complete: () => { - if (!credentialService.superadmin.value) { - router.navigate(['/login']); - return subscriber.next(false); - } else { - return subscriber.next(true); - } - } - }); + return new Observable((subscriber) => { + credentialService.validating + .pipe(takeWhile((validating) => validating)) + .subscribe({ + complete: () => { + if (!credentialService.superadmin.value) { + router.navigate(['/login']); + return subscriber.next(false); + } else { + return subscriber.next(true); + } + }, + }); }); -} - - +}; diff --git a/webapp/src/app/shared/guards/user.guard.ts b/webapp/src/app/shared/guards/user.guard.ts index a44f5f58..c64e9cbc 100644 --- a/webapp/src/app/shared/guards/user.guard.ts +++ b/webapp/src/app/shared/guards/user.guard.ts @@ -6,16 +6,21 @@ import { Observable, of, switchMap, takeWhile } from 'rxjs'; export const userGuard: CanActivateFn = (route, state) => { let credentialService = inject(CredentialService); let router = inject(Router); - return new Observable(subscriber => { - credentialService.validating.pipe(takeWhile(validating => validating)).subscribe({ - complete: () => { - if (!credentialService.superadmin.value && !credentialService.universityadmin.value) { - router.navigate(['/login']); - return subscriber.next(false); - } else { - return subscriber.next(true); - } - } - }); + return new Observable((subscriber) => { + credentialService.validating + .pipe(takeWhile((validating) => validating)) + .subscribe({ + complete: () => { + if ( + !credentialService.superadmin.value && + !credentialService.universityadmin.value + ) { + router.navigate(['/login']); + return subscriber.next(false); + } else { + return subscriber.next(true); + } + }, + }); }); }; diff --git a/webapp/src/app/shared/interceptors/authentication.interceptor.ts b/webapp/src/app/shared/interceptors/authentication.interceptor.ts index e4cd322d..ac649afd 100644 --- a/webapp/src/app/shared/interceptors/authentication.interceptor.ts +++ b/webapp/src/app/shared/interceptors/authentication.interceptor.ts @@ -4,17 +4,30 @@ import { CredentialService } from '../services/credential.service'; import { switchMap, throwError } from 'rxjs'; export const authenticationInterceptor: HttpInterceptorFn = (req, next) => { - if (req.method == 'POST' && (req.url.endsWith('/auth/id') || req.url.endsWith('/auth/access'))) { + if ( + (req.method == 'POST' && + (req.url.endsWith('/auth/id') || + req.url.endsWith('/auth/access') || + req.url.endsWith('/inse-account/create'))) || + req.url.endsWith('/institutions/autocomplete') + ) { return next(req); } else { const credentialService = inject(CredentialService); const tokenProvider = credentialService.getBearerToken(); return tokenProvider.pipe( - switchMap(response => { + switchMap((response) => { if (response == undefined) { - return throwError(() => new HttpErrorResponse({ status: 403, statusText: 'Forbidden' })); + return throwError( + () => + new HttpErrorResponse({ status: 403, statusText: 'Forbidden' }), + ); } else { - return next(req.clone({ headers: req.headers.set('Authorization', 'Bearer ' + response)})); + return next( + req.clone({ + headers: req.headers.set('Authorization', 'Bearer ' + response), + }), + ); } }), ); diff --git a/webapp/src/app/shared/pipes/truncate.pipe.ts b/webapp/src/app/shared/pipes/truncate.pipe.ts index 2d20cd60..018aadc8 100644 --- a/webapp/src/app/shared/pipes/truncate.pipe.ts +++ b/webapp/src/app/shared/pipes/truncate.pipe.ts @@ -2,13 +2,11 @@ import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'truncate', - standalone: true + standalone: true, }) export class TruncatePipe implements PipeTransform { - transform(value: string, limit: number): string { if (!value) return ''; return value.length > limit ? value.substring(0, limit) + '...' : value; } - } diff --git a/webapp/src/app/shared/services/api.service.ts b/webapp/src/app/shared/services/api.service.ts index 9925c823..a9e86954 100644 --- a/webapp/src/app/shared/services/api.service.ts +++ b/webapp/src/app/shared/services/api.service.ts @@ -21,10 +21,9 @@ export interface ItemCreate { } @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class ApiService { - private readonly basePath = '/inse-service'; constructor(private http: HttpClient) {} diff --git a/webapp/src/app/shared/services/credential.service.ts b/webapp/src/app/shared/services/credential.service.ts index e75f73c8..a6963764 100644 --- a/webapp/src/app/shared/services/credential.service.ts +++ b/webapp/src/app/shared/services/credential.service.ts @@ -1,14 +1,19 @@ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -//import { BehaviorSubject, Observable, takeWhile } from 'rxjs'; +import { Injectable, inject } from '@angular/core'; import { filter, take, map } from 'rxjs/operators'; //TODO: review by arman import { Observable, of } from 'rxjs'; // review import { BehaviorSubject } from 'rxjs'; //review +import { + INSEAccountServiceService, + IdentityGrant as ApiIdentityGrant, + AccessGrant as ApiAccessGrant, +} from '../../api'; export interface AuthAccount { i: number; l: string; o: number; + e: string; + on: string; } export interface AuthScope { @@ -44,39 +49,52 @@ interface TimedAccessGrant { } @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CredentialService { + private accountService = inject(INSEAccountServiceService); - private static readonly KEY_GRANT = "grant"; + private static readonly KEY_GRANT = 'grant'; public readonly validating = new BehaviorSubject(false); public readonly authenticated = new BehaviorSubject(false); public readonly superadmin = new BehaviorSubject(false); public readonly universityadmin = new BehaviorSubject(false); - public readonly organization = new BehaviorSubject(undefined); - public readonly login = new BehaviorSubject(""); + public readonly organization = new BehaviorSubject( + undefined, + ); + public readonly login = new BehaviorSubject(''); + public readonly email = new BehaviorSubject(''); + public readonly organizationName = new BehaviorSubject(''); - private readonly identityToken = new BehaviorSubject(undefined); - private readonly accessToken = new BehaviorSubject(undefined); + private readonly identityToken = new BehaviorSubject< + TimedIdentityGrant | undefined + >(undefined); + private readonly accessToken = new BehaviorSubject< + TimedAccessGrant | undefined + >(undefined); private request = 0; - constructor(private http: HttpClient) { + constructor() { this.accessToken.subscribe((token) => { if (token) { const r = token.grant.scope.r as string[]; this.superadmin.next(r.includes('SUPER_ADMIN')); this.universityadmin.next(r.includes('UNI_ADMIN')); this.login.next(token.grant.scope.a?.l ?? ''); + this.email.next(token.grant.scope.a?.e ?? ''); + this.organizationName.next(token.grant.scope.a?.on ?? ''); } else { this.superadmin.next(false); this.universityadmin.next(false); - this.login.next(""); + this.login.next(''); + this.email.next(''); + this.organizationName.next(''); } }); const data = localStorage.getItem(CredentialService.KEY_GRANT); - const id = data ? JSON.parse(data) as TimedIdentityGrant : undefined; + const id = data ? (JSON.parse(data) as TimedIdentityGrant) : undefined; if (id && id.expiration && id.expiration >= Date.now()) { this.identityToken.next(id); this.validating.next(true); @@ -99,20 +117,24 @@ export class CredentialService { body.set('username', login); body.set('password', password); - this.http.post('/inse-account/auth/id', body.toString(), { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' } - }).subscribe({ + this.accountService.getIdentityGrant(login, password).subscribe({ next: (result) => { if (this.request != request) return; - const token = { grant: result, expiration: result.expires_in * 1000 + now }; + const token: TimedIdentityGrant = { + grant: result as any as IdentityGrant, + expiration: result.expires_in * 1000 + now, + }; this.identityToken.next(token); - localStorage.setItem(CredentialService.KEY_GRANT, JSON.stringify(token)); + localStorage.setItem( + CredentialService.KEY_GRANT, + JSON.stringify(token), + ); this.refreshAccessToken(token); }, error: () => { if (this.request != request) return; this.validating.next(false); - } + }, }); } @@ -124,32 +146,30 @@ export class CredentialService { const uid = identityToken.grant.scope.a!.i; const org = identityToken.grant.scope.a!.o; - const body = new URLSearchParams(); - body.set('secret', identityToken.grant.access_token); - body.set('account', uid.toString()); - body.set('organization', org.toString()); - - this.http.post('/inse-account/auth/access', body.toString(), { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' } - }).subscribe({ - next: (result) => { - if (this.request != request) return; - const token = { grant: result, expiration: result.expires_in * 1000 + now }; - this.accessToken.next(token); - this.organization.next(result.scope.a!.o); - this.authenticated.next(true); - this.validating.next(false); - }, - error: () => { - if (this.request != request) return; - this.identityToken.next(undefined); - this.organization.next(undefined); - this.authenticated.next(false); - this.superadmin.next(false); - this.universityadmin.next(false); - this.validating.next(false); - } - }); + this.accountService + .getAccessGrant(identityToken.grant.access_token, uid, org) + .subscribe({ + next: (result) => { + if (this.request != request) return; + const token: TimedAccessGrant = { + grant: result as any as AccessGrant, + expiration: result.expires_in * 1000 + now, + }; + this.accessToken.next(token); + this.organization.next(result.scope.a!.o); + this.authenticated.next(true); + this.validating.next(false); + }, + error: () => { + if (this.request != request) return; + this.identityToken.next(undefined); + this.organization.next(undefined); + this.authenticated.next(false); + this.superadmin.next(false); + this.universityadmin.next(false); + this.validating.next(false); + }, + }); } public logoutAcount() { @@ -164,11 +184,17 @@ export class CredentialService { this.validating.next(false); } + public registerAccount(data: any): Observable { + return this.accountService.createUser(data); + } //review: arman (generated fix) public getBearerToken(): Observable { // 1. If we have a valid access token, return it immediately and complete. - if (this.accessToken.value && Date.now() < this.accessToken.value.expiration) { + if ( + this.accessToken.value && + Date.now() < this.accessToken.value.expiration + ) { return of(this.accessToken.value.grant.access_token); } @@ -182,9 +208,13 @@ export class CredentialService { // 3. Wait for the validation to finish, then return the resulting token. return this.validating.pipe( - filter(isValidating => !isValidating), // Wait until validating becomes false + filter((isValidating) => !isValidating), // Wait until validating becomes false take(1), // Take exactly 1 emission and then automatically complete() - map(() => this.accessToken.value ? this.accessToken.value.grant.access_token : undefined) + map(() => + this.accessToken.value + ? this.accessToken.value.grant.access_token + : undefined, + ), ); } /* Old version with added complete statements to resolve loading spinner issue diff --git a/webapp/src/app/shared/services/error.service.ts b/webapp/src/app/shared/services/error.service.ts new file mode 100644 index 00000000..04eb0e40 --- /dev/null +++ b/webapp/src/app/shared/services/error.service.ts @@ -0,0 +1,27 @@ +import { Injectable, signal } from '@angular/core'; + +export interface ErrorState { + statusCode: number; + title: string; + message: string; + errorDetails?: string; +} + +@Injectable({ + providedIn: 'root', +}) +export class ErrorService { + private readonly errorSignal = signal(null); + + setError(error: ErrorState): void { + this.errorSignal.set(error); + } + + clearError(): void { + this.errorSignal.set(null); + } + + getError(): ErrorState | null { + return this.errorSignal(); + } +} diff --git a/webapp/src/app/shared/services/pagination.service.ts b/webapp/src/app/shared/services/pagination.service.ts index fecd6cb6..d7537a35 100644 --- a/webapp/src/app/shared/services/pagination.service.ts +++ b/webapp/src/app/shared/services/pagination.service.ts @@ -1,13 +1,12 @@ import { Injectable } from '@angular/core'; @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PaginationService { - public readonly options = [1, 5, 10, 25, 100]; public selection = 10; - constructor() { } + constructor() {} } diff --git a/webapp/src/app/shared/services/resolver-state.service.ts b/webapp/src/app/shared/services/resolver-state.service.ts new file mode 100644 index 00000000..f6eb2052 --- /dev/null +++ b/webapp/src/app/shared/services/resolver-state.service.ts @@ -0,0 +1,49 @@ +import { Injectable, signal, inject, computed } from '@angular/core'; +import { Router, RouterEvent, ActivatedRoute } from '@angular/router'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { ResolveEnd, ResolveStart } from '@angular/router'; +import { + NavigationEnd, + NavigationError, + NavigationCancel, +} from '@angular/router'; +@Injectable({ providedIn: 'root' }) +export class ResolverStateService { + private readonly router = inject(Router); + + readonly resolvingUrl = signal(null); + readonly previousUrl = signal(null); + + readonly isResolving = computed(() => this.resolvingUrl() !== null); + + constructor() { + this.router.events.subscribe((event) => { + if (event instanceof ResolveStart) { + this.previousUrl.set(this.router.url); // capture current before it changes + this.resolvingUrl.set(event.url); + } + + if ( + event instanceof NavigationEnd || + event instanceof NavigationCancel || + event instanceof NavigationError + ) { + this.resolvingUrl.set(null); + } + }); + } + + isResolvingFromOutside(path: string) { + const from = this.previousUrl(); + const to = this.resolvingUrl(); + if (!to?.startsWith(path)) return false; + return !from?.startsWith(path); // came from outside + } + + isResolvingInside(path: string) { + const from = this.previousUrl(); + const to = this.resolvingUrl(); + if (to?.startsWith(path) && from?.startsWith(path)) return true; + return false; + } +} diff --git a/webapp/src/app/shared/services/shared-state.service.ts b/webapp/src/app/shared/services/shared-state.service.ts index e03428ba..fb4b9bc9 100644 --- a/webapp/src/app/shared/services/shared-state.service.ts +++ b/webapp/src/app/shared/services/shared-state.service.ts @@ -2,12 +2,10 @@ import { Injectable, signal } from '@angular/core'; import { AuthorsListResponse } from '../../api'; @Injectable({ providedIn: 'root' }) export class SharedStateService { - - searchValue = signal(null); persons = signal({ meta: null, results: [], - group_by: [] + group_by: [], }); hasSearched = signal(false); @@ -15,7 +13,7 @@ export class SharedStateService { this.persons.set({ meta: null, results: [], - group_by: [] + group_by: [], }); } -} \ No newline at end of file +} diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.html b/webapp/src/app/shared/ui/app-layout/app-layout.component.html index b2fe1274..7b479fe8 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.html +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.html @@ -1,6 +1,8 @@
- + @if ( (credentialService.authenticated | async) && ((credentialService.superadmin | async) || @@ -8,50 +10,69 @@ ) { - + [(opened)]="sideNavOpen"> + + } - -
- @if ( - mediaQuery.matches && (credentialService.authenticated | async) - ) { - + } + - } - -
- - - -
- -
-
+
+ +
+ +
+ + }
- +
+ @if (resolverState.isResolvingFromOutside('/persons')) { + + } @else if (resolverState.isResolvingFromOutside('/person/')) { + + } @else if (resolverState.isResolvingFromOutside('/projects/')) { + + } @else { + + } +
+ +
+ +
diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.scss b/webapp/src/app/shared/ui/app-layout/app-layout.component.scss index e7864dd0..1f16e6cf 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.scss +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.scss @@ -1,148 +1,149 @@ @use '@angular/material' as mat; -@import '../../../../m3-theme.scss'; .app-shell { - height: 100svh; - overflow: hidden; - background: var(--sg-background); + height: 100svh; + overflow: hidden; + background: var(--sg-background); } .container, .drawer-container { - width: 100%; - height: 100%; - background: var(--sg-background); + width: 100%; + height: 100%; + background: var(--sg-background); } .container { - overflow: hidden; + overflow: hidden; } .content-shell { - min-height: 100%; - background: var(--sg-background); + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; + background: var(--sg-background); } mat-toolbar.main { - position: sticky; - top: 0; - z-index: 10; - display: grid; - grid-template-columns: minmax(190px, 1fr) minmax(320px, 560px) minmax(130px, 1fr); - gap: 24px; - height: 76px; - padding: 0 32px; - background: rgba(255, 255, 255, 0.92); - border-bottom: 1px solid var(--sg-border); - color: var(--sg-text); - backdrop-filter: blur(16px); - box-shadow: none; + position: sticky; + top: 0; + z-index: 10; + display: grid; + grid-template-columns: minmax(190px, 1fr) minmax(320px, 560px) minmax( + 130px, + 1fr + ); + gap: 24px; + height: 76px; + padding: 0 32px; + background: var(--sg-surface-soft); + border-bottom: 1px solid var(--sg-border); + color: var(--sg-text); + box-shadow: none; } .topbar-left, .topbar-actions { - display: flex; - align-items: center; - gap: 10px; + display: flex; + align-items: center; + gap: 10px; } .topbar-actions { - justify-content: flex-end; + justify-content: flex-end; } .topbar-actions button { - color: var(--sg-text); + color: var(--sg-text); } .back-link { - display: inline-flex; - align-items: center; - gap: 10px; - min-height: 42px; - border: 0; - background: transparent; - color: var(--sg-text-muted); - font-size: 13px; - cursor: pointer; + display: inline-flex; + align-items: center; + gap: 10px; + min-height: 42px; + border: 0; + background: transparent; + color: var(--sg-text-muted); + font-size: 13px; + cursor: pointer; } .back-link mat-icon { - font-size: 20px; - width: 20px; - height: 20px; -} - -.search-box { - display: flex; - align-items: center; - gap: 12px; - height: 44px; - align-self: center; - padding: 0 18px; - background: var(--sg-surface-muted); - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); - color: var(--sg-text-soft); - font-size: 13px; - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); -} - -.search-box input { - width: 100%; - min-width: 0; - border: 0; - outline: 0; - background: transparent; - color: var(--sg-text); -} - -.search-box input::placeholder { - color: var(--sg-text-muted); + font-size: 20px; + width: 20px; + height: 20px; } .drawer { - width: var(--sg-sidebar-width); - background: var(--sg-surface); - border-right: 1px solid var(--sg-border); - box-shadow: none; + width: var(--sg-sidebar-width); + background: var(--sg-surface); + border-right: 1px solid var(--sg-border); + border-radius: 0; + box-shadow: none; +} + +.drawer--collapsed { + width: 64px; } .content { - min-height: calc(100svh - 76px); - background: var(--sg-background); + display: flex; + flex-direction: column; + flex: 1; + overflow-y: auto; + background: var(--sg-background); +} + +.main-content-body { + flex: 1; +} + +.footer-container { + flex-shrink: 0; + padding: 12px 32px; + background: var(--sg-surface-soft); + border-top: 1px solid var(--sg-border); +} + +.footer { + font-size: 12px; + color: var(--sg-text-muted); + text-align: center; } @media (max-width: 900px) { - mat-toolbar.main { - grid-template-columns: auto 1fr auto; - height: auto; - min-height: 72px; - padding: 12px 16px; - gap: 12px; - } + mat-toolbar.main { + grid-template-columns: auto 1fr auto; + height: auto; + min-height: 72px; + padding: 12px 16px; + gap: 12px; + } - .back-link span { - display: none; - } + .back-link span { + display: none; + } - .search-box { - height: 44px; - } + .search-box { + height: 44px; + } } @media (max-width: 600px) { - mat-toolbar.main { - grid-template-columns: 1fr auto; - } + mat-toolbar.main { + grid-template-columns: 1fr auto; + } - .search-box { - grid-column: 1 / -1; - order: 3; - } + .search-box { + grid-column: 1 / -1; + order: 3; + } - .content { - min-height: calc(100svh - 124px); - } + .content { + min-height: 0; + } } .search-wrapper { position: relative; @@ -157,13 +158,12 @@ mat-toolbar.main { background: white; border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); - box-shadow: 0 4px 12px rgba(0,0,0,0.1); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); z-index: 1000; max-height: 300px; overflow-y: auto; } - .search-result-item { padding: 10px 16px; cursor: pointer; diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts index d92dd9f2..f0a1e6c1 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts @@ -4,45 +4,66 @@ import { OnDestroy, OnInit, ViewChild, + inject, } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MatToolbarModule } from '@angular/material/toolbar'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatDrawer, MatSidenavModule } from '@angular/material/sidenav'; -import { Router} from '@angular/router'; +import { Router } from '@angular/router'; import { MediaMatcher } from '@angular/cdk/layout'; import { AppMenuComponent } from '../app-menu/app-menu.component'; import { MatTooltipModule } from '@angular/material/tooltip'; import { CredentialService } from '../../services/credential.service'; -import { FormControl,ReactiveFormsModule } from '@angular/forms'; -import { SharedStateService } from '../../services/shared-state.service'; import { Location } from '@angular/common'; - +import { AppSearchbarComponent } from '../app-searchbar/app-searchbar.component'; +import { ResolverStateService } from '../../services/resolver-state.service'; +import { LoadingComponent } from '../loading/loading.component'; @Component({ - selector: 'app-layout', - imports: [CommonModule, MatToolbarModule, MatSidenavModule, MatButtonModule, MatIconModule, AppMenuComponent, MatTooltipModule,ReactiveFormsModule], - templateUrl: './app-layout.component.html', - styleUrl: './app-layout.component.scss', - standalone: true, + selector: 'app-layout', + imports: [ + CommonModule, + MatToolbarModule, + MatSidenavModule, + MatButtonModule, + MatIconModule, + AppMenuComponent, + MatTooltipModule, + AppSearchbarComponent, + LoadingComponent, + ], + templateUrl: './app-layout.component.html', + styleUrl: './app-layout.component.scss', + standalone: true, }) export class AppLayoutComponent implements OnInit, OnDestroy { @ViewChild(MatDrawer, { static: false }) drawer?: MatDrawer; mediaQuery: MediaQueryList; - + protected resolverState = inject(ResolverStateService); mediaQueryListener: () => void; + private readonly sidebarCollapsedStorageKey = 'inse.sidebar.collapsed'; sideNavOpen = false; - searchValue = new FormControl(''); - constructor(public credentialService: CredentialService, public router: Router, - private location:Location, - private state: SharedStateService, - public changeDetector: ChangeDetectorRef, media: MediaMatcher) { + sideNavCollapsed = this.readSidebarCollapsedState(); + + constructor( + public credentialService: CredentialService, + public router: Router, + private location: Location, + public changeDetector: ChangeDetectorRef, + media: MediaMatcher, + ) { this.mediaQuery = media.matchMedia('(max-width: 600px)'); this.mediaQueryListener = () => { this.sideNavOpen = !this.mediaQuery.matches; + + if (this.mediaQuery.matches) { + this.sideNavCollapsed = false; + } + changeDetector.detectChanges(); }; } @@ -53,6 +74,26 @@ export class AppLayoutComponent implements OnInit, OnDestroy { } } + private readSidebarCollapsedState(): boolean { + return localStorage.getItem(this.sidebarCollapsedStorageKey) === 'true'; + } + + isSidebarCollapsed(): boolean { + return this.sideNavCollapsed && !this.mediaQuery.matches; + } + + toggleSidebarCollapsed(): void { + if (this.mediaQuery.matches) { + return; + } + + this.sideNavCollapsed = !this.sideNavCollapsed; + localStorage.setItem( + this.sidebarCollapsedStorageKey, + String(this.sideNavCollapsed), + ); + } + ngOnInit() { this.sideNavOpen = !this.mediaQuery.matches; this.mediaQuery.addEventListener('change', this.mediaQueryListener); @@ -66,15 +107,7 @@ export class AppLayoutComponent implements OnInit, OnDestroy { this.credentialService.logoutAcount(); this.router.navigate(['/']); } - startSearch(){ - const query = this.searchValue.value || null; - this.state.searchValue.set(query); - this.router.navigate(['/persons'], { - queryParams: { query, page: 1 }, - queryParamsHandling: 'merge', - }); - } - navigateBack(){ - this.location.back() + navigateBack() { + this.location.back(); } } diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index caea0f1d..ab143d54 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.html +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.html @@ -1,55 +1,130 @@ -