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/src/main/inse/.env b/service/src/main/inse/.env index 2b84a5ea..b5adb53d 100644 --- a/service/src/main/inse/.env +++ b/service/src/main/inse/.env @@ -6,4 +6,7 @@ ELASTICSEARCH_INSE_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FM 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 + +ELASTICSEARCH_INSE_URL=https://inse.nes.uni-due.de/elastic +ELASTICSEARCH_INSE_API_KEY=bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== \ No newline at end of file diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py index bfa60cfc..c72e5db4 100644 --- a/service/src/main/inse/config.py +++ b/service/src/main/inse/config.py @@ -58,6 +58,11 @@ class Settings(BaseSettings): {"url": "http://localhost:8000", "description": "Local development server"}, ] + elasticsearch_inse_url: Optional[str] = None + elasticsearch_inse_api_key: Optional[str] = None + + 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/institutions/institutions_search_client.py b/service/src/main/inse/institutions/institutions_search_client.py new file mode 100644 index 00000000..23a736af --- /dev/null +++ b/service/src/main/inse/institutions/institutions_search_client.py @@ -0,0 +1,194 @@ +import logging +from typing import List, Set + +import httpx + +from inse.models.openalex.institution import Institution +from inse.exceptions import NotFoundException + + +logger = logging.getLogger(__name__) + + +class InstitutionsSearchClient: + def __init__( + self, + base_url: str, + api_key: str, + ): + self.base_url = base_url + self.api_key = api_key + self.headers = { + "Content-Type": "application/json", + "Authorization": f"ApiKey {self.api_key}", + } + + async def get_institution_by_id(self, raw_institution_id: str) -> Institution: + query = { + "query": { + "match": { + "id": f"https://openalex.org/{raw_institution_id.upper()}", + } + }, + "size": 1, + } + authors = await self.get_authors_by_institution_id(raw_institution_id) + logger.debug( + "Retrieved authors for institution_id=%s: %s", raw_institution_id, authors + ) + + async with httpx.AsyncClient() as client: + response = await client.post( + f"{self.base_url}/openalex-institutions/_search", + json=query, + headers=self.headers, + ) + response.raise_for_status() + hits = response.json().get("hits", {}).get("hits", []) + if not hits: + raise NotFoundException( + f"Institution with ID '{raw_institution_id}' not found." + ) + + return Institution.from_dict(hits[0]["_source"]) + + async def get_authors_by_institution_id(self, raw_institution_id: str) -> List[str]: + query = { + "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, + ) + async with httpx.AsyncClient() as client: + response = await client.post( + "https://project.nes.uni-due.de/elastic/openalex-authors/_search", + json=query, + headers=self.headers, + ) + try: + response.raise_for_status() + except httpx.HTTPStatusError as e: + logger.exception( + "Error fetching authors for institution_id=%s: %s, response content: %s", + raw_institution_id, + str(e), + response.text, + ) + return [] + hits = response.json().get("hits", {}).get("hits", []) + authors = set() + for hit in hits: + authors.update( + auth["author"]["display_name"] + for auth in hit["_source"].get("authorships", []) + ) + return list(authors) + + async def get_institution_aliases_by_id(self, raw_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_institution_id (str): The raw institution ID for which to retrieve aliases. + + Returns: + List[str]: A list of aliases for the given institution ID. + """ + institution = await self.get_institution_by_id(raw_institution_id) + aliases = list( + self.augment_aliases(set(institution.display_name_alternatives or [])) + | self.get_predefined_institution_aliases(raw_institution_id) + ) + logger.debug( + "Retrieved aliases for institution_id=%s: %s", raw_institution_id, aliases + ) + return aliases + + def get_predefined_institution_aliases(self, raw_institution_id: str) -> Set[str]: + """Get predefined aliases for a given institution ID. + + Args: + raw_institution_id (str): The raw institution ID for which to retrieve predefined aliases. + + Returns: + Set[str]: A set of predefined aliases for the given institution ID. + """ + raw_institution_id = raw_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_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 diff --git a/service/src/main/inse/institutions/logic.py b/service/src/main/inse/institutions/logic.py index 65a49ed6..a4f834ee 100644 --- a/service/src/main/inse/institutions/logic.py +++ b/service/src/main/inse/institutions/logic.py @@ -3,9 +3,10 @@ """ Business logic for OpenAlex institutions. """ + import logging from copy import deepcopy -from typing import Any +from typing import Any, Optional import httpx from fastapi import HTTPException @@ -15,9 +16,13 @@ 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.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__) @@ -33,6 +38,12 @@ _VALID_INSTITUTION_TYPES = { } +async def get_institution_by_id( + raw_institution_id: str, client: InstitutionsSearchClient +) -> Institution: + return await client.get_institution_by_id(raw_institution_id) + + async def list_institutions( *, search: str | None = None, @@ -85,7 +96,10 @@ async def list_institutions( try: normalized_data = _normalize_institutions_response(data) - return InstitutionsListResponse.from_dict(normalized_data) or InstitutionsListResponse() + return ( + InstitutionsListResponse.from_dict(normalized_data) + or InstitutionsListResponse() + ) except ValidationError as exc: logger.exception("OpenAlex institutions response could not be parsed.") raise HTTPException( @@ -114,10 +128,7 @@ async def autocomplete_institutions( sort="works_count:desc", per_page=limit, page=1, - select=( - "id,ror,display_name,country_code,type,works_count," - "cited_by_count,geo" - ), + select=("id,ror,display_name,country_code,type,works_count,cited_by_count,geo"), client=client, ) @@ -165,7 +176,13 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: meta = normalized.get("meta") if isinstance(meta, dict): - for field in ["count", "db_response_time_ms", "page", "per_page", "groups_count"]: + 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")) @@ -187,7 +204,10 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: 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: + 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) @@ -202,7 +222,9 @@ def _normalize_institutions_response(data: dict[str, Any]) -> dict[str, Any]: 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")) + institution["updated_date"] = _datetime_str_or_none( + institution.get("updated_date") + ) summary_stats = institution.get("summary_stats") if isinstance(summary_stats, dict): diff --git a/service/src/main/inse/institutions/search_client.py b/service/src/main/inse/institutions/search_client.py index 3db5e1dd..9839e24c 100644 --- a/service/src/main/inse/institutions/search_client.py +++ b/service/src/main/inse/institutions/search_client.py @@ -3,6 +3,7 @@ """ HTTP client for OpenAlex institutions. """ + from typing import Any import httpx @@ -19,8 +20,14 @@ class OpenAlexInstitutionsClient: 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.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( diff --git a/service/src/main/inse/institutions/service.py b/service/src/main/inse/institutions/service.py index 424fb7af..dd13b718 100644 --- a/service/src/main/inse/institutions/service.py +++ b/service/src/main/inse/institutions/service.py @@ -3,20 +3,60 @@ """ REST API for OpenAlex institutions. """ + +from functools import lru_cache from typing import Annotated -from fastapi import APIRouter -from fastapi import Query +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.config import get_settings +from inse.models.openalex.institution import Institution from . import logic +from inse.institutions.institutions_search_client import InstitutionsSearchClient router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS]) +@lru_cache +def get_institutions_search_client() -> InstitutionsSearchClient: + settings = get_settings() + if not settings.elasticsearch_url: + raise ValueError("Elasticsearch URL is missing in settings.") + if not settings.elasticsearch_api_key: + raise ValueError("Elasticsearch API key is missing in settings.") + + return InstitutionsSearchClient( + api_key=settings.elasticsearch_api_key, + base_url=settings.elasticsearch_url, + ) + + +@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( "/autocomplete", operation_id="autocompleteInstitutions", @@ -27,7 +67,10 @@ router = APIRouter(prefix="/api/institutions", tags=[Tags.INSTITUTIONS]) async def autocomplete_institutions( query: Annotated[ str, - Query(description="Institution search text, for example 'Duisburg Essen'.", min_length=1), + Query( + description="Institution search text, for example 'Duisburg Essen'.", + min_length=1, + ), ], country_code: Annotated[ str | None, @@ -64,7 +107,9 @@ async def list_institutions( ] = None, filter: Annotated[ str | None, - Query(description="OpenAlex filter, for example 'country_code:DE,type:education'."), + Query( + description="OpenAlex filter, for example 'country_code:DE,type:education'." + ), ] = None, sort: Annotated[ str | None, @@ -88,7 +133,11 @@ async def list_institutions( ] = None, sample: Annotated[ int | None, - Query(description="Random sample size. Cannot be combined with sort or page.", ge=1, le=10000), + Query( + description="Random sample size. Cannot be combined with sort or page.", + ge=1, + le=10000, + ), ] = None, select: Annotated[ str | None, diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index a1e4614e..450a4dd9 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -7,8 +7,8 @@ webapp. """ import logging -from fastapi import FastAPI -from fastapi.responses import RedirectResponse +from fastapi import FastAPI, Request +from fastapi.responses import JSONResponse, RedirectResponse from fastapi.middleware.cors import CORSMiddleware from inse.collaboration_network.router import router as collaboration_network_router from inse.institutions.service import router as institutions_service_router @@ -16,7 +16,11 @@ 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.projects.router import router as projects_router +# caching +from inse.middleware.etag_cache import ETagCacheMiddleware +from inse.exceptions import NotFoundException from . import config from .service import router as service_router from .account.service import router as account_router @@ -43,15 +47,27 @@ app.include_router(funders_service_router) app.include_router(service_router) app.include_router(account_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/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/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/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/persons/logic.py b/service/src/main/inse/persons/logic.py index 409ce5ae..88b36788 100644 --- a/service/src/main/inse/persons/logic.py +++ b/service/src/main/inse/persons/logic.py @@ -20,9 +20,35 @@ 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 +from inse.persons.model import ( + CustomAuthor, + CustomAuthorsListResponse, + PersonSearchRequest, +) + logger = logging.getLogger(__name__) -INDEX_NAME="openalex-authors" +INDEX_NAME = "openalex-authors" + + +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, @@ -83,7 +109,7 @@ def _fetch_author_display_name(author_id: str) -> Optional[str]: if not hits: return None - + return hits[0].get("_source", {}).get("display_name") @@ -96,7 +122,7 @@ def _fetch_works_and_topics(author_id: str) -> tuple[list, list]: "cited_by_count", "primary_topic", ] - + author_url = f"https://openalex.org/{author_id.strip()}" authorship_query = { @@ -140,18 +166,22 @@ def _fetch_works_and_topics(author_id: str) -> tuple[list, list]: works.append(hit.get("_source", {})) topics = [] - buckets = response.get("aggregations", {}).get("primary_topics", {}).get("buckets", []) + 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"), - }) + topics.append( + { + "id": bucket.get("key"), + "display_name": display_name, + "count": bucket.get("doc_count"), + } + ) return works, topics @@ -162,13 +192,15 @@ def _build_papers(works: list) -> list: 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"), - }, - }) + papers.append( + { + "name": name, + "abstract": abstract, + "stats": { + "cited_by_count": work.get("cited_by_count"), + }, + } + ) return papers @@ -205,7 +237,12 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s 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) + 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( @@ -214,17 +251,16 @@ def generate_person_bio(author_id: str, include: Optional[set[str]] = None) -> s return bio -def get_person_by_id(author_id: str, include: Optional[str] = None) -> AuthorsListResponse: + +def get_person_by_id( + author_id: str, include: Optional[str] = None +) -> AuthorsListResponse: body = { - "_source":include.split(",") if include else True, + "_source": include.split(",") if include else True, } try: - hit = elasticsearch.get( - index="openalex-authors", - body=body, - doc_id=author_id - ) + 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" @@ -238,7 +274,10 @@ def get_person_by_id(author_id: str, include: Optional[str] = None) -> AuthorsLi def search_persons_by_name( - author_name: str, limit: Optional[int] = 10, page_offset: Optional[int] = 0, include: Optional[str] = None + 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") @@ -270,78 +309,73 @@ def search_persons_by_name( offset=page_offset, source=include.split(",") if include else True, size=limit, - track_total_hits=True + 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) + 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)) + 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: +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" - ) + 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;" + "query": { + "wildcard": { + "display_name.keyword": { + "value": author_name + "*", + "case_insensitive": True, + } } - } - } - ], - "boost_mode": "multiply" + }, + "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" } + 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 + "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 - ) + response = elasticsearch.search(index="openalex-authors", body=body) except Exception as e: raise HTTPException( - status_code=500, - detail=f"Elasticsearch search failed: {str(e)}" + 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) + 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) @@ -352,16 +386,20 @@ def search_persons_autocomplete(author_name: str, limit: Optional[int] = 5, incl if orcid_val: ids_copy["orcid"] = str(orcid_val) source_copy["ids"] = ids_copy - - for key,value in fields.items(): - source_copy[key] = value + + 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 + institution_name: str, + limit: Optional[int] = 10, + page_offset: Optional[int] = 0, + include: Optional[str] = None, ) -> AuthorsListResponse: if not institution_name: @@ -380,7 +418,7 @@ def search_persons_by_institution( } ] } - } + }, } } try: @@ -391,32 +429,34 @@ def search_persons_by_institution( size=limit, offset=page_offset, sort=[{"works_count": {"order": "desc"}}], - track_total_hits=True + 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) + 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)) + 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'): + if hasattr(author_data, "model_dump"): author_data = author_data.model_dump() - elif hasattr(author_data, 'to_dict'): + 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) - + h = int(hashlib.md5(author_id.encode("utf-8")).hexdigest(), 16) # Experimental suitability rating suitability_score = h % 100 @@ -446,6 +486,7 @@ def _enrich_author_data(author_data) -> Optional[CustomAuthor]: ) return author + def advanced_search_persons( query: Optional[str] = None, institution_name: Optional[str] = None, @@ -470,9 +511,9 @@ def advanced_search_persons( page_size=page_size, include=include, strict=strict, - track_total_hits = True, + track_total_hits=True, filter_mode=filter_mode, - filter_year=filter_year + filter_year=filter_year, ) response_dict = elasticsearch.search( index=INDEX_NAME, @@ -482,12 +523,7 @@ def advanced_search_persons( 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 - ) + 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)}") @@ -509,7 +545,7 @@ def advanced_search_persons( raise HTTPException( status_code=500, detail=f"Elasticsearch search failed: {str(e)}" ) - total_count = response_dict.get("hits",{}).get("total",{}).get("value",0) + 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) @@ -521,10 +557,5 @@ def advanced_search_persons( results.append(custom_author) return CustomAuthorsListResponse( - results=results, - meta=Meta( - count=total_count, - page=page, - per_page=page_size - ) + results=results, meta=Meta(count=total_count, page=page, per_page=page_size) ) diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py new file mode 100644 index 00000000..03a3caa3 --- /dev/null +++ b/service/src/main/inse/projects/model.py @@ -0,0 +1,75 @@ +from typing import List, Optional + +from pydantic import BaseModel, Field + +from inse.models.bund_project import BundProject +from inse.models.eu_project import EuProject + + +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." + ) 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..c448c704 --- /dev/null +++ b/service/src/main/inse/projects/projects_search_client.py @@ -0,0 +1,625 @@ +import json +import logging +from typing import Any, Dict, List, Optional + +import httpx + +from inse.config import get_settings +from inse.models.bund_project import BundProject +from inse.projects.model import ( + BundProjectPage, + DfgProjectPage, + DfgProjectSummary, + EuProjectPage, +) +from inse.models.eu_project import EuProject + + +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", +] + + +class ProjectsSearchClient: + def __init__( + self, + base_url: str, + index: str, + api_key: str, + ): + self.base_url = base_url + self.index = index + self.api_key = api_key + self.headers = { + "Content-Type": "application/json", + "Authorization": f"ApiKey {self.api_key}", + } + + async def make_search_request(self, query: dict) -> dict: + async with httpx.AsyncClient() as client: + response = await client.post( + f"{self.base_url}/{self.index}/_search", + json=query, + headers=self.headers, + ) + + try: + response.raise_for_status() + except httpx.HTTPStatusError as e: + logger.exception( + f"HTTP error occurred: {e.response.status_code} - {e.response.text}" + ) + raise + + return response.json() + + +class BundProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_bund", + api_key=settings.elasticsearch_inse_api_key, + ) + + def bund_projects_query( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + topic: Optional[str] = None, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> dict: + from_ = page * size + query: Dict[str, Any] = {"size": size, "from": from_, "query": {}} + + must_clauses: List[Dict[str, Any]] = [] + if id: + must_clauses.append({"match": {"id": id}}) + + 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 topic is not None and topic.strip() != "": + must_clauses.append( + { + "match_phrase_prefix": { + "Thema": { + "query": topic, + "max_expansions": 50, + } + } + } + ) + + if must_clauses: + query["query"] = {"bool": {"must": must_clauses}} + else: + query["query"] = {"match_all": {}} + + sort_by = sort_by.strip() + if sort_by == "topic": + sort_by = "Thema.keyword" + elif sort_by == "department": + sort_by = "Ressort_fullname.keyword" + elif sort_by == "grant_amount": + sort_by = "Fördersumme" + + sort_direction = sort_direction.strip().lower() + if sort_direction not in ["asc", "desc"]: + sort_direction = "asc" + + query["sort"] = [{f"{sort_by}": {"order": sort_direction}}] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed Bund project query: {query_str}") + + return query + + def response_to_bund_project_page( + self, response: dict, page: int, size: int + ) -> BundProjectPage: + 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 + ) + + async def search_bund_projects( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + topic: Optional[str] = None, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> BundProjectPage: + query = self.bund_projects_query( + page=page, + size=size, + id=id, + institution_names=institution_names, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_bund_project_page(response, page, size) + + async def get_bund_projects_by_institution_name( + self, + institution_names: List[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> BundProjectPage: + query = self.bund_projects_query( + page=page, + size=size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_bund_project_page(response, page, size) + + +class EuProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_eu_all", + api_key=settings.elasticsearch_inse_api_key, + ) + + def eu_projects_query( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + topic: Optional[str] = "Network", + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> dict: + from_ = page * size + query: Dict[str, Any] = {"size": size, "from": from_, "query": {}} + + must_clauses: List[Dict[str, Any]] = [] + if id: + must_clauses.append({"match": {"id": id}}) + + if topic is not None and topic.strip() != "": + must_clauses.append( + { + "match_phrase_prefix": { + "title": { + "query": topic, + "max_expansions": 50, + } + } + } + ) + + if institution_names: + must_clauses.append( + { + "nested": { + "path": "organization_nested", + "query": { + "bool": { + "should": [ + { + "match": { + "organization_nested.name": { + "query": name, + "operator": "and", + } + } + } + for name in institution_names + ], + "minimum_should_match": 1, + } + }, + } + } + ) + + if must_clauses: + query["query"] = {"bool": {"must": must_clauses}} + else: + query["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" + + sort_config: Dict[str, Any] = {} + + if sort_by == "topic": + sort_config = {"title.keyword": {"order": sort_direction}} + + elif sort_by == "grant_amount": + sort_config = {"totalCost.keyword": {"order": sort_direction}} + + elif sort_by == "department": + sort_config = { + "programme_nested.programme.keyword": { + "order": sort_direction, + "nested": {"path": "programme_nested"}, + } + } + else: + sort_config = {"id.keyword": {"order": sort_direction}} + + query["sort"] = [sort_config] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed EU project query: {query_str}") + + return query + + def response_to_eu_project_page( + self, response: dict, page: int, size: int + ) -> EuProjectPage: + hits_block = response.get("hits", {}) + total_hits = hits_block.get("total", {}).get("value", 0) + elements = [ + EuProject.model_validate(hit["_source"]) + for hit in hits_block.get("hits", []) + ] + return EuProjectPage(elements=elements, total=total_hits, page=page, size=size) + + async def search_eu_projects( + self, + page: int, + size: int, + id: Optional[str] = None, + institution_names: List[str] = [], + topic: Optional[str] = None, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> EuProjectPage: + query = self.eu_projects_query( + page=page, + size=size, + id=id, + institution_names=institution_names, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_eu_project_page(response, page, size) + + async def get_eu_projects_by_institution_name( + self, + institution_names: List[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", + ) -> EuProjectPage: + query = self.eu_projects_query( + page=page, + size=size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_eu_project_page(response, page, size) + + +class DfgProjectsSearchClient(ProjectsSearchClient): + def __init__(self): + if not settings.elasticsearch_inse_url: + raise ValueError("Elasticsearch INSE URL is missing in settings.") + if not settings.elasticsearch_inse_api_key: + raise ValueError("Elasticsearch INSE API key is missing in settings.") + super().__init__( + base_url=settings.elasticsearch_inse_url, + index="projects_dfg_all", + api_key=settings.elasticsearch_inse_api_key, + ) + + def dfg_projects_query( + self, + page: int, + size: int, + names: Optional[List[str]] = None, + topic: Optional[str] = None, + sort_by: str = "id", + sort_direction: str = "asc", + ) -> dict: + + from_ = page * size + + painless_fields_string = ", ".join( + [f"'{f}.keyword'" for f in DFG_PERSON_FIELDS] + ) + + query: 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: + query["query"] = {"bool": {}} + if must_clauses: + query["query"]["bool"]["must"] = must_clauses + if filter_clauses: + query["query"]["bool"]["filter"] = filter_clauses + else: + query["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}} + + query["sort"] = [sort_config] + + query_str = json.dumps(query, indent=2) + logger.debug(f"Constructed DFG project query: {query_str}") + + return query + + def response_to_dfg_project_page( + self, response: dict, page: int, size: int + ) -> DfgProjectPage: + 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) + + async def search_dfg_projects( + self, + page: int, + size: int, + names: Optional[List[str]] = None, + topic: Optional[str] = None, + sort_by: str = "id", + sort_direction: str = "asc", + ) -> DfgProjectPage: + query = self.dfg_projects_query( + page=page, + size=size, + names=names, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + response = await self.make_search_request(query) + return self.response_to_dfg_project_page(response, page, size) diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py new file mode 100644 index 00000000..cf8e2a12 --- /dev/null +++ b/service/src/main/inse/projects/router.py @@ -0,0 +1,176 @@ +from functools import lru_cache +import logging +from typing import Annotated, Optional + +from fastapi import APIRouter, Depends, Query, status + +from inse.projects.model import BundProjectPage, DfgProjectPage, EuProjectPage +from inse.tags import Tags +from inse.projects import service as projects_service +from inse.projects.projects_search_client import ( + BundProjectsSearchClient, + DfgProjectsSearchClient, + EuProjectsSearchClient, +) +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) +from inse.institutions.service import get_institutions_search_client + +logger = logging.getLogger(__name__) + +router = APIRouter(prefix="/api/projects", tags=[Tags.PROJECTS]) + + +@lru_cache +def get_bund_search_client() -> BundProjectsSearchClient: + return BundProjectsSearchClient() + + +@lru_cache +def get_eu_search_client() -> EuProjectsSearchClient: + return EuProjectsSearchClient() + + +@lru_cache +def get_dfg_search_client() -> DfgProjectsSearchClient: + return DfgProjectsSearchClient() + + +@router.get( + "/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="getBundProjects", + 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 get_bund_projects( + bund_search_client: Annotated[ + BundProjectsSearchClient, Depends(get_bund_search_client) + ], + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + institution_id: Annotated[ + str, Query(description="The institution 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", +) -> BundProjectPage: + return await projects_service.get_bund_projects_by_institution_id( + bund_search_client=bund_search_client, + institutions_search_client=institutions_search_client, + institution_id=institution_id, + page=page, + size=size, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + +@router.get( + "/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="getEuProjects", + responses={ + status.HTTP_200_OK: { + "description": "Successful Response", + "model": EuProjectPage, + }, + status.HTTP_404_NOT_FOUND: {"description": "Institution not found"}, + }, + response_model_by_alias=False, +) +async def get_eu_projects( + eu_search_client: Annotated[EuProjectsSearchClient, Depends(get_eu_search_client)], + institutions_search_client: Annotated[ + InstitutionsSearchClient, Depends(get_institutions_search_client) + ], + institution_id: Annotated[ + str, Query(description="The institution 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", +) -> EuProjectPage: + return await projects_service.get_eu_projects_by_institution_id( + eu_search_client=eu_search_client, + institutions_search_client=institutions_search_client, + institution_id=institution_id, + topic=topic, + page=page, + size=size, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + +@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( + dfg_search_client: Annotated[ + DfgProjectsSearchClient, Depends(get_dfg_search_client) + ], + 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( + dfg_search_client=dfg_search_client, + author_id=author_id, + topic=topic, + page=page, + size=size, + 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..f6693a57 --- /dev/null +++ b/service/src/main/inse/projects/service.py @@ -0,0 +1,133 @@ +import logging +from typing import List, Optional + +from inse.projects.projects_search_client import ( + BundProjectsSearchClient, + DfgProjectsSearchClient, + EuProjectsSearchClient, +) +from inse.projects.model import BundProjectPage, DfgProjectPage, EuProjectPage +from inse.institutions.institutions_search_client import ( + InstitutionsSearchClient, +) +from inse.exceptions import NotFoundException +from inse.persons.logic import get_author_name_by_id + +logger = logging.getLogger(__name__) + + +async def get_bund_projects_by_institution_id( + bund_search_client: BundProjectsSearchClient, + institutions_search_client: InstitutionsSearchClient, + institution_id: str, + page: int, + size: int, + topic: Optional[str], + sort_by: str = "topic", + sort_direction: str = "asc", +) -> BundProjectPage: + logger.info( + f"Fetching bund projects for institution_id={institution_id}, page={page}, size={size}" + ) + institution_aliases = ( + await institutions_search_client.get_institution_aliases_by_id(institution_id) + ) + logger.debug( + f"Found institution aliases for institution_id={institution_id}: {institution_aliases}" + ) + response = await bund_search_client.search_bund_projects( + page=page, + size=size, + institution_names=institution_aliases, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + logger.debug(f"get_bund_projects_by_institution_id response: {response}") + return response + + +async def get_eu_projects_by_institution_id( + eu_search_client: EuProjectsSearchClient, + institutions_search_client: InstitutionsSearchClient, + institution_id: str, + topic: Optional[str], + page: int, + size: int, + sort_by: str = "topic", + sort_direction: str = "asc", +) -> EuProjectPage: + logger.info( + f"Fetching EU projects for institution_id={institution_id}, page={page}, size={size}" + ) + institution_aliases = ( + await institutions_search_client.get_institution_aliases_by_id(institution_id) + ) + logger.debug( + f"Found institution aliases for institution_id={institution_id}: {institution_aliases}" + ) + response = await eu_search_client.search_eu_projects( + page=page, + size=size, + institution_names=institution_aliases, + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + logger.debug(f"get_eu_projects_by_institution_id response: {response}") + return response + + +async def get_bund_projects_by_institution_name( + bund_search_client: BundProjectsSearchClient, + page: int, + size: int, + institution_names: List[str] = [], + sort_by: str = "topic", + sort_direction: str = "asc", +) -> BundProjectPage: + logger.info( + f"Fetching bund projects for institution_names={institution_names}, page={page}, size={size}" + ) + response = await bund_search_client.search_bund_projects( + page=page, + size=size, + institution_names=institution_names, + sort_by=sort_by, + sort_direction=sort_direction, + ) + + logger.debug(f"get_bund_projects_by_institution_name response: {response}") + + return response + + +async def get_dfg_projects_by_author_id( + dfg_search_client: DfgProjectsSearchClient, + 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 = await dfg_search_client.search_dfg_projects( + page=page, + size=size, + names=[name], + topic=topic, + sort_by=sort_by, + sort_direction=sort_direction, + ) + return response diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 21c6b03c..600bcfb0 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -7,3 +7,4 @@ class Tags(Enum): INSTITUTIONS = "Institutions" TOPICS = "Topics" WORKS = "Works" + PROJECTS = "Projects" diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py index 3b1f61fe..40e2c9f1 100644 --- a/service/src/main/inse/works/logic.py +++ b/service/src/main/inse/works/logic.py @@ -391,6 +391,19 @@ 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()): @@ -400,11 +413,14 @@ async def get_topics_by_time_by_author( topics = [] for topic in topic_items[:max_topics_per_year]: + info = topic_details.get(topic["id"], {}) + topics.append( TopicCount( id=topic["id"], name=topic["name"], count=topic["count"], + description=info.get("description"), ) ) @@ -414,11 +430,14 @@ async def get_topics_by_time_by_author( primary_topics = [] for topic in primary_topic_items[:max_topics_per_year]: + info = topic_details.get(topic["id"], {}) + primary_topics.append( TopicCount( id=topic["id"], name=topic["name"], count=topic["count"], + description=info.get("description"), ) ) diff --git a/ude_person.http b/ude_person.http index 0eef0048..e41036ba 100644 --- a/ude_person.http +++ b/ude_person.http @@ -6,12 +6,648 @@ Content-Type: application/json "query": { "query_string": { "default_field": "name", - "query": "Tobias Janelt" + "query": "Marcus Handte" } } } +### +GET https://inse.nes.uni-due.de/elastic/projects_dfg_all/_search +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": 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 + +{ + "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/_mapping +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +### +GET https://inse.nes.uni-due.de/elastic/projects_bund/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + + "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 @@ -24,10 +660,107 @@ 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-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 + + +### + +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": { @@ -36,9 +769,42 @@ Content-Type: application/json # "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-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 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/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 9779c964..8e08ac07 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -1,117 +1,122 @@ .gitignore +.openapi-generator-ignore README.md api.base.service.ts api.module.ts api/api.ts api/funding.service.ts -api/funding.serviceInterface.ts -api/inse-account-service.service.ts -api/inse-account-service.serviceInterface.ts -api/inse-service.service.ts -api/inse-service.serviceInterface.ts +api/iNSEAccountService.service.ts +api/iNSEService.service.ts api/institutions.service.ts -api/institutions.serviceInterface.ts api/items.service.ts -api/items.serviceInterface.ts -api/person-network.service.ts -api/person-network.serviceInterface.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-network-node.ts -model/author-parsed-longest-name.ts -model/author-position-count.ts -model/author-summary-stats.ts +model/accessGrant.ts +model/authAccount.ts +model/authScope.ts model/author.ts -model/authors-filter-properties.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/autocomplete-response-meta.ts -model/autocomplete-response-results-inner.ts -model/autocomplete-response.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.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/funder-by-author.ts -model/funders-by-author-response.ts +model/bundProject.ts +model/bundProjectPage.ts +model/categoryNested.ts +model/collaborationNetwork.ts +model/collaborationNetworkEdge.ts +model/collaborationNetworkNodeType.ts +model/costUsd.ts +model/customAuthor.ts +model/customAuthorsListResponse.ts +model/dehydratedAuthor.ts +model/dehydratedFunder.ts +model/dehydratedInstitution.ts +model/dehydratedSource.ts +model/dfgProjectPage.ts +model/dfgProjectSummary.ts +model/displayCodeSplittedNested.ts +model/euProject.ts +model/euProjectPage.ts +model/filterInformation.ts +model/filterProperties.ts +model/funderByAuthor.ts +model/fundersByAuthorResponse.ts model/fwci.ts -model/group-by-result.ts -model/http-validation-error.ts -model/identity-grant.ts -model/institution-geo.ts -model/institution-ids.ts -model/institution-information.ts -model/institution-network-node.ts +model/groupByResult.ts +model/hTTPValidationError.ts +model/identityGrant.ts model/institution.ts -model/institutions-list-response.ts -model/item-create.ts -model/item-page.ts +model/institutionGeo.ts +model/institutionIds.ts +model/institutionInformation.ts +model/institutionNetworkNode.ts +model/institutionsListResponse.ts model/item.ts +model/itemCreate.ts +model/itemPage.ts +model/keywordNested.ts model/latitude.ts model/location.ts model/longitude.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/publication-ids-by-author-position.ts -model/publications-by-author-response.ts +model/openAccess.ts +model/organizationNested.ts +model/personBio.ts +model/programmeNested.ts +model/publicationDetailByFunder.ts +model/publicationIdsByAuthorPosition.ts +model/publicationsByAuthorResponse.ts model/score.ts -model/topic-count.ts -model/topic-domain.ts -model/topic-field.ts -model/topic-ids.ts -model/topic-subfield.ts model/topic.ts -model/topics-by-time.ts -model/topics-by-year.ts -model/topics-list-response.ts -model/validation-error-loc-inner.ts -model/validation-error.ts +model/topicCount.ts +model/topicDomain.ts +model/topicField.ts +model/topicIds.ts +model/topicSubfield.ts +model/topicsByTime.ts +model/topicsByYear.ts +model/topicsListResponse.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-network-node.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-filter-properties.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 param.ts provide-api.ts variables.ts diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index a51f46b8..559a00bc 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,30 +1,23 @@ export * from './funding.service'; import { FundingService } from './funding.service'; -export * from './funding.serviceInterface'; -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 './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 './institutions.serviceInterface'; 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 './personNetwork.service'; +import { PersonNetworkService } from './personNetwork.service'; export * from './persons.service'; import { PersonsService } from './persons.service'; -export * from './persons.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 = [ FundingService, INSEAccountServiceService, @@ -33,6 +26,7 @@ export const APIS = [ ItemsService, PersonNetworkService, PersonsService, + ProjectsService, TopicsService, WorksService, ]; diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts index 340b881f..f1f0a1a7 100644 --- a/webapp/src/app/api/api/funding.service.ts +++ b/webapp/src/app/api/api/funding.service.ts @@ -23,25 +23,21 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { FundersByAuthorResponse } from '../model/funders-by-author-response'; +import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { PublicationsByAuthorResponse } from '../model/publications-by-author-response'; +import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { FundingServiceInterface } from './funding.serviceInterface'; @Injectable({ providedIn: 'root', }) -export class FundingService - extends BaseService - implements FundingServiceInterface -{ +export class FundingService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], diff --git a/webapp/src/app/api/api/funding.serviceInterface.ts b/webapp/src/app/api/api/funding.serviceInterface.ts deleted file mode 100644 index 18504afd..00000000 --- a/webapp/src/app/api/api/funding.serviceInterface.ts +++ /dev/null @@ -1,49 +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 { FundersByAuthorResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { PublicationsByAuthorResponse } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface FundingServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Get funding organizations by author. - * - * @endpoint get /api/inse-service/authors/{author_id}/funders - * @param authorId - */ - getFundersByAuthor( - authorId: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Get funded publications by author. - * - * @endpoint get /api/inse-service/authors/{author_id}/publications - * @param authorId - * @param page - * @param pageSize - */ - getPublicationsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - extraHttpRequestParams?: any, - ): Observable; -} 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 4e455475..00000000 --- a/webapp/src/app/api/api/inse-account-service.service.ts +++ /dev/null @@ -1,347 +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 4f3d6db7..00000000 --- a/webapp/src/app/api/api/inse-account-service.serviceInterface.ts +++ /dev/null @@ -1,51 +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 1ce8270c..00000000 --- a/webapp/src/app/api/api/inse-service.service.ts +++ /dev/null @@ -1,957 +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 { 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 { 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, - }, - ); - } - - /** - * 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-service.serviceInterface.ts b/webapp/src/app/api/api/inse-service.serviceInterface.ts deleted file mode 100644 index 97898ea0..00000000 --- a/webapp/src/app/api/api/inse-service.serviceInterface.ts +++ /dev/null @@ -1,108 +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 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; - - /** - * 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; - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * - * @endpoint get /api/inse-service/topics/hierarchy - */ - getTopicHierarchy(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 index 2700f021..e365240f 100644 --- a/webapp/src/app/api/api/institutions.service.ts +++ b/webapp/src/app/api/api/institutions.service.ts @@ -23,25 +23,23 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { AutocompleteResponse } from '../model/autocomplete-response'; +import { AutocompleteResponse } from '../model/autocompleteResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { InstitutionsListResponse } from '../model/institutions-list-response'; +import { Institution } from '../model/institution'; +// @ts-ignore +import { InstitutionsListResponse } from '../model/institutionsListResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { InstitutionsServiceInterface } from './institutions.serviceInterface'; @Injectable({ providedIn: 'root', }) -export class InstitutionsService - extends BaseService - implements InstitutionsServiceInterface -{ +export class InstitutionsService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @@ -190,6 +188,109 @@ export class InstitutionsService ); } + /** + * Returns a single institution by ID. + * Returns a single institution by its OpenAlex ID. + * @endpoint get /api/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/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 a list of OpenAlex institutions. * @endpoint get /api/institutions diff --git a/webapp/src/app/api/api/institutions.serviceInterface.ts b/webapp/src/app/api/api/institutions.serviceInterface.ts deleted file mode 100644 index bfb7f511..00000000 --- a/webapp/src/app/api/api/institutions.serviceInterface.ts +++ /dev/null @@ -1,67 +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 { AutocompleteResponse } from '../model/models'; -import { HTTPValidationError } from '../model/models'; -import { InstitutionsListResponse } from '../model/models'; - -import { Configuration } from '../configuration'; - -export interface InstitutionsServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * Returns institution options for autocomplete inputs. - * - * @endpoint get /api/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. - */ - autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns a list of OpenAlex institutions. - * - * @endpoint get /api/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. - */ - listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - extraHttpRequestParams?: any, - ): Observable; -} diff --git a/webapp/src/app/api/api/items.service.ts b/webapp/src/app/api/api/items.service.ts index 969303a5..bc3c2293 100644 --- a/webapp/src/app/api/api/items.service.ts +++ b/webapp/src/app/api/api/items.service.ts @@ -23,24 +23,23 @@ 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 { BaseService } from '../api.base.service'; -import { ItemsServiceInterface } from './items.serviceInterface'; @Injectable({ 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[], 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 89cbb34c..00000000 --- a/webapp/src/app/api/api/items.serviceInterface.ts +++ /dev/null @@ -1,77 +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/person-network.service.ts b/webapp/src/app/api/api/person-network.service.ts deleted file mode 100644 index 2dc1c55e..00000000 --- a/webapp/src/app/api/api/person-network.service.ts +++ /dev/null @@ -1,172 +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 1a3b6479..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/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index 141555ce..4c6206a2 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -23,27 +23,23 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { AuthorsListResponse } from '../model/authors-list-response'; +import { AuthorsListResponse } from '../model/authorsListResponse'; // @ts-ignore -import { CustomAuthorsListResponse } from '../model/custom-authors-list-response'; +import { CustomAuthorsListResponse } from '../model/customAuthorsListResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { PersonBio } from '../model/person-bio'; +import { PersonBio } from '../model/personBio'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { PersonsServiceInterface } from './persons.serviceInterface'; @Injectable({ 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[], 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 19c4be40..00000000 --- a/webapp/src/app/api/api/persons.serviceInterface.ts +++ /dev/null @@ -1,234 +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 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_1( - 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 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, ... - */ - searchPersonsAutocomplete( - authorName: string, - include: string, - extraHttpRequestParams?: any, - ): Observable; - - /** - * 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, ... - */ - searchPersonsAutocomplete_2( - authorName: 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, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - 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, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - 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, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - 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, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - */ - searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - 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 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 - */ - searchPersonsList( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - 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 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 - */ - searchPersonsList_5( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - 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..b08a911f --- /dev/null +++ b/webapp/src/app/api/api/projects.service.ts @@ -0,0 +1,533 @@ +/** + * 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 { BundProjectPage } from '../model/bundProjectPage'; +// @ts-ignore +import { DfgProjectPage } from '../model/dfgProjectPage'; +// @ts-ignore +import { EuProjectPage } from '../model/euProjectPage'; +// @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 ProjectsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Get bund projects. + * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/institution/bund/search + * @param institutionId The institution 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 getBundProjects( + institutionId: 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 getBundProjects( + institutionId: 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 getBundProjects( + institutionId: 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 getBundProjects( + institutionId: 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 (institutionId === null || institutionId === undefined) { + throw new Error( + 'Required parameter institutionId was null or undefined when calling getBundProjects.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionId, + 'institution_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/institution/bund/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 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. + * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/institution/eu/search + * @param institutionId The institution 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 getEuProjects( + institutionId: 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 getEuProjects( + institutionId: 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 getEuProjects( + institutionId: 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 getEuProjects( + institutionId: 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 (institutionId === null || institutionId === undefined) { + throw new Error( + 'Required parameter institutionId was null or undefined when calling getEuProjects.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionId, + 'institution_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/institution/eu/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 33db87ef..2c218236 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 @@ -11,42 +11,32 @@ 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 { AutocompleteResponse } from '../model/autocomplete-response'; +import { AutocompleteResponse } from '../model/autocompleteResponse'; // @ts-ignore -import { HTTPValidationError } from '../model/http-validation-error'; +import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { TopicsListResponse } from '../model/topics-list-response'; +import { TopicsListResponse } from '../model/topicsListResponse'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; -import { TopicsServiceInterface } from './topics.serviceInterface'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) -export class TopicsService - extends BaseService - implements TopicsServiceInterface -{ - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { +export class TopicsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) { super(basePath, configuration); } @@ -61,119 +51,45 @@ export class TopicsService * @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 { + 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.', - ); + throw new Error('Required parameter query was null or undefined when calling autocompleteTopics.'); } 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', - ); + 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 localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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; + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; @@ -182,9 +98,7 @@ export class TopicsService let localVarPath = `/api/topics/autocomplete`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, @@ -192,11 +106,9 @@ export class TopicsService ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); } @@ -208,86 +120,36 @@ export class TopicsService * @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 { + 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', - ); + 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']); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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; + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; @@ -296,9 +158,7 @@ export class TopicsService let localVarPath = `/api/inse-service/topics/cache`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, @@ -306,11 +166,9 @@ export class TopicsService ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); } @@ -321,87 +179,41 @@ export class TopicsService * @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 { + 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.', - ); + 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', - ); - }); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) } let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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; + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; @@ -410,9 +222,7 @@ export class TopicsService let localVarPath = `/api/inse-service/topics/count`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, @@ -420,11 +230,9 @@ export class TopicsService ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); } @@ -434,66 +242,30 @@ export class TopicsService * @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 { + 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']); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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; + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; @@ -502,20 +274,16 @@ export class TopicsService let localVarPath = `/api/inse-service/topics/hierarchy`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); } @@ -534,149 +302,50 @@ export class TopicsService * @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 { + 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', - ); + 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']); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + 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; + let responseType_: 'text' | 'json' | 'blob' = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; @@ -685,9 +354,7 @@ export class TopicsService let localVarPath = `/api/topics`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, + return this.httpClient.request('get', `${basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, @@ -695,14 +362,215 @@ export class TopicsService ...(withCredentials ? { withCredentials } : {}), headers: localVarHeaders, observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); } + 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 < any > { + 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 @@ -712,116 +580,116 @@ export class TopicsService * @param reportProgress flag to report request and response progress. */ public vectorSearchTopics( - query: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; + query: string, + limit ?: number, + observe ?: 'body', + reportProgress ?: boolean, + options ?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, +): Observable; public vectorSearchTopics( - query: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; + query: string, + limit ?: number, + observe ?: 'response', + reportProgress ?: boolean, + options ?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, +): Observable>; public vectorSearchTopics( - query: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; + query: string, + limit ?: number, + observe ?: 'events', + reportProgress ?: boolean, + options ?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, +): Observable>; public vectorSearchTopics( - query: 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 vectorSearchTopics.', - ); - } + query: string, + limit ?: number, + observe: any = 'body', + reportProgress: boolean = false, + options ?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, +): Observable < any > { + 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', - ); - if (limit !== undefined && limit !== null) { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - } +let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); +localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', +); +if (limit !== undefined && limit !== null) { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); +} - 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 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, - }, - ); +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/works.service.ts b/webapp/src/app/api/api/works.service.ts index 3806a5e6..20d855a3 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -23,28 +23,27 @@ 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/topic-count'; +import { TopicCount } from '../model/topicCount'; // @ts-ignore -import { TopicsByTime } from '../model/topics-by-time'; +import { TopicsByTime } from '../model/topicsByTime'; // @ts-ignore import { Work } from '../model/work'; // @ts-ignore -import { WorkPage } from '../model/work-page'; +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', }) -export class WorksService extends BaseService implements WorksServiceInterface { +export class WorksService extends BaseService { constructor( protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], 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 718c6192..00000000 --- a/webapp/src/app/api/api/works.serviceInterface.ts +++ /dev/null @@ -1,98 +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 { TopicCount } from '../model/models'; -import { TopicsByTime } from '../model/models'; -import { Work } 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. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - */ - getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - extraHttpRequestParams?: any, - ): Observable; - - /** - * 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. - */ - getPrimaryTopicCountsByAuthor( - authorId: string, - extraHttpRequestParams?: any, - ): Observable>; - - /** - * 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. - */ - getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - extraHttpRequestParams?: any, - ): Observable; - - /** - * Returns one publication. - * - * @endpoint get /api/works/detail/{work_id} - * @param workId The OpenAlex work id, for example W2741809807. - */ - getWork(workId: string, extraHttpRequestParams?: any): Observable; -} diff --git a/webapp/src/app/api/model/access-grant.ts b/webapp/src/app/api/model/access-grant.ts deleted file mode 100644 index a7a6381c..00000000 --- a/webapp/src/app/api/model/access-grant.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 { AuthScope } from './auth-scope'; - -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/auth-scope.ts b/webapp/src/app/api/model/auth-scope.ts deleted file mode 100644 index ed52c93d..00000000 --- a/webapp/src/app/api/model/auth-scope.ts +++ /dev/null @@ -1,17 +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 { AuthAccount } from './auth-account'; - -export interface AuthScope { - t: string; - a: AuthAccount; - d?: number | null; - r?: Array; -} diff --git a/webapp/src/app/api/model/author-affiliations-inner.ts b/webapp/src/app/api/model/author-affiliations-inner.ts deleted file mode 100644 index d13f78c9..00000000 --- a/webapp/src/app/api/model/author-affiliations-inner.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 { DehydratedInstitution } from './dehydrated-institution'; - -/** - * AuthorAffiliationsInner - */ -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/author-counts-by-year-inner.ts deleted file mode 100644 index 1fac5b45..00000000 --- a/webapp/src/app/api/model/author-counts-by-year-inner.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. - */ - -/** - * AuthorCountsByYearInner - */ -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/author-ids.ts deleted file mode 100644 index 0b079d33..00000000 --- a/webapp/src/app/api/model/author-ids.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. - */ - -/** - * External identifiers: - */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; -} diff --git a/webapp/src/app/api/model/author-network-node.ts b/webapp/src/app/api/model/author-network-node.ts deleted file mode 100644 index 2e684c1c..00000000 --- a/webapp/src/app/api/model/author-network-node.ts +++ /dev/null @@ -1,26 +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 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/author-parsed-longest-name.ts deleted file mode 100644 index f08df27d..00000000 --- a/webapp/src/app/api/model/author-parsed-longest-name.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. - */ - -/** - * 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; -} diff --git a/webapp/src/app/api/model/author-position-count.ts b/webapp/src/app/api/model/author-position-count.ts deleted file mode 100644 index 989d2c18..00000000 --- a/webapp/src/app/api/model/author-position-count.ts +++ /dev/null @@ -1,16 +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 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/author-summary-stats.ts deleted file mode 100644 index ede015ad..00000000 --- a/webapp/src/app/api/model/author-summary-stats.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 { Model2YrMeanCitedness } from './model2-yr-mean-citedness'; - -/** - * Citation metrics: - */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; -} diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index a9199cd9..0a050590 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -7,13 +7,13 @@ * 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 diff --git a/webapp/src/app/api/model/authors-filter-properties.ts b/webapp/src/app/api/model/authors-filter-properties.ts deleted file mode 100644 index 50795f2a..00000000 --- a/webapp/src/app/api/model/authors-filter-properties.ts +++ /dev/null @@ -1,24 +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 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/authors-list-response.ts deleted file mode 100644 index 228618c7..00000000 --- a/webapp/src/app/api/model/authors-list-response.ts +++ /dev/null @@ -1,21 +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 { Author } from './author'; -import { GroupByResult } from './group-by-result'; - -/** - * AuthorsListResponse - */ -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 224c6007..f1b9d48e 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -7,8 +7,8 @@ * 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 diff --git a/webapp/src/app/api/model/autocomplete-response-meta.ts b/webapp/src/app/api/model/autocomplete-response-meta.ts deleted file mode 100644 index 5bf94a57..00000000 --- a/webapp/src/app/api/model/autocomplete-response-meta.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * AutocompleteResponseMeta - */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; -} diff --git a/webapp/src/app/api/model/autocomplete-response-results-inner.ts b/webapp/src/app/api/model/autocomplete-response-results-inner.ts deleted file mode 100644 index 0fa956b7..00000000 --- a/webapp/src/app/api/model/autocomplete-response-results-inner.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. - */ - -/** - * 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/autocomplete-response.ts b/webapp/src/app/api/model/autocomplete-response.ts deleted file mode 100644 index b4e91a1d..00000000 --- a/webapp/src/app/api/model/autocomplete-response.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 { AutocompleteResponseMeta } from './autocomplete-response-meta'; -import { AutocompleteResponseResultsInner } from './autocomplete-response-results-inner'; - -/** - * AutocompleteResponse - */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; -} 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/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/categoryNested.ts b/webapp/src/app/api/model/categoryNested.ts new file mode 100644 index 00000000..2e92a624 --- /dev/null +++ b/webapp/src/app/api/model/categoryNested.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 { DisplayCodeSplittedNested } from './displayCodeSplittedNested'; + +export interface CategoryNested { + category?: string | null; + code?: string | null; + display_code?: string | null; + /** + * A tokenized hierarchy breakdown of the display code represented as an array of strings. + */ + display_code_splitted?: Array; + /** + * Granular, nested breakdowns of the split parts of the display code. + */ + display_code_splitted_nested?: Array; +} 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 baffb178..00000000 --- a/webapp/src/app/api/model/collaboration-network-edge.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. - */ - -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/collaboration-network-node-type.ts deleted file mode 100644 index 20d462bd..00000000 --- a/webapp/src/app/api/model/collaboration-network-node-type.ts +++ /dev/null @@ -1,17 +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 const CollaborationNetworkNodeType = { - author: 'author', - institution: 'institution', - work: 'work', -} as const; -export type CollaborationNetworkNodeType = - (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; 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 c923277d..00000000 --- a/webapp/src/app/api/model/collaboration-network.ts +++ /dev/null @@ -1,41 +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 { WorkNetworkNode } from './work-network-node'; -import { CollaborationNetworkEdge } from './collaboration-network-edge'; -import { InstitutionNetworkNode } from './institution-network-node'; -import { AuthorNetworkNode } from './author-network-node'; - -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/cost-usd.ts b/webapp/src/app/api/model/cost-usd.ts deleted file mode 100644 index 494cb094..00000000 --- a/webapp/src/app/api/model/cost-usd.ts +++ /dev/null @@ -1,14 +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. - */ - -/** - * Cost of this request in USD - */ -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 d4a837ad..00000000 --- a/webapp/src/app/api/model/custom-author.ts +++ /dev/null @@ -1,37 +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 72cb2f9d..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 { Author } from './author'; -import { GroupByResult } from './group-by-result'; - -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-author.ts b/webapp/src/app/api/model/dehydrated-author.ts deleted file mode 100644 index 350718ef..00000000 --- a/webapp/src/app/api/model/dehydrated-author.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. - */ - -/** - * [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; -} diff --git a/webapp/src/app/api/model/dehydrated-funder.ts b/webapp/src/app/api/model/dehydrated-funder.ts deleted file mode 100644 index c4231c13..00000000 --- a/webapp/src/app/api/model/dehydrated-funder.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. - */ - -/** - * [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; -} diff --git a/webapp/src/app/api/model/dehydrated-institution.ts b/webapp/src/app/api/model/dehydrated-institution.ts deleted file mode 100644 index 956fc03e..00000000 --- a/webapp/src/app/api/model/dehydrated-institution.ts +++ /dev/null @@ -1,21 +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 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; -} 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 b672b5dd..00000000 --- a/webapp/src/app/api/model/dehydrated-source.ts +++ /dev/null @@ -1,26 +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/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/auth-account.ts b/webapp/src/app/api/model/displayCodeSplittedNested.ts similarity index 71% rename from webapp/src/app/api/model/auth-account.ts rename to webapp/src/app/api/model/displayCodeSplittedNested.ts index 179a3e67..8d7317dc 100644 --- a/webapp/src/app/api/model/auth-account.ts +++ b/webapp/src/app/api/model/displayCodeSplittedNested.ts @@ -8,8 +8,6 @@ * Do not edit the class manually. */ -export interface AuthAccount { - i: number; - l: string; - o: number; +export interface DisplayCodeSplittedNested { + single_display_code?: string | null; } diff --git a/webapp/src/app/api/model/euProject.ts b/webapp/src/app/api/model/euProject.ts new file mode 100644 index 00000000..66469d1f --- /dev/null +++ b/webapp/src/app/api/model/euProject.ts @@ -0,0 +1,49 @@ +/** + * 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 { ProgrammeNested } from './programmeNested'; +import { KeywordNested } from './keywordNested'; +import { OrganizationNested } from './organizationNested'; +import { CategoryNested } from './categoryNested'; + +export interface EuProject { + acronym?: string | null; + /** + * Structured lists of classification categories and taxonomy mappings assigned to the project. + */ + categories_nested?: Array; + doc_number?: string | null; + doi?: string | null; + ec_max_contribution?: string | null; + end_date?: string | null; + funding_end?: string | null; + funding_start?: string | null; + id?: string | null; + keywords?: string | null; + /** + * Strictly tokenized and isolated keywords nested for targeted search engine aggregations. + */ + keywords_nested?: Array; + link?: string | null; + objective?: string | null; + /** + * The full roster of academic, public, or private organizations participating in the project consortium. + */ + organization_nested?: Array; + /** + * The nested historical line of EU funding frameworks and structural grants supporting this project. + */ + programme_nested?: Array; + source?: string | null; + start_date?: string | null; + status?: string | null; + teaser?: string | null; + title?: string | null; + total_cost?: string | null; +} diff --git a/webapp/src/app/api/model/item-page.ts b/webapp/src/app/api/model/euProjectPage.ts similarity index 54% rename from webapp/src/app/api/model/item-page.ts rename to webapp/src/app/api/model/euProjectPage.ts index 53a7140a..276e0b06 100644 --- a/webapp/src/app/api/model/item-page.ts +++ b/webapp/src/app/api/model/euProjectPage.ts @@ -7,23 +7,23 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { Item } from './item'; +import { EuProject } from './euProject'; -export interface ItemPage { +export interface EuProjectPage { /** - * The elements of the page. + * The current page number. */ - elements?: Array; + page?: number; /** - * The page offset in elements. + * The requested page size. */ - offset?: number; + size?: number; /** - * The total number of elements. + * The total number of items. */ total?: number; /** - * The page size in elements. + * The EU projects on this page. */ - size?: number; + 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 47c0ca27..00000000 --- a/webapp/src/app/api/model/filter-information.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 { 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 6b901b2e..00000000 --- a/webapp/src/app/api/model/filter-properties.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 { WorksFilterProperties } from './works-filter-properties'; -import { AuthorsFilterProperties } from './authors-filter-properties'; - -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/funder-by-author.ts b/webapp/src/app/api/model/funder-by-author.ts deleted file mode 100644 index 50dc9bb9..00000000 --- a/webapp/src/app/api/model/funder-by-author.ts +++ /dev/null @@ -1,21 +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 { PublicationIdsByAuthorPosition } from './publication-ids-by-author-position'; -import { AuthorPositionCount } from './author-position-count'; - -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 }; -} diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts index 4fde5d86..c62110e7 100644 --- a/webapp/src/app/api/model/funderByAuthor.ts +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -9,6 +9,7 @@ */ import { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition'; import { AuthorPositionCount } from './authorPositionCount'; +import { PublicationDetailByFunder } from './publicationDetailByFunder'; export interface FunderByAuthor { funder_id?: string | null; @@ -18,4 +19,5 @@ export interface FunderByAuthor { 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/funders-by-author-response.ts b/webapp/src/app/api/model/funders-by-author-response.ts deleted file mode 100644 index 44d0ffbc..00000000 --- a/webapp/src/app/api/model/funders-by-author-response.ts +++ /dev/null @@ -1,17 +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 { FunderByAuthor } from './funder-by-author'; - -export interface FundersByAuthorResponse { - author_id: string; - author_name?: string | null; - funder_count: number; - funders: Array; -} diff --git a/webapp/src/app/api/model/group-by-result.ts b/webapp/src/app/api/model/group-by-result.ts deleted file mode 100644 index 98580663..00000000 --- a/webapp/src/app/api/model/group-by-result.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. - */ - -/** - * GroupByResult - */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; -} diff --git a/webapp/src/app/api/model/http-validation-error.ts b/webapp/src/app/api/model/http-validation-error.ts deleted file mode 100644 index c7691bc7..00000000 --- a/webapp/src/app/api/model/http-validation-error.ts +++ /dev/null @@ -1,14 +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 { ValidationError } from './validation-error'; - -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 264feeb0..00000000 --- a/webapp/src/app/api/model/identity-grant.ts +++ /dev/null @@ -1,17 +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/institution-geo.ts b/webapp/src/app/api/model/institution-geo.ts deleted file mode 100644 index b438d37c..00000000 --- a/webapp/src/app/api/model/institution-geo.ts +++ /dev/null @@ -1,24 +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 { 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/institution-ids.ts b/webapp/src/app/api/model/institution-ids.ts deleted file mode 100644 index fd952098..00000000 --- a/webapp/src/app/api/model/institution-ids.ts +++ /dev/null @@ -1,21 +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. - */ - -/** - * 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/institution-information.ts b/webapp/src/app/api/model/institution-information.ts deleted file mode 100644 index 9e12986d..00000000 --- a/webapp/src/app/api/model/institution-information.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. - */ - -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-network-node.ts b/webapp/src/app/api/model/institution-network-node.ts deleted file mode 100644 index 981be8cf..00000000 --- a/webapp/src/app/api/model/institution-network-node.ts +++ /dev/null @@ -1,26 +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 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/institution.ts b/webapp/src/app/api/model/institution.ts index 8a86878a..c099fc57 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -7,10 +7,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { InstitutionIds } from './institution-ids'; -import { AuthorCountsByYearInner } from './author-counts-by-year-inner'; -import { AuthorSummaryStats } from './author-summary-stats'; -import { InstitutionGeo } from './institution-geo'; +import { InstitutionIds } from './institutionIds'; +import { AuthorCountsByYearInner } from './authorCountsByYearInner'; +import { AuthorSummaryStats } from './authorSummaryStats'; +import { InstitutionGeo } from './institutionGeo'; /** * A university, research organization, or other affiliation diff --git a/webapp/src/app/api/model/institutions-list-response.ts b/webapp/src/app/api/model/institutions-list-response.ts deleted file mode 100644 index 15487606..00000000 --- a/webapp/src/app/api/model/institutions-list-response.ts +++ /dev/null @@ -1,21 +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 { Institution } from './institution'; -import { GroupByResult } from './group-by-result'; - -/** - * 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 36920a12..00000000 --- a/webapp/src/app/api/model/item-create.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. - */ - -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/model2-yr-mean-citedness.ts b/webapp/src/app/api/model/keywordNested.ts similarity index 77% rename from webapp/src/app/api/model/model2-yr-mean-citedness.ts rename to webapp/src/app/api/model/keywordNested.ts index d9c3d9df..f52bb734 100644 --- a/webapp/src/app/api/model/model2-yr-mean-citedness.ts +++ b/webapp/src/app/api/model/keywordNested.ts @@ -8,4 +8,6 @@ * Do not edit the class manually. */ -export interface Model2YrMeanCitedness {} +export interface KeywordNested { + keyword?: string | null; +} diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index ba587ef2..f92e2ffb 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { DehydratedSource } from './dehydrated-source'; +import { DehydratedSource } from './dehydratedSource'; /** * Where a work is hosted diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index 0457bafa..f9f56443 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { CostUsd } from './cost-usd'; +import { CostUsd } from './costUsd'; /** * Metadata about the query results diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index cd44ec17..8caaecfd 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -1,86 +1,98 @@ -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-network-node'; -export * from './author-parsed-longest-name'; -export * from './author-position-count'; -export * from './author-summary-stats'; -export * from './authors-filter-properties'; -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 './autocomplete-response'; -export * from './autocomplete-response-meta'; -export * from './autocomplete-response-results-inner'; +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-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 './funder-by-author'; -export * from './funders-by-author-response'; +export * from './bundProject'; +export * from './bundProjectPage'; +export * from './categoryNested'; +export * from './collaborationNetwork'; +export * from './collaborationNetworkEdge'; +export * from './collaborationNetworkNodeType'; +export * from './costUsd'; +export * from './customAuthor'; +export * from './customAuthorsListResponse'; +export * from './dehydratedAuthor'; +export * from './dehydratedFunder'; +export * from './dehydratedInstitution'; +export * from './dehydratedSource'; +export * from './dfgProjectPage'; +export * from './dfgProjectSummary'; +export * from './displayCodeSplittedNested'; +export * from './euProject'; +export * from './euProjectPage'; +export * from './filterInformation'; +export * from './filterProperties'; +export * from './funderByAuthor'; +export * from './fundersByAuthorResponse'; export * from './fwci'; -export * from './group-by-result'; -export * from './http-validation-error'; -export * from './identity-grant'; +export * from './groupByResult'; +export * from './hTTPValidationError'; +export * from './identityGrant'; export * from './institution'; -export * from './institution-geo'; -export * from './institution-ids'; -export * from './institution-information'; -export * from './institution-network-node'; -export * from './institutions-list-response'; +export * from './institutionGeo'; +export * from './institutionIds'; +export * from './institutionInformation'; +export * from './institutionNetworkNode'; +export * from './institutionsListResponse'; export * from './item'; -export * from './item-create'; -export * from './item-page'; +export * from './itemCreate'; +export * from './itemPage'; +export * from './keywordNested'; export * from './latitude'; export * from './location'; export * from './longitude'; export * from './meta'; -export * from './model2-yr-mean-citedness'; -export * from './open-access'; -export * from './person-bio'; -export * from './publication-ids-by-author-position'; -export * from './publications-by-author-response'; +export * from './model2YrMeanCitedness'; +export * from './openAccess'; +export * from './organizationNested'; +export * from './personBio'; +export * from './programmeNested'; +export * from './publicationDetailByFunder'; +export * from './publicationIdsByAuthorPosition'; +export * from './publicationsByAuthorResponse'; export * from './score'; export * from './topic'; -export * from './topic-count'; -export * from './topic-domain'; -export * from './topic-field'; -export * from './topic-ids'; -export * from './topic-subfield'; -export * from './topics-by-time'; -export * from './topics-by-year'; -export * from './topics-list-response'; -export * from './validation-error'; -export * from './validation-error-loc-inner'; +export * from './topicCount'; +export * from './topicDomain'; +export * from './topicField'; +export * from './topicIds'; +export * from './topicSubfield'; +export * from './topicsByTime'; +export * from './topicsByYear'; +export * from './topicsListResponse'; +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-network-node'; -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-filter-properties'; -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'; diff --git a/webapp/src/app/api/model/open-access.ts b/webapp/src/app/api/model/open-access.ts deleted file mode 100644 index 40d7b1d0..00000000 --- a/webapp/src/app/api/model/open-access.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. - */ - -/** - * Open access information - */ -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/topic-field.ts b/webapp/src/app/api/model/organizationNested.ts similarity index 53% rename from webapp/src/app/api/model/topic-field.ts rename to webapp/src/app/api/model/organizationNested.ts index cd7d08c8..8c948d35 100644 --- a/webapp/src/app/api/model/topic-field.ts +++ b/webapp/src/app/api/model/organizationNested.ts @@ -8,10 +8,11 @@ * Do not edit the class manually. */ -/** - * The field (second level) containing this topic: - */ -export interface TopicField { +export interface OrganizationNested { + ec_contribution?: string | null; id?: string | null; - display_name?: string | null; + name?: string | null; + net_ec_contribution?: string | null; + total_cost?: string | null; + organization_type?: string | null; } diff --git a/webapp/src/app/api/model/person-bio.ts b/webapp/src/app/api/model/person-bio.ts deleted file mode 100644 index b060c9a9..00000000 --- a/webapp/src/app/api/model/person-bio.ts +++ /dev/null @@ -1,16 +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 PersonBio { - /** - * The generated biography. - */ - bio: string; -} diff --git a/webapp/src/app/api/model/work-topic-field.ts b/webapp/src/app/api/model/programmeNested.ts similarity index 66% rename from webapp/src/app/api/model/work-topic-field.ts rename to webapp/src/app/api/model/programmeNested.ts index 432b993e..98710fdb 100644 --- a/webapp/src/app/api/model/work-topic-field.ts +++ b/webapp/src/app/api/model/programmeNested.ts @@ -8,10 +8,8 @@ * Do not edit the class manually. */ -/** - * The parent [field](/api-reference/fields) - */ -export interface WorkTopicField { +export interface ProgrammeNested { + code?: string | null; id?: string | null; - display_name?: string | null; + programme?: string | null; } diff --git a/webapp/src/app/api/model/publication-ids-by-author-position.ts b/webapp/src/app/api/model/publication-ids-by-author-position.ts deleted file mode 100644 index d549f8ed..00000000 --- a/webapp/src/app/api/model/publication-ids-by-author-position.ts +++ /dev/null @@ -1,16 +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 PublicationIdsByAuthorPosition { - first?: Array; - middle?: Array; - last?: Array; - unknown?: Array; -} 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/publications-by-author-response.ts b/webapp/src/app/api/model/publications-by-author-response.ts deleted file mode 100644 index 35333880..00000000 --- a/webapp/src/app/api/model/publications-by-author-response.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. - */ - -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/topic-count.ts b/webapp/src/app/api/model/topic-count.ts deleted file mode 100644 index 559242d9..00000000 --- a/webapp/src/app/api/model/topic-count.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 TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; -} diff --git a/webapp/src/app/api/model/topic-domain.ts b/webapp/src/app/api/model/topic-domain.ts deleted file mode 100644 index 573bef0d..00000000 --- a/webapp/src/app/api/model/topic-domain.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * 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/topic-ids.ts b/webapp/src/app/api/model/topic-ids.ts deleted file mode 100644 index 22ca3343..00000000 --- a/webapp/src/app/api/model/topic-ids.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * External identifiers: - */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; -} diff --git a/webapp/src/app/api/model/topic-subfield.ts b/webapp/src/app/api/model/topic-subfield.ts deleted file mode 100644 index 79f3c9c7..00000000 --- a/webapp/src/app/api/model/topic-subfield.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * 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/topic.ts b/webapp/src/app/api/model/topic.ts index 36f66189..eaac16f6 100644 --- a/webapp/src/app/api/model/topic.ts +++ b/webapp/src/app/api/model/topic.ts @@ -7,10 +7,10 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicDomain } from './topic-domain'; -import { TopicIds } from './topic-ids'; -import { TopicSubfield } from './topic-subfield'; -import { TopicField } from './topic-field'; +import { TopicDomain } from './topicDomain'; +import { TopicIds } from './topicIds'; +import { TopicSubfield } from './topicSubfield'; +import { TopicField } from './topicField'; /** * A research topic automatically assigned to works diff --git a/webapp/src/app/api/model/topics-by-time.ts b/webapp/src/app/api/model/topics-by-time.ts deleted file mode 100644 index 377ac395..00000000 --- a/webapp/src/app/api/model/topics-by-time.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 { TopicsByYear } from './topicsByYear'; - -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/topics-by-year.ts b/webapp/src/app/api/model/topics-by-year.ts deleted file mode 100644 index 8aaafbf6..00000000 --- a/webapp/src/app/api/model/topics-by-year.ts +++ /dev/null @@ -1,29 +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 { TopicCount } from './topic-count'; - -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/topics-list-response.ts b/webapp/src/app/api/model/topics-list-response.ts deleted file mode 100644 index 54285ca1..00000000 --- a/webapp/src/app/api/model/topics-list-response.ts +++ /dev/null @@ -1,21 +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 { GroupByResult } from './group-by-result'; -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/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 3242d9fc..007dc43d 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -7,7 +7,7 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { TopicsByYear } from './topics-by-year'; +import { TopicsByYear } from './topicsByYear'; export interface TopicsByTime { /** @@ -19,7 +19,7 @@ export interface TopicsByTime { */ total?: number; /** - * True if the timeline contains only a limited subset of the author's publications. + * True if the timeline contains only a limited subset of the author\'s publications. */ is_limited?: boolean; /** diff --git a/webapp/src/app/api/model/validation-error-loc-inner.ts b/webapp/src/app/api/model/validation-error-loc-inner.ts deleted file mode 100644 index 3c1ffa29..00000000 --- a/webapp/src/app/api/model/validation-error-loc-inner.ts +++ /dev/null @@ -1,11 +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 ValidationErrorLocInner {} 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 87fed83b..00000000 --- a/webapp/src/app/api/model/validation-error.ts +++ /dev/null @@ -1,16 +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/work-biblio.ts b/webapp/src/app/api/model/work-biblio.ts deleted file mode 100644 index 65c0a34b..00000000 --- a/webapp/src/app/api/model/work-biblio.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. - */ - -/** - * 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; -} diff --git a/webapp/src/app/api/model/work-citation-normalized-percentile.ts b/webapp/src/app/api/model/work-citation-normalized-percentile.ts deleted file mode 100644 index 4a2bc6d4..00000000 --- a/webapp/src/app/api/model/work-citation-normalized-percentile.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 { 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; -} diff --git a/webapp/src/app/api/model/work-cited-by-percentile-year.ts b/webapp/src/app/api/model/work-cited-by-percentile-year.ts deleted file mode 100644 index 7bcd3c85..00000000 --- a/webapp/src/app/api/model/work-cited-by-percentile-year.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * Percentile rank compared to other works published in the same year. Contains `min` and `max`. - */ -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/work-counts-by-year-inner.ts deleted file mode 100644 index 496a11db..00000000 --- a/webapp/src/app/api/model/work-counts-by-year-inner.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * WorkCountsByYearInner - */ -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/work-has-content.ts deleted file mode 100644 index 76871238..00000000 --- a/webapp/src/app/api/model/work-has-content.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * Information about downloadable full-text content: - */ -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/work-ids.ts deleted file mode 100644 index fe562e40..00000000 --- a/webapp/src/app/api/model/work-ids.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. - */ - -/** - * 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; -} diff --git a/webapp/src/app/api/model/work-keyword.ts b/webapp/src/app/api/model/work-keyword.ts deleted file mode 100644 index 7270db25..00000000 --- a/webapp/src/app/api/model/work-keyword.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 { Score } from './score'; - -/** - * WorkKeyword - */ -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/work-mesh-inner.ts deleted file mode 100644 index 36a0c569..00000000 --- a/webapp/src/app/api/model/work-mesh-inner.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. - */ - -/** - * 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; -} diff --git a/webapp/src/app/api/model/work-network-node.ts b/webapp/src/app/api/model/work-network-node.ts deleted file mode 100644 index 0bedef21..00000000 --- a/webapp/src/app/api/model/work-network-node.ts +++ /dev/null @@ -1,29 +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 { WorkTopicInformation } from './work-topic-information'; -import { CollaborationNetworkNodeType } from './collaboration-network-node-type'; - -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/work-page.ts b/webapp/src/app/api/model/work-page.ts deleted file mode 100644 index 285d2065..00000000 --- a/webapp/src/app/api/model/work-page.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 { 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/work-sustainable-development-goals-inner.ts deleted file mode 100644 index 8bc67292..00000000 --- a/webapp/src/app/api/model/work-sustainable-development-goals-inner.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 { Score } from './score'; - -/** - * WorkSustainableDevelopmentGoalsInner - */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; -} diff --git a/webapp/src/app/api/model/work-topic-domain.ts b/webapp/src/app/api/model/work-topic-domain.ts deleted file mode 100644 index 13b227df..00000000 --- a/webapp/src/app/api/model/work-topic-domain.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * The parent [domain](/api-reference/domains) - */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; -} 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 5dbbfc78..00000000 --- a/webapp/src/app/api/model/work-topic-information.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. - */ - -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/work-topic-subfield.ts deleted file mode 100644 index 49c1155b..00000000 --- a/webapp/src/app/api/model/work-topic-subfield.ts +++ /dev/null @@ -1,17 +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. - */ - -/** - * The parent [subfield](/api-reference/subfields) - */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; -} 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 73bb7ad9..00000000 --- a/webapp/src/app/api/model/work-topic.ts +++ /dev/null @@ -1,25 +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 746cc648..6c6ae99b 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -7,22 +7,22 @@ * 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.) diff --git a/webapp/src/app/api/model/works-filter-properties.ts b/webapp/src/app/api/model/works-filter-properties.ts deleted file mode 100644 index fd25fd26..00000000 --- a/webapp/src/app/api/model/works-filter-properties.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. - */ - -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/works-list-response.ts deleted file mode 100644 index 6c711607..00000000 --- a/webapp/src/app/api/model/works-list-response.ts +++ /dev/null @@ -1,21 +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 { Work } from './work'; -import { GroupByResult } from './group-by-result'; - -/** - * WorksListResponse - */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; -} diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index 7aaeef9e..fe2175b6 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -1,9 +1,19 @@ -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'; @@ -11,6 +21,7 @@ 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,7 +33,42 @@ 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; + } + + 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(), diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index c19c5b60..dab2a1f0 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -4,6 +4,10 @@ import { collaborationNetworkResolver } from './resolvers/collaboration-network. 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 { bundProjectsResolver } from './resolvers/bund-projects.resolver'; +import { euProjectsResolver } from './resolvers/eu-projects.resolver'; +import { dfgProjectsResolver } from './resolvers/dfg-projects.resolver'; export const routes: Routes = [ { @@ -93,6 +97,30 @@ export const routes: Routes = [ (mod) => mod.PersonOverviewComponent, ), }, + { + path: 'projects', + loadComponent: () => + import('./modules/person-projects/person-projects.component').then( + (mod) => mod.PersonProjectsComponent, + ), + resolve: { + dfgProjectPage: dfgProjectsResolver, + }, + 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: 'publications', + loadComponent: () => + import('./modules/person-publications/person-publications.component').then( + (mod) => mod.PersonPublicationsComponent, + ), + }, { path: 'network', loadComponent: () => @@ -102,7 +130,7 @@ export const routes: Routes = [ resolve: { collaborationNetwork: collaborationNetworkResolver, }, - runGuardsAndResolvers: (to, from) => { + runGuardsAndResolvers: (from, to) => { // No need to re-run for different table view or search term const keys = [ 'filter_by', @@ -117,17 +145,11 @@ export const routes: Routes = [ ]; return keys.some( - (key) => to.queryParamMap.get(key) !== from.queryParamMap.get(key), + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), ); }, }, - { - path: 'publications', - loadComponent: () => - import('./modules/person-publications/person-publications.component').then( - (mod) => mod.PersonPublicationsComponent, - ), - }, + { path: 'funding', loadComponent: () => @@ -138,15 +160,74 @@ export const routes: Routes = [ ], }, { - path: 'institution/:id', + 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: 'projects', + loadComponent: () => { + return import('./modules/institution-projects/institution-projects.component').then( + (mod) => mod.InstitutionProjectsComponent, + ); + }, + resolve: { + bundProjectPage: bundProjectsResolver, + euProjectPage: euProjectsResolver, + }, + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction', 'search']; + + return keys.some( + (key) => from.queryParamMap.get(key) !== to.queryParamMap.get(key), + ); + }, + }, + ], + runGuardsAndResolvers: (from, to) => { + const keys = ['page', 'size', 'sort_by', 'sort_direction']; + + 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.', + }, }, ]; 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/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/institution-projects.component.html b/webapp/src/app/modules/institution-projects/institution-projects.component.html new file mode 100644 index 00000000..77736b04 --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.html @@ -0,0 +1,56 @@ +
+

Projekte

+ + + + + Suche nach Themen + + search + + + + + + + + + + + + + +
+ + + {{ row.funding_start | date: 'dd.MM.yyyy' }} + + + {{ row.funding_end | date: 'dd.MM.yyyy' }} + + + {{ row.grant_amount | currency: 'EUR' : 'symbol' : '1.0-0' : 'de' }} + 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..c8534b0d --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.scss @@ -0,0 +1,8 @@ +.content { + padding: 16px; +} + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} 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..b5218f2a --- /dev/null +++ b/webapp/src/app/modules/institution-projects/institution-projects.component.ts @@ -0,0 +1,300 @@ +import { + Component, + computed, + effect, + input, + OnInit, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; +import { + BundProject, + BundProjectPage, + EuProject, + EuProjectPage, +} from '../../api'; +import { MatCardModule } from '@angular/material/card'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +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 { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; +import { Sort, SortDirection } from '@angular/material/sort'; +import { DebounceDirective } from '../../directives/debounce.directive'; +import { MatIconModule } from '@angular/material/icon'; +import { MatButtonModule } from '@angular/material/button'; + +type BundProjectRow = { + topic: string; + funding_start: Date; + funding_end: Date; + grant_amount: number; + department: string; +}; + +type EuProjectRow = { + topic: string; + funding_start: Date; + funding_end: Date; + grant_amount: number; +}; + +@Component({ + selector: 'app-institution-projects', + imports: [ + MatCardModule, + MatFormFieldModule, + MatTabsModule, + MatPaginatorModule, + FormsModule, + MatInputModule, + DataTableComponent, + DatePipe, + CurrencyPipe, + DebounceDirective, + MatIconModule, + MatButtonModule, + ], + templateUrl: './institution-projects.component.html', + styleUrl: './institution-projects.component.scss', +}) +export class InstitutionProjectsComponent implements OnInit { + fundingStartTmp = viewChild.required>('fundingStartTmp'); + fundingEndTmp = viewChild.required>('fundingEndTmp'); + grantAmountTmp = viewChild.required>('grantAmountTmp'); + + euProjectPage = input.required(); + euProjectColumns: GenericColumn[] = []; + euProjectData: EuProjectRow[] = []; + + bundProjectPage = input.required(); + bundProjectColumns: GenericColumn[] = []; + bundProjectData: BundProjectRow[] = []; + + urlSortKey = signal(''); + urlSortDirection = signal(''); + urlSearchTerm = signal(''); + + constructor( + private readonly activatedRoute: ActivatedRoute, + private readonly router: Router, + ) { + this.activatedRoute.queryParams + .pipe(takeUntilDestroyed()) + .subscribe((params) => { + this.urlSortKey.set(params['sort_by'] ?? ''); + this.urlSortDirection.set( + (params['sort_direction'] as SortDirection) ?? '', + ); + this.urlSearchTerm.set(params['search'] ?? ''); + }); + + effect(() => { + const euPage = this.euProjectPage(); + 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)) + : []; + } + }); + + effect(() => { + const searchTerm = this.urlSearchTerm(); + if (searchTerm) { + this.router.navigate([], { + queryParams: { search: searchTerm }, + queryParamsHandling: 'merge', + }); + } + }); + } + + readonly queryParams = toSignal(this.activatedRoute.queryParamMap, { + initialValue: null, + }); + + readonly displayedProjects = computed(() => { + return this.queryParams()?.get('project_tab') ?? 'eu'; + }); + + readonly page = computed(() => { + const pageParam = this.queryParams()?.get('page'); + const page = pageParam ? Number.parseInt(pageParam, 10) : 0; + return Number.isNaN(page) ? 0 : page; + }); + + readonly selectedPage = computed(() => { + if (this.displayedProjects() === 'eu') { + return this.euProjectPage(); + } else { + return this.bundProjectPage(); + } + }); + + readonly pageTotal = computed(() => { + return this.selectedPage()?.total ?? 0; + }); + + readonly pageSize = computed(() => { + return this.selectedPage()?.size ?? 10; + }); + + readonly pageIndex = computed(() => { + return this.selectedPage()?.page ?? 0; + }); + + ngOnInit(): void { + this.euProjectColumns = [ + { + id: 'topic', + header: 'Thema', + 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: 'grant_amount', + header: 'Fördersumme', + type: 'accessor', + accessorKey: 'grant_amount', + cellTemplate: this.grantAmountTmp(), + }, + ]; + this.bundProjectColumns = [ + { + id: 'topic', + header: 'Thema', + 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: 'grant_amount', + header: 'Fördersumme', + type: 'accessor', + accessorKey: 'grant_amount', + cellTemplate: this.grantAmountTmp(), + }, + { + id: 'department', + header: 'Abteilung', + type: 'accessor', + accessorKey: 'department', + }, + ]; + } + + transformEuRow(project: EuProject): EuProjectRow { + return { + 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), + grant_amount: Number(project.total_cost) || 0, + }; + } + + transformBundRow(project: BundProject): BundProjectRow { + return { + 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), + grant_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: 1, size: 10 }, + queryParamsHandling: 'merge', + }); + } + + handlePageChange(event: PageEvent): void { + this.router.navigate([], { + queryParams: { page: event.pageIndex, size: event.pageSize }, + queryParamsHandling: 'merge', + }); + } + + handleSortChange(event: Sort): void { + this.router.navigate([], { + queryParams: { sort_by: event.active, sort_direction: event.direction }, + queryParamsHandling: 'merge', + }); + } + + handleSearchTermChange(newTerm: string): void { + this.router.navigate([], { + queryParams: { search: newTerm }, + queryParamsHandling: 'merge', + }); + } + + clearSearchTerm(): void { + this.router.navigate([], { + queryParams: { search: null }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/institution/institution.component.html b/webapp/src/app/modules/institution/institution.component.html index 06cbe4a2..2024c855 100644 --- a/webapp/src/app/modules/institution/institution.component.html +++ b/webapp/src/app/modules/institution/institution.component.html @@ -1 +1,28 @@ -

institution works!

+
+

{{ 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 index e69de29b..2521fee5 100644 --- a/webapp/src/app/modules/institution/institution.component.scss +++ 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 index 2e11507e..acd4b205 100644 --- a/webapp/src/app/modules/institution/institution.component.ts +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -1,9 +1,51 @@ -import { Component } from '@angular/core'; +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: [], + imports: [ + MatCardModule, + MatTabsModule, + RouterLink, + RouterOutlet, + RouterLinkActive, + ], templateUrl: './institution.component.html', styleUrl: './institution.component.scss', }) -export class InstitutionComponent {} +export class InstitutionComponent implements OnInit { + institution!: Institution; + + links = [ + { label: 'Übersicht', path: 'overview', disabled: false }, + { + label: 'Projekte', + path: 'projects', + disabled: false, + queryParams: { + project_tab: 'bund', + page: 1, + size: 10, + search: '', + sort_by: 'topic', + 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/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 0c95379c..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.html +++ /dev/null @@ -1,52 +0,0 @@ -
- - - - - - - - - - - - - - - - -
Name - {{ element.name }} - Häufigkeit - {{ element.works.length }} - - - open_in_new - -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Kollaborierenden gefunden.

-} - - -
- -
-
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 4dfb4f9e..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.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%; -} - -.work-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} 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 f86545d4..00000000 --- a/webapp/src/app/modules/person-network-collaborators/person-network-collaborators.component.ts +++ /dev/null @@ -1,156 +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[] = ['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.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 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-institutions/person-network-institutions.component.html b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.html deleted file mode 100644 index 39a86dd9..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.html +++ /dev/null @@ -1,45 +0,0 @@ -
- - - - - - - - - - - - -
Name - {{ element.name }} - Mitwirkende - {{ element.collaborators.length }} -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Institutionen gefunden.

-} - - - - - - - - diff --git a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss deleted file mode 100644 index 7cb09d57..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.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%; -} - -.person-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} diff --git a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts b/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts deleted file mode 100644 index c992a06e..00000000 --- a/webapp/src/app/modules/person-network-institutions/person-network-institutions.component.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { - AfterViewInit, - Component, - effect, - input, - ViewChild, -} from '@angular/core'; -import { CollaborationNetwork } from '../../api'; -import { MatTableDataSource, MatTableModule } from '@angular/material/table'; -import { MatSort, MatSortModule } from '@angular/material/sort'; -import { MatIconModule } from '@angular/material/icon'; -import { RouterModule } from '@angular/router'; -import { CdkDetailRowDirective } from '../../directives/cdk-detail-row.directive'; -import { MatButtonModule } from '@angular/material/button'; - -type Collaborator = { - id: string; - name: string; -}; - -type Institution = { - id: string; - name: string; - collaborators: Collaborator[]; -}; - -@Component({ - selector: 'app-person-network-institutions', - imports: [ - MatTableModule, - MatIconModule, - MatSortModule, - RouterModule, - CdkDetailRowDirective, - MatButtonModule, - ], - templateUrl: './person-network-institutions.component.html', - styleUrl: './person-network-institutions.component.scss', -}) -export class PersonNetworkInstitutionsComponent implements AfterViewInit { - collaborationNetwork = input.required(); - searchTerm = input.required(); - - displayedColumns: string[] = ['name', 'collaborators']; - - dataSource = new MatTableDataSource(); - - trackBy = (index: number, item: Institution) => item.id; - - @ViewChild(MatSort) sort!: MatSort; - - constructor() { - effect(() => { - const collaborationNetwork = this.collaborationNetwork(); - if (!collaborationNetwork) { - return; - } - - this.dataSource = this.buildInstitutionsDataSource(collaborationNetwork); - this.dataSource.sortingDataAccessor = (item, property) => { - if (property === 'collaborators') { - return item.collaborators.length; - } - return (item as any)[property]; - }; - if (this.sort) { - this.dataSource.sort = this.sort; - this.setDefaultSort(); - } - }); - - effect(() => { - const searchTerm = this.searchTerm().toLowerCase(); - this.dataSource.filter = searchTerm; - }); - } - - ngAfterViewInit() { - if (this.sort) { - this.dataSource.sort = this.sort; - } - } - - private setDefaultSort(): void { - this.sort.active = 'name'; - this.sort.direction = 'asc'; - this.sort.sortChange.emit({ active: 'name', direction: 'asc' }); - } - - buildInstitutionsDataSource( - collaborationNetwork: CollaborationNetwork, - ): MatTableDataSource { - 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 new MatTableDataSource(Object.values(institutionsMap)); - } -} 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 83bcc41c..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.html +++ /dev/null @@ -1,54 +0,0 @@ -
- - - - - - - - - - - - - - - - -
Titel - {{ element.title }} - Mitwirkende - {{ element.collaborators.length }} - - - open_in_new - -
-
-@if (dataSource.filteredData.length === 0) { -

Keine Publikationen gefunden.

-} - - - - - - - - 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 7cb09d57..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.scss +++ /dev/null @@ -1,38 +0,0 @@ -.table { - overflow: auto; - width: 100%; - max-height: 100%; -} - -.mat-mdc-table { - background-color: var(--sg-background); -} - -.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%; -} - -.person-link { - color: var(--sg-primary); - text-decoration: none; - - &:hover { - text-decoration: underline; - } -} 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 c4c08016..00000000 --- a/webapp/src/app/modules/person-network-publications/person-network-publications.component.ts +++ /dev/null @@ -1,144 +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[] = ['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.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 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 5da3bb31..f6a27bce 100644 --- a/webapp/src/app/modules/person-network/person-network.component.html +++ b/webapp/src/app/modules/person-network/person-network.component.html @@ -6,7 +6,7 @@
@@ -51,17 +51,26 @@ @if (this.displayedTable() === 'collaborators') { - + } @else if (this.displayedTable() === 'publications') { - + } @else if (this.displayedTable() === 'institutions') { - + } @@ -77,3 +86,81 @@ }
+ + + + 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 36506868..74a4778c 100644 --- a/webapp/src/app/modules/person-network/person-network.component.scss +++ b/webapp/src/app/modules/person-network/person-network.component.scss @@ -59,3 +59,13 @@ form > div > mat-button-toggle-group { 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 647f2939..1c96f6eb 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, signal } 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,11 +26,7 @@ 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 { NodeCategory, @@ -36,26 +38,57 @@ 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 { PersonNetworkInstitutionsComponent } from '../person-network-institutions/person-network-institutions.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, @@ -63,14 +96,50 @@ import { PersonNetworkInstitutionsComponent } from '../person-network-institutio MatExpansionModule, MatDialogModule, PersonNetworkInfoCardComponent, - PersonNetworkInstitutionsComponent, + 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(''), @@ -181,7 +250,50 @@ export class PersonNetworkComponent implements OnInit { private readonly activatedRoute: ActivatedRoute, private readonly router: Router, private readonly dialog: MatDialog, - ) {} + ) { + effect(() => { + this.collaboratorsData = this.buildCollaboratorsDataSource( + this.collaborationNetwork(), + ); + + this.publicationsData = this.buildWorksDataSource( + this.collaborationNetwork(), + ); + + this.institutionsData = this.buildInstitutionsDataSource( + this.collaborationNetwork(), + ); + + this.calculateSummary(this.collaborationNetwork()); + + const currentParams = this.activatedRoute.snapshot.queryParams; + + this.filterForm.setValue({ + searchTerm: currentParams['search_term'] || '', + filterBy: currentParams['filter_by'] || 'works', + displayedTable: currentParams['table'] || 'collaborators', + + 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); @@ -233,38 +345,66 @@ export class PersonNetworkComponent implements OnInit { } ngOnInit(): void { - this.activatedRoute.data.subscribe(({ collaborationNetwork }) => { - this.collaborationNetwork = collaborationNetwork; - - this.calculateSummary(collaborationNetwork); - - const currentParams = this.activatedRoute.snapshot.queryParams; - - this.filterForm.setValue({ - searchTerm: currentParams['search_term'] || '', - filterBy: currentParams['filter_by'] || 'works', - displayedTable: currentParams['table'] || 'collaborators', - - 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(',') - : [], - }); - }); + 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) => { console.log('Form value changed:', value); @@ -294,4 +434,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-overview/components/research-timeline/research-timeline.component.html b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.html index 39f4d7e6..5376284b 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 @@ -49,10 +49,17 @@ (click)="setTimelineViewMode('compact')"> Kompakt + +
@@ -103,311 +110,331 @@ {{ maxYear }}
+ +
+ +
-
- - Forschungstimeline wird geladen ... -
+ + + -
- Forschungstimeline konnte nicht geladen werden. -
+ +
+ + Forschungstimeline wird geladen ... +
- - - -
-
- +
+ Forschungstimeline konnte nicht geladen werden. +
-
-
- - -
+ + + +
+
+
- - -
-
- -
-
-

+ class="timeline-points" + [style.grid-template-columns]="gridTemplateColumns"> +
-

+ +
- - Laden fehlgeschlagen. - - - -
-

+
-

- - - -
- + {{ item.year }} + + +
+
+ +
+
+

- +

- - Keine weiteren Topics - -
- + + Laden fehlgeschlagen. + + + +
+

+ +

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

- -

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

+ +

-
-
-
-
-
- - Hauptforschungsschwerpunkte im jeweiligen Zeitraum -
+
+ + + + + + Keine weiteren Topics + +
+ + + +
+
+
+ + + +
+ +
+ + + + + + Keine weiteren Topics + +
+
+
+
+
+
+ +
+ + Hauptforschungsschwerpunkte im jeweiligen Zeitraum +
+
- +
Keine Timeline-Daten vorhanden.
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 98c1da9c..90dfbe9f 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,5 +1,6 @@ import { CommonModule } from '@angular/common'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { AfterViewChecked, Component, @@ -25,7 +26,7 @@ export interface TopicTimelineElement { primary_topics?: TopicTimelineTopic[]; } -export type TimelineViewMode = 'years' | 'compact'; +export type TimelineViewMode = 'years' | 'compact' | 'wordcloud'; export interface TimelineYearRange { startYear: number; @@ -66,7 +67,7 @@ interface TimelineScrollAnchor { @Component({ selector: 'app-research-timeline', standalone: true, - imports: [CommonModule, MatProgressSpinnerModule], + imports: [CommonModule, MatProgressSpinnerModule, MatTooltipModule], templateUrl: './research-timeline.component.html', styleUrl: './research-timeline.component.scss', }) @@ -315,6 +316,20 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { 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), + ); + } + togglePhase(phase: ResearchTimelinePhase): void { if (this.expandedPhaseIds.has(phase.id)) { this.expandedPhaseIds.delete(phase.id); @@ -440,6 +455,23 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { 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 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; } @@ -717,7 +749,7 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { } 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 { 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 dbba4131..3d3ffa2d 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.html +++ b/webapp/src/app/modules/person-overview/person-overview.component.html @@ -13,31 +13,31 @@ (yearRangeChange)="onTimelineYearRangeChange($event)" (topicSelect)="onTimelineTopicSelect($event)" (yearSelect)="onTimelineYearSelect($event)" - (loadEarlierYears)="onTimelineLoadEarlierYears()"> + (loadEarlierYears)="onTimelineLoadEarlierYears()"> +
+ @if (loadingWordCloud) { + Themen laden ... + } @else if (wordCloudOptions && sliderMax > 5) { + {{ topN }} Themen +
+
+ +
+ } @else { + Themen + } +
- @if (!loadingWordCloud) { -
-
-

Forschungsthemen

- @if (wordCloudOptions && sliderMax > 5) { -
- {{ topN }} Themen -
-
- -
-
- } -
- @if (wordCloudOptions) { +
+ @if (loadingWordCloud) { +
Forschungsthemen werden geladen ...
+ } @else if (wordCloudOptions) {
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 4e70b0e9..7b40485a 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.scss +++ b/webapp/src/app/modules/person-overview/person-overview.component.scss @@ -5,37 +5,12 @@ box-sizing: border-box; } -.word-cloud-card { - margin-top: 1.5rem; - padding: 24px 28px; - border: 1px solid #d7e4ff; - border-radius: 16px; - background: #ffffff; - box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); - box-sizing: border-box; -} - -.word-cloud-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 1.5rem; - margin-bottom: 0.75rem; -} - -.word-cloud-title { - margin: 0; - font-family: 'Montserrat', 'Open Sans', Arial, sans-serif; - font-size: 20px; - font-weight: 700; - color: var(--sg-text); -} - .word-cloud-slider-wrapper { display: flex; align-items: center; + justify-content: center; gap: 0.75rem; - flex-shrink: 0; + min-height: 86px; } .slider-label { @@ -115,15 +90,24 @@ } } +.word-cloud-view { + min-height: 420px; +} + .word-cloud-chart { width: 100%; - height: 400px; + height: 420px; cursor: pointer; } +.word-cloud-state, .word-cloud-empty { - margin: 2rem 0 0.5rem; - text-align: center; + 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 d6963b71..5291c82a 100644 --- a/webapp/src/app/modules/person-overview/person-overview.component.ts +++ b/webapp/src/app/modules/person-overview/person-overview.component.ts @@ -489,7 +489,11 @@ export class PersonOverviewComponent implements OnInit { } 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 { 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..b1f8bb43 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.html @@ -0,0 +1,64 @@ +
+
+
Projekte
+

Übersicht der durchgeführten Projekte.

+
+ + + + Suche nach Titel + + search + + + + + + + + + + +
+ + + + 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 }} +
  • + } +
+
+
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..660576e3 --- /dev/null +++ b/webapp/src/app/modules/person-projects/person-projects.component.ts @@ -0,0 +1,162 @@ +import { + Component, + computed, + effect, + input, + OnInit, + signal, + TemplateRef, + viewChild, +} from '@angular/core'; +import { 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 { DebounceDirective } from '../../directives/debounce.directive'; +import { ActivatedRoute, Router } from '@angular/router'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; +import { Sort, SortDirection } from '@angular/material/sort'; + +@Component({ + selector: 'app-person-projects', + imports: [ + DataTableComponent, + MatIconModule, + MatButtonModule, + MatCardModule, + MatTabsModule, + MatFormFieldModule, + MatInputModule, + DebounceDirective, + MatPaginatorModule, + ], + 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', + ); + + urlSearchTerm = signal(''); + urlSortKey = signal(''); + urlSortDirection = signal(''); + + readonly pageTotal = computed(() => { + return this.dfgProjectPage()?.total ?? 0; + }); + + readonly pageSize = computed(() => { + return this.dfgProjectPage()?.size ?? 10; + }); + + readonly pageIndex = computed(() => { + return this.dfgProjectPage()?.page ?? 0; + }); + + constructor( + private readonly router: Router, + private readonly activatedRoute: ActivatedRoute, + ) { + this.activatedRoute.queryParamMap + .pipe(takeUntilDestroyed()) + .subscribe((params) => { + this.urlSearchTerm.set(params.get('search') || ''); + }); + + effect(() => { + console.log( + 'PersonProjectsComponent: dfgProjectPage changed', + this.dfgProjectPage(), + ); + this.dfgProjectData = this.dfgProjectPage().elements || []; + }); + + effect(() => { + const searchTerm = this.urlSearchTerm(); + if (searchTerm) { + this.router.navigate([], { + queryParams: { search: searchTerm }, + queryParamsHandling: 'merge', + }); + } + }); + } + + 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(), + }, + ]; + } + + handleSearchTermChange(newTerm: string): void { + this.router.navigate([], { + queryParams: { search: newTerm }, + queryParamsHandling: 'merge', + }); + } + + clearSearchTerm(): void { + this.router.navigate([], { + queryParams: { search: null }, + queryParamsHandling: 'merge', + }); + } + + handlePageChange(event: PageEvent): void { + this.router.navigate([], { + queryParams: { page: event.pageIndex, size: event.pageSize }, + queryParamsHandling: 'merge', + }); + } + + handleSortChange(event: Sort): void { + this.router.navigate([], { + queryParams: { sort_by: event.active, sort_direction: event.direction }, + queryParamsHandling: 'merge', + }); + } +} diff --git a/webapp/src/app/modules/person/person.component.html b/webapp/src/app/modules/person/person.component.html index b4fba84c..a0b50703 100644 --- a/webapp/src/app/modules/person/person.component.html +++ b/webapp/src/app/modules/person/person.component.html @@ -21,11 +21,11 @@ } @if (citedByCount() !== null) { {{ citedByCount() }} Zitationen - } + } @if (h_index() !== null) { - h_index: {{ h_index() }} + h_index: {{ h_index() }} } } @@ -74,6 +74,7 @@ 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 h_index = computed( + () => this.person()?.summary_stats?.h_index ?? null, + ); readonly orcid = computed(() => { const rawOrcid = this.getId('orcid'); if (!rawOrcid) { @@ -168,7 +170,18 @@ export class PersonComponent { ); 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 }, diff --git a/webapp/src/app/resolvers/bund-projects.resolver.ts b/webapp/src/app/resolvers/bund-projects.resolver.ts new file mode 100644 index 00000000..88025139 --- /dev/null +++ b/webapp/src/app/resolvers/bund-projects.resolver.ts @@ -0,0 +1,30 @@ +import { ResolveFn } from '@angular/router'; +import { BundProjectPage, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const bundProjectsResolver: ResolveFn = ( + route, + state, +) => { + console.log('bundProjectsResolver called with route:', route); + 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') ?? 'topic'; + const sortDirection = route.queryParamMap.get('sort_direction') ?? 'asc'; + + const search = route.queryParamMap.get('search'); + + return inject(ProjectsService).getBundProjects( + institutionId || '', + search || undefined, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; 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/eu-projects.resolver.ts b/webapp/src/app/resolvers/eu-projects.resolver.ts new file mode 100644 index 00000000..5ca019aa --- /dev/null +++ b/webapp/src/app/resolvers/eu-projects.resolver.ts @@ -0,0 +1,25 @@ +import { ResolveFn } from '@angular/router'; +import { EuProjectPage, ProjectsService } from '../api'; +import { inject } from '@angular/core'; + +export const euProjectsResolver: ResolveFn = (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') ?? 'topic'; + const sortDirection = route.queryParamMap.get('sort_direction') ?? 'asc'; + const search = route.queryParamMap.get('search'); + + return inject(ProjectsService).getEuProjects( + institutionId || '', + search || undefined, + Number(page), + Number(size), + sortBy, + sortDirection, + ); +}; 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/person-list.resolver.ts b/webapp/src/app/resolvers/person-list.resolver.ts index 97001abe..8e4b824c 100644 --- a/webapp/src/app/resolvers/person-list.resolver.ts +++ b/webapp/src/app/resolvers/person-list.resolver.ts @@ -26,8 +26,8 @@ export const personListResolver: ResolveFn = ( : 10; const institutionName = params.get('institutionName') || undefined; - const sortBy= params.get('sortBy') || undefined; - const sortOrder= params.get('sortOrder') || undefined; + const sortBy = params.get('sortBy') || undefined; + const sortOrder = params.get('sortOrder') || undefined; const topicsParam = params.getAll('topic'); 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/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index 8e136a31..942b7cbd 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,5 +1,5 @@