diff --git a/service/Dockerfile b/service/Dockerfile index 3fe46ebb..6ecf783c 100644 --- a/service/Dockerfile +++ b/service/Dockerfile @@ -19,7 +19,8 @@ RUN pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-c "partial-json-parser==0.2.1.1.post7" \ "sqlmodel~=0.0.33" \ "argon2-cffi~=25.1.0" \ - "pypdf==6.14.2" + "pandas~=2.3.3" \ + "pypdf==6.14.2" COPY [ "src/main", "/home" ] COPY [ "src/data", "/data" ] diff --git a/service/pyproject.toml b/service/pyproject.toml index ba9ea440..74854c18 100644 --- a/service/pyproject.toml +++ b/service/pyproject.toml @@ -22,6 +22,7 @@ dependencies = [ "torch", "sqlmodel~=0.0.33", "argon2-cffi~=25.1.0", + "pandas~=2.3.3", ] [[tool.uv.index]] diff --git a/service/scripts/patents/data/eval_runs/labeling_presentation.json b/service/scripts/patents/data/eval_runs/labeling_presentation.json index 06648f6e..bd8b24d5 100644 --- a/service/scripts/patents/data/eval_runs/labeling_presentation.json +++ b/service/scripts/patents/data/eval_runs/labeling_presentation.json @@ -16,9 +16,7 @@ "relevance_score": 1.0 } ], - "expected_ipc_prefixes": [ - "H01M" - ], + "expected_ipc_prefixes": ["H01M"], "mapping_status": "mapped", "diagnostics": { "search_path": "ipc", @@ -57,12 +55,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/90 20060101AFI20240910BHUS", @@ -91,12 +85,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/083 20160101AFI20210209BHUS", @@ -142,12 +132,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20160101AFI20201124BHUS", @@ -178,12 +164,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/0221 20160101AFI20201124BHUS", @@ -229,12 +211,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "A62C 3/06 20060101AFI20190820BHEP", @@ -260,12 +238,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 12/08 20060101AFI20190521BHUS", @@ -301,12 +275,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/36 20060101AFI20181009BHUS", @@ -338,12 +308,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20160101AFI20180626BHUS", @@ -379,12 +345,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/0656 20160101AFI20170424BHEP", @@ -411,12 +373,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20160101AFI20170207BHUS", @@ -445,12 +403,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20160614BHUS", @@ -484,12 +438,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20151215BHUS", @@ -515,12 +465,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/04 20060101AFI20150714BHUS", @@ -548,12 +494,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/22 20060101AFI20150310BHUS", @@ -579,12 +521,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/10 20060101AFI20150310BHUS", @@ -621,12 +559,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20141125BHUS", @@ -652,12 +586,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20060101AFI20140930BHUS", @@ -685,12 +615,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/90 20060101AFI20251230BHUS", @@ -719,12 +645,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/04082 20160101AFI20250909BHUS", @@ -754,12 +676,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/083 20160101AFI20250722BHUS", @@ -825,10 +743,7 @@ "US12412912", "US12368175" ], - "irrelevant_patent_ids": [ - "US10847825", - "EP3549641" - ] + "irrelevant_patent_ids": ["US10847825", "EP3549641"] }, { "id": "speech-recognition", @@ -844,9 +759,7 @@ "relevance_score": 1.0 } ], - "expected_ipc_prefixes": [ - "G10L" - ], + "expected_ipc_prefixes": ["G10L"], "mapping_status": "mapped", "diagnostics": { "search_path": "ipc", @@ -895,12 +808,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20241105BHUS", @@ -947,12 +856,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20230411BHUS", @@ -999,12 +904,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/42 20060101AFI20230307BHUS", @@ -1033,12 +934,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/42 20060101AFI20200811BHUS", @@ -1085,12 +982,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20170919BHUS", @@ -1142,12 +1035,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 17/00 20130101AFI20170620BHUS", @@ -1180,12 +1069,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G06F 3/16 20060101AFI20160628BHUS", @@ -1220,12 +1105,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 1/64 20060101AFI20170815BHUS", @@ -1258,12 +1139,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "G10L 17/14 20130101AFI20260317BHUS", @@ -1299,12 +1176,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20190827BHUS", @@ -1335,12 +1208,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20160614BHUS", @@ -1376,12 +1245,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20260428BHUS", @@ -1424,12 +1289,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 17/26 20130101AFI20260331BHUS", @@ -1480,12 +1341,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/00 20060101AFI20170214BHUS", @@ -1526,12 +1383,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/183 20130101AFI20251125BHUS", @@ -1568,12 +1421,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20241029BHUS", @@ -1616,12 +1465,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20240910BHUS", @@ -1664,12 +1509,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20231107BHUS", @@ -1712,12 +1553,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20230718BHUS", @@ -1760,12 +1597,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 11/00 20060101AFI20201208BHUS", @@ -1837,9 +1670,7 @@ "US11706338", "US10863033" ], - "irrelevant_patent_ids": [ - "US10397400" - ] + "irrelevant_patent_ids": ["US10397400"] } ], "labeling_status": { @@ -1851,4 +1682,4 @@ }, "warning": "KI-gestützte Vorlabelierung anhand von Titel sowie IPC/CPC-Evidenz. Für einen wissenschaftlichen Goldstandard sollten Grenzfälle fachlich geprüft werden." } -} \ No newline at end of file +} diff --git a/service/scripts/patents/data/keyword_patent_goldset_presentation.json b/service/scripts/patents/data/keyword_patent_goldset_presentation.json index af14c599..630bf5f2 100644 --- a/service/scripts/patents/data/keyword_patent_goldset_presentation.json +++ b/service/scripts/patents/data/keyword_patent_goldset_presentation.json @@ -2,11 +2,7 @@ "version": 1, "presentation": true, "description": "goldset for two IPC cases.", - "ks": [ - 5, - 10, - 20 - ], + "ks": [5, 10, 20], "cases": [ { "id": "fuel-cell", @@ -22,9 +18,7 @@ "relevance_score": 1.0 } ], - "expected_ipc_prefixes": [ - "H01M" - ], + "expected_ipc_prefixes": ["H01M"], "relevant_patent_ids": [ "US12087951", "US10916789", @@ -45,10 +39,7 @@ "US12412912", "US12368175" ], - "irrelevant_patent_ids": [ - "US10847825", - "EP3549641" - ], + "irrelevant_patent_ids": ["US10847825", "EP3549641"], "relevance_grades": { "US12087951": 2, "US10916789": 2, @@ -82,12 +73,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/90 20060101AFI20240910BHUS", @@ -116,12 +103,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/083 20160101AFI20210209BHUS", @@ -167,12 +150,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20160101AFI20201124BHUS", @@ -203,12 +182,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/0221 20160101AFI20201124BHUS", @@ -254,12 +229,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "A62C 3/06 20060101AFI20190820BHEP", @@ -285,12 +256,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 12/08 20060101AFI20190521BHUS", @@ -326,12 +293,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/36 20060101AFI20181009BHUS", @@ -363,12 +326,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20160101AFI20180626BHUS", @@ -404,12 +363,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/0656 20160101AFI20170424BHEP", @@ -436,12 +391,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20160101AFI20170207BHUS", @@ -470,12 +421,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20160614BHUS", @@ -509,12 +456,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20151215BHUS", @@ -540,12 +483,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/04 20060101AFI20150714BHUS", @@ -573,12 +512,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/22 20060101AFI20150310BHUS", @@ -604,12 +539,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/10 20060101AFI20150310BHUS", @@ -646,12 +577,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/06 20060101AFI20141125BHUS", @@ -677,12 +604,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/08 20060101AFI20140930BHUS", @@ -710,12 +633,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 4/90 20060101AFI20251230BHUS", @@ -744,12 +663,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/04082 20160101AFI20250909BHUS", @@ -779,12 +694,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "fuel cell" - ], - "matched_ipc_symbols": [ - "H01M8/083" - ], + "matched_keywords": ["fuel cell"], + "matched_ipc_symbols": ["H01M8/083"], "text_retrieval": false, "ipc": [ "H01M 8/083 20160101AFI20250722BHUS", @@ -823,9 +734,7 @@ "relevance_score": 1.0 } ], - "expected_ipc_prefixes": [ - "G10L" - ], + "expected_ipc_prefixes": ["G10L"], "relevant_patent_ids": [ "US12137183", "US11627221", @@ -847,9 +756,7 @@ "US11706338", "US10863033" ], - "irrelevant_patent_ids": [ - "US10397400" - ], + "irrelevant_patent_ids": ["US10397400"], "relevance_grades": { "US12137183": 2, "US11627221": 2, @@ -883,12 +790,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20241105BHUS", @@ -935,12 +838,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20230411BHUS", @@ -987,12 +886,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/42 20060101AFI20230307BHUS", @@ -1021,12 +916,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/42 20060101AFI20200811BHUS", @@ -1073,12 +964,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20170919BHUS", @@ -1130,12 +1017,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 17/00 20130101AFI20170620BHUS", @@ -1168,12 +1051,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G06F 3/16 20060101AFI20160628BHUS", @@ -1208,12 +1087,8 @@ "topic_score": 1.0, "text_score": 1.0, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 1/64 20060101AFI20170815BHUS", @@ -1246,12 +1121,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "G10L 17/14 20130101AFI20260317BHUS", @@ -1287,12 +1158,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20190827BHUS", @@ -1323,12 +1190,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "G10L17/14" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["G10L17/14"], "text_retrieval": false, "ipc": [ "H04M 3/493 20060101AFI20160614BHUS", @@ -1364,12 +1227,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/00 20130101AFI20260428BHUS", @@ -1412,12 +1271,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 17/26 20130101AFI20260331BHUS", @@ -1468,12 +1323,8 @@ "topic_score": 1.0, "text_score": 0.3333333333333333, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/00 20060101AFI20170214BHUS", @@ -1514,12 +1365,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "G10L 15/183 20130101AFI20251125BHUS", @@ -1556,12 +1403,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20241029BHUS", @@ -1604,12 +1447,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20240910BHUS", @@ -1652,12 +1491,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20231107BHUS", @@ -1700,12 +1535,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 3/51 20060101AFI20230718BHUS", @@ -1748,12 +1579,8 @@ "topic_score": 1.0, "text_score": 0.6666666666666666, "topic_match_kind": "topic_id", - "matched_keywords": [ - "speech recognition" - ], - "matched_ipc_symbols": [ - "H04M2201/405" - ], + "matched_keywords": ["speech recognition"], + "matched_ipc_symbols": ["H04M2201/405"], "text_retrieval": false, "ipc": [ "H04M 11/00 20060101AFI20201208BHUS", @@ -1784,4 +1611,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/service/src/main/inse/company_connections/logic.py b/service/src/main/inse/company_connections/logic.py index fa96a1f4..ceb39e06 100644 --- a/service/src/main/inse/company_connections/logic.py +++ b/service/src/main/inse/company_connections/logic.py @@ -73,6 +73,28 @@ async def get_company_connections_by_author_id( ) +async def get_company_counts_by_names( + names: list[str], + company_status: str = "all", + client: CompanyConnectionsSearchClient | None = None, +) -> dict[str, int]: + """Bulk variant of the per-author lookup for the ranking pipeline. + + Returns a mapping ``display_name -> company_count`` for the given names in a + single Elasticsearch aggregation. Names without a match are absent from the + mapping (callers should treat them as 0). ``company_status`` selects which + companies to count: ``all``, only ``active`` (non-deleted), or only ``deleted``. + """ + search_client = client or CompanyConnectionsSearchClient() + cleaned = [name for name in (_clean(n) for n in names) if name] + if not cleaned: + return {} + + return await search_client.count_companies_by_founder_names( + cleaned, company_status=str(company_status) + ) + + def _get_ude_institution_scope(source: dict[str, Any]) -> tuple[str | None, list[str]]: institutions = source.get("last_known_institutions") or [] diff --git a/service/src/main/inse/company_connections/search_client.py b/service/src/main/inse/company_connections/search_client.py index 5d4c89f7..3e391ac8 100644 --- a/service/src/main/inse/company_connections/search_client.py +++ b/service/src/main/inse/company_connections/search_client.py @@ -58,6 +58,112 @@ class CompanyConnectionsSearchClient: cluster=ESCluster.NES, ) + async def count_companies_by_founder_names( + self, + founder_names: list[str], + company_status: str = "all", + ) -> dict[str, int]: + """Returns the number of companies they are linked to a author. + + ``company_status`` selects which companies are counted: ``all``, only + ``active`` (non-deleted), or only ``deleted`` (``current_status: removed``). + """ + names = sorted({name for name in founder_names if name}) + if not names: + return {} + + payload = self.handelsregister_founder_counts_query(names, company_status) + response = await elasticsearch.search( + index=self.handelsregister_index, + body=payload, + cluster=ESCluster.NES, + ) + + buckets = ( + response.get("aggregations", {}) + .get("founders", {}) + .get("matched", {}) + .get("by_name", {}) + .get("buckets", []) + ) + + counts: dict[str, int] = {} + for bucket in buckets: + name = bucket.get("key", "") + if not name: + continue + counts[name] = int(bucket.get("companies", {}).get("doc_count", 0)) + + return counts + + @staticmethod + def handelsregister_founder_counts_query( + founder_names: list[str], + company_status: str = "all", + ) -> dict[str, Any]: + """Aggregation that counts distinct companies per founder name. + + The ``matched`` filter keeps only the founders whose name is one of the + candidates, then ``reverse_nested`` steps back to the company level so the + per-name ``doc_count`` is a company count, not a founder-occurrence count. + ``company_status`` restricts which companies are counted at the company + level: ``all`` (no restriction), only ``active`` (exclude + ``current_status: removed``), or only ``deleted`` (only that status). + """ + query_filters: list[dict[str, Any]] = [ + { + "nested": { + "path": "officers", + "query": { + "bool": { + "filter": [ + {"term": {"officers.type": "person"}}, + {"terms": {"officers.name.keyword": founder_names}}, + ] + } + }, + } + } + ] + + bool_query: dict[str, Any] = {"filter": query_filters} + if company_status == "active": + bool_query["must_not"] = [{"term": {"current_status": "removed"}}] + elif company_status == "deleted": + query_filters.append({"term": {"current_status": "removed"}}) + + return { + "size": 0, + "track_total_hits": False, + "query": {"bool": bool_query}, + "aggs": { + "founders": { + "nested": {"path": "officers"}, + "aggs": { + "matched": { + "filter": { + "terms": {"officers.name.keyword": founder_names}, + }, + "aggs": { + "by_name": { + "terms": { + "field": "officers.name.keyword", + "size": len(founder_names), + "execution_hint": "map", + }, + "aggs": { + # step back to the company (parent) level so + # the count is distinct companies per name + "companies": {"reverse_nested": {}}, + }, + }, + }, + }, + }, + }, + }, + } + @staticmethod def handelsregister_officer_name_query( officer_name: str, diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 083faa6d..bb55e148 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -24,6 +24,7 @@ from inse.exceptions import ( ) from inse.funders.service import router as funders_service_router from inse.projects.router import router as projects_router +from inse.ranking.router import router as ranking_router from inse.university_ranking.service import router as university_ranking_router from inse.keywords.service import router as keywords_service_router from inse.patents.keywords.service import router as keywords_patents_router @@ -97,6 +98,7 @@ app.include_router(news_service_router) app.include_router(company_connections_router) app.include_router(patents_service_router) app.include_router(university_ranking_router) +app.include_router(ranking_router) app.include_router(projects_router) app.include_router(patents_all_router) app.include_router(keywords_service_router) diff --git a/service/src/main/inse/persons/query_builder.py b/service/src/main/inse/persons/query_builder.py index d6b4119d..a45a492f 100644 --- a/service/src/main/inse/persons/query_builder.py +++ b/service/src/main/inse/persons/query_builder.py @@ -1,50 +1,15 @@ from typing import Any, List, Optional, Set -def build_authors_search_rescored( - using: Any = None, - index: Optional[str] = None, - query: Optional[str] = None, +def build_author_filter_clauses( institution_name: Optional[str] = None, - sort_by: Optional[str] = None, - sort_order: Optional[str] = None, topics: Optional[List[str]] = None, - page: int = 1, - page_size: int = 10, - include: Optional[Set[str]] = None, strict: Optional[bool] = False, - track_total_hits: Optional[bool] = False, filter_mode: Optional[str] = "from", filter_year: Optional[int] = None, - name_quality_boost=True, - h_index_boost=True, - citations_boost=True, - works_boost=True, - _2yr_mean_citedness_boost=True, -) -> dict: - """ - Builds an Elasticsearch search request query body for authors as a dictionary. - """ - # 1. Build Query Clauses - query_clause = None - if query: - query_clause = { - "bool": { - "should": [ - {"match_phrase": {"display_name": {"query": query, "boost": 5}}}, - { - "match_phrase_prefix": { - "display_name": {"query": query, "boost": 3} - } - }, - {"match": {"display_name": {"query": query}}}, - ], - "minimum_should_match": 1, - } - } - - # 2. Build Filters - filter_clauses = [] +) -> List[dict]: + """Builds the list of Elasticsearch ``filter`` clauses used to select authors.""" + filter_clauses: List[dict] = [] # Filter against false entries (nested ((Works > 2 AND Year > 2020) OR has last_known_institution)) filter_clauses.append( @@ -196,6 +161,61 @@ def build_authors_search_rescored( } } ) + + return filter_clauses + + +def build_authors_search_rescored( + using: Any = None, + index: Optional[str] = None, + query: Optional[str] = None, + institution_name: Optional[str] = None, + sort_by: Optional[str] = None, + sort_order: Optional[str] = None, + topics: Optional[List[str]] = None, + page: int = 1, + page_size: int = 10, + include: Optional[Set[str]] = None, + strict: Optional[bool] = False, + track_total_hits: Optional[bool] = False, + filter_mode: Optional[str] = "from", + filter_year: Optional[int] = None, + name_quality_boost=True, + h_index_boost=True, + citations_boost=True, + works_boost=True, + _2yr_mean_citedness_boost=True, +) -> dict: + """ + Builds an Elasticsearch search request query body for authors as a dictionary. + """ + # 1. Build Query Clauses + query_clause = None + if query: + query_clause = { + "bool": { + "should": [ + {"match_phrase": {"display_name": {"query": query, "boost": 5}}}, + { + "match_phrase_prefix": { + "display_name": {"query": query, "boost": 3} + } + }, + {"match": {"display_name": {"query": query}}}, + ], + "minimum_should_match": 1, + } + } + + # 2. Build Filters + filter_clauses = build_author_filter_clauses( + institution_name=institution_name, + topics=topics, + strict=strict, + filter_mode=filter_mode, + filter_year=filter_year, + ) + functions = [] if not sort_by: # if (name_quality_boost): # Name quality boost, boost names which are not "Value Value" diff --git a/service/src/main/inse/ranking/__init__.py b/service/src/main/inse/ranking/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/service/src/main/inse/ranking/logic.py b/service/src/main/inse/ranking/logic.py new file mode 100644 index 00000000..faa023bf --- /dev/null +++ b/service/src/main/inse/ranking/logic.py @@ -0,0 +1,1082 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import asyncio +import logging +from dataclasses import dataclass +from time import time +from typing import Any, List, Optional + +import pandas as pd + +from inse.integrations import elasticsearch +from inse.model import ESCluster +from inse.persons.logic import _classify_career_stage +from inse.persons.query_builder import build_author_filter_clauses +from inse.company_connections.logic import get_company_counts_by_names +from .. import config +from .model import ( + AuthorStaticStats, + AuthorTopicProfile, + AuthorTopicStats, + CareerStage, + CompanyStatusFilter, + FilterType, + KeywordOperator, + PublicationType, + RankedAuthor, + RankingWeights, + SubfieldShare, + Timespan, +) + +logger = logging.getLogger(__name__) + + +# terms size: gather all matching authors as candidates before the score is +# computed, so a strong citation weight can still lift a low-works author. +CANDIDATE_POOL_SIZE = 10000 +UNI_AUTHOR_LIMIT = 20000 + + +async def _get_author_ids_from_uni(institution_name: str) -> List[str]: + """Returns the ids of all authors of the given institution. + + Uses the same author selection as the persons search endpoint (by institution + display name, see ``build_author_filter_clauses``), but scrolls over the whole + result set instead of paginating so that *all* matching author ids are returned. + """ + query = { + "bool": { + "filter": build_author_filter_clauses(institution_name=institution_name), + }, + } + + author_ids = [] + async for hit in elasticsearch.scan( + index="openalex-authors", + query=query, + source=["id"], + page_size=5000, + cluster=ESCluster.NES, + ): + source = hit.get("_source", {}) + author_id = source.get("id") or hit.get("_id", "") + if author_id: + author_ids.append(author_id) + if len(author_ids) >= UNI_AUTHOR_LIMIT: + break + + return author_ids + + + +@dataclass(frozen=True) +class MatchConfig: + """Where a topic filter matches on a work: keyword display names or topic ids.""" + + path: str + match_field: str + score_field: str + + +_KEYWORD_MATCH = MatchConfig( + path="keywords", + match_field="keywords.display_name.keyword", + score_field="keywords.score", +) +_TOPIC_MATCH = MatchConfig( + path="topics", + match_field="topics.display_name.keyword", + score_field="topics.score", +) + + +def _match_config(filter_type: FilterType) -> MatchConfig: + """Resolves the request's filter_type into the single set of fields to match on.""" + if filter_type == FilterType.TOPIC: + return _TOPIC_MATCH + return _KEYWORD_MATCH + + +def _keyword_clause(value: str, config: MatchConfig = _KEYWORD_MATCH) -> dict: + """A single nested clause that matches one keyword/topic value on a work.""" + return { + "nested": { + "path": config.path, + "query": { + "term": {config.match_field: value}, + }, + }, + } + + +def _build_keyword_query( + keywords: List[str], + operator: KeywordOperator, + config: MatchConfig = _KEYWORD_MATCH, +) -> dict: + """Combines the keyword/topic clauses according to the operator. + + AND: a work must carry all values (every clause is required). + OR: a work must carry at least one of the values. + """ + clauses = [] + for keyword in keywords: + clauses.append(_keyword_clause(keyword, config)) + + if operator == KeywordOperator.OR: + return { + "bool": { + "should": clauses, + "minimum_should_match": 1, + }, + } + + return { + "bool": { + "must": clauses, + }, + } + + +def _author_filter(author_ids: List[str]) -> dict: + + return { + "nested": { + "path": "authorships", + "query": { + "terms": {"authorships.author.id": author_ids}, + }, + }, + } + + +def _topic_stats_query( + author_ids: List[str], + keywords: List[str], + operator: KeywordOperator, + publication_types: List[PublicationType], + timespan: Optional[Timespan], + config: MatchConfig = _KEYWORD_MATCH, +) -> dict: + """Builds a single query with all stats for Section 1""" + + filters = [ + _build_keyword_query(keywords, operator, config), + _author_filter(author_ids), + ] + + if publication_types: + filters.append(_publication_type_filter(publication_types)) + + if timespan: + filters.append(_timespan_filter(timespan)) + + return { + "size": 0, + "query": { + "bool": { + "filter": filters, + }, + }, + "aggs": { + "authors": { + "nested": {"path": "authorships"}, + "aggs": { + "selected": { + "filter": {"terms": {"authorships.author.id": author_ids}}, + "aggs": { + "by_author": { + "terms": { + "field": "authorships.author.id", + "size": len(author_ids), + "execution_hint": "map", + }, + "aggs": { + "author_name": { + "terms": { + "field": "authorships.author.display_name.keyword", + "size": 1, + "execution_hint": "map", + }, + }, + "corresponding": { + "filter": { + "term": {"authorships.is_corresponding": True}, + }, + }, + "positions": { + "terms": { + "field": "authorships.author_position", + "size": 3, + "execution_hint": "map", + }, + }, + "to_work": { + "reverse_nested": {}, + "aggs": { + "avg_percentile": { + "avg": { + "field": "citation_normalized_percentile.value", + }, + }, + "top1": { + "filter": { + "term": { + "citation_normalized_percentile.is_in_top_1_percent": True, + }, + }, + }, + "top10": { + "filter": { + "term": { + "citation_normalized_percentile.is_in_top_10_percent": True, + }, + }, + }, + "fwci_above_one": { + "filter": { + "range": {"fwci": {"gt": 1}}, + }, + }, + # works without an fwci value are excluded from the avg + "fwci_avg": { + "avg": {"field": "fwci"}, + }, + "citations_total": { + "sum": {"field": "cited_by_count"}, + }, + "citations_avg": { + "avg": {"field": "cited_by_count"}, + }, + "citations_max": { + "max": {"field": "cited_by_count"}, + }, + "industry_collab": { + "filter": { + "nested": { + "path": "authorships", + "query": { + "nested": { + "path": "authorships.institutions", + "query": { + "term": { + "authorships.institutions.type": "company", + }, + }, + }, + }, + }, + }, + }, + "first_year": { + "min": {"field": "publication_year"}, + }, + "last_year": { + "max": {"field": "publication_year"}, + }, + # most-cited works, used to compute the h-index + # (top_hits is capped at 100, so the h-index is too) + "top_cited": { + "top_hits": { + "size": 100, + "sort": [{"cited_by_count": {"order": "desc"}}], + "_source": {"includes": ["cited_by_count"]}, + }, + }, + # works whose matched keyword/topic scores above 0.8 + "relevance_above_80": { + "filter": { + "nested": { + "path": config.path, + "query": { + "bool": { + "filter": [ + {"terms": {config.match_field: keywords}}, + {"range": {config.score_field: {"gt": 0.8}}}, + ], + }, + }, + }, + }, + }, + # average matched relevance score over the works + "matched_keywords": { + "nested": {"path": config.path}, + "aggs": { + "only_searched": { + "filter": { + "terms": {config.match_field: keywords}, + }, + "aggs": { + "avg_score": { + "avg": {"field": config.score_field}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + +def _max_h_index(citation_counts_desc: List[int]) -> int: + """The largest h such that h works have at least h citations each. + + Expects the counts sorted in descending order. + """ + h = 0 + for rank, citations in enumerate(citation_counts_desc, start=1): + if citations >= rank: + h = rank + else: + break + return h + + +async def topic_stats_for_authors( + author_ids: List[str], + keywords: List[str], + operator: KeywordOperator, + publication_types: List[PublicationType], + timespan: Optional[Timespan], + filter_type: FilterType = FilterType.KEYWORD, +) -> List[AuthorTopicStats]: + + if not author_ids: + return [] + + match_cfg = _match_config(filter_type) + response: dict[str, Any] = await elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=_topic_stats_query( + author_ids, keywords, operator, publication_types, timespan, match_cfg + ), + cluster=ESCluster.NES, + ) + + author_buckets = ( + response.get("aggregations", {}) + .get("authors", {}) + .get("selected", {}) + .get("by_author", {}) + .get("buckets", []) + ) + + results = [] + + for author_bucket in author_buckets: + to_work = author_bucket.get("to_work", {}) + avg_value = to_work.get("avg_percentile", {}).get("value") + avg_rel = ( + to_work.get("matched_keywords", {}) + .get("only_searched", {}) + .get("avg_score", {}) + .get("value") + ) + positions = { + bucket.get("key", ""): bucket.get("doc_count", 0) + for bucket in author_bucket.get("positions", {}).get("buckets", []) + } + avg_fwci = to_work.get("fwci_avg", {}).get("value") + citations_total = to_work.get("citations_total", {}).get("value") + avg_citations = to_work.get("citations_avg", {}).get("value") + max_citations = to_work.get("citations_max", {}).get("value") + first_year = to_work.get("first_year", {}).get("value") + last_year = to_work.get("last_year", {}).get("value") + top_cited_counts = [ + hit.get("_source", {}).get("cited_by_count") or 0 + for hit in to_work.get("top_cited", {}).get("hits", {}).get("hits", []) + ] + results.append( + AuthorTopicStats( + author_id=author_bucket.get("key", ""), + display_name=_display_name_from_bucket(author_bucket), + works_total=author_bucket.get("doc_count", 0), + corresponding_count=author_bucket.get("corresponding", {}).get("doc_count", 0), + avg_percentile=float(avg_value) if avg_value is not None else 0.0, + top1_count=to_work.get("top1", {}).get("doc_count", 0), + top10_count=to_work.get("top10", {}).get("doc_count", 0), + fwci_above_one_count=to_work.get("fwci_above_one", {}).get("doc_count", 0), + citations_total=int(citations_total) if citations_total is not None else 0, + avg_citations=float(avg_citations) if avg_citations is not None else 0.0, + max_citations=int(max_citations) if max_citations is not None else 0, + h_index=_max_h_index(top_cited_counts), + avg_fwci=float(avg_fwci) if avg_fwci is not None else 0.0, + industry_works_count=to_work.get("industry_collab", {}).get("doc_count", 0), + first_year=int(first_year) if first_year is not None else None, + last_year=int(last_year) if last_year is not None else None, + relevance_above_80_count=to_work.get("relevance_above_80", {}).get("doc_count", 0), + avg_relevance=float(avg_rel) if avg_rel is not None else 0.0, + first_author_count=positions.get("first", 0), + middle_author_count=positions.get("middle", 0), + last_author_count=positions.get("last", 0), + ) + ) + + return results + + +def _topic_profile_query( + author_ids: List[str], + keywords: List[str], + operator: KeywordOperator, + publication_types: List[PublicationType], + timespan: Optional[Timespan], + config: MatchConfig = _KEYWORD_MATCH, +) -> dict: + """Builds the Section 3 query""" + + filters = [_author_filter(author_ids)] + + if publication_types: + filters.append(_publication_type_filter(publication_types)) + + if timespan: + filters.append(_timespan_filter(timespan)) + + return { + "size": 0, + "query": { + "bool": { + "filter": filters, + }, + }, + "aggs": { + "authors": { + "nested": {"path": "authorships"}, + "aggs": { + "selected": { + "filter": {"terms": {"authorships.author.id": author_ids}}, + "aggs": { + "by_author": { + "terms": { + "field": "authorships.author.id", + "size": len(author_ids), + "execution_hint": "map", + }, + "aggs": { + "author_name": { + "terms": { + "field": "authorships.author.display_name.keyword", + "size": 1, + "execution_hint": "map", + }, + }, + "to_work": { + "reverse_nested": {}, + "aggs": { + "matched": { + "filter": _build_keyword_query(keywords, operator, config), + "aggs": { + "primary_match": { + "filter": { + "terms": { + "primary_topic.display_name.keyword": keywords, + }, + }, + }, + }, + }, + "by_subfield": { + "terms": { + "field": "primary_topic.subfield.display_name.keyword", + "size": 10, + }, + }, + "distinct_topics": { + "cardinality": {"field": "primary_topic.id"}, + }, + "distinct_subfields": { + "cardinality": {"field": "primary_topic.subfield.id"}, + }, + "distinct_fields": { + "cardinality": {"field": "primary_topic.field.id"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + +async def topic_profile_for_authors( + author_ids: List[str], + keywords: List[str], + operator: KeywordOperator, + publication_types: List[PublicationType], + timespan: Optional[Timespan], + filter_type: FilterType = FilterType.KEYWORD, +) -> List[AuthorTopicProfile]: + + if not author_ids: + return [] + + match_cfg = _match_config(filter_type) + response: dict[str, Any] = await elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=_topic_profile_query( + author_ids, keywords, operator, publication_types, timespan, match_cfg + ), + cluster=ESCluster.NES, + ) + + author_buckets = ( + response.get("aggregations", {}) + .get("authors", {}) + .get("selected", {}) + .get("by_author", {}) + .get("buckets", []) + ) + + results = [] + + for author_bucket in author_buckets: + to_work = author_bucket.get("to_work", {}) + matched = to_work.get("matched", {}) + subfields = [ + SubfieldShare( + name=bucket.get("key", ""), + count=bucket.get("doc_count", 0), + ) + for bucket in to_work.get("by_subfield", {}).get("buckets", []) + ] + results.append( + AuthorTopicProfile( + author_id=author_bucket.get("key", ""), + display_name=_display_name_from_bucket(author_bucket), + works_total=to_work.get("doc_count", 0), + matched_works=matched.get("doc_count", 0), + primary_topic_matches=matched.get("primary_match", {}).get("doc_count", 0), + distinct_topics=to_work.get("distinct_topics", {}).get("value", 0), + distinct_subfields=to_work.get("distinct_subfields", {}).get("value", 0), + distinct_fields=to_work.get("distinct_fields", {}).get("value", 0), + subfields=subfields, + ) + ) + + return results + + +async def _get_display_names_by_ids(author_ids: List[str]) -> dict: + + if not author_ids: + return {} + + body = { + "size": len(author_ids), + "_source": ["id", "display_name"], + "query": {"terms": {"id": author_ids}}, + } + + response: dict[str, Any] = await elasticsearch.search( + index="openalex-authors", + body=body, + cluster=ESCluster.NES, + ) + + names = {} + for hit in response.get("hits", {}).get("hits", []): + source = hit.get("_source", {}) + author_id = source.get("id") + if author_id: + names[author_id] = source.get("display_name", "") + return names + + +async def static_stats_for_authors( + author_ids: List[str], + company_status: CompanyStatusFilter = CompanyStatusFilter.ALL, +) -> List[AuthorStaticStats]: + """Section 2: per author, keyword-independent stats (companies, news, patents). + Companies and news are matched by exact display name, patents by author id. + """ + + if not author_ids: + return [] + + names_by_id = await _get_display_names_by_ids(author_ids) + names = [name for name in names_by_id.values() if name] + + company_counts, news_counts, patent_counts = await asyncio.gather( + get_company_counts_by_names(names, company_status=company_status), + _get_news_counts_by_names(names), + _get_patent_counts_by_author_ids(author_ids), + ) + + results = [] + + for author_id in author_ids: + name = names_by_id.get(author_id, "") + results.append( + AuthorStaticStats( + author_id=author_id, + display_name=name, + companies_count=company_counts.get(name, 0), + news_count=news_counts.get(name, 0), + patents_count=patent_counts.get(author_id, 0), + ) + ) + + return results + + +def _publication_type_filter(publication_types: List[PublicationType]) -> dict: + """Keeps only works whose type is one of the given publication types.""" + type_values = [] + for publication_type in publication_types: + type_values.append(publication_type.value) + return {"terms": {"type": type_values}} + + +def _timespan_filter(timespan: Timespan) -> dict: + """Keeps only works whose publication year is within the timespan (inclusive).""" + return { + "range": { + "publication_year": { + "gte": timespan.from_year, + "lte": timespan.to_year, + }, + }, + } + + +def _build_query( + keywords: List[str], + operator: KeywordOperator, + author_ids: List[str], + publication_types: List[PublicationType], + timespan: Optional[Timespan], + config: MatchConfig = _KEYWORD_MATCH, +) -> dict: + """Builds the Elasticsearch query that returns the raw stats per author.""" + work_filters = [ + _build_keyword_query(keywords, operator, config), + _author_filter(author_ids), + ] + if publication_types: + work_filters.append(_publication_type_filter(publication_types)) + if timespan is not None: + work_filters.append(_timespan_filter(timespan)) + + return { + "size": 0, + "query": { + "bool": { + "filter": work_filters, + }, + }, + "aggs": { + "authors": { + "nested": {"path": "authorships"}, + "aggs": { + "uni_only": { + "filter": { + "terms": { + "authorships.author.id": author_ids + } + }, + "aggs": { + "by_author": { + "terms": { + "field": "authorships.author.id", + "size": CANDIDATE_POOL_SIZE, + "execution_hint": "map", + }, + "aggs": { + "author_name": { + "terms": { + "field": "authorships.author.display_name.keyword", + "size": 1, + "execution_hint": "map", + }, + }, + "to_work": { + "reverse_nested": {}, + "aggs": { + "citations": { + "sum": {"field": "cited_by_count"}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + +def _display_name_from_bucket(author_bucket: dict) -> str: + """Reads the authors display name out of the name sub-aggregation.""" + name_buckets = author_bucket.get("author_name", {}).get("buckets", []) + if name_buckets: + return name_buckets[0].get("key", "") + return "" + + +def _citations_from_bucket(author_bucket: dict) -> int: + """Reads the summed citations out of the reverse_nested sub-aggregation.""" + citations_value = ( + author_bucket.get("to_work", {}) + .get("citations", {}) + .get("value", 0) + ) + return int(citations_value) + + +def _bucket_to_ranked_author(author_bucket: dict) -> RankedAuthor: + """Converts an author bucket from the ES aggregation into a RankedAuthor.""" + return RankedAuthor( + author_id=author_bucket.get("key", ""), + display_name=_display_name_from_bucket(author_bucket), + works_count=author_bucket.get("doc_count", 0), + citations_count=_citations_from_bucket(author_bucket), + ) + + +def _min_max_normalize(values: pd.Series) -> pd.Series: + """Scales a numeric column to the range [0, 1] via min-max normalization.""" + minimum = values.min() + maximum = values.max() + # if all values are the same, return a series of 1.0 to avoid division by zero. + if maximum == minimum: + return pd.Series([1.0] * len(values)) + + return (values - minimum) / (maximum - minimum) + + +def _apply_scores(authors: List[RankedAuthor], weights: RankingWeights) -> None: + """Normalizes works, citations, company connections and news to [0, 1] and sets each author's weighted score.""" + if not authors: + return + + works_counts = [] + citations_counts = [] + companies_counts = [] + news_counts = [] + patents_counts = [] + + for author in authors: + works_counts.append(author.works_count) + citations_counts.append(author.citations_count) + companies_counts.append(author.companies_count) + news_counts.append(author.news_count) + patents_counts.append(author.patents_count) + + frame = pd.DataFrame({ + "works": works_counts, + "citations": citations_counts, + "companies": companies_counts, + "news": news_counts, + "patents": patents_counts, + }) + + quantile_value = 0.95 + + frame["works"] = frame["works"].clip(upper=frame["works"].quantile(quantile_value)) + frame["citations"] = frame["citations"].clip(upper=frame["citations"].quantile(quantile_value)) + frame["companies"] = frame["companies"].clip(upper=frame["companies"].quantile(quantile_value)) + frame["news"] = frame["news"].clip(upper=frame["news"].quantile(quantile_value)) + frame["patents"] = frame["patents"].clip(upper=frame["patents"].quantile(quantile_value)) + + works_normalized = _min_max_normalize(frame["works"]) + citations_normalized = _min_max_normalize(frame["citations"]) + companies_normalized = _min_max_normalize(frame["companies"]) + news_normalized = _min_max_normalize(frame["news"]) + patents_normalized = _min_max_normalize(frame["patents"]) + + scores = ( + works_normalized * weights.works + + citations_normalized * weights.citation + + companies_normalized * weights.companies + + news_normalized * weights.news + + patents_normalized * weights.patents + ) + + for index, author in enumerate(authors): + author.score = float(scores.iloc[index]) + + +def _author_score(author: RankedAuthor) -> float: + """Sort key: the weighted score of an author.""" + return author.score + + +async def _enrich_with_company_counts( + authors: List[RankedAuthor], + company_status: CompanyStatusFilter = CompanyStatusFilter.ALL, +) -> None: + """Sets each author's company_count from a single bulk Handelsregister query. + + Matching is by exact display name (same as the company-connections feature), so + authors without a name match keep a count of 0. ``company_status`` selects which + companies are counted: all, only active (non-deleted), or only deleted. + """ + if not authors: + return + + names = [author.display_name for author in authors if author.display_name] + counts = await get_company_counts_by_names(names, company_status=company_status) + + for author in authors: + author.companies_count = counts.get(author.display_name, 0) + + +async def _get_news_counts_by_names(names: List[str]) -> dict: + """Returns a mapping ``display_name -> news count`` for the given author names. + """ + unique_names = sorted({name for name in names if name}) + + if not unique_names: + return {} + + body = { + "size": 0, + "query": {"terms": {"authors.keyword": unique_names}}, + "aggs": { + "by_author": { + "terms": { + "field": "authors.keyword", + "include": unique_names, + "size": len(unique_names), + "execution_hint": "map", + }, + }, + }, + } + + response: dict[str, Any] = await elasticsearch.search( + index="aktuell_postproc", + body=body, + cluster=ESCluster.INSE, + ) + + buckets = ( + response.get("aggregations", {}) + .get("by_author", {}) + .get("buckets", []) + ) + + return {bucket.get("key", ""): bucket.get("doc_count", 0) for bucket in buckets} + + +async def _enrich_with_news_counts(authors: List[RankedAuthor]) -> None: + """Sets each author's news_count from a single bulk news query. + Matching is by exact display name, so authors without a name match keep 0. + """ + + if not authors: + return + + names = [author.display_name for author in authors if author.display_name] + counts = await _get_news_counts_by_names(names) + + for author in authors: + author.news_count = counts.get(author.display_name, 0) + + +async def _get_patent_counts_by_author_ids(author_ids: List[str]) -> dict: + + short_to_full = {full.rsplit("/", 1)[-1]: full for full in author_ids} + + body = { + "size": 0, + "aggs": { + "matched": { + "nested": {"path": "matched_authors"}, + "aggs": { + "by_author": { + "terms": { + "field": "matched_authors.openalex_author_id", + "include": list(short_to_full.keys()), + "size": len(short_to_full), + "execution_hint": "map", + }, + "aggs": { + "patents": {"reverse_nested": {}}, + }, + }, + }, + }, + }, + } + + response: dict[str, Any] = await elasticsearch.search( + index="org_patents", + body=body, + cluster=ESCluster.INSE, + ) + + buckets = ( + response.get("aggregations", {}) + .get("matched", {}) + .get("by_author", {}) + .get("buckets", []) + ) + + counts = {} + for bucket in buckets: + full_id = short_to_full.get(bucket.get("key", "")) + if full_id: + counts[full_id] = bucket.get("patents", {}).get("doc_count", 0) + return counts + + +async def _enrich_with_patent_counts(authors: List[RankedAuthor]) -> None: + + if not authors: + return + + author_ids = [author.author_id for author in authors if author.author_id] + counts = await _get_patent_counts_by_author_ids(author_ids) + + for author in authors: + author.patents_count = counts.get(author.author_id, 0) + + +async def _filter_author_ids_by_career_stage( + author_ids: List[str], + career_stages: List[CareerStage], +) -> List[str]: + """Filters the given author ids down to those whose career stage is in the list.""" + + if not author_ids or not career_stages: + return author_ids + + # remove openalex.org prefix to match the multiplicators_v1 index, which only stores the id + short_to_full = {full.rsplit("/", 1)[-1]: full for full in author_ids} + + body = { + "size": 0, + "query": { + "bool": { + "filter": [ + {"terms": {"author_id": list(short_to_full.keys())}}, + { + "terms": { + "career_bucket": [stage.value for stage in career_stages] + } + }, + ], + }, + }, + "aggs": { + "matched_authors": { + "terms": { + "field": "author_id", + "size": len(short_to_full), + "execution_hint": "map", + }, + }, + }, + } + + response: dict[str, Any] = await elasticsearch.search( + index="multiplicators_v1", + body=body, + cluster=ESCluster.INSE, + ) + + buckets = ( + response.get("aggregations", {}) + .get("matched_authors", {}) + .get("buckets", []) + ) + + filtered_ids = [] + for bucket in buckets: + full_id = short_to_full.get(bucket.get("key", "")) + if full_id: + filtered_ids.append(full_id) + + return filtered_ids + + +async def rank_authors_by_keywords( + keywords: List[str], + operator: KeywordOperator, + institution_name: str, + weights: RankingWeights, + career_stages: List[CareerStage], + publication_types: List[PublicationType], + timespan: Optional[Timespan], + company_status: CompanyStatusFilter = CompanyStatusFilter.ALL, + filter_type: FilterType = FilterType.KEYWORD, +) -> List[RankedAuthor]: + """Ranks the university's authors by a weighted score over works and citations. + + When career_stages is not empty, the ranked list is filtered down to + authors whose career stage is one of the given stages. + """ + query_start_time = time() + + author_ids = await _get_author_ids_from_uni(institution_name) + + if not author_ids: + return [] + + if career_stages: + author_ids = await _filter_author_ids_by_career_stage(author_ids, career_stages) + + query_body = _build_query( + keywords, operator, author_ids, publication_types, timespan, + _match_config(filter_type), + ) + + response: dict[str, Any] = await elasticsearch.search( + index=config.settings.openalex_works_search_index, + body=query_body, + cluster=ESCluster.NES, + ) + + query_end_time = time() + + author_buckets = ( + response.get("aggregations", {}) + .get("authors", {}) + .get("uni_only", {}) + .get("by_author", {}) + .get("buckets", []) + ) + + # Build the raw authors, then compute the normalized weighted score. + backend_processing_start_time = time() + ranked_authors = [] + for author_bucket in author_buckets: + ranked_authors.append(_bucket_to_ranked_author(author_bucket)) + + if weights.companies > 0: + await _enrich_with_company_counts(ranked_authors, company_status) + + if weights.news > 0: + await _enrich_with_news_counts(ranked_authors) + + if weights.patents > 0: + await _enrich_with_patent_counts(ranked_authors) + + _apply_scores(ranked_authors, weights) + + # Sort by the weighted score, highest first. + ranked_authors.sort(key=_author_score, reverse=True) + + backend_processing_end_time = time() + logger.info("Query time: %.3f s, backend processing time: %.3f s", query_end_time - query_start_time, backend_processing_end_time - backend_processing_start_time) + + return ranked_authors diff --git a/service/src/main/inse/ranking/model.py b/service/src/main/inse/ranking/model.py new file mode 100644 index 00000000..1321102f --- /dev/null +++ b/service/src/main/inse/ranking/model.py @@ -0,0 +1,364 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Data models for author ranking. +""" +from enum import StrEnum +from typing import List, Optional + +from pydantic import BaseModel, Field, field_validator, model_validator + + +class KeywordOperator(StrEnum): + AND = "and" + OR = "or" + + +class FilterType(StrEnum): + KEYWORD = "keyword" + TOPIC = "topic" + + +class CompanyStatusFilter(StrEnum): + ALL = "all" + ACTIVE = "active" + DELETED = "deleted" + +class CareerStage(StrEnum): + UNKNOWN = "unknown" + EARLY = "Early" + EMERGING = "Emerging" + ESTABLISHED = "Established" + SENIOR = "Senior" + + +class PublicationType(StrEnum): + ARTICLE = "article" + OTHER = "other" + DATASET = "dataset" + BOOK_CHAPTER = "book-chapter" + BOOK = "book" + DISSERTATION = "dissertation" + PREPRINT = "preprint" + PARATEXT = "paratext" + LIBGUIDES = "libguides" + REVIEW = "review" + LETTER = "letter" + REFERENCE_ENTRY = "reference-entry" + EDITORIAL = "editorial" + PEER_REVIEW = "peer-review" + REPORT = "report" + STANDARD = "standard" + ERRATUM = "erratum" + RETRACTION = "retraction" + SUPPLEMENTARY_MATERIALS = "supplementary-materials" + BOOK_SECTION = "book-section" + DATABASE = "database" + SOFTWARE = "software" + REPORT_COMPONENT = "report-component" + GRANT = "grant" + +class Timespan(BaseModel): + from_year: int = Field(alias="from", description="Start year (inclusive).") + to_year: int = Field(alias="to", description="End year (inclusive).") + + @model_validator(mode="after") + def check_order(self): + if self.from_year > self.to_year: + raise ValueError("timespan 'from' must not be greater than 'to'.") + return self + + +class RankingWeights(BaseModel): + citation: float = Field( + ge=0.0, + le=1.0, + description="Weight for the citation metric (0.0 - 1.0).", + ) + works: float = Field( + ge=0.0, + le=1.0, + description="Weight for the works metric (0.0 - 1.0).", + ) + companies: float = Field( + default=0.0, + ge=0.0, + le=1.0, + description="Weight for the company-foundations metric (0.0 - 1.0).", + ) + news: float = Field( + default=0.0, + ge=0.0, + le=1.0, + description="Weight for the news/media-visibility metric (0.0 - 1.0).", + ) + patents: float = Field( + default=0.0, + ge=0.0, + le=1.0, + description="Weight for the patents metric (0.0 - 1.0).", + ) + + +class KeywordToAuthorRequest(BaseModel): + keywords: List[str] = Field( + min_length=1, + description="One or more keywords to rank the author by.", + ) + operator: KeywordOperator = Field( + default=KeywordOperator.AND, + description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.", + ) + filter_type: FilterType = Field( + default=FilterType.KEYWORD, + description="What the 'keywords' values match against: 'keyword' (OpenAlex " + "keyword display names) or 'topic' (OpenAlex topic display names). Defaults to 'keyword'.", + ) + institution_name: str = Field( + default="University of Duisburg-Essen", + description="The selected institution display name. (Default Uni-Due)", + ) + weights: RankingWeights = Field( + description="Weights for the ranking metrics. Required.", + ) + career_stages: List[CareerStage] = Field( + default_factory=list, + description="Optional filter: only keep authors in one of these career stages. Empty = no filter.", + ) + publication_types: List[PublicationType] = Field( + default_factory=list, + description="Optional filter: only count works of these publication types. Empty = no filter.", + ) + timespan: Optional[Timespan] = Field( + default=None, + description="Optional filter: only count works whose publication_year is within [from, to].", + ) + company_status: CompanyStatusFilter = Field( + default=CompanyStatusFilter.ALL, + description="Which companies to count for the company-foundations metric: " + "'all', only 'active' (non-deleted), or only 'deleted'.", + ) + + @field_validator("operator", "filter_type", mode="before") + @classmethod + def operator_case_insensitive(cls, value): + if isinstance(value, str): + return value.lower() + return value + + +class SelectedAuthorsRequest(BaseModel): + author_ids: List[str] = Field( + min_length=1, + description="OpenAlex IDs of the authors to rank.", + ) + keywords: List[str] = Field( + min_length=1, + description="One or more keywords defining the topic.", + ) + operator: KeywordOperator = Field( + default=KeywordOperator.AND, + description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.", + ) + filter_type: FilterType = Field( + default=FilterType.KEYWORD, + description="What the 'keywords' values match against: 'keyword' (OpenAlex " + "keyword display names) or 'topic' (OpenAlex topic ids). Defaults to 'keyword'.", + ) + publication_types: List[PublicationType] = Field( + default_factory=list, + description="Optional filter: only count works of these publication types. Empty = no filter.", + ) + timespan: Optional[Timespan] = Field( + default=None, + description="Optional filter: only count works whose publication_year is within [from, to].", + ) + + @field_validator("operator", mode="before") + @classmethod + def operator_case_insensitive(cls, value): + if isinstance(value, str): + return value.lower() + return value + + @field_validator("filter_type", mode="before") + @classmethod + def filter_type_case_insensitive(cls, value): + if isinstance(value, str): + return value.lower() + return value + + +class AuthorMetricsRequest(BaseModel): + author_ids: List[str] = Field( + min_length=1, + description="OpenAlex IDs of the authors.", + ) + company_status: CompanyStatusFilter = Field( + default=CompanyStatusFilter.ALL, + description="Which companies to count for the company-foundations metric: " + "'all', only 'active' (non-deleted), or only 'deleted'.", + ) + + +class AuthorTopicStats(BaseModel): + """Section 1: combined stats over an author's works that match the topic filter.""" + + author_id: str = Field(description="The OpenAlex ID of the author.") + display_name: str = Field(description="The name of the author.") + works_total: int = Field( + description="Number of the author's works matching the topic filter.", + ) + corresponding_count: int = Field( + description="Number of the author's topic works where they are the corresponding author.", + ) + avg_percentile: float = Field( + description="Average field-normalized citation percentile (0-1) over the author's topic works.", + ) + top1_count: int = Field( + description="Number of the author's topic works in the top 1% most-cited.", + ) + top10_count: int = Field( + description="Number of the author's topic works in the top 10% most-cited.", + ) + fwci_above_one_count: int = Field( + default=0, + description="Number of the author's topic works with a field-weighted citation " + "impact (FWCI) above 1 (cited more than the field/year/type average).", + ) + citations_total: int = Field( + default=0, + description="Total citations across the author's topic works.", + ) + avg_citations: float = Field( + default=0.0, + description="Average citations per topic work.", + ) + max_citations: int = Field( + default=0, + description="Citations of the author's most-cited topic work.", + ) + h_index: int = Field( + default=0, + description="h-index over the author's topic works (capped at 100).", + ) + avg_fwci: float = Field( + default=0.0, + description="Average field-weighted citation impact (FWCI) over the author's " + "topic works; works without an FWCI value are excluded.", + ) + industry_works_count: int = Field( + default=0, + description="Number of the author's topic works with at least one co-author " + "institution of type 'company'.", + ) + first_year: Optional[int] = Field( + default=None, + description="Earliest publication year among the author's topic works.", + ) + last_year: Optional[int] = Field( + default=None, + description="Latest publication year among the author's topic works.", + ) + relevance_above_80_count: int = Field( + default=0, + description="Number of the author's topic works where the matched keyword's " + "relevance score is above 0.8.", + ) + avg_relevance: float = Field( + default=0.0, + description="Average matched-keyword relevance score (0-1) over the author's topic works.", + ) + first_author_count: int = Field( + default=0, + description="Number of the author's topic works where they are the first author.", + ) + middle_author_count: int = Field( + default=0, + description="Number of the author's topic works where they are a middle author.", + ) + last_author_count: int = Field( + default=0, + description="Number of the author's topic works where they are the last author.", + ) + + +class SubfieldShare(BaseModel): + name: str = Field(description="The subfield display name.") + count: int = Field(description="Number of works whose primary topic belongs to this subfield.") + + +class AuthorTopicProfile(BaseModel): + author_id: str = Field(description="The OpenAlex ID of the author.") + display_name: str = Field(description="The name of the author.") + works_total: int = Field( + description="All works of the author in the timespan, regardless of the topic filter.", + ) + matched_works: int = Field( + description="Works matching the topic filter (same subset as Section 1).", + ) + primary_topic_matches: int = Field( + description="Matched works where one of the searched topics is the work's " + "primary topic (only meaningful for filter_type 'topic').", + ) + distinct_topics: int = Field( + description="Number of distinct primary topics across all works.", + ) + distinct_subfields: int = Field( + description="Number of distinct primary-topic subfields across all works.", + ) + distinct_fields: int = Field( + description="Number of distinct primary-topic fields across all works.", + ) + subfields: List[SubfieldShare] = Field( + default_factory=list, + description="Top subfields over all works, by primary topic, largest first.", + ) + + +class AuthorStaticStats(BaseModel): + """Section 2: author-level stats independent of any keyword/topic/time filter.""" + + author_id: str = Field(description="The OpenAlex ID of the author.") + display_name: str = Field(description="The name of the author.") + companies_count: int = Field( + description="Number of Handelsregister company connections matched by the author's name.", + ) + news_count: int = Field( + description="Number of news articles that mention the author by exact name.", + ) + patents_count: int = Field( + description="Number of patents matched to the author (from the org_patents index).", + ) + + +class RankedAuthor(BaseModel): + author_id: str = Field(description="The OpenAlex ID of the author.") + display_name: str = Field(description="The name of the author.") + works_count: int = Field(description="Number of matching works by this author.") + citations_count: int = Field( + description="Total citations across this author's matching works.", + ) + companies_count: int = Field( + default=0, + description="Number of Handelsregister company connections matched by the " + "author's name (proxy for company foundations).", + ) + news_count: int = Field( + default=0, + description="Number of news articles that mention the author by exact name " + "(proxy for media visibility).", + ) + patents_count: int = Field( + default=0, + description="Number of patents matched to the author (from the precomputed " + "org_patents index).", + ) + score: float = Field( + default=0.0, + description="Normalized weighted score used for ranking.", + ) + career_stage: CareerStage = Field( + default=CareerStage.UNKNOWN, + description="Career stage derived from the author's active publication years.", + ) diff --git a/service/src/main/inse/ranking/ranking.http b/service/src/main/inse/ranking/ranking.http new file mode 100644 index 00000000..6fd0c062 --- /dev/null +++ b/service/src/main/inse/ranking/ranking.http @@ -0,0 +1,280 @@ +### Autoren-Ranking: ein Keyword +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Computer science"], + "filter_by_university": "https://openalex.org/I62318514", + "latest_publication_year": 2025 +} + +### Autoren-Ranking: nur Autoren mit juengster Arbeit ab 2023 +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Computer science"], + "latest_publication_year": 2023 +} + +### Autoren-Ranking: mehrere Keywords mit OR +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Waste management", "Public transport"], + "operator": "or" +} + +### Autoren-Ranking: mehrere Keywords mit AND +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Waste management", "Public transport"], + "operator": "and" +} + +### Autoren-Ranking: gefiltert nach Career Stage (nur Senior + Established) +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Waste management"], + "career_stages": ["Senior", "Established"] +} + +### Autoren-Ranking: nur Autoren der Uni Duisburg-Essen +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Waste management"], + "filter_by_university": "https://openalex.org/I62318514" +} + +### Autoren-Ranking: alle Filter kombiniert +POST http://localhost:8000/api/search/rank +Content-Type: application/json + +{ + "keywords": ["Context-Aware Activity Recognition Systems"], + //"career_stages": ["Senior"], + "filter_by_university": "https://openalex.org/I62318514" +} + +### Autor in die Rangliste einer (fremden) Uni einsortieren (publications) +POST http://localhost:8000/api/search/rank-author +Content-Type: application/json + +{ + "author_id": "https://openalex.org/A5036533333", + "universities": ["https://openalex.org/I62318514"], + "keywords": ["Control theory (sociology)"], + "metric": "publications" +} + +### +POST http://localhost:8000/api/search/rank-author +Content-Type: application/json + +{ + "author_id": "https://openalex.org/A5036533333", + "universities": ["https://openalex.org/I8204097"], + "keywords": ["Control theory (sociology)"], + "metric": "citations" +} + +### +POST http://localhost:8000/api/search/rank-author +Content-Type: application/json + +{ + "author_id": "https://openalex.org/A5036533333", + "universities": ["https://openalex.org/I8204097"], + "keywords": ["Control theory (sociology)"], + "metric": "publications" +} + +### +POST http://localhost:8000/api/rank/rank-author +Content-Type: application/json + +{ + //"author_id": "https://openalex.org/A5036533333" + "keywords": ["Computer science"] +} + +### +POST http://localhost:8000/api/rank/rank-author +Content-Type: application/json + +{ + "keywords": ["Middleware (distributed applications)"], + "weights": { "citation": 0.2, "works": 1.0 }, + "career_stages": ["Senior"], + "timespan": { "from": 2018, "to": 2025 } +} + +### +GET https://project.nes.uni-due.de/elastic/_aliases +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== + +### +GET https://inse.nes.uni-due.de/elastic/_aliases +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== + +### +GET https://inse.nes.uni-due.de/elastic/multiplicators_v1/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 1, + "query": { + "match_all": {} + } +} + +### +GET https://project.nes.uni-due.de/elastic/work-classifications/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 1, + "query": { + "match_all": {} + } +} + +### +GET https://project.nes.uni-due.de/elastic/openalex-keywords/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 5, + "query": { + "match_all": {} + } +} + + + + + +### +GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 25, + "query": { + "match_all": {} + } +} + +### +GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_search +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== +Content-Type: application/json + +{ + "size": 0, + "aggs": { + "authors_leer": { + "filter": { + "bool": { "must_not": { "exists": { "field": "authors" } } } + } + }, + "keywords_leer": { + "filter": { + "bool": { "must_not": { "exists": { "field": "keywords" } } } + } + } + } +} + +### +GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_count +Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw== + + + + + +### +POST https://project.nes.uni-due.de/elastic/openalex-works*/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "filter": [ + { + "nested": { + "path": "authorships", + "query": { + "term": { "authorships.author.id": "https://openalex.org/A5007170803" } + } + } + } + ] + } + }, + "aggs": { + "by_field": { + "terms": { + "field": "primary_topic.field.display_name.keyword", + "size": 30 + } + } + } +} + +### +POST https://project.nes.uni-due.de/elastic/openalex-works*/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json + +{ + "size": 0, + "query": { + "bool": { + "filter": [ + { + "nested": { + "path": "authorships", + "query": { + "term": { "authorships.author.id": "https://openalex.org/A5007170803" } + } + } + } + ] + } + }, + "aggs": { + "by_field": { + "terms": { + "field": "primary_topic.field.display_name.keyword", + "size": 30 + }, + "aggs": { + "works": { + "top_hits": { + "size": 100, + "_source": ["id"] + } + } + } + } + } +} + +### +POST https://project.nes.uni-due.de/elastic/topicvectors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== diff --git a/service/src/main/inse/ranking/router.py b/service/src/main/inse/ranking/router.py new file mode 100644 index 00000000..6f00eca7 --- /dev/null +++ b/service/src/main/inse/ranking/router.py @@ -0,0 +1,105 @@ +import logging +from typing import List + +from fastapi import APIRouter + +from inse.tags import Tags +from . import logic +from .model import ( + AuthorMetricsRequest, + AuthorStaticStats, + AuthorTopicProfile, + AuthorTopicStats, + KeywordToAuthorRequest, + RankedAuthor, + SelectedAuthorsRequest, +) + +logger = logging.getLogger(__name__) + +router = APIRouter( + prefix="/api/rank", + tags=[Tags.RANKING], +) + +# Author ranking +@router.post("/rank-author", response_model=List[RankedAuthor]) +async def rank_author(request: KeywordToAuthorRequest): + logger.info( + "rank-author keywords=%s operator=%s filter_type=%s institution_name=%s career_stages=%s " + "publication_types=%s timespan=%s", + request.keywords, + request.operator, + request.filter_type, + request.institution_name, + request.career_stages, + request.publication_types, + request.timespan, + ) + return await logic.rank_authors_by_keywords( + request.keywords, + request.operator, + request.institution_name, + request.weights, + request.career_stages, + request.publication_types, + request.timespan, + request.company_status, + request.filter_type, + ) + +# Compare authors table 1 (topic stats) +@router.post("/topic-stats", response_model=List[AuthorTopicStats]) +async def topic_stats(request: SelectedAuthorsRequest): + logger.info( + "topic-stats author_ids=%s keywords=%s operator=%s filter_type=%s publication_types=%s timespan=%s", + request.author_ids, + request.keywords, + request.operator, + request.filter_type, + request.publication_types, + request.timespan, + ) + return await logic.topic_stats_for_authors( + request.author_ids, + request.keywords, + request.operator, + request.publication_types, + request.timespan, + request.filter_type, + ) + +# Compare authors section 3 (topic profile over ALL works of each author) +@router.post("/topic-profile", response_model=List[AuthorTopicProfile]) +async def topic_profile(request: SelectedAuthorsRequest): + logger.info( + "topic-profile author_ids=%s keywords=%s operator=%s filter_type=%s " + "publication_types=%s timespan=%s", + request.author_ids, + request.keywords, + request.operator, + request.filter_type, + request.publication_types, + request.timespan, + ) + return await logic.topic_profile_for_authors( + request.author_ids, + request.keywords, + request.operator, + request.publication_types, + request.timespan, + request.filter_type, + ) + +# Compare authors table 2 (author-level stats, keyword/time-independent) +@router.post("/static-stats", response_model=List[AuthorStaticStats]) +async def static_stats(request: AuthorMetricsRequest): + logger.info( + "static-stats author_ids=%s company_status=%s", + request.author_ids, + request.company_status, + ) + return await logic.static_stats_for_authors( + request.author_ids, + request.company_status, + ) diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 3a7eefcc..2e264875 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -13,6 +13,7 @@ class Tags(StrEnum): ACCOUNT = "Account" ORGANIZATION = "Organization" UNIVERSITY_RANKINGS = "University Rankings" + RANKING = "Ranking" DASHBOARD = "Dashboard" AUTHORS_V2 = "Authors V2" diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index ecd90061..e8dd68e8 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -42,6 +42,33 @@ export * from './universityRankings.service'; import { UniversityRankingsService } from './universityRankings.service'; export * from './works.service'; import { WorksService } from './works.service'; +export * from './ranking.service'; +import { RankingService } from './ranking.service'; export * from './worksV2.service'; import { WorksV2Service } from './worksV2.service'; -export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service]; +export const APIS = [ + AuthService, + AuthorsV2Service, + BookmarksService, + CompanyConnectionsService, + DFGInstitutionsService, + DFGPersonsService, + DashboardService, + FundingService, + INSEServiceService, + InstitutionsService, + InstitutionsV2Service, + KeywordsService, + NewsService, + OrganizationService, + PatentsService, + PersonNetworkService, + PersonsService, + ProjectsService, + RankingService, + TopicsService, + TopicsV2Service, + UniversityRankingsService, + WorksService, + WorksV2Service, +]; diff --git a/webapp/src/app/api/api/authorsV2.service.ts b/webapp/src/app/api/api/authorsV2.service.ts index 9b1deb23..aa247f9e 100644 --- a/webapp/src/app/api/api/authorsV2.service.ts +++ b/webapp/src/app/api/api/authorsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorPage } from '../model/authorPage'; @@ -22,137 +28,231 @@ import { AuthorPage } from '../model/authorPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthorsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of authors for a given search term based on their display name. + * @endpoint get /api/v2/authors/autocomplete/selector + * @param query A search term to filter authors by (partial matches allowed). + * @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 autocompleteAuthorsForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteAuthorsForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteAuthorsForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteAuthorsForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a paginated list of authors for a given search term based on their display name. - * @endpoint get /api/v2/authors/autocomplete/selector - * @param query A search term to filter authors by (partial matches allowed). - * @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 autocompleteAuthorsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteAuthorsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteAuthorsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteAuthorsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/v2/authors/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/authors/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a paginated list of authors for a given list of author IDs. + * @endpoint get /api/v2/authors/authors/id + * @param authorIds A list of author IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorsByIds( + authorIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorsByIds( + authorIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorsByIds( + authorIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorsByIds( + authorIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', ); + }); } - /** - * Returns a paginated list of authors for a given list of author IDs. - * @endpoint get /api/v2/authors/authors/id - * @param authorIds A list of author IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorsByIds(authorIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorsByIds(authorIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorsByIds(authorIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorsByIds(authorIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - - 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/v2/authors/authors/id`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/authors/authors/id`; + 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/bookmarks.service.ts b/webapp/src/app/api/api/bookmarks.service.ts index 3e0ec2e8..198f796e 100644 --- a/webapp/src/app/api/api/bookmarks.service.ts +++ b/webapp/src/app/api/api/bookmarks.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreatePersonBookmark } from '../model/createPersonBookmark'; @@ -24,206 +30,375 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBookmarkResponse } from '../model/personBookmarkResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class BookmarksService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Bookmark Person + * @endpoint put /api/bookmarks/persons/{person_id} + * @param personId + * @param createPersonBookmark + * @param secureFgpAcc + * @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 bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public bookmarkPerson( + personId: string, + createPersonBookmark: CreatePersonBookmark, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (personId === null || personId === undefined) { + throw new Error( + 'Required parameter personId was null or undefined when calling bookmarkPerson.', + ); + } + if (createPersonBookmark === null || createPersonBookmark === undefined) { + throw new Error( + 'Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.', + ); } - /** - * Bookmark Person - * @endpoint put /api/bookmarks/persons/{person_id} - * @param personId - * @param createPersonBookmark - * @param secureFgpAcc - * @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 bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (personId === null || personId === undefined) { - throw new Error('Required parameter personId was null or undefined when calling bookmarkPerson.'); - } - if (createPersonBookmark === null || createPersonBookmark === undefined) { - throw new Error('Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createPersonBookmark, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * List Person Bookmarks - * @endpoint get /api/bookmarks/persons - * @param secureFgpAcc - * @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 listPersonBookmarks(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listPersonBookmarks(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listPersonBookmarks(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listPersonBookmarks(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/bookmarks/persons`; - 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 - } - ); + // 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, + ); } - /** - * Remove Person Bookmark - * @endpoint delete /api/bookmarks/persons/{person_id} - * @param personId - * @param secureFgpAcc - * @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 removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public removePersonBookmark(personId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (personId === null || personId === undefined) { - throw new Error('Required parameter personId was null or undefined when calling removePersonBookmark.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", 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 - } - ); + 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/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPersonBookmark, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * List Person Bookmarks + * @endpoint get /api/bookmarks/persons + * @param secureFgpAcc + * @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 listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public listPersonBookmarks( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/bookmarks/persons`; + 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, + }, + ); + } + + /** + * Remove Person Bookmark + * @endpoint delete /api/bookmarks/persons/{person_id} + * @param personId + * @param secureFgpAcc + * @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 removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public removePersonBookmark( + personId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (personId === null || personId === undefined) { + throw new Error( + 'Required parameter personId was null or undefined when calling removePersonBookmark.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', 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, + }, + ); + } } diff --git a/webapp/src/app/api/api/dFGInstitutions.service.ts b/webapp/src/app/api/api/dFGInstitutions.service.ts index 2582d69a..811cb490 100644 --- a/webapp/src/app/api/api/dFGInstitutions.service.ts +++ b/webapp/src/app/api/api/dFGInstitutions.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage'; @@ -22,137 +28,231 @@ import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DFGInstitutionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/institutions/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @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 getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of institutions based on a search term for autocomplete functionality. - * @endpoint get /api/dfg/institutions/autocomplete/selector - * @param query A search term to filter institutions by (partial matches allowed). - * @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 getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/dfg/institutions/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/institutions/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/dfg/institutions/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgInstitutionsByIds( + institutionIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - /** - * Returns a list of institutions based on their IDs. - * @endpoint get /api/dfg/institutions/ids - * @param institutionIds A list of institution IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - - 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/dfg/institutions/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/institutions/ids`; + 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/dFGPersons.service.ts b/webapp/src/app/api/api/dFGPersons.service.ts index edfcf946..19c2589a 100644 --- a/webapp/src/app/api/api/dFGPersons.service.ts +++ b/webapp/src/app/api/api/dFGPersons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage'; @@ -22,137 +28,231 @@ import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DFGPersonsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of persons based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/persons/autocomplete/selector + * @param query A search term to filter persons by (partial matches allowed). + * @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 getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of persons based on a search term for autocomplete functionality. - * @endpoint get /api/dfg/persons/autocomplete/selector - * @param query A search term to filter persons by (partial matches allowed). - * @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 getDfgPersonAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/dfg/persons/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dfg/persons/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of persons based on their IDs. + * @endpoint get /api/dfg/persons/ids + * @param personIds A list of person IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonsByIds( + personIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgPersonsByIds( + personIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (personIds) { + personIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'person_ids', ); + }); } - /** - * Returns a list of persons based on their IDs. - * @endpoint get /api/dfg/persons/ids - * @param personIds A list of person IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgPersonsByIds(personIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgPersonsByIds(personIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonsByIds(personIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgPersonsByIds(personIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (personIds) { - personIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'person_ids'); - }) - } - - 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/dfg/persons/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/persons/ids`; + 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/dashboard.service.ts b/webapp/src/app/api/api/dashboard.service.ts index 5bf6b615..247dfab8 100644 --- a/webapp/src/app/api/api/dashboard.service.ts +++ b/webapp/src/app/api/api/dashboard.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DashboardStatisticValue } from '../model/dashboardStatisticValue'; @@ -28,477 +34,897 @@ import { TopAuthorStatistics } from '../model/topAuthorStatistics'; import { TopicHeatmap } from '../model/topicHeatmap'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class DashboardService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Dashboard Bmbf Projects + * @endpoint get /api/dashboard/statistics/projects/bmbf + * @param secureFgpAcc + * @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 getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardBmbfProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Bmbf Projects - * @endpoint get /api/dashboard/statistics/projects/bmbf - * @param secureFgpAcc - * @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 getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardBmbfProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/dashboard/statistics/projects/bmbf`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Dfg Projects - * @endpoint get /api/dashboard/statistics/projects/dfg - * @param secureFgpAcc - * @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 getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardDfgProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/bmbf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Dfg Projects + * @endpoint get /api/dashboard/statistics/projects/dfg + * @param secureFgpAcc + * @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 getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardDfgProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/statistics/projects/dfg`; - 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 - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Eu Projects - * @endpoint get /api/dashboard/statistics/projects/eu - * @param secureFgpAcc - * @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 getDashboardEuProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardEuProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/dashboard/statistics/projects/eu`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + 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'; + } } - /** - * Dashboard Persons - * @endpoint get /api/dashboard/statistics/persons - * @param secureFgpAcc - * @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 getDashboardPersons(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardPersons(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPersons(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPersons(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/dfg`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Eu Projects + * @endpoint get /api/dashboard/statistics/projects/eu + * @param secureFgpAcc + * @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 getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardEuProjects( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/statistics/persons`; - 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 - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Publications - * @endpoint get /api/dashboard/statistics/publications - * @param secureFgpAcc - * @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 getDashboardPublications(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardPublications(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPublications(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardPublications(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/dashboard/statistics/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Statistics - * @endpoint get /api/dashboard/statistics - * @param secureFgpAcc - * @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 getDashboardStatistics(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardStatistics(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardStatistics(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardStatistics(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/projects/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; + /** + * Dashboard Persons + * @endpoint get /api/dashboard/statistics/persons + * @param secureFgpAcc + * @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 getDashboardPersons( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardPersons( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPersons( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPersons( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/statistics`; - 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 - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Dashboard Top Authors - * @endpoint get /api/dashboard/top-authors - * @param worksPeriod - * @param secureFgpAcc - * @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 getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - worksPeriod, 'works_period'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/dashboard/top-authors`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Dashboard Topic Heatmap - * @endpoint get /api/dashboard/topic-heatmap - * @param fromYear - * @param toYear - * @param limit - * @param secureFgpAcc - * @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 getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/dashboard/statistics/persons`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fromYear, 'from_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - toYear, 'to_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); + /** + * Dashboard Publications + * @endpoint get /api/dashboard/statistics/publications + * @param secureFgpAcc + * @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 getDashboardPublications( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardPublications( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPublications( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardPublications( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/dashboard/topic-heatmap`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/publications`; + 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, + }, + ); + } + + /** + * Dashboard Statistics + * @endpoint get /api/dashboard/statistics + * @param secureFgpAcc + * @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 getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardStatistics( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardStatistics( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/statistics`; + 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, + }, + ); + } + + /** + * Dashboard Top Authors + * @endpoint get /api/dashboard/top-authors + * @param worksPeriod + * @param secureFgpAcc + * @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 getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopAuthors( + worksPeriod?: 'all_time' | 'last_5_years', + secureFgpAcc?: 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, + worksPeriod, + 'works_period', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/top-authors`; + 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, + }, + ); + } + + /** + * Dashboard Topic Heatmap + * @endpoint get /api/dashboard/topic-heatmap + * @param fromYear + * @param toYear + * @param limit + * @param secureFgpAcc + * @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 getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDashboardTopicHeatmap( + fromYear?: number, + toYear?: number, + limit?: number, + secureFgpAcc?: 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, + fromYear, + 'from_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + toYear, + 'to_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/dashboard/topic-heatmap`; + 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/institutionsV2.service.ts b/webapp/src/app/api/api/institutionsV2.service.ts index d0e3c555..a3675dec 100644 --- a/webapp/src/app/api/api/institutionsV2.service.ts +++ b/webapp/src/app/api/api/institutionsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { InstitutionPageV2 } from '../model/institutionPageV2'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class InstitutionsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/v2/institutions/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @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 getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionAutocompleteForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionAutocompleteForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a list of institutions based on a search term for autocomplete functionality. - * @endpoint get /api/v2/institutions/autocomplete/selector - * @param query A search term to filter institutions by (partial matches allowed). - * @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 getInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/v2/institutions/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/institutions/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/v2/institutions/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionsByIds( + institutionIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionsByIds( + institutionIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - /** - * Returns a list of institutions based on their IDs. - * @endpoint get /api/v2/institutions/ids - * @param institutionIds A list of institution IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - - 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/v2/institutions/ids`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/institutions/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index c3f30c46..1694be0b 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AllPatentsResponse } from '../model/allPatentsResponse'; @@ -32,396 +38,769 @@ import { PatentsByInstitutionResponse } from '../model/patentsByInstitutionRespo import { RebuildResponse } from '../model/rebuildResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PatentsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get all patents with pagination and search. + * @endpoint get /api/inse-service/patents + * @param page + * @param size + * @param search + * @param source + * @param sortBy + * @param sortDirection + * @param yearFrom + * @param yearTo + * @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 getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllPatents( + page?: number, + size?: number, + search?: string, + source?: string, + sortBy?: string, + sortDirection?: string, + yearFrom?: number, + yearTo?: 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, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + source, + 'source', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'year_from', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'year_to', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get all patents with pagination and search. - * @endpoint get /api/inse-service/patents - * @param page - * @param size - * @param search - * @param source - * @param sortBy - * @param sortDirection - * @param yearFrom - * @param yearTo - * @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 getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - source, 'source'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortDirection, 'sort_direction'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'year_from'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'year_to'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Get pre-indexed org patents for an institution. - * @endpoint get /api/inse-service/institutions/{id}/org-patents - * @param id - * @param matchType Filter patents by match type. - * @param page - * @param size - * @param source - * @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 getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: 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 getOrgPatentsByInstitution.'); - } + let localVarPath = `/api/inse-service/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - matchType, 'match_type'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - source, 'source'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents`; - 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 pre-indexed org patents for an institution. + * @endpoint get /api/inse-service/institutions/{id}/org-patents + * @param id + * @param matchType Filter patents by match type. + * @param page + * @param size + * @param source + * @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 getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrgPatentsByInstitution( + id: string, + matchType?: 'institution' | 'name' | 'both' | 'all', + page?: number, + size?: number, + source?: 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 getOrgPatentsByInstitution.', + ); } - /** - * Get a single patent by identifier with optional title fallback. - * @endpoint get /api/inse-service/patents/{identifier} - * @param identifier - * @param prefix - * @param title - * @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 getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + matchType, + 'match_type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + source, + 'source', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - prefix, 'prefix'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); + 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 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/patents/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get patents matched to an author by name. - * @endpoint get /api/inse-service/authors/{author_id}/patents - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPatentsByAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + 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'; + } } - /** - * Get patents matched to an institution by assignee name. - * @endpoint get /api/inse-service/institutions/{id}/patents - * @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 getPatentsByInstitution(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentsByInstitution(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByInstitution(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentsByInstitution(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 getPatentsByInstitution.'); - } + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Get a single patent by identifier with optional title fallback. + * @endpoint get /api/inse-service/patents/{identifier} + * @param identifier + * @param prefix + * @param title + * @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 getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentByIdOrTitle( + identifier: string, + prefix?: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.', + ); } - /** - * Trigger a background rebuild of the org_patents index for an institution. - * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild - * @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 rebuildOrgPatents(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public rebuildOrgPatents(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public rebuildOrgPatents(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public rebuildOrgPatents(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 rebuildOrgPatents.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + prefix, + 'prefix', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); - 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 localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents/rebuild`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get patents matched to an institution by assignee name. + * @endpoint get /api/inse-service/institutions/{id}/patents + * @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 getPatentsByInstitution( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPatentsByInstitution( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByInstitution( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPatentsByInstitution( + 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 getPatentsByInstitution.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Trigger a background rebuild of the org_patents index for an institution. + * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild + * @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 rebuildOrgPatents( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public rebuildOrgPatents( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rebuildOrgPatents( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rebuildOrgPatents( + 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 rebuildOrgPatents.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents/rebuild`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/ranking.service.ts b/webapp/src/app/api/api/ranking.service.ts new file mode 100644 index 00000000..9b5b4a8d --- /dev/null +++ b/webapp/src/app/api/api/ranking.service.ts @@ -0,0 +1,518 @@ +/** + * 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 { KeywordToAuthorRequest } from '../model/keywordToAuthorRequest'; +// @ts-ignore +import { RankedAuthor } from '../model/rankedAuthor'; +// @ts-ignore +import { RankSelectedAuthorRequest } from '../model/rankSelectedAuthorRequest'; +// @ts-ignore +import { AuthorTopicStats } from '../model/authorTopicStats'; +// @ts-ignore +import { AuthorTopicProfile } from '../model/authorTopicProfile'; +// @ts-ignore +import { AuthorStaticStats } from '../model/authorStaticStats'; +// @ts-ignore +import { AuthorMetricsRequest } from '../model/authorMetricsRequest'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + +@Injectable({ + providedIn: 'root', +}) +export class RankingService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } + + /** + * Ranks a university\'s authors by a weighted score over works and citations. + * @endpoint post /api/rank/rank-author + * @param keywordToAuthorRequest + * @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 rankAuthor( + keywordToAuthorRequest: KeywordToAuthorRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public rankAuthor( + keywordToAuthorRequest: KeywordToAuthorRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public rankAuthor( + keywordToAuthorRequest: KeywordToAuthorRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public rankAuthor( + keywordToAuthorRequest: KeywordToAuthorRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + keywordToAuthorRequest === null || + keywordToAuthorRequest === undefined + ) { + throw new Error( + 'Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthor.', + ); + } + + 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/rank/rank-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordToAuthorRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Section 1: combined stats over each selected author\'s topic-filtered works. + * @endpoint post /api/rank/topic-stats + * @param rankSelectedAuthorRequest + * @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 topicStats( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public topicStats( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicStats( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicStats( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + rankSelectedAuthorRequest === null || + rankSelectedAuthorRequest === undefined + ) { + throw new Error( + 'Required parameter rankSelectedAuthorRequest was null or undefined when calling topicStats.', + ); + } + + 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; + + 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/rank/topic-stats`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: rankSelectedAuthorRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Section 3: topic profile over ALL works of each selected author. + * @endpoint post /api/rank/topic-profile + * @param rankSelectedAuthorRequest + * @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 topicProfile( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public topicProfile( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicProfile( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public topicProfile( + rankSelectedAuthorRequest: RankSelectedAuthorRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + rankSelectedAuthorRequest === null || + rankSelectedAuthorRequest === undefined + ) { + throw new Error( + 'Required parameter rankSelectedAuthorRequest was null or undefined when calling topicProfile.', + ); + } + + 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; + + 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/rank/topic-profile`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: rankSelectedAuthorRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Section 2: keyword-independent author-level stats (companies, news, patents). + * @endpoint post /api/rank/static-stats + * @param authorMetricsRequest + * @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 staticStats( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public staticStats( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public staticStats( + authorMetricsRequest: AuthorMetricsRequest, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public staticStats( + authorMetricsRequest: AuthorMetricsRequest, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorMetricsRequest === null || authorMetricsRequest === undefined) { + throw new Error( + 'Required parameter authorMetricsRequest was null or undefined when calling staticStats.', + ); + } + + 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; + + 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/rank/static-stats`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: authorMetricsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } +} diff --git a/webapp/src/app/api/api/topicsV2.service.ts b/webapp/src/app/api/api/topicsV2.service.ts index f082e67b..e1bddbc5 100644 --- a/webapp/src/app/api/api/topicsV2.service.ts +++ b/webapp/src/app/api/api/topicsV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { TopicPageV2 } from '../model/topicPageV2'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class TopicsV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of topics for a given search term based on their display name. + * @endpoint get /api/v2/topics/autocomplete/selector + * @param query A search term to filter topics by (partial matches allowed). + * @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 autocompleteTopicsForSelector( + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public autocompleteTopicsForSelector( + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopicsForSelector( + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public autocompleteTopicsForSelector( + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a paginated list of topics for a given search term based on their display name. - * @endpoint get /api/v2/topics/autocomplete/selector - * @param query A search term to filter topics by (partial matches allowed). - * @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 autocompleteTopicsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public autocompleteTopicsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopicsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public autocompleteTopicsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/v2/topics/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/topics/autocomplete/selector`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Returns a paginated list of topics for a given list of topic IDs. + * @endpoint get /api/v2/topics/topics/id + * @param topicIds A list of topic IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByIds( + topicIds?: Array, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicsByIds( + topicIds?: Array, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByIds( + topicIds?: Array, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByIds( + topicIds?: Array, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', ); + }); } - /** - * Returns a paginated list of topics for a given list of topic IDs. - * @endpoint get /api/v2/topics/topics/id - * @param topicIds A list of topic IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByIds(topicIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicsByIds(topicIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByIds(topicIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByIds(topicIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - - 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/v2/topics/topics/id`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/topics/topics/id`; + 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/universityRankings.service.ts b/webapp/src/app/api/api/universityRankings.service.ts index 82bcee4c..a7aba880 100644 --- a/webapp/src/app/api/api/universityRankings.service.ts +++ b/webapp/src/app/api/api/universityRankings.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteLocationItem } from '../model/autocompleteLocationItem'; @@ -32,391 +38,748 @@ import { TrendResponse } from '../model/trendResponse'; import { TrendSearchType } from '../model/trendSearchType'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class UniversityRankingsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns country and continent options for autocomplete inputs. + * @endpoint get /api/inse-service/university-rankings/autocomplete-locations + * @param query Query text to search for countries/continents + * @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 getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( + query: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.', + ); } - /** - * Returns country and continent options for autocomplete inputs. - * @endpoint get /api/inse-service/university-rankings/autocomplete-locations - * @param query Query text to search for countries/continents - * @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 getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Returns data for the University Ranking Dashboard. + * @endpoint get /api/inse-service/university-rankings + * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') + * @param metric Metric to rank by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet( + topic: string, + metric?: 'publications' | 'citations', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topic === null || topic === undefined) { + throw new Error( + 'Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.', + ); + } - let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + metric, + 'metric', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns top institutions filtered by country/region and sorted by topic-level publications count. + * @endpoint get /api/inse-service/university-rankings/top-institutions + * @param topic Research topic + * @param region Region identifier (e.g. EU) + * @param country Country code (e.g. DE) + * @param limit Max suggestions 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 getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( + topic: string, + region?: string, + country?: string, + limit?: number, + 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 getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + region, + 'region', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + country, + 'country', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns top 10 research topics for a selected entity. + * @endpoint get /api/inse-service/university-rankings/top-topics + * @param entityId Entity ID + * @param entityType Entity type: institution, author, country, region + * @param startYear Start year + * @param endYear End year + * @param searchType Search strategy type + * @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 getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( + entityId: string, + entityType: string, + startYear?: number, + endYear?: number, + searchType?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (entityId === null || entityId === undefined) { + throw new Error( + 'Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', + ); + } + if (entityType === null || entityType === undefined) { + throw new Error( + 'Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + entityId, + 'entity_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + entityType, + 'entity_type', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + startYear, + 'start_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + endYear, + 'end_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'search_type', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-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, + }, + ); + } + + /** + * Returns timeseries publication data for compared institutions, countries, and regions. + * @endpoint get /api/inse-service/university-rankings/trend + * @param topics List of topics to analyze + * @param keywords List of raw keywords corresponding to topics + * @param fuzzy True if using mapped topics, False if using raw keywords + * @param institutions List of OpenAlex Institution IDs + * @param countries List of country codes + * @param regions List of region identifiers + * @param authors List of OpenAlex Author IDs + * @param searchType + * @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 getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet( + topics: Array, + keywords?: Array, + fuzzy?: boolean, + institutions?: Array, + countries?: Array, + regions?: Array, + authors?: Array, + searchType?: TrendSearchType, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (topics === null || topics === undefined) { + throw new Error( + 'Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topics', ); + }); } - - /** - * Returns data for the University Ranking Dashboard. - * @endpoint get /api/inse-service/university-rankings - * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') - * @param metric Metric to rank by - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topic === null || topic === undefined) { - throw new Error('Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - topic, 'topic'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - metric, 'metric'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'keywords', ); + }); } - - /** - * Returns top institutions filtered by country/region and sorted by topic-level publications count. - * @endpoint get /api/inse-service/university-rankings/top-institutions - * @param topic Research topic - * @param region Region identifier (e.g. EU) - * @param country Country code (e.g. DE) - * @param limit Max suggestions 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 getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, 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 getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - topic, 'topic'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - region, 'region'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - country, 'country'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-institutions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fuzzy, + 'fuzzy', + ); + if (institutions) { + institutions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institutions', ); + }); } - - /** - * Returns top 10 research topics for a selected entity. - * @endpoint get /api/inse-service/university-rankings/top-topics - * @param entityId Entity ID - * @param entityType Entity type: institution, author, country, region - * @param startYear Start year - * @param endYear End year - * @param searchType Search strategy type - * @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 getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (entityId === null || entityId === undefined) { - throw new Error('Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); - } - if (entityType === null || entityType === undefined) { - throw new Error('Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - entityId, 'entity_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - entityType, 'entity_type'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - startYear, 'start_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - endYear, 'end_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'search_type'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-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 - } + if (countries) { + countries.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'countries', ); + }); } - - /** - * Returns timeseries publication data for compared institutions, countries, and regions. - * @endpoint get /api/inse-service/university-rankings/trend - * @param topics List of topics to analyze - * @param keywords List of raw keywords corresponding to topics - * @param fuzzy True if using mapped topics, False if using raw keywords - * @param institutions List of OpenAlex Institution IDs - * @param countries List of country codes - * @param regions List of region identifiers - * @param authors List of OpenAlex Author IDs - * @param searchType - * @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 getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (topics === null || topics === undefined) { - throw new Error('Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topics'); - }) - } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'keywords'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fuzzy, 'fuzzy'); - if (institutions) { - institutions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institutions'); - }) - } - if (countries) { - countries.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'countries'); - }) - } - if (regions) { - regions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'regions'); - }) - } - if (authors) { - authors.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'authors'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - searchType, 'search_type'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/trend`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (regions) { + regions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'regions', ); + }); + } + if (authors) { + authors.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'authors', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + searchType, + 'search_type', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/trend`; + 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 186ae663..4561cb78 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -30,359 +36,674 @@ import { WorkPage } from '../model/workPage'; import { WorksListResponse } from '../model/worksListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class WorksService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns all works for an author. + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllAuthorWorks( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAllAuthorWorks( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAllAuthorWorks( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAllAuthorWorks.', + ); } - /** - * Returns all works for an author. - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/all`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Returns a page of works for an author. + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + * @param institutionId Filter by OpenAlex institution id. Can be repeated. + * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param sort Sort order: by publication year or by citation count. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorks( + authorId: string, + page?: number, + size?: number, + publicationYear?: Array, + type?: Array, + language?: Array, + institutionId?: Array, + topicId?: Array, + sort?: 'year' | 'citations', + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getAuthorWorks.', + ); + } - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_year', ); + }); } - - /** - * Returns a page of works for an author. - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - * @param sort Sort order: by publication year or by citation count. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); - }) - } - if (type) { - type.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'type'); - }) - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); - }) - } - if (institutionId) { - institutionId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_id'); - }) - } - if (topicId) { - topicId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_id'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sort, 'sort'); - - 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/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (type) { + type.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'type', ); + }); } - - /** - * Returns work counts per primary topic for an author. - * @endpoint get /api/works/{author_id}/primary-topic-counts - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPrimaryTopicCountsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.'); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-topic-counts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language', ); + }); } - - /** - * Returns topics grouped by publication year for an author. - * @endpoint get /api/works/{author_id}/topics-by-time - * @param authorId The author id, for example A5023888391. - * @param maxTopicsPerYear The maximum number of topics per year. - * @param targetPublications Target number of publications used for the timeline. Complete years are always included. - * @param includeAll If true, all publications are used for the timeline. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - maxTopicsPerYear, 'max_topics_per_year'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - targetPublications, 'target_publications'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - includeAll, 'include_all'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (institutionId) { + institutionId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_id', ); + }); } - - /** - * Returns one publication by OpenAlex ID or DOI. - * @endpoint get /api/works/detail/{identifier} - * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. - * @param title Do we want to fallback to title search if ID and DOI dont work? - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWork(identifier: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWork(identifier: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWork(identifier: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWork(identifier: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (identifier === null || identifier === undefined) { - throw new Error('Required parameter identifier was null or undefined when calling getWork.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - - 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/works/detail/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (topicId) { + topicId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_id', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sort, + 'sort', + ); + + 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/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns work counts per primary topic for an author. + * @endpoint get /api/works/{author_id}/primary-topic-counts + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>>; + public getPrimaryTopicCountsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-topic-counts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param targetPublications Target number of publications used for the timeline. Complete years are always included. + * @param includeAll If true, all publications are used for the timeline. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getTopicsByTimeByAuthor( + authorId: string, + maxTopicsPerYear?: number, + targetPublications?: number, + includeAll?: boolean, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + maxTopicsPerYear, + 'max_topics_per_year', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + targetPublications, + 'target_publications', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + includeAll, + 'include_all', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/works/detail/{identifier} + * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. + * @param title Do we want to fallback to title search if ID and DOI dont work? + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWork( + identifier: string, + title?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWork( + identifier: string, + title?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + identifier: string, + title?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWork( + identifier: string, + title?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (identifier === null || identifier === undefined) { + throw new Error( + 'Required parameter identifier was null or undefined when calling getWork.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + + 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/works/detail/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } } diff --git a/webapp/src/app/api/api/worksV2.service.ts b/webapp/src/app/api/api/worksV2.service.ts index 50f05609..542f13f3 100644 --- a/webapp/src/app/api/api/worksV2.service.ts +++ b/webapp/src/app/api/api/worksV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -32,636 +38,1281 @@ import { WorkPageV2 } from '../model/workPageV2'; import { WorkSortBy } from '../model/workSortBy'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class WorksV2Service extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns a paginated list of works for a given author based on their ID. + * @endpoint get /api/v2/works/author/{raw_oa_author_id} + * @param rawOaAuthorId The raw OpenAlex author id. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param title A title to filter by (partial matches allowed). + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAuthorWorkPage( + rawOaAuthorId: string, + page?: number, + size?: number, + title?: string, + publicationYears?: Array, + publicationTypes?: Array, + institutionIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.', + ); } - /** - * Returns a paginated list of works for a given author based on their ID. - * @endpoint get /api/v2/works/author/{raw_oa_author_id} - * @param rawOaAuthorId The raw OpenAlex author id. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param title A title to filter by (partial matches allowed). - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_years'); - }) - } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_types'); - }) - } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language_codes'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - 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/v2/works/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_years', ); + }); } - - /** - * Returns a paginated list of works for a given institution based on their ID. - * @endpoint get /api/v2/works/institution/{raw_oa_institution_id} - * @param rawOaInstitutionId The raw OpenAlex institution id. - * @param page The page number to retrieve. (0-based) - * @param title A title to filter by (partial matches allowed). - * @param size The number of works to retrieve per page. - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param authorIds A list of author IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_years'); - }) - } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_types'); - }) - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language_codes'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - 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/v2/works/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_types', ); + }); } - - /** - * Returns the primary category aggregations of works for a given author based on their ID - * @endpoint get /api/v2/works/author/{raw_oa_author_id}/primary-category-aggregations - * @param rawOaAuthorId The raw OpenAlex author id. - * @param yearSize The number of years to retrieve aggregations for. - * @param categorySize The number of categories to retrieve aggregations for. - * @param secureFgpAcc - * @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 getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getPrimaryCategoryAggregationsByAuthorId.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearSize, 'year_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - categorySize, 'category_size'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/v2/works/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', ); + }); } - - /** - * Returns the primary category aggregations of works for a given institution based on their ID. - * @endpoint get /api/v2/works/institution/{raw_oa_institution_id}/primary-category-aggregations - * @param rawOaInstitutionId The raw OpenAlex institution id. - * @param yearSize The number of years to retrieve aggregations for. - * @param categorySize The number of categories to retrieve aggregations for. - * @param secureFgpAcc - * @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 getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getPrimaryCategoryAggregationsByInstitutionId.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearSize, 'year_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - categorySize, 'category_size'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/v2/works/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', ); + }); } - - /** - * Returns the classifications of a work based on its ID. - * @endpoint get /api/v2/works/classification/work/{raw_oa_work_id} - * @param rawOaWorkId The raw OpenAlex work id. - * @param secureFgpAcc - * @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 getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaWorkId === null || rawOaWorkId === undefined) { - throw new Error('Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', '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/v2/works/classification/work/${this.configuration.encodeParam({name: "rawOaWorkId", value: rawOaWorkId, 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 - } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language_codes', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns the classifications of works based on their IDs. - * @endpoint get /api/v2/works/classification/works/search - * @param workIds A list of OpenAlex work IDs to retrieve classifications for. - * @param page The page number to retrieve. (0-based) - * @param size The number of classifications to retrieve per page. - * @param secureFgpAcc - * @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 getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (workIds) { - workIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'work_ids'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + let localVarPath = `/api/v2/works/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + /** + * Returns a paginated list of works for a given institution based on their ID. + * @endpoint get /api/v2/works/institution/{raw_oa_institution_id} + * @param rawOaInstitutionId The raw OpenAlex institution id. + * @param page The page number to retrieve. (0-based) + * @param title A title to filter by (partial matches allowed). + * @param size The number of works to retrieve per page. + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param authorIds A list of author IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionWorkPage( + rawOaInstitutionId: string, + page?: number, + title?: string, + size?: number, + publicationYears?: Array, + publicationTypes?: Array, + authorIds?: Array, + topicIds?: Array, + languageCodes?: Array, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.', + ); + } - 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/v2/works/classification/works/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 localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_years', ); + }); } - - /** - * Search works by topics or raw keywords with filters. - * @endpoint get /api/v2/works/keyword/search - * @param topics List of topics to match. - * @param topicIds List of topic IDs to match. - * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. - * @param keywords Raw keywords to search in title/abstract. - * @param fuzzy Use topic resolution if True, otherwise use raw keywords. - * @param publicationYear A list of publication years to filter by. - * @param publicationType A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param authorIds A list of author IDs to filter by. - * @param language A list of language codes to filter by. - * @param title Title to search for in works. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topics'); - }) - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic_ids'); - }) - } - if (filterTopicIds) { - filterTopicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'filter_topic_ids'); - }) - } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'keywords'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fuzzy, 'fuzzy'); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_year'); - }) - } - if (publicationType) { - publicationType.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'publication_type'); - }) - } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'institution_ids'); - }) - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'author_ids'); - }) - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'language'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sort_order'); - - 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/v2/works/keyword/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 - } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_types', ); + }); + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', + ); + }); + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', + ); + }); + } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language_codes', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + 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/v2/works/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns the primary category aggregations of works for a given author based on their ID + * @endpoint get /api/v2/works/author/{raw_oa_author_id}/primary-category-aggregations + * @param rawOaAuthorId The raw OpenAlex author id. + * @param yearSize The number of years to retrieve aggregations for. + * @param categorySize The number of categories to retrieve aggregations for. + * @param secureFgpAcc + * @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 getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByAuthorId( + rawOaAuthorId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getPrimaryCategoryAggregationsByAuthorId.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearSize, + 'year_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + categorySize, + 'category_size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/v2/works/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-category-aggregations`; + 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 primary category aggregations of works for a given institution based on their ID. + * @endpoint get /api/v2/works/institution/{raw_oa_institution_id}/primary-category-aggregations + * @param rawOaInstitutionId The raw OpenAlex institution id. + * @param yearSize The number of years to retrieve aggregations for. + * @param categorySize The number of categories to retrieve aggregations for. + * @param secureFgpAcc + * @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 getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPrimaryCategoryAggregationsByInstitutionId( + rawOaInstitutionId: string, + yearSize?: number, + categorySize?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getPrimaryCategoryAggregationsByInstitutionId.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearSize, + 'year_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + categorySize, + 'category_size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/v2/works/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-category-aggregations`; + 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 classifications of a work based on its ID. + * @endpoint get /api/v2/works/classification/work/{raw_oa_work_id} + * @param rawOaWorkId The raw OpenAlex work id. + * @param secureFgpAcc + * @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 getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationByWorkId( + rawOaWorkId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaWorkId === null || rawOaWorkId === undefined) { + throw new Error( + 'Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/v2/works/classification/work/${this.configuration.encodeParam({ name: 'rawOaWorkId', value: rawOaWorkId, 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 the classifications of works based on their IDs. + * @endpoint get /api/v2/works/classification/works/search + * @param workIds A list of OpenAlex work IDs to retrieve classifications for. + * @param page The page number to retrieve. (0-based) + * @param size The number of classifications to retrieve per page. + * @param secureFgpAcc + * @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 getWorkClassificationsByWorkIds( + workIds?: Array, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorkClassificationsByWorkIds( + workIds?: Array, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByWorkIds( + workIds?: Array, + page?: number, + size?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByWorkIds( + workIds?: Array, + page?: number, + size?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (workIds) { + workIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'work_ids', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + '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/v2/works/classification/works/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, + }, + ); + } + + /** + * Search works by topics or raw keywords with filters. + * @endpoint get /api/v2/works/keyword/search + * @param topics List of topics to match. + * @param topicIds List of topic IDs to match. + * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. + * @param keywords Raw keywords to search in title/abstract. + * @param fuzzy Use topic resolution if True, otherwise use raw keywords. + * @param publicationYear A list of publication years to filter by. + * @param publicationType A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param authorIds A list of author IDs to filter by. + * @param language A list of language codes to filter by. + * @param title Title to search for in works. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorksByKeywords( + topics?: Array, + topicIds?: Array, + filterTopicIds?: Array, + keywords?: Array, + fuzzy?: boolean, + publicationYear?: Array, + publicationType?: Array, + institutionIds?: Array, + authorIds?: Array, + language?: Array, + title?: string, + page?: number, + size?: number, + sortBy?: WorkSortBy, + sortOrder?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topics', + ); + }); + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic_ids', + ); + }); + } + if (filterTopicIds) { + filterTopicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'filter_topic_ids', + ); + }); + } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'keywords', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + fuzzy, + 'fuzzy', + ); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_year', + ); + }); + } + if (publicationType) { + publicationType.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'publication_type', + ); + }); + } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'institution_ids', + ); + }); + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'author_ids', + ); + }); + } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'language', + ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sort_order', + ); + + 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/v2/works/keyword/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/model/accessToken.ts b/webapp/src/app/api/model/accessToken.ts index 74c4d45a..c2a5ec79 100644 --- a/webapp/src/app/api/model/accessToken.ts +++ b/webapp/src/app/api/model/accessToken.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 @@ -10,51 +10,47 @@ import { TokenType } from './tokenType'; import { UserRole } from './userRole'; - -export interface AccessToken { - /** - * The unique identifier of the real account associated with this token. - */ - real_account_id: string; - /** - * The timestamp indicating when the token will expire. - */ - expires_at: string; - /** - * The epoch value for the token. Used for versioning of tokens. - */ - epoch?: number; - /** - * The type of the token, which is always ACCESS_TOKEN for this class. - */ - token_type?: TokenType; - /** - * A unique fingerprint of the user, used for additional security checks. - */ - user_fingerprint_hash: string; - /** - * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. - */ - effective_account_id: string; - /** - * The specific role this access token grants within its organization. - */ - effective_role?: UserRole; - /** - * The roles this access token grants within its organization. - */ - effective_roles?: Array; - /** - * The unique identifier of the organization associated with this access token. - */ - effective_organization_id: string; - effective_institution_id?: string | null; - /** - * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. - */ - raw_token: string; +export interface AccessToken { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ACCESS_TOKEN for this class. + */ + token_type?: TokenType; + /** + * A unique fingerprint of the user, used for additional security checks. + */ + user_fingerprint_hash: string; + /** + * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. + */ + effective_account_id: string; + /** + * The specific role this access token grants within its organization. + */ + effective_role?: UserRole; + /** + * The roles this access token grants within its organization. + */ + effective_roles?: Array; + /** + * The unique identifier of the organization associated with this access token. + */ + effective_organization_id: string; + effective_institution_id?: string | null; + /** + * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. + */ + raw_token: string; } -export namespace AccessToken { -} - - +export namespace AccessToken {} diff --git a/webapp/src/app/api/model/accountProfile.ts b/webapp/src/app/api/model/accountProfile.ts index a7d7afa5..a61b98ae 100644 --- a/webapp/src/app/api/model/accountProfile.ts +++ b/webapp/src/app/api/model/accountProfile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,16 @@ */ import { UserRole } from './userRole'; - -export interface AccountProfile { - id: string; - email: string; - name: string; - roles: Array; - organization_id: string; - organization_name: string; - deleted: boolean; - activated: boolean; - is_current?: boolean; - is_real_account?: boolean; - is_impersonating?: boolean; +export interface AccountProfile { + id: string; + email: string; + name: string; + roles: Array; + organization_id: string; + organization_name: string; + deleted: boolean; + activated: boolean; + is_current?: boolean; + is_real_account?: boolean; + is_impersonating?: boolean; } - diff --git a/webapp/src/app/api/model/authorMetricsRequest.ts b/webapp/src/app/api/model/authorMetricsRequest.ts new file mode 100644 index 00000000..bc7111f0 --- /dev/null +++ b/webapp/src/app/api/model/authorMetricsRequest.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface AuthorMetricsRequest { + /** + * OpenAlex IDs of the authors. + */ + author_ids: Array; + /** + * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. + */ + company_status?: string; +} diff --git a/webapp/src/app/api/model/authorPage.ts b/webapp/src/app/api/model/authorPage.ts index ce0a58ed..842ce006 100644 --- a/webapp/src/app/api/model/authorPage.ts +++ b/webapp/src/app/api/model/authorPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { Author } from './author'; - /** * A paginated response containing a list of authors. */ -export interface AuthorPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface AuthorPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/authorStaticStats.ts b/webapp/src/app/api/model/authorStaticStats.ts new file mode 100644 index 00000000..882564c8 --- /dev/null +++ b/webapp/src/app/api/model/authorStaticStats.ts @@ -0,0 +1,32 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface AuthorStaticStats { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of Handelsregister company connections matched by the author\'s name. + */ + companies_count: number; + /** + * Number of news articles that mention the author by exact name. + */ + news_count: number; + /** + * Number of patents matched to the author (from the org_patents index). + */ + patents_count: number; +} diff --git a/webapp/src/app/api/model/authorTopicProfile.ts b/webapp/src/app/api/model/authorTopicProfile.ts new file mode 100644 index 00000000..00d5593a --- /dev/null +++ b/webapp/src/app/api/model/authorTopicProfile.ts @@ -0,0 +1,65 @@ +/** + * 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. + */ + +/** + * One slice of an author\'s topic profile: works whose primary topic is in this subfield. + */ +export interface SubfieldShare { + /** + * The subfield display name. + */ + name: string; + /** + * Number of works whose primary topic belongs to this subfield. + */ + count: number; +} + +/** + * Section 3: how an author\'s complete body of work distributes over topics. All counts are based on each work\'s primary topic. + */ +export interface AuthorTopicProfile { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * All works of the author in the timespan, regardless of the topic filter. + */ + works_total: number; + /** + * Works matching the topic filter (same subset as Section 1). + */ + matched_works: number; + /** + * Matched works where one of the searched topics is the work\'s primary topic. + */ + primary_topic_matches: number; + /** + * Number of distinct primary topics across all works. + */ + distinct_topics: number; + /** + * Number of distinct primary-topic subfields across all works. + */ + distinct_subfields: number; + /** + * Number of distinct primary-topic fields across all works. + */ + distinct_fields: number; + /** + * Top subfields over all works, by primary topic, largest first. + */ + subfields: Array; +} diff --git a/webapp/src/app/api/model/authorTopicStats.ts b/webapp/src/app/api/model/authorTopicStats.ts new file mode 100644 index 00000000..b31401c5 --- /dev/null +++ b/webapp/src/app/api/model/authorTopicStats.ts @@ -0,0 +1,96 @@ +/** + * 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 AuthorTopicStats { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of the author\'s works matching the topic filter. + */ + works_total: number; + /** + * Number of the author\'s topic works where they are the corresponding author. + */ + corresponding_count: number; + /** + * Average field-normalized citation percentile (0-1) over the author\'s topic works. + */ + avg_percentile: number; + /** + * Number of the author\'s topic works in the top 1% most-cited. + */ + top1_count: number; + /** + * Number of the author\'s topic works in the top 10% most-cited. + */ + top10_count: number; + /** + * Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1. + */ + fwci_above_one_count: number; + /** + * Total citations across the author\'s topic works. + */ + citations_total: number; + /** + * Average citations per topic work. + */ + avg_citations: number; + /** + * Citations of the author\'s most-cited topic work. + */ + max_citations: number; + /** + * h-index over the author\'s topic works (capped at 100). + */ + h_index: number; + /** + * Average field-weighted citation impact (FWCI) over the author\'s topic works. + */ + avg_fwci: number; + /** + * Number of the author\'s topic works with at least one co-author institution of type \'company\'. + */ + industry_works_count: number; + /** + * Earliest publication year among the author\'s topic works. + */ + first_year: number | null; + /** + * Latest publication year among the author\'s topic works. + */ + last_year: number | null; + /** + * Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8. + */ + relevance_above_80_count: number; + /** + * Average matched-keyword relevance score (0-1) over the author\'s topic works. + */ + avg_relevance: number; + /** + * Number of the author\'s topic works where they are the first author. + */ + first_author_count: number; + /** + * Number of the author\'s topic works where they are a middle author. + */ + middle_author_count: number; + /** + * Number of the author\'s topic works where they are the last author. + */ + last_author_count: number; +} diff --git a/webapp/src/app/api/model/createAccountRequest.ts b/webapp/src/app/api/model/createAccountRequest.ts index b2393cc2..c38fce15 100644 --- a/webapp/src/app/api/model/createAccountRequest.ts +++ b/webapp/src/app/api/model/createAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { UserRole } from './userRole'; - -export interface CreateAccountRequest { - email: string; - name: string; - roles?: Array; - organization_id: string; - password: string; - openalex_person_id?: string | null; +export interface CreateAccountRequest { + email: string; + name: string; + roles?: Array; + organization_id: string; + password: string; + openalex_person_id?: string | null; } - diff --git a/webapp/src/app/api/model/createPersonBookmark.ts b/webapp/src/app/api/model/createPersonBookmark.ts index e2e196dd..d9d69bea 100644 --- a/webapp/src/app/api/model/createPersonBookmark.ts +++ b/webapp/src/app/api/model/createPersonBookmark.ts @@ -1,15 +1,13 @@ /** * 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 CreatePersonBookmark { - person_name?: string | null; +export interface CreatePersonBookmark { + person_name?: string | null; } - diff --git a/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts index 716a0f11..9764ebe9 100644 --- a/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts +++ b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * DFGProjectFachgebieteInner */ -export interface DFGProjectFachgebieteInner { - fach?: string | null; - fach_code?: string | null; - fachgebiet?: string | null; - fachgebiet_code?: string | null; - fachkollegium?: string | null; - fachkollegium_code?: string | null; - wissenschaftsbereich?: string | null; - wissenschaftsbereich_code?: string | null; +export interface DFGProjectFachgebieteInner { + fach?: string | null; + fach_code?: string | null; + fachgebiet?: string | null; + fachgebiet_code?: string | null; + fachkollegium?: string | null; + fachkollegium_code?: string | null; + wissenschaftsbereich?: string | null; + wissenschaftsbereich_code?: string | null; } - diff --git a/webapp/src/app/api/model/dashboardStatisticValue.ts b/webapp/src/app/api/model/dashboardStatisticValue.ts index 928bdd76..7666aee8 100644 --- a/webapp/src/app/api/model/dashboardStatisticValue.ts +++ b/webapp/src/app/api/model/dashboardStatisticValue.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface DashboardStatisticValue { - institution_id: string; - organization_name: string; - value: number; +export interface DashboardStatisticValue { + institution_id: string; + organization_name: string; + value: number; } - diff --git a/webapp/src/app/api/model/dashboardStatistics.ts b/webapp/src/app/api/model/dashboardStatistics.ts index ba33382d..28d2527c 100644 --- a/webapp/src/app/api/model/dashboardStatistics.ts +++ b/webapp/src/app/api/model/dashboardStatistics.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface DashboardStatistics { - institution_id: string; - organization_name: string; - publications: number; - persons: number; - projects: number; - dfg_projects: number; - eu_projects: number; - bmbf_projects: number; +export interface DashboardStatistics { + institution_id: string; + organization_name: string; + publications: number; + persons: number; + projects: number; + dfg_projects: number; + eu_projects: number; + bmbf_projects: number; } - diff --git a/webapp/src/app/api/model/dfgInstitutionSummary.ts b/webapp/src/app/api/model/dfgInstitutionSummary.ts index e3da7abf..f2134a2f 100644 --- a/webapp/src/app/api/model/dfgInstitutionSummary.ts +++ b/webapp/src/app/api/model/dfgInstitutionSummary.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * A summary of a DFG institution. */ -export interface DfgInstitutionSummary { - id: number; - institute_name_de?: string | null; - institute_name_en?: string | null; - root_id?: number | null; - root_name_de?: string | null; - root_name_en?: string | null; - address_country_de?: string | null; - address_country_en?: string | null; +export interface DfgInstitutionSummary { + id: number; + institute_name_de?: string | null; + institute_name_en?: string | null; + root_id?: number | null; + root_name_de?: string | null; + root_name_en?: string | null; + address_country_de?: string | null; + address_country_en?: string | null; } - diff --git a/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts index 0bb6e492..f31398c8 100644 --- a/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts +++ b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; - /** * A paginated response containing a list of institutions. */ -export interface DfgInstitutionSummaryPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface DfgInstitutionSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/dfgPersonSummary.ts b/webapp/src/app/api/model/dfgPersonSummary.ts index ebd441ee..5c525ca5 100644 --- a/webapp/src/app/api/model/dfgPersonSummary.ts +++ b/webapp/src/app/api/model/dfgPersonSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,14 +9,12 @@ */ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; - -export interface DfgPersonSummary { - person_id: number; - orcid_id?: string | null; - project_ref_id?: number | null; - full_name?: string | null; - role_label_en?: string | null; - role_label_de?: string | null; - institution?: DfgInstitutionSummary | null; +export interface DfgPersonSummary { + person_id: number; + orcid_id?: string | null; + project_ref_id?: number | null; + full_name?: string | null; + role_label_en?: string | null; + role_label_de?: string | null; + institution?: DfgInstitutionSummary | null; } - diff --git a/webapp/src/app/api/model/dfgPersonSummaryPage.ts b/webapp/src/app/api/model/dfgPersonSummaryPage.ts index c4b7d916..fe367b63 100644 --- a/webapp/src/app/api/model/dfgPersonSummaryPage.ts +++ b/webapp/src/app/api/model/dfgPersonSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { DfgPersonSummary } from './dfgPersonSummary'; - /** * A paginated response containing a list of persons. */ -export interface DfgPersonSummaryPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface DfgPersonSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/fileUpload.ts b/webapp/src/app/api/model/fileUpload.ts index 61722b2f..921db4c3 100644 --- a/webapp/src/app/api/model/fileUpload.ts +++ b/webapp/src/app/api/model/fileUpload.ts @@ -1,26 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface FileUpload { - /** - * The name of the uploaded file. - */ - filename: string; - /** - * The base64-encoded content of the uploaded file. - */ - content_base64: string; - /** - * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. - */ - mime_type: string; +export interface FileUpload { + /** + * The name of the uploaded file. + */ + filename: string; + /** + * The base64-encoded content of the uploaded file. + */ + content_base64: string; + /** + * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. + */ + mime_type: string; } - diff --git a/webapp/src/app/api/model/institutionPageV2.ts b/webapp/src/app/api/model/institutionPageV2.ts index 15f481f6..67017198 100644 --- a/webapp/src/app/api/model/institutionPageV2.ts +++ b/webapp/src/app/api/model/institutionPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { Institution } from './institution'; - /** * A paginated response containing a list of institutions. */ -export interface InstitutionPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface InstitutionPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/keywordEvidence.ts b/webapp/src/app/api/model/keywordEvidence.ts index a8a78209..9b131bc1 100644 --- a/webapp/src/app/api/model/keywordEvidence.ts +++ b/webapp/src/app/api/model/keywordEvidence.ts @@ -1,28 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Traceable title/abstract evidence for keyword text retrieval. */ -export interface KeywordEvidence { - phrase_in_title?: boolean; - phrase_in_abstract?: boolean; - full_token_match?: boolean; - partial_token_match?: boolean; - word_match_score?: number; - matched_phrases?: Array; - matched_words?: Array; - /** - * phrase_title | phrase_abstract | full_token | partial_token | none - */ - text_match_kind?: string; +export interface KeywordEvidence { + phrase_in_title?: boolean; + phrase_in_abstract?: boolean; + full_token_match?: boolean; + partial_token_match?: boolean; + word_match_score?: number; + matched_phrases?: Array; + matched_words?: Array; + /** + * phrase_title | phrase_abstract | full_token | partial_token | none + */ + text_match_kind?: string; } - diff --git a/webapp/src/app/api/model/keywordPatentLevel.ts b/webapp/src/app/api/model/keywordPatentLevel.ts index 3522ae9e..97689af9 100644 --- a/webapp/src/app/api/model/keywordPatentLevel.ts +++ b/webapp/src/app/api/model/keywordPatentLevel.ts @@ -1,19 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const KeywordPatentLevel = { - Broad: 'broad', - Coarse: 'coarse', - Fine: 'fine', - Custom: 'custom' + Broad: 'broad', + Coarse: 'coarse', + Fine: 'fine', + Custom: 'custom', } as const; -export type KeywordPatentLevel = typeof KeywordPatentLevel[keyof typeof KeywordPatentLevel]; - +export type KeywordPatentLevel = + (typeof KeywordPatentLevel)[keyof typeof KeywordPatentLevel]; diff --git a/webapp/src/app/api/model/keywordPatentMappingStatus.ts b/webapp/src/app/api/model/keywordPatentMappingStatus.ts index a820fed5..23b2c4d1 100644 --- a/webapp/src/app/api/model/keywordPatentMappingStatus.ts +++ b/webapp/src/app/api/model/keywordPatentMappingStatus.ts @@ -1,20 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const KeywordPatentMappingStatus = { - Mapped: 'mapped', - Uncertain: 'uncertain', - NoMapping: 'no_mapping', - NoPatentsFound: 'no_patents_found', - SearchError: 'search_error' + Mapped: 'mapped', + Uncertain: 'uncertain', + NoMapping: 'no_mapping', + NoPatentsFound: 'no_patents_found', + SearchError: 'search_error', } as const; -export type KeywordPatentMappingStatus = typeof KeywordPatentMappingStatus[keyof typeof KeywordPatentMappingStatus]; - +export type KeywordPatentMappingStatus = + (typeof KeywordPatentMappingStatus)[keyof typeof KeywordPatentMappingStatus]; diff --git a/webapp/src/app/api/model/keywordPatentMatch.ts b/webapp/src/app/api/model/keywordPatentMatch.ts index 5b7c4068..3e412bdf 100644 --- a/webapp/src/app/api/model/keywordPatentMatch.ts +++ b/webapp/src/app/api/model/keywordPatentMatch.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 @@ -10,32 +10,30 @@ import { KeywordEvidence } from './keywordEvidence'; import { PatentEntry } from './patentEntry'; - -export interface KeywordPatentMatch { - patent: PatentEntry; - /** - * Combined match quality score. - */ - match_score: number; - /** - * IPC/CPC classification match score. - */ - ipc_score: number; - /** - * Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none. - */ - topic_score: number; - /** - * Title/abstract keyword overlap score. - */ - text_score: number; - matched_keywords?: Array; - matched_ipc_symbols?: Array; - /** - * True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits. - */ - text_retrieval?: boolean; - keyword_evidence?: KeywordEvidence | null; - topic_match_kind?: string | null; +export interface KeywordPatentMatch { + patent: PatentEntry; + /** + * Combined match quality score. + */ + match_score: number; + /** + * IPC/CPC classification match score. + */ + ipc_score: number; + /** + * Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none. + */ + topic_score: number; + /** + * Title/abstract keyword overlap score. + */ + text_score: number; + matched_keywords?: Array; + matched_ipc_symbols?: Array; + /** + * True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits. + */ + text_retrieval?: boolean; + keyword_evidence?: KeywordEvidence | null; + topic_match_kind?: string | null; } - diff --git a/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts index 753ef4dd..1c9b28b1 100644 --- a/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts +++ b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts @@ -1,32 +1,30 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Pipeline counters for evaluation (no effect on ranking thresholds). */ -export interface KeywordPatentSearchDiagnostics { - /** - * ipc | text | none - */ - search_path: string; - es_query_size_per_index?: number; - raw_patents_after_dedupe?: number; - filtered_by_ipc?: number; - filtered_by_relevance_gate?: number; - filtered_by_min_score?: number; - passed_relevance_gate?: number; - scored_before_cap?: number; - returned?: number; - max_patents_cap?: number; - hit_return_cap?: boolean; - ipc_cluster_selections?: Array; +export interface KeywordPatentSearchDiagnostics { + /** + * ipc | text | none + */ + search_path: string; + es_query_size_per_index?: number; + raw_patents_after_dedupe?: number; + filtered_by_ipc?: number; + filtered_by_relevance_gate?: number; + filtered_by_min_score?: number; + passed_relevance_gate?: number; + scored_before_cap?: number; + returned?: number; + max_patents_cap?: number; + hit_return_cap?: boolean; + ipc_cluster_selections?: Array; } - diff --git a/webapp/src/app/api/model/keywordPatentSearchItem.ts b/webapp/src/app/api/model/keywordPatentSearchItem.ts index c7521f63..cbcd04d4 100644 --- a/webapp/src/app/api/model/keywordPatentSearchItem.ts +++ b/webapp/src/app/api/model/keywordPatentSearchItem.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,19 @@ */ import { KeywordPatentLevel } from './keywordPatentLevel'; - -export interface KeywordPatentSearchItem { - /** - * Extracted keyword text. - */ - keyword: string; - keyword_level?: KeywordPatentLevel | null; - topic_id?: string | null; - topic_display_name?: string | null; - subfield_name?: string | null; - field_name?: string | null; - /** - * LLM relevance score for the keyword. - */ - relevance_score?: number; +export interface KeywordPatentSearchItem { + /** + * Extracted keyword text. + */ + keyword: string; + keyword_level?: KeywordPatentLevel | null; + topic_id?: string | null; + topic_display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + /** + * LLM relevance score for the keyword. + */ + relevance_score?: number; } -export namespace KeywordPatentSearchItem { -} - - +export namespace KeywordPatentSearchItem {} diff --git a/webapp/src/app/api/model/keywordToAuthorRequest.ts b/webapp/src/app/api/model/keywordToAuthorRequest.ts new file mode 100644 index 00000000..9d34e1d9 --- /dev/null +++ b/webapp/src/app/api/model/keywordToAuthorRequest.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 { RankingWeights } from './rankingWeights'; + +export interface KeywordToAuthorRequest { + /** + * One or more keywords to rank the author by. + */ + keywords: Array; + /** + * Weights for the ranking metrics. Required. + */ + weights: RankingWeights; + /** + * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. + */ + operator?: string; + /** + * What the \'keywords\' values match against: \'keyword\' or \'topic\'. Defaults to \'keyword\'. + */ + filter_type?: string; + /** + * The selected institution display name. (Default Uni-Due) + */ + institution_name?: string; + /** + * Optional filter: only keep authors in one of these career stages. + */ + career_stages?: Array; + /** + * Optional filter: only count works of these publication types. + */ + publication_types?: Array; + /** + * Optional filter: only count works whose publication_year is within [from, to]. + */ + timespan?: { from: number; to: number }; + /** + * Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'. + */ + company_status?: string; +} diff --git a/webapp/src/app/api/model/keywordsRequest.ts b/webapp/src/app/api/model/keywordsRequest.ts index 8acb7082..094ed97b 100644 --- a/webapp/src/app/api/model/keywordsRequest.ts +++ b/webapp/src/app/api/model/keywordsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,18 @@ */ import { FileUpload } from './fileUpload'; - -export interface KeywordsRequest { - /** - * The input text from which to extract keywords. - */ - query: string; - files?: Array | null; - /** - * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. - */ - mode: string; - /** - * The maximum number of keywords to extract. - */ - limit?: number; +export interface KeywordsRequest { + /** + * The input text from which to extract keywords. + */ + query: string; + files?: Array | null; + /** + * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. + */ + mode: string; + /** + * The maximum number of keywords to extract. + */ + limit?: number; } - diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 7be7ffb2..6eefd7b1 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -230,3 +230,11 @@ export * from './workTopicSubfield'; export * from './worksFilterProperties'; export * from './worksListResponse'; export * from './yearlyData'; +export * from './rankingWeights'; +export * from './rankedAuthor'; +export * from './keywordToAuthorRequest'; +export * from './rankSelectedAuthorRequest'; +export * from './authorTopicStats'; +export * from './authorTopicProfile'; +export * from './authorStaticStats'; +export * from './authorMetricsRequest'; diff --git a/webapp/src/app/api/model/patentsByKeywordsResponse.ts b/webapp/src/app/api/model/patentsByKeywordsResponse.ts index d9f28a8e..f801c6d5 100644 --- a/webapp/src/app/api/model/patentsByKeywordsResponse.ts +++ b/webapp/src/app/api/model/patentsByKeywordsResponse.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,17 +11,13 @@ import { KeywordPatentMappingStatus } from './keywordPatentMappingStatus'; import { KeywordPatentSearchDiagnostics } from './keywordPatentSearchDiagnostics'; import { KeywordPatentMatch } from './keywordPatentMatch'; - -export interface PatentsByKeywordsResponse { - patent_count: number; - patents: Array; - /** - * IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend). - */ - mapping_status: KeywordPatentMappingStatus; - diagnostics?: KeywordPatentSearchDiagnostics | null; +export interface PatentsByKeywordsResponse { + patent_count: number; + patents: Array; + /** + * IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend). + */ + mapping_status: KeywordPatentMappingStatus; + diagnostics?: KeywordPatentSearchDiagnostics | null; } -export namespace PatentsByKeywordsResponse { -} - - +export namespace PatentsByKeywordsResponse {} diff --git a/webapp/src/app/api/model/personBookmarkResponse.ts b/webapp/src/app/api/model/personBookmarkResponse.ts index 5227060a..b40bdc71 100644 --- a/webapp/src/app/api/model/personBookmarkResponse.ts +++ b/webapp/src/app/api/model/personBookmarkResponse.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PersonBookmarkResponse { - person_id: string; - person_name: string | null; - created_at: string; +export interface PersonBookmarkResponse { + person_id: string; + person_name: string | null; + created_at: string; } - diff --git a/webapp/src/app/api/model/primaryCategoryYearAggregation.ts b/webapp/src/app/api/model/primaryCategoryYearAggregation.ts index bc146f8d..02abd7b7 100644 --- a/webapp/src/app/api/model/primaryCategoryYearAggregation.ts +++ b/webapp/src/app/api/model/primaryCategoryYearAggregation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PrimaryCategoryYearAggregation { - /** - * The publication year. - */ - publication_year: number; - /** - * A mapping of primary categories to their counts for the given year. - */ - categories?: { [key: string]: number; }; +export interface PrimaryCategoryYearAggregation { + /** + * The publication year. + */ + publication_year: number; + /** + * A mapping of primary categories to their counts for the given year. + */ + categories?: { [key: string]: number }; } - diff --git a/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts b/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts index e191b225..c448c0f2 100644 --- a/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts +++ b/webapp/src/app/api/model/primaryCategoryYearAggregationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { PrimaryCategoryYearAggregation } from './primaryCategoryYearAggregation'; - -export interface PrimaryCategoryYearAggregationPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface PrimaryCategoryYearAggregationPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/rankSelectedAuthorRequest.ts b/webapp/src/app/api/model/rankSelectedAuthorRequest.ts new file mode 100644 index 00000000..6119e974 --- /dev/null +++ b/webapp/src/app/api/model/rankSelectedAuthorRequest.ts @@ -0,0 +1,36 @@ +/** + * 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 RankSelectedAuthorRequest { + /** + * OpenAlex IDs of the authors to rank. + */ + author_ids: Array; + /** + * One or more keywords defining the topic. + */ + keywords: Array; + /** + * How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'. + */ + operator?: string; + /** + * What the \'keywords\' values match against: \'keyword\' or \'topic\'. Defaults to \'keyword\'. + */ + filter_type?: string; + /** + * Optional filter: only count works of these publication types. + */ + publication_types?: Array; + /** + * Optional filter: only count works whose publication_year is within [from, to]. + */ + timespan?: { from: number; to: number }; +} diff --git a/webapp/src/app/api/model/rankedAuthor.ts b/webapp/src/app/api/model/rankedAuthor.ts new file mode 100644 index 00000000..360507bc --- /dev/null +++ b/webapp/src/app/api/model/rankedAuthor.ts @@ -0,0 +1,48 @@ +/** + * 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 RankedAuthor { + /** + * The OpenAlex ID of the author. + */ + author_id: string; + /** + * The name of the author. + */ + display_name: string; + /** + * Number of matching works by this author. + */ + works_count: number; + /** + * Total citations across this author\'s matching works. + */ + citations_count: number; + /** + * Number of Handelsregister company connections matched by the author\'s name (proxy for company foundations). + */ + companies_count?: number; + /** + * Number of news articles that mention the author by exact name (proxy for media visibility). + */ + news_count?: number; + /** + * Number of patents matched to the author (from the precomputed org_patents index). + */ + patents_count?: number; + /** + * Normalized weighted score used for ranking. + */ + score?: number; + /** + * Career stage derived from the author\'s active publication years. + */ + career_stage?: string; +} diff --git a/webapp/src/app/api/model/rankingWeights.ts b/webapp/src/app/api/model/rankingWeights.ts new file mode 100644 index 00000000..5f1d2df4 --- /dev/null +++ b/webapp/src/app/api/model/rankingWeights.ts @@ -0,0 +1,32 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface RankingWeights { + /** + * Weight for the citation metric (0.0 - 1.0). + */ + citation: number; + /** + * Weight for the works metric (0.0 - 1.0). + */ + works: number; + /** + * Weight for the company-foundations metric (0.0 - 1.0). + */ + companies?: number; + /** + * Weight for the news/media-visibility metric (0.0 - 1.0). + */ + news?: number; + /** + * Weight for the patents metric (0.0 - 1.0). + */ + patents?: number; +} diff --git a/webapp/src/app/api/model/topAuthor.ts b/webapp/src/app/api/model/topAuthor.ts index 6a74fa91..bc431723 100644 --- a/webapp/src/app/api/model/topAuthor.ts +++ b/webapp/src/app/api/model/topAuthor.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopAuthor { - id?: string | null; - name: string; - count: number; +export interface TopAuthor { + id?: string | null; + name: string; + count: number; } - diff --git a/webapp/src/app/api/model/topAuthorStatistics.ts b/webapp/src/app/api/model/topAuthorStatistics.ts index 6ea5990a..1c912edb 100644 --- a/webapp/src/app/api/model/topAuthorStatistics.ts +++ b/webapp/src/app/api/model/topAuthorStatistics.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,10 @@ */ import { TopAuthor } from './topAuthor'; - -export interface TopAuthorStatistics { - institution_id: string; - works: Array; - projects: Array; - patents: Array; - news: Array; +export interface TopAuthorStatistics { + institution_id: string; + works: Array; + projects: Array; + patents: Array; + news: Array; } - diff --git a/webapp/src/app/api/model/topTopicItem.ts b/webapp/src/app/api/model/topTopicItem.ts index 2ae026c1..e6a151d4 100644 --- a/webapp/src/app/api/model/topTopicItem.ts +++ b/webapp/src/app/api/model/topTopicItem.ts @@ -1,16 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopTopicItem { - name: string; - count: number; +export interface TopTopicItem { + name: string; + count: number; } - diff --git a/webapp/src/app/api/model/topTopicsResponse.ts b/webapp/src/app/api/model/topTopicsResponse.ts index 7f109033..4bac3de8 100644 --- a/webapp/src/app/api/model/topTopicsResponse.ts +++ b/webapp/src/app/api/model/topTopicsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,6 @@ */ import { TopTopicItem } from './topTopicItem'; - -export interface TopTopicsResponse { - items: Array; +export interface TopTopicsResponse { + items: Array; } - diff --git a/webapp/src/app/api/model/topicHeatmap.ts b/webapp/src/app/api/model/topicHeatmap.ts index be36dc40..64e915a5 100644 --- a/webapp/src/app/api/model/topicHeatmap.ts +++ b/webapp/src/app/api/model/topicHeatmap.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { TopicHeatmapField } from './topicHeatmapField'; - -export interface TopicHeatmap { - institution_id: string; - organization_name: string; - years: Array; - fields: Array; +export interface TopicHeatmap { + institution_id: string; + organization_name: string; + years: Array; + fields: Array; } - diff --git a/webapp/src/app/api/model/topicHeatmapField.ts b/webapp/src/app/api/model/topicHeatmapField.ts index 1687c6d9..4c35a17e 100644 --- a/webapp/src/app/api/model/topicHeatmapField.ts +++ b/webapp/src/app/api/model/topicHeatmapField.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { TopicHeatmapValue } from './topicHeatmapValue'; - -export interface TopicHeatmapField { - id: string; - name: string; - total: number; - values: Array; +export interface TopicHeatmapField { + id: string; + name: string; + total: number; + values: Array; } - diff --git a/webapp/src/app/api/model/topicHeatmapValue.ts b/webapp/src/app/api/model/topicHeatmapValue.ts index f840b938..2f5a01d9 100644 --- a/webapp/src/app/api/model/topicHeatmapValue.ts +++ b/webapp/src/app/api/model/topicHeatmapValue.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopicHeatmapValue { - year: number; - count: number; - share: number; +export interface TopicHeatmapValue { + year: number; + count: number; + share: number; } - diff --git a/webapp/src/app/api/model/topicPageV2.ts b/webapp/src/app/api/model/topicPageV2.ts index 67f1272b..5df5a490 100644 --- a/webapp/src/app/api/model/topicPageV2.ts +++ b/webapp/src/app/api/model/topicPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Topic } from './topic'; - -export interface TopicPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface TopicPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/trendSearchType.ts b/webapp/src/app/api/model/trendSearchType.ts index 5495800e..bde11a52 100644 --- a/webapp/src/app/api/model/trendSearchType.ts +++ b/webapp/src/app/api/model/trendSearchType.ts @@ -1,21 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const TrendSearchType = { - Publications: 'publications', - Authors: 'authors', - Patents: 'patents', - Projects: 'projects', - News: 'news', - All: 'all' + Publications: 'publications', + Authors: 'authors', + Patents: 'patents', + Projects: 'projects', + News: 'news', + All: 'all', } as const; -export type TrendSearchType = typeof TrendSearchType[keyof typeof TrendSearchType]; - +export type TrendSearchType = + (typeof TrendSearchType)[keyof typeof TrendSearchType]; diff --git a/webapp/src/app/api/model/trendSeries.ts b/webapp/src/app/api/model/trendSeries.ts index 312dee1c..b8ce939f 100644 --- a/webapp/src/app/api/model/trendSeries.ts +++ b/webapp/src/app/api/model/trendSeries.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,20 @@ */ import { TopicYearlyData } from './topicYearlyData'; - -export interface TrendSeries { - entity_id: string; - entity_name: string; - entity_type: TrendSeries.EntityTypeEnum; - country_code?: string | null; - topic_data: { [key: string]: Array; }; +export interface TrendSeries { + entity_id: string; + entity_name: string; + entity_type: TrendSeries.EntityTypeEnum; + country_code?: string | null; + topic_data: { [key: string]: Array }; } export namespace TrendSeries { - export const EntityTypeEnum = { - Institution: 'institution', - Country: 'country', - Region: 'region', - Author: 'author' - } as const; - export type EntityTypeEnum = typeof EntityTypeEnum[keyof typeof EntityTypeEnum]; + export const EntityTypeEnum = { + Institution: 'institution', + Country: 'country', + Region: 'region', + Author: 'author', + } as const; + export type EntityTypeEnum = + (typeof EntityTypeEnum)[keyof typeof EntityTypeEnum]; } - - diff --git a/webapp/src/app/api/model/updateAccountRequest.ts b/webapp/src/app/api/model/updateAccountRequest.ts index 574f5d0d..db502fd9 100644 --- a/webapp/src/app/api/model/updateAccountRequest.ts +++ b/webapp/src/app/api/model/updateAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,13 @@ */ import { UserRole } from './userRole'; - -export interface UpdateAccountRequest { - email?: string | null; - name?: string | null; - roles?: Array | null; - organization_id?: string | null; - password?: string | null; - openalex_person_id?: string | null; - deleted?: boolean | null; - activated?: boolean | null; +export interface UpdateAccountRequest { + email?: string | null; + name?: string | null; + roles?: Array | null; + organization_id?: string | null; + password?: string | null; + openalex_person_id?: string | null; + deleted?: boolean | null; + activated?: boolean | null; } - diff --git a/webapp/src/app/api/model/workClassification.ts b/webapp/src/app/api/model/workClassification.ts index 12885922..ff62bec2 100644 --- a/webapp/src/app/api/model/workClassification.ts +++ b/webapp/src/app/api/model/workClassification.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 @@ -14,32 +14,30 @@ import { WorkClassificationMeta } from './workClassificationMeta'; import { WorkClassificationValidation } from './workClassificationValidation'; import { WorkClassificationAuthor } from './workClassificationAuthor'; - /** * Represents a full work-classification document. */ -export interface WorkClassification { - /** - * The full OpenAlex work id/URL. - */ - work_id: string; - doi?: string | null; - title?: string | null; - publication_year?: number | null; - /** - * The authors of the work. - */ - authors?: Array; - /** - * The institutions associated with the work. - */ - institutions?: Array; - /** - * The topics associated with the work. - */ - topics?: Array; - classification?: WorkClassificationDetails | null; - classification_meta?: WorkClassificationMeta | null; - validation?: WorkClassificationValidation | null; +export interface WorkClassification { + /** + * The full OpenAlex work id/URL. + */ + work_id: string; + doi?: string | null; + title?: string | null; + publication_year?: number | null; + /** + * The authors of the work. + */ + authors?: Array; + /** + * The institutions associated with the work. + */ + institutions?: Array; + /** + * The topics associated with the work. + */ + topics?: Array; + classification?: WorkClassificationDetails | null; + classification_meta?: WorkClassificationMeta | null; + validation?: WorkClassificationValidation | null; } - diff --git a/webapp/src/app/api/model/workClassificationAuthor.ts b/webapp/src/app/api/model/workClassificationAuthor.ts index a28e37de..aef36e2b 100644 --- a/webapp/src/app/api/model/workClassificationAuthor.ts +++ b/webapp/src/app/api/model/workClassificationAuthor.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * An author entry within a work classification document. */ -export interface WorkClassificationAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface WorkClassificationAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationDetails.ts b/webapp/src/app/api/model/workClassificationDetails.ts index e096423b..20593e72 100644 --- a/webapp/src/app/api/model/workClassificationDetails.ts +++ b/webapp/src/app/api/model/workClassificationDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,16 @@ */ import { WorkPrimaryCategory } from './workPrimaryCategory'; - /** * The core classification result for a work. */ -export interface WorkClassificationDetails { - primary_category?: WorkPrimaryCategory | null; - confidence?: string | null; - pasteur_quadrant?: string | null; - applied_orientation_score?: number | null; - insufficient_context?: boolean | null; - signals_used?: Array | null; - classification_reason?: string | null; +export interface WorkClassificationDetails { + primary_category?: WorkPrimaryCategory | null; + confidence?: string | null; + pasteur_quadrant?: string | null; + applied_orientation_score?: number | null; + insufficient_context?: boolean | null; + signals_used?: Array | null; + classification_reason?: string | null; } -export namespace WorkClassificationDetails { -} - - +export namespace WorkClassificationDetails {} diff --git a/webapp/src/app/api/model/workClassificationInstitution.ts b/webapp/src/app/api/model/workClassificationInstitution.ts index db2eae24..754b1eb8 100644 --- a/webapp/src/app/api/model/workClassificationInstitution.ts +++ b/webapp/src/app/api/model/workClassificationInstitution.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * An institution entry within a work classification document. */ -export interface WorkClassificationInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface WorkClassificationInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationMeta.ts b/webapp/src/app/api/model/workClassificationMeta.ts index eb67e185..9e6619d5 100644 --- a/webapp/src/app/api/model/workClassificationMeta.ts +++ b/webapp/src/app/api/model/workClassificationMeta.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Metadata about how and when a classification was produced. */ -export interface WorkClassificationMeta { - model?: string | null; - prompt_version?: string | null; - classified_at?: string | null; +export interface WorkClassificationMeta { + model?: string | null; + prompt_version?: string | null; + classified_at?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationPage.ts b/webapp/src/app/api/model/workClassificationPage.ts index 22b71991..db7e3e0d 100644 --- a/webapp/src/app/api/model/workClassificationPage.ts +++ b/webapp/src/app/api/model/workClassificationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { WorkClassification } from './workClassification'; - -export interface WorkClassificationPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface WorkClassificationPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/workClassificationTopic.ts b/webapp/src/app/api/model/workClassificationTopic.ts index 5ea5b9f9..34f8c96a 100644 --- a/webapp/src/app/api/model/workClassificationTopic.ts +++ b/webapp/src/app/api/model/workClassificationTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,16 +9,14 @@ */ import { WorkClassificationTopicGroup } from './workClassificationTopicGroup'; - /** * A topic entry within a work classification document. */ -export interface WorkClassificationTopic { - id?: string | null; - display_name?: string | null; - score?: number | null; - domain?: WorkClassificationTopicGroup | null; - field?: WorkClassificationTopicGroup | null; - subfield?: WorkClassificationTopicGroup | null; +export interface WorkClassificationTopic { + id?: string | null; + display_name?: string | null; + score?: number | null; + domain?: WorkClassificationTopicGroup | null; + field?: WorkClassificationTopicGroup | null; + subfield?: WorkClassificationTopicGroup | null; } - diff --git a/webapp/src/app/api/model/workClassificationTopicGroup.ts b/webapp/src/app/api/model/workClassificationTopicGroup.ts index 58ce3fe6..8e574397 100644 --- a/webapp/src/app/api/model/workClassificationTopicGroup.ts +++ b/webapp/src/app/api/model/workClassificationTopicGroup.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * A domain/field/subfield group referenced within a classification topic. */ -export interface WorkClassificationTopicGroup { - id?: string | null; - display_name?: string | null; +export interface WorkClassificationTopicGroup { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workClassificationValidation.ts b/webapp/src/app/api/model/workClassificationValidation.ts index da1db647..46c91824 100644 --- a/webapp/src/app/api/model/workClassificationValidation.ts +++ b/webapp/src/app/api/model/workClassificationValidation.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Validation results for a classification. */ -export interface WorkClassificationValidation { - valid?: boolean | null; - errors?: Array | null; - corrections?: Array | null; +export interface WorkClassificationValidation { + valid?: boolean | null; + errors?: Array | null; + corrections?: Array | null; } - diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts index 8490c3ab..285d2065 100644 --- a/webapp/src/app/api/model/workPage.ts +++ b/webapp/src/app/api/model/workPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,27 +9,25 @@ */ 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; +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/workPageV2.ts b/webapp/src/app/api/model/workPageV2.ts index a22b6855..bc93d6ce 100644 --- a/webapp/src/app/api/model/workPageV2.ts +++ b/webapp/src/app/api/model/workPageV2.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Work } from './work'; - -export interface WorkPageV2 { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; +export interface WorkPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/workPrimaryCategory.ts b/webapp/src/app/api/model/workPrimaryCategory.ts index ddbbde75..563359d3 100644 --- a/webapp/src/app/api/model/workPrimaryCategory.ts +++ b/webapp/src/app/api/model/workPrimaryCategory.ts @@ -1,23 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Represents the primary category of a work. */ export const WorkPrimaryCategory = { - BasicResearch: 'basic_research', - AppliedResearch: 'applied_research', - NonResearch: 'non_research', - ExperimentalDevelopment: 'experimental_development', - NotClassified: 'not_classified' + BasicResearch: 'basic_research', + AppliedResearch: 'applied_research', + NonResearch: 'non_research', + ExperimentalDevelopment: 'experimental_development', + NotClassified: 'not_classified', } as const; -export type WorkPrimaryCategory = typeof WorkPrimaryCategory[keyof typeof WorkPrimaryCategory]; - +export type WorkPrimaryCategory = + (typeof WorkPrimaryCategory)[keyof typeof WorkPrimaryCategory]; diff --git a/webapp/src/app/api/model/workSortBy.ts b/webapp/src/app/api/model/workSortBy.ts index 7580ac82..56f89162 100644 --- a/webapp/src/app/api/model/workSortBy.ts +++ b/webapp/src/app/api/model/workSortBy.ts @@ -1,20 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const WorkSortBy = { - Title: 'title', - Type: 'type', - PublicationYear: 'publication_year', - Language: 'language', - CitedByCount: 'cited_by_count' + Title: 'title', + Type: 'type', + PublicationYear: 'publication_year', + Language: 'language', + CitedByCount: 'cited_by_count', } as const; -export type WorkSortBy = typeof WorkSortBy[keyof typeof WorkSortBy]; - +export type WorkSortBy = (typeof WorkSortBy)[keyof typeof WorkSortBy]; diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index d3cfe683..5afe8de7 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -90,6 +90,21 @@ export const routes: Routes = [ (mod) => mod.DashboardComponent, ), }, + { + path: 'compare', + canActivate: [ + roleGuard([ + UserRole.User, + UserRole.Manager, + UserRole.Admin, + UserRole.SuperAdmin, + ]), + ], + loadComponent: () => + import('./modules/compare-authors/compare-authors.component').then( + (mod) => mod.CompareAuthorsComponent, + ), + }, { path: 'bookmarks', canActivate: [ diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.html b/webapp/src/app/modules/compare-authors/compare-authors.component.html new file mode 100644 index 00000000..eac43fd0 --- /dev/null +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.html @@ -0,0 +1,179 @@ +
+
+

Autoren-Vergleich

+ +
+ @if (keywords().length > 0) { + + topic + {{ keywords().join(', ') }} + + } + @if (timespan(); as span) { + + date_range + {{ span.from }}–{{ span.to }} + + } +
+ + @if (hasData()) { +
    + @for (author of summary(); track author.authorId) { +
  • + + {{ author.name }} +
  • + } +
+ } +
+ + @if (loading()) { +

Lädt…

+ } @else if (!hasData()) { +

Keine Daten für die ausgewählten Autoren.

+ } @else { + +
+

Kennzahlen zu den Keywords

+

+ Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für + diese:n Autor:in nicht vorliegt. +

+ +
+ + +
+

Kennzahlen zur Person

+

Unabhängig von den Keywords und Zeitraum.

+ +
+ + +
+

Themenprofil

+

"Topic-Analyse"

+ + @if (profileLoading()) { +

Lädt…

+ } @else if (orderedProfiles().length > 0) { +

Themenverteilung nach Subfield

+

+ Von allen Arbeiten der Autor:innen im Zeitraum: der Anteil je + Subfield, bestimmt über das Primärthema jeder Arbeit. (Top 5) +

+
+ +
+
+

Themen-Fokus

+

+ Anzahl der Werke zum Suchthema im Verhältnis zum Gesamtwerk – und + wie viele davon das Suchthema als Primärthema tragen. +

+
+
+
+

Themenbreite

+

+ Einzigartige Primärthemen, Subfields und Fields im Gesamtwerk + (Primary Topic) +

+
+
+
+ } @else { +

Keine Daten für das Themenprofil.

+ } +
+ } +
+ + +
+ + + + + @for (author of summary(); track author.authorId) { + + } + + + + @for (row of rows; track row.label) { + + + @if (row.kind === 'group') { + @for (gc of row.groupCells; track $index) { + + } + } @else { + @for (cell of row.cells; track $index) { + + } + } + + } + +
Kennzahl + + + {{ author.name }} + +
+ {{ row.label }} + {{ row.hint }} + @if (row.kind === 'group') { + + @for (seg of row.segments; track $index; let i = $index) { + @if (i > 0) { + | + } + {{ + seg.label + }} + } + + } + + @for (v of gc.values; track $index; let i = $index) { + @if (i > 0) { + | + } + + {{ + v === null + ? '–' + : row.segments[i].plain + ? v + : row.segments[i].decimals + ? (v | number: '1.2-2') + : (v | number) + }} + + } + + @if (cell.raw === null) { + – + } @else if (row.decimals) { + {{ cell.raw | number: '1.2-2' }} + } @else { + {{ cell.raw | number }} + } +
+
+
diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.scss b/webapp/src/app/modules/compare-authors/compare-authors.component.scss new file mode 100644 index 00000000..f05c3335 --- /dev/null +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.scss @@ -0,0 +1,279 @@ +.compare-layout { + padding: 28px 32px 42px; + display: flex; + flex-direction: column; + gap: 18px; + max-width: 1280px; + margin: 0 auto; + box-sizing: border-box; +} + +/* ---- header ---- */ +.compare-header { + display: flex; + flex-direction: column; + gap: 12px; + + h1 { + margin: 0; + font-size: 24px; + font-weight: 700; + color: var(--sg-text, #101a3d); + } +} + +.compare-meta { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.meta-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 4px 12px; + border-radius: 999px; + background: var(--sg-surface-muted, #f7f9ff); + border: 1px solid var(--sg-border, #dde5f2); + color: var(--sg-text-muted, #64708f); + font-size: 13px; + + mat-icon { + font-size: 16px; + width: 16px; + height: 16px; + color: var(--sg-text-soft, #8a95b3); + } +} + +.author-legend { + list-style: none; + margin: 0; + padding: 0; + display: flex; + flex-wrap: wrap; + gap: 8px 18px; +} + +.legend-item { + display: inline-flex; + align-items: center; + gap: 8px; + font-size: 14px; + font-weight: 600; + color: var(--sg-text, #101a3d); +} + +.legend-swatch { + width: 12px; + height: 12px; + border-radius: 3px; + flex: 0 0 auto; +} + +/* ---- cards ---- */ +.card { + background: #fff; + border: 1px solid #d7e4ff; + border-radius: 16px; + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04); + padding: 20px 22px; +} + +.card-title { + margin: 0; + font-size: 16px; + font-weight: 700; + color: var(--sg-text, #101a3d); +} + +.card-sub { + margin: 4px 0 0; + font-size: 13px; + color: var(--sg-text-muted, #64708f); +} + +.compare-hint { + padding: 24px; + text-align: center; + color: var(--sg-text-muted, #64708f); +} + +/* ---- comparison table ---- */ +.table-scroll { + margin-top: 14px; + overflow-x: auto; +} + +.compare-table { + width: 100%; + border-collapse: collapse; + font-size: 14px; + + thead th { + text-align: left; + padding: 0 16px 10px; + border-bottom: 2px solid var(--sg-border, #dde5f2); + vertical-align: bottom; + } + + .author-col { + text-align: right; + } + + .th-name { + display: inline-flex; + align-items: center; + gap: 8px; + font-weight: 700; + color: var(--sg-text, #101a3d); + } + + tbody tr + tr th, + tbody tr + tr td { + border-top: 1px solid var(--sg-border, #dde5f2); + } + + tbody th, + tbody td { + padding: 12px 16px; + } +} + +.metric-col { + min-width: 220px; +} + +.metric-label { + display: block; + font-weight: 600; + color: var(--sg-text, #101a3d); +} + +.metric-hint { + display: block; + margin-top: 2px; + font-size: 12px; + font-weight: 400; + color: var(--sg-text-soft, #8a95b3); +} + +.value-cell { + text-align: right; + font-variant-numeric: tabular-nums; + color: var(--sg-text, #101a3d); + white-space: nowrap; + + &.best { + font-weight: 700; + color: var(--sg-primary, #0b1020); + background: var(--sg-surface-soft, #f3f6fd); + } +} + +.value-empty { + color: var(--sg-text-soft, #8a95b3); +} + +/* author-position row: first / middle / last shown together, colour-coded */ +.position-cell { + white-space: nowrap; +} + +.pos { + font-weight: 700; + font-variant-numeric: tabular-nums; + + &.pos-first { + color: #16a34a; + } + &.pos-middle { + color: #d97706; + } + &.pos-last { + color: #2563eb; + } + &.rel-count { + color: #7c3aed; + } + &.rel-avg { + color: #0891b2; + } + &.cit-total { + color: #b91c1c; + } + &.cit-avg { + color: #ea580c; + } + &.fwci-count { + color: #4d7c0f; + } + &.fwci-avg { + color: #0d9488; + } + &.year-from { + color: #6d28d9; + } + &.year-to { + color: #be185d; + } + &.ind-count { + color: #92400e; + } + &.ind-share { + color: #1d4ed8; + } +} + +.pos-sep { + margin: 0 4px; + color: var(--sg-text-soft, #b6bed6); + font-weight: 400; +} + +.position-legend { + display: block; + margin-top: 4px; + font-size: 11px; + font-weight: 600; +} + +/* ---- section 3: topic profile charts ---- */ +.chart-title { + margin: 18px 0 0; + font-size: 14px; + font-weight: 700; + color: var(--sg-text, #101a3d); +} + +.chart-hint { + margin: 2px 0 8px; + font-size: 12px; + color: var(--sg-text-muted, #64708f); +} + +.profile-chart { + width: 100%; + height: 260px; +} + +.profile-chart-wide { + height: 320px; +} + +.chart-grid { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 8px 24px; +} + +@media (max-width: 900px) { + .compare-layout { + padding: 20px 16px 32px; + } + + .chart-grid { + grid-template-columns: 1fr; + } +} diff --git a/webapp/src/app/modules/compare-authors/compare-authors.component.ts b/webapp/src/app/modules/compare-authors/compare-authors.component.ts new file mode 100644 index 00000000..299c1f47 --- /dev/null +++ b/webapp/src/app/modules/compare-authors/compare-authors.component.ts @@ -0,0 +1,701 @@ +import { Component, OnInit, computed, inject, signal } from '@angular/core'; +import { DecimalPipe, NgTemplateOutlet } from '@angular/common'; +import { ActivatedRoute } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { EChartsOption } from 'echarts'; +import { NgxEchartsDirective } from 'ngx-echarts'; + +import { + AuthorStaticStats, + AuthorTopicProfile, + AuthorTopicStats, + RankingService, +} from '../../api'; + +const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd']; +const SUBFIELD_COLORS = [ + '#2563eb', + '#16a34a', + '#d97706', + '#7c3aed', + '#0891b2', + '#db2777', + '#65a30d', + '#b45309', +]; +const OTHER_COLOR = '#9ca3af'; +const SUBFIELD_LIMIT = 5; + +interface AuthorSummary { + authorId: string; + name: string; + color: string; + // section 1 + // topic stats + totalWorks: number | null; + corresponding: number | null; + avgPercentile: number | null; + top10: number | null; + top1: number | null; + fwciAboveOne: number | null; + avgFwci: number | null; + // citations over the topic works + citationsTotal: number | null; + avgCitations: number | null; + maxCitations: number | null; + hIndex: number | null; + // industry collaboration (works with a company co-author institution) + industryWorks: number | null; + industryShare: number | null; + // active years within the topic + firstYear: number | null; + lastYear: number | null; + // topic-relevance (matched keyword score) + relevanceAbove80: number | null; + avgRelevance: number | null; + // author-position split (first / middle / last) + firstAuthor: number | null; + middleAuthor: number | null; + lastAuthor: number | null; + // section 2: author-level stats (keyword-independent) + companies: number | null; + news: number | null; + patents: number | null; +} + +interface MetricCell { + raw: number | null; + best: boolean; +} + +interface GroupSegment { + label: string; + colorClass: string; + decimals: boolean; + // render the value as-is, without the number pipe (e.g. years) + plain: boolean; +} + +interface GroupCell { + values: (number | null)[]; +} + +interface MetricRow { + label: string; + hint: string; + decimals: boolean; + kind: 'scalar' | 'group'; + cells: MetricCell[]; + segments: GroupSegment[]; + groupCells: GroupCell[]; +} + +interface RowDef { + label: string; + hint: string; + select: (a: AuthorSummary) => number | null; + decimals?: boolean; +} + +interface SegmentDef { + label: string; + colorClass: string; + select: (a: AuthorSummary) => number | null; + decimals?: boolean; + plain?: boolean; +} + +@Component({ + selector: 'app-compare-authors', + standalone: true, + imports: [DecimalPipe, NgTemplateOutlet, MatIconModule, NgxEchartsDirective], + templateUrl: './compare-authors.component.html', + styleUrl: './compare-authors.component.scss', +}) +export class CompareAuthorsComponent implements OnInit { + private readonly route = inject(ActivatedRoute); + private readonly rankingService = inject(RankingService); + + readonly keywords = signal([]); + readonly timespan = signal<{ from: number; to: number } | null>(null); + // full OpenAlex ids in the requested order — the source of truth for colour + order + readonly authorIds = signal([]); + + // section 1: combined topic stats, one entry per author + readonly topic = signal([]); + // section 2: keyword-independent author-level stats + readonly staticStats = signal([]); + // section 3: topic profile over ALL works of each author + readonly profile = signal([]); + readonly profileLoading = signal(false); + readonly loading = signal(false); + + // maps both sections onto one row per author, in the requested order + readonly summary = computed(() => { + const topicById = new Map(this.topic().map((a) => [a.author_id, a])); + const staticById = new Map(this.staticStats().map((a) => [a.author_id, a])); + + return this.authorIds().map((id, index) => { + const t = topicById.get(id); + const m = staticById.get(id); + const name = + t?.display_name ?? m?.display_name ?? id.split('/').pop() ?? id; + + return { + authorId: id, + name, + color: AUTHOR_COLORS[index % AUTHOR_COLORS.length], + totalWorks: t ? t.works_total : null, + corresponding: t ? t.corresponding_count : null, + avgPercentile: t ? t.avg_percentile : null, + top10: t ? t.top10_count : null, + top1: t ? t.top1_count : null, + fwciAboveOne: t ? t.fwci_above_one_count : null, + avgFwci: t ? t.avg_fwci : null, + citationsTotal: t ? t.citations_total : null, + avgCitations: t ? t.avg_citations : null, + maxCitations: t ? t.max_citations : null, + hIndex: t ? t.h_index : null, + industryWorks: t ? t.industry_works_count : null, + industryShare: + t && t.works_total > 0 + ? t.industry_works_count / t.works_total + : null, + firstYear: t ? t.first_year : null, + lastYear: t ? t.last_year : null, + relevanceAbove80: t ? t.relevance_above_80_count : null, + avgRelevance: t ? t.avg_relevance : null, + firstAuthor: t ? t.first_author_count : null, + middleAuthor: t ? t.middle_author_count : null, + lastAuthor: t ? t.last_author_count : null, + companies: m ? m.companies_count : null, + news: m ? m.news_count : null, + patents: m ? m.patents_count : null, + }; + }); + }); + + readonly hasData = computed(() => this.summary().length > 0); + + // section 1 table: stats over the topic-filtered works + readonly topicRows = computed(() => [ + ...this.buildRows([ + { + label: 'Werke gesamt', + hint: 'Publikationen zum Thema im Zeitraum', + select: (a) => a.totalWorks, + }, + { + label: 'Corresponding-Author-Werke', + hint: 'Werke, in denen die Person korrespondierende:r Autor:in ist', + select: (a) => a.corresponding, + }, + ]), + this.buildGroupRow( + 'Zitationen', + 'Zitationen der Themen-Werke: gesamt | Ø pro Werk', + [ + { + label: 'gesamt', + colorClass: 'cit-total', + select: (a) => a.citationsTotal, + }, + { + label: 'Ø', + colorClass: 'cit-avg', + decimals: true, + select: (a) => a.avgCitations, + }, + ], + ), + ...this.buildRows([ + { + label: 'Ø Impact-Perzentil', + hint: 'Feld-normalisiertes Zitations-Perzentil (0–1)', + select: (a) => a.avgPercentile, + decimals: true, + }, + { + label: 'h-Index', + hint: 'h-Index über die Werke zum Thema', + select: (a) => a.hIndex, + }, + { + label: 'Meistzitiertes Werk', + hint: 'Zitationen des meistzitierten Werks zum Thema', + select: (a) => a.maxCitations, + }, + { + label: 'Top-10%-Werke', + hint: 'Werke unter den 10% meistzitierten', + select: (a) => a.top10, + }, + { + label: 'Top-1%-Werke', + hint: 'Werke unter den 1% meistzitierten', + select: (a) => a.top1, + }, + ]), + this.buildGroupRow( + 'FWCI', + 'Field-Weighted Citation Impact: Werke über Feld-Durchschnitt | Ø über alle', + [ + { + label: '> 1', + colorClass: 'fwci-count', + select: (a) => a.fwciAboveOne, + }, + { + label: 'Ø', + colorClass: 'fwci-avg', + decimals: true, + select: (a) => a.avgFwci, + }, + ], + ), + this.buildGroupRow( + 'Themen-Relevanz', + 'Match-Score der Keywords: Werke > 80% | Ø über alle', + [ + { + label: '> 80%', + colorClass: 'rel-count', + select: (a) => a.relevanceAbove80, + }, + { + label: 'Ø', + colorClass: 'rel-avg', + decimals: true, + select: (a) => a.avgRelevance, + }, + ], + ), + this.buildGroupRow( + 'Autor-Position', + 'Werke nach Position (Erst | Mittel | Letzt)', + [ + { + label: 'Erst', + colorClass: 'pos-first', + select: (a) => a.firstAuthor, + }, + { + label: 'Mittel', + colorClass: 'pos-middle', + select: (a) => a.middleAuthor, + }, + { label: 'Letzt', colorClass: 'pos-last', select: (a) => a.lastAuthor }, + ], + ), + this.buildGroupRow( + 'Industrie-Kollaboration', + 'Werke mit Co-Autor:in aus einem Unternehmen: Anzahl | Anteil', + [ + { + label: 'Anzahl', + colorClass: 'ind-count', + select: (a) => a.industryWorks, + }, + { + label: 'Anteil', + colorClass: 'ind-share', + decimals: true, + select: (a) => a.industryShare, + }, + ], + ), + this.buildGroupRow( + 'Aktiv im Thema', + 'Erstes und letztes Publikationsjahr zum Thema', + [ + { + label: 'von', + colorClass: 'year-from', + plain: true, + select: (a) => a.firstYear, + }, + { + label: 'bis', + colorClass: 'year-to', + plain: true, + select: (a) => a.lastYear, + }, + ], + ), + ]); + + // section 2 table: author-level stats, independent of the keywords + readonly staticRows = computed(() => + this.buildRows([ + { + label: 'Unternehmensgründungen', + hint: 'Handelsregister-Verbindungen über den Namen', + select: (a) => a.companies, + }, + { + label: 'News-Artikel', + hint: 'Nachrichtenartikel, die die Person namentlich nennen', + select: (a) => a.news, + }, + { + label: 'Patente', + hint: 'Der Person zugeordnete Patente', + select: (a) => a.patents, + }, + ]), + ); + + // section 3: profiles in the requested author order (drives all charts) + readonly orderedProfiles = computed(() => { + const byId = new Map(this.profile().map((p) => [p.author_id, p])); + return this.authorIds() + .map((id) => byId.get(id)) + .filter((p): p is AuthorTopicProfile => p !== undefined); + }); + + // colours the author names on the chart axes like the legend chips + private authorAxisLabel(profiles: AuthorTopicProfile[]) { + const rich: Record = {}; + profiles.forEach((_, i) => { + rich[`a${i}`] = { + color: AUTHOR_COLORS[i % AUTHOR_COLORS.length], + fontWeight: 600, + }; + }); + return { + formatter: (value: string) => { + const index = profiles.findIndex((p) => p.display_name === value); + return index >= 0 ? `{a${index}|${value}}` : value; + }, + rich, + // rich-text labels are measured slightly too narrow — leave some slack + margin: 12, + }; + } + + // chart 1: how each author's complete body of work distributes over subfields + readonly subfieldChart = computed(() => { + const profiles = this.orderedProfiles(); + if (profiles.length === 0) return {}; + + // union of the biggest subfields across all authors, one colour each + const totals = new Map(); + for (const p of profiles) { + for (const s of p.subfields) { + totals.set(s.name, (totals.get(s.name) ?? 0) + s.count); + } + } + const topSubfields = [...totals.entries()] + .sort((a, b) => b[1] - a[1]) + .slice(0, SUBFIELD_LIMIT) + .map(([name]) => name); + + const shownCounts = profiles.map((p) => + topSubfields.map( + (name) => p.subfields.find((s) => s.name === name)?.count ?? 0, + ), + ); + + const series: any[] = topSubfields.map((name, si) => ({ + name, + type: 'bar', + stack: 'profil', + barWidth: 22, + emphasis: { focus: 'series' }, + itemStyle: { color: SUBFIELD_COLORS[si % SUBFIELD_COLORS.length] }, + data: profiles.map((p, ai) => { + const count = shownCounts[ai][si]; + return { + value: + p.works_total > 0 + ? Math.round((count / p.works_total) * 1000) / 10 + : 0, + count, + }; + }), + })); + + // everything outside the shown subfields (incl. works without primary topic) + series.push({ + name: 'Sonstige', + type: 'bar', + stack: 'profil', + barWidth: 22, + emphasis: { focus: 'series' }, + itemStyle: { color: OTHER_COLOR }, + data: profiles.map((p, ai) => { + const rest = + p.works_total - shownCounts[ai].reduce((sum, c) => sum + c, 0); + return { + value: + p.works_total > 0 + ? Math.round((rest / p.works_total) * 1000) / 10 + : 0, + count: rest, + }; + }), + }); + + return { + tooltip: { + trigger: 'axis', + axisPointer: { type: 'shadow' }, + formatter: (params: any) => { + const lines = params + .filter((p: any) => p.data.count > 0) + .map( + (p: any) => + `${p.marker} ${p.seriesName}: ${p.data.value} % (${p.data.count} Werke)`, + ); + return `${params[0]?.name ?? ''}
${lines.join('
')}`; + }, + }, + legend: { type: 'scroll', top: 0 }, + grid: { left: 16, right: 24, top: 56, bottom: 8, containLabel: true }, + xAxis: { + type: 'value', + max: 100, + axisLabel: { formatter: '{value} %' }, + }, + yAxis: { + type: 'category', + inverse: true, + data: profiles.map((p) => p.display_name), + axisLabel: this.authorAxisLabel(profiles), + }, + series, + } as EChartsOption; + }); + + // chart 2: topic focus — how much of the complete body of work is on the searched topic + readonly focusChart = computed(() => { + const profiles = this.orderedProfiles(); + if (profiles.length === 0) return {}; + + const pct = (part: number, whole: number) => + whole > 0 ? Math.round((part / whole) * 1000) / 10 : 0; + + return { + tooltip: { + trigger: 'axis', + axisPointer: { type: 'shadow' }, + formatter: (params: any) => { + const lines = params.map( + (p: any) => + `${p.marker} ${p.seriesName}: ${p.data.value} % (${p.data.part} von ${p.data.whole} Werken)`, + ); + return `${params[0]?.name ?? ''}
${lines.join('
')}`; + }, + }, + legend: { top: 0 }, + grid: { left: 16, right: 40, top: 32, bottom: 8, containLabel: true }, + xAxis: { + type: 'value', + max: 100, + axisLabel: { formatter: '{value} %' }, + }, + yAxis: { + type: 'category', + inverse: true, + data: profiles.map((p) => p.display_name), + axisLabel: this.authorAxisLabel(profiles), + }, + series: [ + { + name: 'Anteil am Gesamtwerk', + type: 'bar', + itemStyle: { color: '#2563eb' }, + label: { show: true, position: 'right', formatter: '{c} %' }, + data: profiles.map((p) => ({ + value: pct(p.matched_works, p.works_total), + part: p.matched_works, + whole: p.works_total, + })), + }, + { + name: 'davon Primärthema', + type: 'bar', + itemStyle: { color: '#7c3aed' }, + label: { show: true, position: 'right', formatter: '{c} %' }, + data: profiles.map((p) => ({ + value: pct(p.primary_topic_matches, p.matched_works), + part: p.primary_topic_matches, + whole: p.matched_works, + })), + }, + ], + } as EChartsOption; + }); + + // chart 3: topic breadth — how many distinct (sub)fields the author publishes in + readonly breadthChart = computed(() => { + const profiles = this.orderedProfiles(); + if (profiles.length === 0) return {}; + + return { + tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } }, + legend: { top: 0 }, + grid: { left: 16, right: 40, top: 32, bottom: 8, containLabel: true }, + xAxis: { type: 'value' }, + yAxis: { + type: 'category', + inverse: true, + data: profiles.map((p) => p.display_name), + axisLabel: this.authorAxisLabel(profiles), + }, + series: [ + { + name: 'Themen', + type: 'bar', + itemStyle: { color: '#0891b2' }, + label: { show: true, position: 'right' }, + data: profiles.map((p) => p.distinct_topics), + }, + { + name: 'Subfields', + type: 'bar', + itemStyle: { color: '#d97706' }, + label: { show: true, position: 'right' }, + data: profiles.map((p) => p.distinct_subfields), + }, + { + name: 'Fields', + type: 'bar', + itemStyle: { color: '#16a34a' }, + label: { show: true, position: 'right' }, + data: profiles.map((p) => p.distinct_fields), + }, + ], + } as EChartsOption; + }); + + // turns row definitions into table rows, marking the best value per row + private buildRows(defs: RowDef[]): MetricRow[] { + const authors = this.summary(); + return defs.map((def) => { + const values = authors.map(def.select); + const present = values.filter((v): v is number => v !== null); + const max = present.length ? Math.max(...present) : null; + return { + label: def.label, + hint: def.hint, + decimals: def.decimals ?? false, + kind: 'scalar' as const, + cells: values.map((raw) => ({ + raw, + best: raw !== null && max !== null && raw === max && max > 0, + })), + segments: [], + groupCells: [], + }; + }); + } + + private buildGroupRow( + label: string, + hint: string, + segs: SegmentDef[], + ): MetricRow { + return { + label, + hint, + decimals: false, + kind: 'group' as const, + cells: [], + segments: segs.map((s) => ({ + label: s.label, + colorClass: s.colorClass, + decimals: s.decimals ?? false, + plain: s.plain ?? false, + })), + groupCells: this.summary().map((a) => ({ + values: segs.map((s) => s.select(a)), + })), + }; + } + + ngOnInit(): void { + // everything is read from the URL so a shared link lands on the same view + const rawAuthors = this.route.snapshot.queryParamMap.get('authors') ?? ''; + const rawKeywords = this.route.snapshot.queryParamMap.get('keywords') ?? ''; + const rawOperator = this.route.snapshot.queryParamMap.get('operator'); + const rawPubType = this.route.snapshot.queryParamMap.get('pubType'); + const rawTFrom = this.route.snapshot.queryParamMap.get('tFrom'); + const rawTTo = this.route.snapshot.queryParamMap.get('tTo'); + + const authorIds = this.parseList(rawAuthors); + const keywords = this.parseList(rawKeywords); + this.keywords.set(keywords); + + if (authorIds.length === 0 || keywords.length === 0) { + return; + } + + const operator = rawOperator === 'and' ? 'and' : 'or'; + const publication_types = rawPubType + ? this.parseList(rawPubType) + : undefined; + const timespan = + rawTFrom && rawTTo ? { from: +rawTFrom, to: +rawTTo } : undefined; + this.timespan.set(timespan ?? null); + + // ids in the url are bare (A5036...); the endpoint expects full OpenAlex urls + const fullIds = authorIds.map((id) => `https://openalex.org/${id}`); + this.authorIds.set(fullIds); + + const request = { + author_ids: fullIds, + keywords: keywords, + operator: operator, + filter_type: 'topic', + publication_types: publication_types, + timespan: timespan, + }; + + // section 1: topic-filtered works stats + this.loading.set(true); + this.rankingService.topicStats(request).subscribe({ + next: (results) => { + this.topic.set(results); + this.loading.set(false); + }, + error: (error) => { + console.error(error); + this.topic.set([]); + this.loading.set(false); + }, + }); + + // section 3: topic profile over ALL works (same filter, own endpoint) + this.profileLoading.set(true); + this.rankingService.topicProfile(request).subscribe({ + next: (results) => { + this.profile.set(results); + this.profileLoading.set(false); + }, + error: (error) => { + console.error(error); + this.profile.set([]); + this.profileLoading.set(false); + }, + }); + + // section 2: keyword-independent author-level stats + this.rankingService.staticStats({ author_ids: fullIds }).subscribe({ + next: (results) => { + this.staticStats.set(results); + }, + error: (error) => { + console.error(error); + this.staticStats.set([]); + }, + }); + } + + private parseList(raw: string): string[] { + return raw + .split(',') + .map((value) => value.trim()) + .filter(Boolean); + } +} diff --git a/webapp/src/app/modules/institution/institution.component.ts b/webapp/src/app/modules/institution/institution.component.ts index 3bc06ee1..00bfcf8e 100644 --- a/webapp/src/app/modules/institution/institution.component.ts +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -54,18 +54,21 @@ export class InstitutionComponent implements OnInit { this.institution = institution; }); - const institutionId = this.activatedRoute.snapshot.paramMap.get('institutionId'); + const institutionId = + this.activatedRoute.snapshot.paramMap.get('institutionId'); if (!institutionId) return; // The "Patente" tab only makes sense once org_patents has been indexed for // this institution (currently a manual, ~30-40 min-per-institution process), // so only show it once we know there is actually data behind it. - this.patentsApi.getOrgPatentsByInstitution(institutionId, undefined, 0, 0).subscribe({ - next: (result) => { - if ((result.patent_count ?? 0) > 0) { - this.links = [...this.links, PATENTS_LINK]; - } - }, - }); + this.patentsApi + .getOrgPatentsByInstitution(institutionId, undefined, 0, 0) + .subscribe({ + next: (result) => { + if ((result.patent_count ?? 0) > 0) { + this.links = [...this.links, PATENTS_LINK]; + } + }, + }); } } diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts index a8735d33..a5c7ed0f 100644 --- a/webapp/src/app/modules/institutions/institutions.component.ts +++ b/webapp/src/app/modules/institutions/institutions.component.ts @@ -59,17 +59,21 @@ export class InstitutionsComponent { const id = this.extractInstitutionId(institution); if (!id || this.patentsAvailable.has(id)) continue; this.patentsAvailable.set(id, false); - this.patentsApi.getOrgPatentsByInstitution(id, undefined, 0, 0).subscribe({ - next: (result) => { - this.patentsAvailable.set(id, (result.patent_count ?? 0) > 0); - }, - }); + this.patentsApi + .getOrgPatentsByInstitution(id, undefined, 0, 0) + .subscribe({ + next: (result) => { + this.patentsAvailable.set(id, (result.patent_count ?? 0) > 0); + }, + }); } }); } hasPatents(institution: Institution): boolean { - return this.patentsAvailable.get(this.extractInstitutionId(institution)) ?? false; + return ( + this.patentsAvailable.get(this.extractInstitutionId(institution)) ?? false + ); } sortingOptions: SelectorOption[] = [ diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html index a97b0264..ec2355cd 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.html @@ -1,31 +1,205 @@
- - groups -

Personenliste

-

- Die aktuelle Gewichtung ist unter normalized verfügbar. -

+ + @if (loading()) { +

Lädt…

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

Keine Autoren gefunden

+

Passe die Keywords oder die Gewichtung an.

+
+ } @else { +
+ + {{ selectedIds().length }} / {{ MAX_SELECTED }} ausgewählt + + +
+
    + @for (author of paginatedAuthors(); track author.author_id) { +
  • + + + {{ author.display_name }} + + + Score: {{ author.score | number: '1.3-3' }} + +
  • + } +
+ + + }
- - - - - +
+ +
+
+

Filter

+ +
+ +
+ + Art der Work + + + + @for (pt of filteredPubTypes(); track pt) { + {{ pt }} + } + + +
+ +
+ + Keyword-Verknüpfung + + @for (option of KEYWORD_OPERATOR_OPTIONS; track option.value) { + {{ + option.label + }} + } + + +
+ +
+ + Karrierestufe + + @for (option of CAREER_STAGE_OPTIONS; track option.value) { + {{ + option.label + }} + } + + +
+ +
+ + Unternehmen + + @for (option of COMPANY_STATUS_OPTIONS; track option.value) { + {{ + option.label + }} + } + + +
+ +
+
+ date_range + Zeitraum +
+ +
+
+ {{ timespanFrom() }} – {{ timespanTo() }} +
+ + + + +
+
+
+
+
diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss index ffeea20d..336c8680 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.scss @@ -7,12 +7,21 @@ grid-template-areas: 'summary results'; gap: 0.75rem; align-items: start; + width: 100%; } -.search-summary-card { +.search-summary-card, +.controls-column { grid-area: summary; } +.controls-column { + display: flex; + flex-direction: column; + gap: 0.75rem; + min-width: 0; +} + .results-card { grid-area: results; } @@ -27,3 +36,123 @@ padding: 0.75rem; } } + +/* ============================================================ + AUTHOR LIST + ============================================================ */ +.author-list { + list-style: none; + margin: 0; + padding: 0; +} + +.results-toolbar { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 0.75rem; + padding: 0.25rem; + margin-bottom: 0.25rem; +} + +.selected-hint { + color: var(--sg-text-secondary, rgba(0, 0, 0, 0.6)); + font-size: 0.85rem; +} + +.author-item { + display: flex; + align-items: center; + gap: 0.75rem; + padding: 0.5rem 0.25rem; + border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); +} + +.author-name { + flex: 1; + font-weight: 500; + text-decoration: none; + color: var(--sg-primary, #1565c0); + + &:hover { + text-decoration: underline; + } +} + +.author-score { + font-variant-numeric: tabular-nums; + color: var(--sg-text-secondary, rgba(0, 0, 0, 0.6)); + white-space: nowrap; +} + +.results-hint { + padding: 0.5rem 0.25rem; +} + +/* ============================================================ + FILTER SECTION (closed, bordered block below the sliders) + ============================================================ */ +::ng-deep .filter-section { + margin-top: 0.75rem; + padding: 0.5rem 0.6rem 0.6rem; + border: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); + border-radius: 6px; + background: var(--sg-surface-variant, rgba(0, 0, 0, 0.015)); +} + +.filter-section-header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.4rem; + margin-bottom: 0.4rem; + + h3 { + margin: 0; + font-size: 0.8rem; + font-weight: 650; + color: var(--sg-text-primary); + } + + button { + min-height: 44px; + padding: 0.2rem 0.4rem; + font-size: 0.75rem; + line-height: 1.2; + } +} + +/* divider between filter rows — not before the first one */ +::ng-deep .filter-section .filter-row + .filter-row { + margin-top: 0.5rem; + padding-top: 0.5rem; + border-top: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); +} + +::ng-deep .company-filter-row { + font-size: 0.8rem; +} + +/* ============================================================ + TIMESPAN + ============================================================ */ +::ng-deep .timespan-range-label { + justify-content: center !important; + font-weight: 500; + color: var(--sg-text-primary) !important; +} + +::ng-deep .timespan-slider { + width: 100%; + margin: 0; +} + +::ng-deep .pub-type-search { + display: flex; + align-items: center; + position: sticky; + top: 0; + z-index: 10; + background: white; + border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); +} diff --git a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts index 3f4e2b98..e0bea4d1 100644 --- a/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/persons-results/persons-results.component.ts @@ -1,7 +1,18 @@ -import { Component, inject, signal } from '@angular/core'; +import { Component, OnInit, computed, inject, signal } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { DecimalPipe } from '@angular/common'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; +import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; +import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatIconModule } from '@angular/material/icon'; +import { MatSliderModule } from '@angular/material/slider'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { FormsModule } from '@angular/forms'; +import { MatSelectModule } from '@angular/material/select'; +import { MatInputModule } from '@angular/material/input'; +import { MatFormFieldModule } from '@angular/material/form-field'; import { WeightMap, @@ -9,37 +20,86 @@ import { WeightsSlidersComponent, WeightsSlidersValue, } from '../../../../shared/ui/weights-sliders/weights-sliders.component'; +import { QueryParamPaginatorComponent } from '../../../../shared/ui/query-param-paginator/query-param-paginator.component'; + +import { + KeywordToAuthorRequest, + RankedAuthor, + RankingService, +} from '../../../../api'; import { SearchResultsStateService } from '../search-results-state.service'; @Component({ selector: 'app-persons-results', standalone: true, - imports: [MatCardModule, MatIconModule, WeightsSlidersComponent], + imports: [ + DecimalPipe, + RouterLink, + MatButtonModule, + MatCardModule, + MatCheckboxModule, + MatIconModule, + MatSliderModule, + FormsModule, + MatSelectModule, + MatInputModule, + MatFormFieldModule, + QueryParamPaginatorComponent, + WeightsSlidersComponent, + ], templateUrl: './persons-results.component.html', styleUrl: './persons-results.component.scss', }) -export class KeywordsToPersonsResultsComponent { +export class KeywordsToPersonsResultsComponent implements OnInit { // injects the state set by the parent route — no duplicate parsing here private readonly state = inject(SearchResultsStateService); + private readonly rankingService = inject(RankingService); + private readonly route = inject(ActivatedRoute); + private readonly router = inject(Router); + private readonly snackBar = inject(MatSnackBar); + private readonly queryParams = toSignal(this.route.queryParams); + + readonly pageIndex = computed(() => { + const p = this.queryParams(); + return p && p['page'] ? +p['page'] || 0 : 0; + }); + + readonly pageSize = computed(() => { + const p = this.queryParams(); + return p && p['size'] ? +p['size'] || 10 : 10; + }); + + readonly paginatedAuthors = computed(() => { + const all = this.authors(); + const start = this.pageIndex() * this.pageSize(); + return all.slice(start, start + this.pageSize()); + }); + + // author selection for the compare view (max 4) + readonly MAX_SELECTED = 4; + readonly selectedIds = signal([]); + readonly canCompare = computed(() => this.selectedIds().length >= 1); + + // works, citations and company foundations are used as metrics/weights readonly defaultWeights: WeightMap = { - publications: 0.5, + works: 0.5, citations: 0.5, + companies: 0.5, + news: 0.5, patents: 0.5, - projects: 0.5, - mediaVisibility: 0.5, }; readonly weightOptions: WeightSliderOption[] = [ { - key: 'publications', - label: 'Publikationen', + key: 'works', + label: 'Works', icon: 'article', description: 'Gewichtet die Anzahl und Relevanz wissenschaftlicher Arbeiten.', defaultValue: 0.5, - queryParamName: 'wPublications', + queryParamName: 'wWorks', }, { key: 'citations', @@ -49,87 +109,369 @@ export class KeywordsToPersonsResultsComponent { defaultValue: 0.5, queryParamName: 'wCitations', }, + { + key: 'companies', + label: 'Unternehmensgründungen', + icon: 'business', + description: + 'Gewichtet die Anzahl der Unternehmensgründungen (Handelsregister-Verbindungen).', + defaultValue: 0.5, + queryParamName: 'wCompanies', + }, + { + key: 'news', + label: 'Medien-Sichtbarkeit', + icon: 'visibility', + description: + 'Gewichtet die öffentliche Sichtbarkeit über Nennungen in Nachrichtenartikeln.', + defaultValue: 0.5, + queryParamName: 'wNews', + }, { key: 'patents', label: 'Patente', icon: 'workspace_premium', - description: 'Gewichtet Innovations- und Transferleistung.', + description: 'Gewichtet Innovations- und Transferleistung über Patente.', defaultValue: 0.5, queryParamName: 'wPatents', }, - { + /*{ key: 'projects', label: 'Projekte', icon: 'account_tree', description: 'Gewichtet Beteiligung an relevanten Forschungsprojekten.', defaultValue: 0.5, queryParamName: 'wProjects', - }, - { - key: 'mediaVisibility', - label: 'Medien-Sichtbarkeit', - icon: 'visibility', - description: 'Gewichtet öffentliche und mediale Sichtbarkeit.', - defaultValue: 0.5, - queryParamName: 'wMedia', - }, + }, */ ]; readonly currentWeights = signal({ raw: this.defaultWeights, normalized: { - publications: 0.2, - citations: 0.2, - patents: 0.2, - projects: 0.2, - mediaVisibility: 0.2, + works: 1 / 5, + citations: 1 / 5, + companies: 1 / 5, + news: 1 / 5, + patents: 1 / 5, }, rawSum: 2.5, normalizedSum: 1, valid: true, }); - readonly persons = signal([]); // placeholder until the results service lands + // publication-year timespan filter (range slider) + readonly minYear = 1900; + readonly maxYear = 2026; + readonly timespanFrom = signal(this.minYear); + readonly timespanTo = signal(this.maxYear); + + // which companies to count for the company-foundations metric + readonly COMPANY_STATUS_OPTIONS = [ + { value: 'all', label: 'Alle Unternehmen' }, + { value: 'active', label: 'Nur aktive Unternehmen' }, + { value: 'deleted', label: 'Nur gelöschte Unternehmen' }, + ]; + readonly companyStatus = signal<'all' | 'active' | 'deleted'>('all'); + + // publication types + readonly ALL_PUBLICATION_TYPES = [ + 'article', + 'other', + 'dataset', + 'book-chapter', + 'book', + 'dissertation', + 'preprint', + 'paratext', + 'libguides', + 'review', + 'letter', + 'reference-entry', + 'editorial', + 'peer-review', + 'report', + 'standard', + 'erratum', + 'retraction', + 'supplementary-materials', + 'book-section', + 'database', + 'software', + 'report-component', + 'grant', + ]; + + readonly pubTypeSearchTerm = signal(''); + + readonly selectedPubTypes = computed(() => { + const p = this.queryParams(); + const val = p?.['pubType']; + if (!val) return []; + return Array.isArray(val) ? val : val.split(','); + }); + + readonly filteredPubTypes = computed(() => { + const term = this.pubTypeSearchTerm().toLowerCase(); + if (!term) return this.ALL_PUBLICATION_TYPES; + return this.ALL_PUBLICATION_TYPES.filter((pt) => + pt.toLowerCase().includes(term), + ); + }); + + onPubTypesChange(selected: string[]) { + const val = selected.length > 0 ? selected.join(',') : null; + this.router.navigate([], { + relativeTo: this.route, + queryParams: { pubType: val, page: null }, + queryParamsHandling: 'merge', + }); + } + + onPubTypeKeydown(event: KeyboardEvent) { + if (event.key === ' ') { + event.stopPropagation(); + } + } + + readonly KEYWORD_OPERATOR_OPTIONS = [ + { value: 'and', label: 'UND' }, + { value: 'or', label: 'ODER' }, + ]; + + readonly keywordOperator = signal<'and' | 'or'>('or'); + + onKeywordOperatorChange(operator: 'and' | 'or'): void { + this.keywordOperator.set(operator); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + operator: operator, + page: null, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + this.loadAuthors(); + } + + readonly CAREER_STAGE_OPTIONS = [ + { value: 'Early', label: 'Early' }, + { value: 'Emerging', label: 'Emerging' }, + { value: 'Established', label: 'Established' }, + { value: 'Senior', label: 'Senior' }, + ]; + + readonly careerStages = signal([]); + + onCareerStagesChange(selected: string[]) { + this.careerStages.set(selected); + const val = selected.length > 0 ? selected.join(',') : null; + this.router.navigate([], { + relativeTo: this.route, + queryParams: { careerStage: val, page: null }, + queryParamsHandling: 'merge', + }); + } + + readonly authors = signal([]); + readonly loading = signal(false); private hasLoadedInitial = false; + ngOnInit(): void { + // restore the timespan from the URL so the range is shareable/bookmarkable + this.timespanFrom.set(this.readYearParam('tFrom', this.minYear)); + this.timespanTo.set(this.readYearParam('tTo', this.maxYear)); + const status = this.route.snapshot.queryParamMap.get('companyStatus'); + if (status === 'active' || status === 'deleted') { + this.companyStatus.set(status); + } + const careerStage = this.route.snapshot.queryParamMap.get('careerStage'); + if (careerStage) { + this.careerStages.set(careerStage.split(',')); + } + const operator = this.route.snapshot.queryParamMap.get('operator'); + if (operator === 'and' || operator === 'or') { + this.keywordOperator.set(operator); + } + } + + // reads a year query param, clamped to the valid range; falls back on invalid input + private readYearParam(name: string, fallback: number): number { + const rawValue = this.route.snapshot.queryParamMap.get(name); + if (rawValue === null) { + return fallback; + } + + const year = Number(rawValue); + if (!Number.isFinite(year)) { + return fallback; + } + + return Math.min(this.maxYear, Math.max(this.minYear, Math.round(year))); + } + + private writeTimespanToUrl(): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { tFrom: this.timespanFrom(), tTo: this.timespanTo() }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + } + onWeightsChange(value: WeightsSlidersValue): void { this.currentWeights.set(value); // fires once with the query-param-aware initial state — use it to load if (!this.hasLoadedInitial) { this.hasLoadedInitial = true; - this.loadPersons(); + this.loadAuthors(); } } onApplyWeights(value: WeightsSlidersValue): void { this.currentWeights.set(value); - this.loadPersons(); + this.loadAuthors(); } - private loadPersons(): void { - const weights = this.currentWeights(); - - const requestPayload = { - manualKeywords: this.state.manualKeywords(), - extractedKeywords: this.state.extractedKeywords(), - keywords: this.state.keywords(), - fuzzy: this.state.fuzzySearch(), - weights: { - raw: weights.raw, - normalized: weights.normalized, + // change the company-status filter — persist to the URL and reload + onCompanyStatusChange(status: 'all' | 'active' | 'deleted'): void { + this.companyStatus.set(status); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + companyStatus: status === 'all' ? null : status, + page: null, }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + this.loadAuthors(); + } + + resetFilters(): void { + this.timespanFrom.set(this.minYear); + this.timespanTo.set(this.maxYear); + this.companyStatus.set('all'); + this.careerStages.set([]); + this.keywordOperator.set('and'); + this.pubTypeSearchTerm.set(''); + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + pubType: null, + careerStage: null, + tFrom: null, + tTo: null, + companyStatus: null, + operator: null, + page: null, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + } + + // called when a timespan thumb is released — persist to the URL and reload + onTimespanChange(): void { + if (this.timespanFrom() > this.timespanTo()) { + return; + } + this.writeTimespanToUrl(); + this.loadAuthors(); + } + + // the backend returns the full OpenAlex url; the profile route needs only the id + authorProfileId(author: RankedAuthor): string { + const parts = author.author_id.split('/'); + return parts[parts.length - 1]; + } + + isSelected(author: RankedAuthor): boolean { + return this.selectedIds().includes(this.authorProfileId(author)); + } + + toggleSelect(author: RankedAuthor): void { + const id = this.authorProfileId(author); + const current = this.selectedIds(); + + if (current.includes(id)) { + this.selectedIds.set(current.filter((existing) => existing !== id)); + return; + } + + if (current.length >= this.MAX_SELECTED) { + this.snackBar.open( + `Es können maximal ${this.MAX_SELECTED} Autoren verglichen werden.`, + 'OK', + { duration: 3000 }, + ); + return; + } + + this.selectedIds.set([...current, id]); + } + + // opens the compare page; everything needed is encoded in the URL so the link is shareable + compare(): void { + if (!this.canCompare()) { + return; + } + + this.router.navigate(['/compare'], { + queryParams: { + authors: this.selectedIds().join(','), + keywords: this.state.topicsList().join(','), + operator: this.keywordOperator(), + pubType: + this.selectedPubTypes().length > 0 + ? this.selectedPubTypes().join(',') + : null, + tFrom: this.timespanFrom(), + tTo: this.timespanTo(), + }, + }); + } + + private loadAuthors(): void { + const rawWeights = this.currentWeights().raw; + + const request: KeywordToAuthorRequest = { + keywords: this.state.topicsList(), + operator: this.keywordOperator(), + filter_type: 'topic', + publication_types: + this.selectedPubTypes().length > 0 + ? this.selectedPubTypes() + : undefined, + career_stages: + this.careerStages().length > 0 ? this.careerStages() : undefined, + weights: { + works: rawWeights['works'], + citation: rawWeights['citations'], + companies: rawWeights['companies'], + news: rawWeights['news'], + patents: rawWeights['patents'], + }, + timespan: { + from: this.timespanFrom(), + to: this.timespanTo(), + }, + company_status: this.companyStatus(), }; - console.log(requestPayload); - - /** - * TODO: - * this.personsService.searchPersons(requestPayload).subscribe({ - * next: results => this.persons.set(results), - * error: error => console.error(error), - * }); - */ + this.loading.set(true); + this.rankingService.rankAuthor(request).subscribe({ + next: (results) => { + this.authors.set(results); + this.loading.set(false); + }, + error: (error) => { + console.error(error); + this.authors.set([]); + this.loading.set(false); + }, + }); } } diff --git a/webapp/src/app/resolvers/selected-topics.resolver.ts b/webapp/src/app/resolvers/selected-topics.resolver.ts index aebb5b30..dac72e9a 100644 --- a/webapp/src/app/resolvers/selected-topics.resolver.ts +++ b/webapp/src/app/resolvers/selected-topics.resolver.ts @@ -1,8 +1,11 @@ import { inject } from '@angular/core'; import { ResolveFn } from '@angular/router'; -import { TopicPageV2, TopicsV2Service } from '../api'; +import { TopicPageV2, TopicsV2Service } from '../api'; -export const selectedTopicsResolver: ResolveFn = (route, state) => { +export const selectedTopicsResolver: ResolveFn = ( + route, + state, +) => { const topicIdQueryParamKey = (route.data['topicIdQueryParamKey'] as string) || 'topicId'; diff --git a/webapp/src/app/resolvers/utils/topic-colors.ts b/webapp/src/app/resolvers/utils/topic-colors.ts index eb9b97bb..4c91c3bf 100644 --- a/webapp/src/app/resolvers/utils/topic-colors.ts +++ b/webapp/src/app/resolvers/utils/topic-colors.ts @@ -71,7 +71,9 @@ export function classificationSectionColor( section: string | null | undefined, ): string { const letter = section?.trim().charAt(0).toUpperCase(); - const hue = (letter ? IPC_SECTION_HUES[letter] : undefined) ?? stableHue(section ?? 'section'); + const hue = + (letter ? IPC_SECTION_HUES[letter] : undefined) ?? + stableHue(section ?? 'section'); return `hsl(${normalizeHue(hue)} ${FIELD_COLOR_SATURATION}% ${FIELD_COLOR_LIGHTNESS}%)`; } diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index ccd910a4..cf3cc849 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -10,7 +10,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatDialog } from '@angular/material/dialog'; import { ConfirmationDialogComponent } from '../confirmation-dialog/confirmation-dialog.component'; import { MatCardContent, MatCardModule } from '@angular/material/card'; -import { MatProgressSpinner } from "@angular/material/progress-spinner"; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; type NavItem = { label: string; @@ -43,8 +43,8 @@ type NavItemGroup = { MatTooltipModule, MatCardModule, MatCardContent, - MatProgressSpinner -], + MatProgressSpinner, + ], templateUrl: './app-menu.component.html', styleUrl: './app-menu.component.scss', standalone: true, diff --git a/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.scss b/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.scss index 5c106e61..edb0d524 100644 --- a/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.scss +++ b/webapp/src/app/shared/ui/primary-category-year-aggregation-chart/primary-category-year-aggregation-chart.component.scss @@ -4,4 +4,4 @@ gap: 1rem; flex-wrap: wrap; margin-top: 1rem; -} \ No newline at end of file +} diff --git a/webapp/src/app/shared/ui/searchable-select/searchable-select.component.html b/webapp/src/app/shared/ui/searchable-select/searchable-select.component.html index 738488b9..89e64567 100644 --- a/webapp/src/app/shared/ui/searchable-select/searchable-select.component.html +++ b/webapp/src/app/shared/ui/searchable-select/searchable-select.component.html @@ -52,7 +52,10 @@ } - @for (element of fetchedElements().elements; track getSelectValue()(element)) { + @for ( + element of fetchedElements().elements; + track getSelectValue()(element) + ) { {{ getSelectLabel()(element) }} @if (getSelectDescription()) { diff --git a/webapp/src/app/shared/ui/searchable-select/searchable-select.component.ts b/webapp/src/app/shared/ui/searchable-select/searchable-select.component.ts index 28b6b388..03b7a658 100644 --- a/webapp/src/app/shared/ui/searchable-select/searchable-select.component.ts +++ b/webapp/src/app/shared/ui/searchable-select/searchable-select.component.ts @@ -81,7 +81,9 @@ export class SearchableSelectComponent { if (!fetchFn) { return of({ elements: [] } as Page); } - return fetchFn(term).pipe(catchError(() => of({ elements: [] } as Page))); + return fetchFn(term).pipe( + catchError(() => of({ elements: [] } as Page)), + ); }), tap(() => this.isLoading.set(false)), takeUntilDestroyed(this.destroyRef), diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html index 519dac93..0823bf1a 100644 --- a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html +++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.html @@ -27,23 +27,25 @@ {{ option.label }} - - - - -
- {{ formatRawWeightLabel(weightControl(option.key).value) }} +
+
+ unwichtig + neutral + wichtig +
+ + +
} @@ -57,6 +59,8 @@ } + + @if (showApplyButton) {
diff --git a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss index 592c7b7b..8c82b75c 100644 --- a/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss +++ b/webapp/src/app/shared/ui/weights-sliders/weights-sliders.component.scss @@ -53,16 +53,17 @@ $touch-target: 44px; margin-top: 0.1rem; } -.weight-row { +::ng-deep .weight-row { display: grid; - grid-template-columns: 1fr 1fr 40px; + grid-template-columns: 1fr 2fr; align-items: center; - gap: 0.2rem; + gap: 0.5rem; min-height: 34px; font-size: 0.8rem; + margin-bottom: 0.4rem; } -.weight-label { +::ng-deep .weight-label { display: flex; align-items: center; gap: 0.2rem; @@ -86,18 +87,25 @@ $touch-target: 44px; } } -.weight-slider { +::ng-deep .slider-container { + display: flex; + flex-direction: column; width: 100%; - height: 20px; /* reduced from 24px */ +} + +::ng-deep .weight-slider { + width: 100%; + height: 20px; margin: 0; } -.weight-value { - font-size: 0.75rem; - font-weight: 650; +::ng-deep .slider-labels { + display: flex; + justify-content: space-between; + font-size: 0.65rem; color: var(--sg-text-secondary); - text-align: right; - font-variant-numeric: tabular-nums; + margin-bottom: -4px; + padding: 0 6px; } /* ============================================================ @@ -154,23 +162,19 @@ $touch-target: 44px; TABLET & PHONE ============================================================ */ @media (max-width: $tablet) { - .weight-row { - grid-template-columns: 1fr 40px; + ::ng-deep .weight-row { + grid-template-columns: 1fr; gap: 0.15rem; padding: 0.1rem 0; } - .weight-label { + ::ng-deep .weight-label { grid-column: 1 / -1; font-size: 0.75rem; } - .weight-slider { - grid-column: 1 / 2; - } - - .weight-value { - grid-column: 2 / 3; + ::ng-deep .slider-container { + grid-column: 1 / -1; } .weight-actions { @@ -191,21 +195,21 @@ $touch-target: 44px; gap: 0.2rem; } - .weight-row { + ::ng-deep .weight-row { gap: 0.1rem; min-height: 30px; } - .weight-label { + ::ng-deep .weight-label { font-size: 0.7rem; } - .weight-slider { + ::ng-deep .weight-slider { height: 18px; } - .weight-value { - font-size: 0.7rem; + ::ng-deep .slider-labels { + font-size: 0.6rem; } .weight-actions {