Compare commits

..
Author SHA1 Message Date
kallweit 27433efe72 feat(news-keyword-search): add search bar
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build started...
2026-08-24 21:49:05 +02:00
kallweit 05eb4c49f7 refactor(news-/works-keyword-search): extract snippet logic 2026-08-24 21:49:05 +02:00
kallweit ab87b87072 fix(data-table): fill full background in extended row 2026-08-24 21:49:05 +02:00
kallweit 2878667727 feat(works-keyword-search): match keyword highlighting approach 2026-08-24 21:49:05 +02:00
kallweit 68f1cae4d9 feat(works-keyword-search): highlight keywords in their topic colors 2026-08-24 21:49:05 +02:00
kallweit bd4305e0eb feat(projects-keyword-search): set min-width for title and author columns 2026-08-24 21:49:05 +02:00
kallweit 46bf66c910 refactor(data-table): extract styling into shared css 2026-08-24 21:49:05 +02:00
kallweit 1bfa0f113d refactor(works/news/-keyword-search): remove expandable rows for fuzzy search 2026-08-24 21:49:05 +02:00
kallweit 1482e3fdc5 feat(news-keyword-search): expand row on click instead of opening article 2026-08-24 21:49:05 +02:00
kallweit 3f4b032e34 refactor(keyword-highlighting): drop the HTML-string path left unused after rebase 2026-08-24 21:49:05 +02:00
kallweit 56ada07d97 refactor(keyword-highlighting): remove duplication after rebase 2026-08-24 21:49:05 +02:00
kallweit 2f509fbbfe feat(keyword-search-works): expand rows to show matched content 2026-08-24 21:49:05 +02:00
genja 2c03f53604 Merge pull request 'fixed wrong fuzzy search toggler behaviour on navigating' (#303) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #303
2026-08-24 21:12:35 +02:00
genja 6609b64076 fixed wrong fuzzy search toggler behaviour on navigating
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-24 21:06:03 +02:00
Kazgatari a1889f13f6 consolidated same icons, created transient helper component to identify icons
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-24 18:23:55 +02:00
kallweit 0854c16a0b Merge pull request 'feature/news-in-keywords' (#301) from feature/news-in-keywords into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #301
2026-08-24 16:45:26 +02:00
kallweit 50ff313a57 refactor(news-keyword-search): adapt styling from projects
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-24 16:32:47 +02:00
kallweit 84073854bf feat(news-keyword-search): preview bigger excerpt 2026-08-24 14:49:36 +02:00
kallweit 9440605a6f refactor(news-keyword-search): adapt projects' highlighting approach and drop tooltips 2026-08-24 13:32:04 +02:00
kuzko 24b7364894 Merge pull request 'refactor/icons' (#300) from refactor/icons into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #300
2026-08-23 17:25:54 +02:00
Kazgatari 767f532e6f removed old unused components
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-23 17:15:56 +02:00
Kazgatari a21d5eaea4 changed other hardcoded icon values to variables 2026-08-23 17:06:20 +02:00
Kazgatari d8de0c2156 changed person-card to use global institution chip
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-23 16:46:37 +02:00
genja ba1c53b642 Merge pull request 'feature/keywords-analysis' (#299) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #299
2026-08-23 11:10:45 +02:00
genja ef00947786 disabled search button while new keyword is being added
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-23 11:03:46 +02:00
genja 9a4a4de379 prevented mouse event propagation in project tables 2026-08-23 11:00:21 +02:00
genja 04e3f97b8b prevented mouse event propagation for chips and togglers 2026-08-23 10:59:36 +02:00
genja 2bf8e03117 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis 2026-08-23 10:28:25 +02:00
tischer 1219970ba8 Merge pull request 'refactor/bio' (#298) from refactor/bio into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #298
2026-08-22 17:08:55 +02:00
Steven Tischer 5c50c29760 fix build: ensure client is closed after API calls
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-22 17:03:34 +02:00
Steven Tischer 5343c3204d execute pipeline
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
2026-08-22 16:48:55 +02:00
Steven Tischer 613640a730 add AI-generated badge to bio
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
2026-08-22 16:41:28 +02:00
Steven Tischer 3147de9fcb improve error handling in bio generation and update tests 2026-08-22 16:20:36 +02:00
Steven Tischer 7d3792c7b4 fix: update parameter documentation to use 'examples' instead of 'example'
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
2026-08-22 14:14:17 +02:00
Steven Tischer eb5d6830a5 test: add tests for person bio generation 2026-08-22 14:12:03 +02:00
Steven Tischer 7da36d8777 remove unused 'include' parameter 2026-08-22 14:04:03 +02:00
Steven Tischer 21482f3c6f refactor: move bio logic to a separate module 2026-08-22 13:59:29 +02:00
tischer b772b100d5 Merge pull request 'feat/ranking' (#296) from feat/ranking into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #296
2026-08-22 13:39:52 +02:00
Steven Tischer bbce780609 fix: update toggleSelect to select only 4 authors
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-22 13:34:47 +02:00
Steven Tischer d719a34ab0 add fuzzy search logic and remove some stats from compare page
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-22 13:08:59 +02:00
Steven Tischer 57d0daa21b enable fuzzy search button 2026-08-22 09:35:55 +02:00
kuzko 1ca3db5c78 Merge pull request 'refactor/icons' (#295) from refactor/icons into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #295
2026-08-18 20:17:52 +02:00
Kazgatari c85d3fa03f fix: bound routing link to signal to remove console error
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-18 20:07:57 +02:00
Kazgatari ffc02a4e59 fix: used set to deduplicate entries 2026-08-18 20:06:55 +02:00
Kazgatari 6c20dc2b58 added expandible toggle to associated institutions 2026-08-18 20:02:12 +02:00
Kazgatari 24cc476dbe implemented overview in institution and added guardrails for card to fetch new information if existing is incomplete 2026-08-18 19:56:56 +02:00
Kazgatari b2f55bd05a changed institutions to hold associated institution array 2026-08-18 19:55:48 +02:00
Kazgatari e153e2d74a Merge branch 'dev' of https://project.nes.uni-due.de/gitea/lbs/smartguide into refactor/icons 2026-08-18 18:27:38 +02:00
farajollahi 171b296c2a Merge pull request 'multi-organisations-statics' (#294) from multi-organisations-statics into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #294
2026-08-18 18:00:08 +02:00
Kazgatari 435c4ae3db added tooltip disable to undefined values for authors and institutions to avoid empty tooltips and links to undefined entities 2026-08-18 17:56:14 +02:00
Kazgatari ac6b5aa72b started with icon duplicate merge 2026-08-18 17:54:32 +02:00
farajollahi e8be0ae8aa Merge branch 'dev' into multi-organisations-statics
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-18 17:47:05 +02:00
kuzko 17e0909d69 Merge pull request 'refactor/icons' (#293) from refactor/icons into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #293
2026-08-18 12:25:21 +02:00
Kazgatari 3aa4c478f6 Merge branch 'dev' of https://project.nes.uni-due.de/gitea/lbs/smartguide into refactor/icons
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-18 12:13:27 +02:00
Kazgatari 9ef9e334fd refactor: changed all static icons to use central defined icons (duplicates not resolved) 2026-08-18 11:57:52 +02:00
genja e7269c6bd2 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-18 11:18:21 +02:00
genja 5aff658c16 replaced the keywords search results navbar with generic navbar component 2026-08-18 11:16:30 +02:00
khalti a40aca3dbe Merge pull request 'refactor(patents): share app-card-search/source-filter across patent page.' (#292) from ts-136-patent-to-researchers-v2 into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #292
2026-08-18 11:00:07 +02:00
khalti 95662119b1 fix(patent-table): resolve merge conflicts with dev
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-18 10:55:23 +02:00
Kazgatari 5b59aca4e6 fix: added option to disable tooltip on topic chip component
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-18 10:49:16 +02:00
khalti 83c809983c refactor(patents): share app-card-search/source-filter across patent page.
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
2026-08-18 10:39:01 +02:00
Kazgatari f5cd79a718 fix: incorrect colors in person card due to missing information
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-18 08:28:43 +02:00
genja 81b7e04b66 Merge pull request 'feature/keywords-analysis' (#291) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #291
2026-08-17 23:17:24 +02:00
genja 25cf39ff69 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-17 22:54:36 +02:00
genja 9a6bae2df4 applied generoc table-data-row for project tables 2026-08-17 22:54:14 +02:00
genja 6eb159cc03 added generic table-detail-row component 2026-08-17 22:52:20 +02:00
genja 6b7a036128 highlight only if keywords are there 2026-08-17 22:52:04 +02:00
genja da70af9163 minor bug fix 2026-08-17 22:46:25 +02:00
genja 09e5af0016 fixed default projects sorting by title for keyword search 2026-08-17 22:45:21 +02:00
genja 203d9cb6d4 fixed wrong highlighted items for dfg projects query 2026-08-17 22:39:44 +02:00
Louis dde38bb680 Merge pull request 'fix/nested-tooltip-hover' (#290) from fix/nested-tooltip-hover into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #290
2026-08-17 22:29:40 +02:00
Louis e7b6255e54 fix(sidebar): highlight nav item for detail pages, not just their list route
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-17 22:20:43 +02:00
Louis 0f9991b618 feat(institution-card): show country flag next to city/country subtitle 2026-08-17 22:08:52 +02:00
Louis ac97c9f496 fix(publication-card): cap tooltip width, size topics to content, truncate chip labels 2026-08-17 22:02:58 +02:00
Louis 8261de4a02 fix(tooltip): prevent tooltips from clipping off-screen near edges 2026-08-17 21:44:55 +02:00
Louis f69b3cf871 fix(tooltip): don't close a tooltip while a nested tooltip inside it is open 2026-08-17 20:23:48 +02:00
farajollahi 6e7a8237ef Merge branch 'refactor-multi-organisation' into multi-organisations-statics
LocationBasedServices/smartguide/pipeline/head This commit looks good
# Conflicts:
#	webapp/src/app/modules/dashboard/dashboard.component.ts
2026-08-17 16:43:29 +02:00
genja 4338b1cc0e Merge pull request 'feature/keywords-analysis' (#289) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #289
2026-08-17 14:53:48 +02:00
genja d5164f9863 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-17 14:48:46 +02:00
genja 86fc87f507 fixed wrong query param retrieval 2026-08-17 14:48:17 +02:00
genja 156e31643c added optional OR/AND matching of topic ids for projects search + changed keyword search from AND to OR matching 2026-08-17 14:48:00 +02:00
spsaefan dbe8f2449a Add institution tab navigation
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-17 14:30:38 +02:00
spsaefan 9c593a0d09 Update institution tab style 2026-08-17 14:30:09 +02:00
kallweit a21030309e Merge pull request 'feature/person-overview-wordcloud' (#288) from feature/person-overview-wordcloud into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #288
2026-08-17 14:18:47 +02:00
kallweit a8db8194cf feat(person-overview): add secondary action to tooltips in 'person interesting' section
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-17 14:04:12 +02:00
kallweit ce218cbfa1 feat(research-timeline): add secondary action to topic tooltip 2026-08-17 14:04:12 +02:00
kallweit ae80f0f812 feat(topic-card, person-overview): add optional secondary action to the topic card to link to person's publications 2026-08-17 14:04:12 +02:00
Louis fed1e56c81 Merge pull request 'refactor/list-card-heights' (#287) from refactor/list-card-heights into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #287
2026-08-17 00:16:03 +02:00
Louis e0d1f0df5c Merge remote-tracking branch 'origin/dev' into refactor/list-card-heights
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-17 00:05:35 +02:00
Louis 27301bf6a5 fix(card-search): keep a single result at normal card width
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-16 23:56:51 +02:00
Louis bbd4ff8685 fix(publications): refresh filter labels when a topic/author id is appended 2026-08-16 23:56:29 +02:00
Louis dbc53a9a49 fix(publication-card): stop card clicks navigating to /topic, wire chips to search filters 2026-08-16 23:56:11 +02:00
Louis 0f0f30f08c feat(publication-card): clamp title/topics/authors to fixed-height sections 2026-08-16 23:25:58 +02:00
Louis 6c3c43ef4f style(projects): wrap type filter chips in filter-card box 2026-08-16 23:00:13 +02:00
Louis a5f6ccc75b style(patents): align filter row with News's design and card grid 2026-08-16 22:37:12 +02:00
Louis cfa2c768eb fix(patents): clamp patent title to 3 lines 2026-08-16 22:26:18 +02:00
kuzko 54e0701698 Merge pull request 'refactor/static_topic_cache' (#285) from refactor/static_topic_cache into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #285
2026-08-16 22:24:23 +02:00
Louis 4a61c00642 fix(project-card): clamp title to prevent row-to-row height drift 2026-08-16 22:18:38 +02:00
Kazgatari 49c45cb924 Merge branch 'dev' of https://project.nes.uni-due.de/gitea/lbs/smartguide into refactor/static_topic_cache
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-16 22:13:52 +02:00
Kazgatari ad14f60a2c changed icons 2026-08-16 22:13:33 +02:00
Louis 2bcd1d4586 fix(institution-card): stabilize header heigh 2026-08-16 22:06:53 +02:00
genja 5d2d694a20 Merge pull request 'feature/keywords-analysis' (#284) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #284
2026-08-16 22:01:01 +02:00
Louis dc31b21dac fix(topic-card): stabilize header height and cap description length 2026-08-16 21:56:17 +02:00
genja d28a662da3 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-16 21:38:23 +02:00
genja 8a418a99b4 enabled project detail row only for projects where highlighted content is persistent 2026-08-16 21:38:01 +02:00
genja 17100024e5 moved topic resolving to search results state service 2026-08-16 21:36:32 +02:00
genja 9b95728c7b bund project field fixed 2026-08-16 21:36:12 +02:00
Kazgatari 4937889968 regenerate frontend 2026-08-16 21:19:05 +02:00
Kazgatari 36773c4ae2 Merge branch 'dev' of https://project.nes.uni-due.de/gitea/lbs/smartguide into refactor/static_topic_cache 2026-08-16 21:04:50 +02:00
Kazgatari 353d938d3e topic hierarchy model addition in backend and component change in frontend 2026-08-16 21:03:51 +02:00
genja f02e510847 expanded row view adjusted for DFG project table 2026-08-16 20:48:32 +02:00
genja 6e0acb9cde added expanded row for EU projects table 2026-08-16 20:47:23 +02:00
genja a0fdc8799b added expanded Row for bund project table 2026-08-16 20:47:03 +02:00
genja f4656fcf39 fixed eu projects resolver 2026-08-16 20:46:16 +02:00
genja d73ee592ea fixed Bund highlight model 2026-08-16 20:45:55 +02:00
Louis c6e1051059 Merge pull request 'fix/wordcloud-legend-highlight' (#283) from fix/wordcloud-legend-highlight into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #283
2026-08-16 20:40:37 +02:00
Louis 014364ec03 fix/wordcloud-legend-highlight
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-16 20:24:19 +02:00
Kazgatari 024724b51d removed cache logic from patents 2026-08-16 19:14:26 +02:00
Kazgatari 7798cdaea5 cleanup of comments and changed import signature in main 2026-08-16 17:54:30 +02:00
Kazgatari a1b9f5a084 removed old service manualy from generated files for now 2026-08-16 17:52:57 +02:00
Kazgatari 6f79733b3e removed topic cache and all affiliated files to see what breaks 2026-08-16 17:35:20 +02:00
genja 9cb01cab45 Merge pull request 'feature/keywords-analysis' (#282) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #282
2026-08-15 23:41:55 +02:00
genja fc30865f34 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-15 23:16:36 +02:00
genja b2a8af532d updated DFG projects model 2026-08-15 23:12:49 +02:00
genja bee9b6e8fd added details row for dfg projects 2026-08-15 23:01:04 +02:00
genja cbd2e902a7 adjusted logic for news highligting to use the generic highlight text component 2026-08-15 22:21:38 +02:00
genja 2cb6d1f660 generic highlight text component added 2026-08-15 22:20:40 +02:00
genja ae2230ff0e moved dfg classification hierarchy to separated component 2026-08-15 22:19:42 +02:00
genja 12914208cd regenerated dfg Project model + added keyword to topic id computed property to search results service 2026-08-15 22:18:52 +02:00
genja abb11077de added global styles for highlighted content 2026-08-15 22:17:01 +02:00
genja ef1a5ad7a1 removed unused fields from DFG project model 2026-08-15 22:16:41 +02:00
kallweit ed919832d8 Merge pull request 'feature/news-in-keywords' (#281) from feature/news-in-keywords into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #281
2026-08-15 20:54:24 +02:00
kallweit ef2ea46882 refactor(news): move keyword highlighting back to news details
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-15 20:49:41 +02:00
kallweit da9516331e feat(news-keyword-search): align table content to the left 2026-08-15 20:49:41 +02:00
kallweit bd581e6004 refactor(news-keyword-search): refactor keyword highlighting to show tooltips 2026-08-15 20:49:41 +02:00
kallweit e37f636236 feat(news-keyword-search): expand rows to show article excerpt and highlight keyword in topic color. 2026-08-15 20:49:41 +02:00
khalti 0ec47e42e4 Merge pull request 'refactor(patents, person-funding): reuse shared app-card-search/app-data-table component' (#280) from ts-136-patent-to-researchers-v2 into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #280
2026-08-15 20:47:59 +02:00
khalti 1369a2bf29 refactor(patents, person-funding): reuse shared app-card-search/app-data-table component
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-15 20:43:52 +02:00
tischer e0704bc8a5 Merge pull request 'feat/ranking' (#279) from feat/ranking into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #279
2026-08-15 12:48:05 +02:00
Steven Tischer d8041751c5 feat(weights-sliders): improve layout of weight labels and icons for better responsiveness
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-15 12:44:00 +02:00
Steven Tischer 87b283ccfb feat(search-results): enhance Fuzzy Search behavior and tooltip logic for improved user experience
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-15 12:40:03 +02:00
Steven Tischer 16d44a0b88 feat(publication-type-counts): implement API for counting works by publication type 2026-08-15 12:23:16 +02:00
Steven Tischer 07f8e8bcca feat(compare-authors): add author profile link 2026-08-15 11:58:07 +02:00
Steven Tischer cbfa60ae46 feat(compare-authors): add name matching note to section 2 2026-08-15 11:42:35 +02:00
tischer 89ce894066 Merge pull request 'feat/ranking' (#278) from feat/ranking into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #278
2026-08-15 11:41:19 +02:00
Steven Tischer 66487c20e7 feat(weights-sliders): add name matching hint with visual indicators 2026-08-15 11:35:36 +02:00
Steven Tischer 08bc87e764 Merge branch 'dev' into feat/ranking
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev This commit looks good
2026-08-15 11:26:07 +02:00
khalti 22afd0fbb5 Merge pull request 'refactor(patents): extract shared app-patent-table component built on app-data-table, used by person/institution/keywords patent views' (#277) from ts-136-patent-to-researchers-v2 into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #277
2026-08-13 22:06:21 +02:00
khalti 5633b412d4 refactor(patents): extract shared app-patent-table component built on app-data-table, used by person/institution/keywords patent views
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-13 22:01:53 +02:00
genja bd030ccb9f regenerated modules and services
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-13 15:30:17 +02:00
genja 41037efd6f updated project search queries for highlighting found content 2026-08-13 15:29:37 +02:00
genja 81c4094708 added/updated models for text highlighting of projects search results 2026-08-13 15:29:11 +02:00
genja 6382987990 Show loading icons when resolving components externally
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-13 13:19:12 +02:00
genja 3276bf46a7 Move filtered subject to top of subject list 2026-08-13 13:17:57 +02:00
genja da1a5b732d fixed bug where matching by topic produces invalid payload 2026-08-13 12:05:37 +02:00
genja 5702223716 Merge pull request 'feature/keywords-analysis' (#276) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #276
2026-08-12 12:43:35 +02:00
genja 21da33be11 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-08-12 12:39:01 +02:00
genja 8b150a81a0 popup animation added to cards
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-11 13:26:29 +02:00
genja 91efbdffeb moved project card into generic component 2026-08-11 13:26:11 +02:00
genja 0dd2a5743d bound the new error propagation to uni trend resolver 2026-08-11 11:46:08 +02:00
genja f8678af87e updated UI for error component, status, details, etc. 2026-08-11 11:45:48 +02:00
genja 5e7f968808 centralized the error handling in error.service 2026-08-11 11:45:24 +02:00
Steven Tischer 0b6a74a8e3 fix: update type hints from List to built-in list for consistency
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-08-03 20:23:51 +02:00
Steven Tischer da59e8137f Merge branch 'dev' into feat/ranking 2026-08-03 20:18:39 +02:00
Steven Tischer 103b6180d0 table 3: replace legend with app-chip component for author display
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-24 11:17:14 +02:00
Steven Tischer 6edca93c1c replace app-chip with app-topic-chip for keyword display and implement keyword color resolution 2026-07-24 11:04:13 +02:00
Steven Tischer a7548d59c0 center align table header cells in comparison table 2026-07-24 10:32:52 +02:00
Steven Tischer 8b1f7d6eb3 center align author and value cells in comparison table 2026-07-24 10:29:56 +02:00
Steven Tischer ff3ac03520 replace author name display with app-chip component 2026-07-24 10:27:40 +02:00
Steven Tischer e51d3095bc update table 3 2026-07-24 10:23:50 +02:00
Steven Tischer d19003d531 update table 2 2026-07-24 10:12:09 +02:00
Steven Tischer 6d5dd88e50 update German labels and hints for clarity in author comparison table 1 2026-07-24 10:04:59 +02:00
Steven Tischer de70973296 enhance metadata display and integrate chip component 2026-07-24 09:39:43 +02:00
Steven Tischer 2a5f104739 enhance filter layout and integrate component year range slider 2026-07-24 09:22:01 +02:00
Steven Tischer 71bd10b303 Merge branch 'dev' into feat/ranking
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-24 09:01:10 +02:00
Steven Tischer 97b7fe6a6f add topic treemap component and integrate into author comparison view
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-23 14:03:21 +02:00
Steven Tischer eb84d3014f update topic profile query and enhance data models with IDs 2026-07-23 13:56:21 +02:00
Steven Tischer 2bdee21169 remove devcontainer from git 2026-07-23 13:41:10 +02:00
Steven Tischer a278ad300f add field, subfield, and topic nodes for topic treemap (backend) 2026-07-23 09:47:14 +02:00
485 changed files with 29998 additions and 42782 deletions
+3 -1
View File
@@ -19,4 +19,6 @@ angular-app/.angular
# Ignore sentence-transformer local model cache
service/sentence_transformer/models/
llm_evaluations/bio_generation/.venv
llm_evaluations/bio_generation/.venv
.devcontainer
File diff suppressed because it is too large Load Diff
@@ -29,12 +29,17 @@ async def get_institution_by_id(
raw_oa_institution_id=institution_id,
source=[
"id",
"ror",
"display_name",
"country_code",
"type",
"homepage_url",
"display_name_alternatives",
"works_count",
"cited_by_count",
"geo",
"summary_stats",
"associated_institutions",
],
)
@@ -43,6 +43,8 @@ async def call(
)
except APIConnectionError:
return "Etwas ist schiefgelaufen. Bitte versuche es später erneut."
finally:
await client.close()
return response.choices[0].message.content or (
"Etwas ist schiefgelaufen. Bitte versuche es erneut."
@@ -126,5 +128,7 @@ async def call_stream(
print(f"LLM streaming failed: {type(e).__name__}: {e}")
traceback.print_exc()
return ""
finally:
await client.close()
return full_content
-193
View File
@@ -1,193 +0,0 @@
"""
This module defines the business logic for our
web service.
"""
import json
import logging
from inse.integrations import elasticsearch
from inse.models.openalex.topic import Topic
from inse.models.openalex.topic_domain import TopicDomain
from inse.models.openalex.topic_field import TopicField
from inse.models.openalex.topic_subfield import TopicSubfield
logger = logging.getLogger(__name__)
topic_cache_filename: str = "topic_hierarchy_cache.json"
def _load_topic_cache() -> dict:
"""Loads the topic hierarchy cache from a JSON file."""
import os
try:
cache_path = "/data/" + topic_cache_filename
if not os.path.exists(cache_path):
current_dir = os.path.dirname(__file__)
cache_path = os.path.join(current_dir, "..", "data", topic_cache_filename)
with open(cache_path, "r", encoding="utf-8") as f:
return json.load(f)
except Exception as exc:
logger.warning("Failed to load topic hierarchy cache: %s", exc)
return {}
async def build_topic_cache(save_json: bool = True) -> dict:
"""
Fetch topics from the hosted OpenAlex topics index and build a lookup cache (scheduled task).
Arguments:
save_json (bool): Whether to save the cache as a JSON file (default: True)
Returns:
taxonomy_cache (dict): The topic hierarchy dictionary.
"""
output_filename: str = "topic_hierarchy_cache.json"
taxonomy_cache = {}
try:
async for hit in elasticsearch.scan(
index="openalex-topics",
query={"match_all": {}},
source=["display_name", "name", "id", "subfield", "field", "domain"],
cluster="nes",
):
source = hit.get("_source", {})
topic_name = source.get("display_name") or source.get("name")
if not topic_name:
continue
taxonomy_cache[topic_name] = {
"topic_id": source.get("id") or hit.get("_id", ""),
"subfield": source.get("subfield", {}).get("display_name", ""),
"field": source.get("field", {}).get("display_name", ""),
"domain": source.get("domain", {}).get("display_name", ""),
}
except Exception as exc:
logger.error("Failed to scan topics from Elasticsearch: %s", exc)
logger.info("Processed %s topics total", len(taxonomy_cache))
if save_json:
data_json = json.dumps(taxonomy_cache, indent=2, ensure_ascii=True)
try:
output_path = "/data/" + output_filename
with open(output_path, "w", encoding="utf-8") as f:
f.write(data_json)
logger.info("Topic hierarchy cache written to %s", output_path)
except Exception as exc:
logger.warning("Failed to write topic hierarchy cache: %s", exc)
return taxonomy_cache
def get_topics_from_cache(topic_names: list[str]) -> list[Topic]:
"""
Given a list of topic names, retrieves their hierarchy information from the cache and returns a list of Topic models.
Arguments:
topic_names (List[str]): A list of topic names to retrieve.
Returns:
List[Topic]: A list of Topic models.
"""
cache = _load_topic_cache()
topics = []
for name in topic_names:
data = cache.get(name)
if not data:
continue
subfield_name = data.get("subfield", "")
field_name = data.get("field", "")
domain_name = data.get("domain", "")
topics.append(
Topic(
id=data.get("topic_id", ""),
display_name=name,
works_count=data.get("count", 1),
subfield=TopicSubfield(display_name=subfield_name)
if subfield_name
else None,
field=TopicField(display_name=field_name) if field_name else None,
domain=TopicDomain(display_name=domain_name) if domain_name else None,
)
)
return topics
def count_topic_hierarchy(topic_names: list[str]) -> dict:
"""
Given a list of topic names, counts the occurrences of each topic and their hierarchy levels (subfield, field, domain) using the cache.
Arguments:
topic_names (List[str]): A list of topic names to count.
Returns:
dict: A dictionary containing the counts of each hierarchy level.
"""
cache = _load_topic_cache()
counts = {"topics": {}, "subfields": {}, "fields": {}, "domains": {}}
for name in topic_names:
data = cache.get(name)
if not data:
continue
counts["topics"][name] = counts["topics"].get(name, 0) + 1
subfield = data.get("subfield", "")
if subfield:
counts["subfields"][subfield] = counts["subfields"].get(subfield, 0) + 1
field = data.get("field", "")
if field:
counts["fields"][field] = counts["fields"].get(field, 0) + 1
domain = data.get("domain", "")
if domain:
counts["domains"][domain] = counts["domains"].get(domain, 0) + 1
return counts
def get_topic_hierarchy() -> dict:
"""
Builds and returns a hierarchical tree structure of topics:
Domains -> Fields -> Subfields -> Topics
"""
flat_cache = _load_topic_cache()
tree = {}
for topic_name, info in flat_cache.items():
domain = info.get("domain") or "Unbekannter Bereich"
field = info.get("field") or "Unbekanntes Feld"
subfield = info.get("subfield") or "Unbekanntes Teilfeld"
topic_id = info.get("topic_id", "")
# Clean topic ID to just be the trailing ID or keep full URL
# For querying, display name is used in persons search, but ID is useful
if domain not in tree:
tree[domain] = {}
if field not in tree[domain]:
tree[domain][field] = {}
if subfield not in tree[domain][field]:
tree[domain][field][subfield] = []
tree[domain][field][subfield].append({"id": topic_id, "name": topic_name})
formatted_domains = []
for d_name, d_fields in tree.items():
formatted_fields = []
for f_name, f_subfields in d_fields.items():
formatted_subfields = []
for sf_name, sf_topics in f_subfields.items():
sf_topics.sort(key=lambda x: x["name"])
formatted_subfields.append({"name": sf_name, "topics": sf_topics})
formatted_subfields.sort(key=lambda x: x["name"])
formatted_fields.append({"name": f_name, "subfields": formatted_subfields})
formatted_fields.sort(key=lambda x: x["name"])
formatted_domains.append({"name": d_name, "fields": formatted_fields})
formatted_domains.sort(key=lambda x: x["name"])
return {"domains": formatted_domains}
-3
View File
@@ -64,7 +64,6 @@ from inse.works.service import router as works_service_router
from inse.works.v2.router import router as works_v2_router
from . import config
from .service import router as service_router
logger = logging.getLogger(__name__)
@@ -119,8 +118,6 @@ app.include_router(patents_all_router)
app.include_router(keywords_service_router)
app.include_router(keywords_patents_router)
app.include_router(service_router)
app.include_router(auth_router)
app.include_router(account_management_router)
app.include_router(organization_management_router)
+2 -2
View File
@@ -108,10 +108,10 @@ class BundProject(BaseModel):
examples=["Deutschland"],
)
implementing_agency: str | None = Field(
executing_agency: str | None = Field(
default=None,
validation_alias="Ausführende Stelle",
description="The implementing agency of the project",
description="The executing agency of the project",
examples=[
"Universität Duisburg-Essen - Fachbereich Allgemeine Informatik - Lehrstuhl Networked Embedded Systems (NES)"
],
@@ -25,6 +25,7 @@ from pydantic_core import to_jsonable_python
from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner
from inse.models.openalex.author_summary_stats import AuthorSummaryStats
from inse.models.openalex.dehydrated_institution import DehydratedInstitution
from inse.models.openalex.institution_geo import InstitutionGeo
from inse.models.openalex.institution_ids import InstitutionIds
@@ -51,9 +52,10 @@ class Institution(BaseModel):
ids: InstitutionIds | None = None
counts_by_year: list[AuthorCountsByYearInner] | None = Field(default=None, description="`works_count` and `cited_by_count` for each of the last ten years.")
works_api_url: StrictStr | None = Field(default=None, description="A URL that will get you a list of all works affiliated with this institution.")
associated_institutions: list[DehydratedInstitution] | None = Field(default=None, description="Associated institutions list.")
created_date: date | None = Field(default=None, description="When this institution was added to OpenAlex (ISO 8601 date).")
updated_date: datetime | None = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).")
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"]
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "associated_institutions", "created_date", "updated_date"]
@field_validator('type')
def type_validate_enum(cls, value):
@@ -151,6 +153,7 @@ class Institution(BaseModel):
"ids": InstitutionIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None,
"counts_by_year": [AuthorCountsByYearInner.from_dict(_item) for _item in obj["counts_by_year"]] if obj.get("counts_by_year") is not None else None,
"works_api_url": obj.get("works_api_url"),
"associated_institutions": [DehydratedInstitution.from_dict(_item) for _item in obj["associated_institutions"]] if obj.get("associated_institutions") is not None else None,
"created_date": obj.get("created_date"),
"updated_date": obj.get("updated_date")
})
@@ -94,7 +94,10 @@ class Work(BaseModel):
content_url: StrictStr | None = Field(default=None, description="URL for downloading full-text content. Only present when `has_content.pdf` or `has_content.grobid_xml` is true.")
created_date: date | None = Field(default=None, description="When this work was added to OpenAlex (ISO 8601 date).")
updated_date: datetime | None = Field(default=None, description="When this work was last updated (ISO 8601 datetime).")
__properties: ClassVar[list[str]] = ["id", "doi", "title", "display_name", "publication_year", "publication_date", "type", "language", "cited_by_count", "is_retracted", "is_paratext", "primary_location", "locations", "best_oa_location", "open_access", "authorships", "ids", "biblio", "abstract_inverted_index", "referenced_works", "referenced_works_count", "related_works", "topics", "primary_topic", "keywords", "funders", "awards", "fwci", "citation_normalized_percentile", "cited_by_percentile_year", "counts_by_year", "sustainable_development_goals", "mesh", "indexed_in", "has_content", "content_url", "created_date", "updated_date"]
snippet: StrictStr | None = Field(default=None, description="Passage of the title or abstract containing the searched keyword, with the matches wrapped in `<em>`. Only set by the keyword search, and only when the keyword actually occurs in the text.")
snippet_field: StrictStr | None = Field(default=None, description="Which field `snippet` was taken from: `title` or `abstract`.")
matched_via: list[StrictStr] | None = Field(default=None, description="Names of the topics and OpenAlex keywords that matched the searched keywords. Set by the keyword search so a work matched purely on metadata can explain itself when there is no `snippet`.")
__properties: ClassVar[list[str]] = ["id", "doi", "title", "display_name", "publication_year", "publication_date", "type", "language", "cited_by_count", "is_retracted", "is_paratext", "primary_location", "locations", "best_oa_location", "open_access", "authorships", "ids", "biblio", "abstract_inverted_index", "referenced_works", "referenced_works_count", "related_works", "topics", "primary_topic", "keywords", "funders", "awards", "fwci", "citation_normalized_percentile", "cited_by_percentile_year", "counts_by_year", "sustainable_development_goals", "mesh", "indexed_in", "has_content", "content_url", "created_date", "updated_date", "snippet", "snippet_field", "matched_via"]
model_config = ConfigDict(
validate_by_name=True,
@@ -273,7 +276,10 @@ class Work(BaseModel):
"has_content": WorkHasContent.from_dict(obj["has_content"]) if obj.get("has_content") is not None else None,
"content_url": obj.get("content_url"),
"created_date": obj.get("created_date"),
"updated_date": obj.get("updated_date")
"updated_date": obj.get("updated_date"),
"snippet": obj.get("snippet"),
"snippet_field": obj.get("snippet_field"),
"matched_via": obj.get("matched_via")
})
return _obj
+28 -19
View File
@@ -11,6 +11,12 @@ from inse.exceptions import ElasticsearchException
from ..integrations import elasticsearch, llm
from ..persons.logic import find_ude_author_by_name, get_author_name_by_id
from ..snippets import (
FRAGMENT_FIELD,
HIGHLIGHT_TAGS,
SNIPPET_FRAGMENT_CHARS,
snippet_with_context,
)
from ..topics.logic import vector_search_topics_batch
from .model import (
MatchedTopic,
@@ -30,6 +36,19 @@ TOPICS_INDEX = "aktuell_openalex_topics"
_SESSION_TOPIC_CACHE: dict[str, list] = {}
PREVIEW_WORD_COUNT = 80
CONTENT_HIGHLIGHT = {
"fields": {
"full_content": {
**FRAGMENT_FIELD,
"no_match_size": SNIPPET_FRAGMENT_CHARS,
}
},
**HIGHLIGHT_TAGS,
"require_field_match": False,
}
KEYWORD_LIMIT = 6
KEYWORD_CONTENT_CHARS = 4000
KEYWORD_SYSTEM_PROMPT = """\
@@ -87,13 +106,6 @@ async def search_news(
) -> NewsPage:
offset = (page - 1) * page_size
highlight = {
"fields": {"full_content": {"fragment_size": 200, "number_of_fragments": 1}},
"pre_tags": ["<em>"],
"post_tags": ["</em>"],
"encoder": "html",
}
# Filter einmal berechnen (der Relevanz-Filter macht eine ES-Abfrage).
clauses = await _filter_clauses(year_from, year_to, relevance_values)
exact_query = {
@@ -115,7 +127,7 @@ async def search_news(
size=page_size,
offset=offset,
sort=None,
highlight=highlight,
highlight=CONTENT_HIGHLIGHT,
)
news_page = await _build_page(response, page, page_size)
@@ -142,6 +154,7 @@ async def search_news_by_keywords(
year_to: int | None = None,
relevance_values: list | None = None,
sort_order: str | None = None,
title: str | None = None,
) -> NewsPage:
"""Searches the news for the keywords of a keywords-search run.
@@ -177,6 +190,9 @@ async def search_news_by_keywords(
return _empty_page(page, page_size)
clauses = await _filter_clauses(year_from, year_to, relevance_values)
if title and title.strip():
clauses.append({"match_phrase_prefix": {"maintitle": title.strip()}})
query = {
"bool": {
"should": should,
@@ -185,13 +201,6 @@ async def search_news_by_keywords(
}
}
highlight = {
"fields": {"full_content": {"fragment_size": 200, "number_of_fragments": 1}},
"pre_tags": ["<em>"],
"post_tags": ["</em>"],
"encoder": "html",
}
sort = [{"date_full": sort_order}] if sort_order in ("asc", "desc") else None
response = await _run_search(
@@ -200,7 +209,7 @@ async def search_news_by_keywords(
size=page_size,
offset=(page - 1) * page_size,
sort=sort,
highlight=None if wanted_topic_ids else highlight,
highlight=None if wanted_topic_ids else CONTENT_HIGHLIGHT,
)
news_page = await _build_page(response, page, page_size)
@@ -761,7 +770,7 @@ def _parse_hit(hit: dict) -> NewsArticle:
fragments = hit.get("highlight", {}).get("full_content")
if fragments:
snippet = fragments[0]
snippet = snippet_with_context(source.get("full_content"), fragments)
else:
snippet = _make_preview(source)
@@ -776,14 +785,13 @@ def _parse_hit(hit: dict) -> NewsArticle:
def _make_preview(source: dict) -> str | None:
text = source.get("intro_content") or source.get("full_content")
text = source.get("full_content") or source.get("intro_content")
if not text:
return None
words = text.split()
PREVIEW_WORD_COUNT = 10
preview = " ".join(words[:PREVIEW_WORD_COUNT])
if len(words) > PREVIEW_WORD_COUNT:
preview = preview + " …"
@@ -874,3 +882,4 @@ async def _related_search_terms(query_text: str) -> list:
terms.append(term)
return terms
+5
View File
@@ -147,6 +147,10 @@ async def search_news_by_keywords(
pattern="^(asc|desc)$",
),
] = None,
title: Annotated[
str | None,
Query(description="Narrows the results to articles whose title matches this text."),
] = None,
):
return await logic.search_news_by_keywords(
keywords=keywords or [],
@@ -159,6 +163,7 @@ async def search_news_by_keywords(
year_from=year_from,
year_to=year_to,
relevance_values=_parse_relevance(relevance),
title=title,
)
@@ -12,19 +12,89 @@ from inse.patents.common import model
from inse.patents.ipc_lookup import extract_ipc_symbol, parse_ipc_symbol
MAPPING_FILENAME = "ipc_openalex_topic_mapping.json"
TOPIC_CACHE_FILENAME = "topic_hierarchy_cache.json"
LEVELS = ("section", "class", "subclass", "group", "subgroup")
MATCH_LEVELS = ("subgroup", "group", "subclass")
@dataclass(frozen=True)
class MappedOpenAlexTopic:
topic_id: str
topic_display_name: str | None = None
subfield_id: str | None = None
field_id: str | None = None
domain_id: str | None = None
subfield_name: str | None = None
field_name: str | None = None
domain_name: str | None = None
ipc_level: str | None = None
ipc_symbol: str | None = None
# High-frequency IPC subclasses missing from the ES-built mapping file.
SUBCLASS_TOPIC_OVERRIDES: dict[str, str] = {
"A61B": "Cardiac electrophysiology and arrhythmias",
"A61K": "Pharmaceutical studies and practices",
"A61P": "Cancer Immunotherapy and Biomarkers",
"C07K": "Cancer Immunotherapy and Biomarkers",
"C12N": "Biotechnology and Related Fields",
"C12Q": "Cancer Immunotherapy and Biomarkers",
"G01N": "Analytical Methods in Pharmaceuticals",
SUBCLASS_TOPIC_OVERRIDES: dict[str, MappedOpenAlexTopic] = {
"A61B": MappedOpenAlexTopic(
topic_id="https://openalex.org/T10217",
topic_display_name="Cardiac electrophysiology and arrhythmias",
subfield_name="Cardiology and Cardiovascular Medicine",
field_name="Medicine",
domain_name="Health Sciences",
ipc_level="subclass",
ipc_symbol="A61B",
),
"A61K": MappedOpenAlexTopic(
topic_id="https://openalex.org/T12015",
topic_display_name="Pharmaceutical studies and practices",
subfield_name="Pharmacology",
field_name="Pharmacology, Toxicology and Pharmaceutics",
domain_name="Health Sciences",
ipc_level="subclass",
ipc_symbol="A61K",
),
"A61P": MappedOpenAlexTopic(
topic_id="https://openalex.org/T11537",
topic_display_name="Cancer Immunotherapy and Biomarkers",
subfield_name="Oncology",
field_name="Medicine",
domain_name="Health Sciences",
ipc_level="subclass",
ipc_symbol="A61P",
),
"C07K": MappedOpenAlexTopic(
topic_id="https://openalex.org/T11537",
topic_display_name="Cancer Immunotherapy and Biomarkers",
subfield_name="Oncology",
field_name="Medicine",
domain_name="Health Sciences",
ipc_level="subclass",
ipc_symbol="C07K",
),
"C12N": MappedOpenAlexTopic(
topic_id="https://openalex.org/T10041",
topic_display_name="Biotechnology and Related Fields",
subfield_name="Biotechnology",
field_name="Immunology and Microbiology",
domain_name="Life Sciences",
ipc_level="subclass",
ipc_symbol="C12N",
),
"C12Q": MappedOpenAlexTopic(
topic_id="https://openalex.org/T11537",
topic_display_name="Cancer Immunotherapy and Biomarkers",
subfield_name="Oncology",
field_name="Medicine",
domain_name="Health Sciences",
ipc_level="subclass",
ipc_symbol="C12Q",
),
"G01N": MappedOpenAlexTopic(
topic_id="https://openalex.org/T10487",
topic_display_name="Analytical Methods in Pharmaceuticals",
subfield_name="Analytical Chemistry",
field_name="Chemistry",
domain_name="Physical Sciences",
ipc_level="subclass",
ipc_symbol="G01N",
),
}
_TOPIC_LABEL_STOPWORDS = frozenset({
@@ -92,20 +162,6 @@ def _meaningful_topic_tokens(label: str) -> set[str]:
}
@dataclass(frozen=True)
class MappedOpenAlexTopic:
topic_id: str
topic_display_name: str | None = None
subfield_id: str | None = None
field_id: str | None = None
domain_id: str | None = None
subfield_name: str | None = None
field_name: str | None = None
domain_name: str | None = None
ipc_level: str | None = None
ipc_symbol: str | None = None
@dataclass(frozen=True)
class OpenAlexTopicRefs:
topic_ids: frozenset[str]
@@ -141,84 +197,11 @@ def _mapping_path() -> str:
return os.path.join(_data_dir(), MAPPING_FILENAME)
@lru_cache(maxsize=1)
def _load_topic_cache() -> dict[str, dict[str, str]]:
path = os.path.join(_data_dir(), TOPIC_CACHE_FILENAME)
try:
with open(path, encoding="utf-8") as handle:
raw = json.load(handle)
except (OSError, json.JSONDecodeError):
return {}
if not isinstance(raw, dict):
return {}
return {
display_name: {
"topic_id": str(info.get("topic_id", "")),
"subfield": info.get("subfield"),
"field": info.get("field"),
"domain": info.get("domain"),
}
for display_name, info in raw.items()
if isinstance(info, dict) and info.get("topic_id")
}
def _enrich_mapped_topic(mapped: MappedOpenAlexTopic) -> MappedOpenAlexTopic:
cache = _load_topic_cache()
topic_name = mapped.topic_display_name or ""
info = cache.get(topic_name)
if info is None:
for candidate in cache.values():
if candidate.get("topic_id") == mapped.topic_id:
info = candidate
break
if info is None:
return mapped
return MappedOpenAlexTopic(
topic_id=mapped.topic_id,
topic_display_name=mapped.topic_display_name or topic_name,
subfield_id=mapped.subfield_id,
field_id=mapped.field_id,
domain_id=mapped.domain_id,
subfield_name=info.get("subfield"),
field_name=info.get("field"),
domain_name=info.get("domain"),
ipc_level=mapped.ipc_level,
ipc_symbol=mapped.ipc_symbol,
)
def _mapped_from_topic_name(
topic_display_name: str,
*,
ipc_level: str,
ipc_symbol: str,
) -> MappedOpenAlexTopic | None:
cache = _load_topic_cache()
info = cache.get(topic_display_name)
if info is None:
return None
return _enrich_mapped_topic(
MappedOpenAlexTopic(
topic_id=info["topic_id"],
topic_display_name=topic_display_name,
ipc_level=ipc_level,
ipc_symbol=ipc_symbol,
)
)
def _apply_subclass_overrides(
parsed: dict[str, dict[str, MappedOpenAlexTopic]],
) -> None:
for symbol, topic_name in SUBCLASS_TOPIC_OVERRIDES.items():
mapped = _mapped_from_topic_name(
topic_name,
ipc_level="subclass",
ipc_symbol=_normalize_symbol(symbol),
)
if mapped is not None:
parsed["subclass"][_normalize_symbol(symbol)] = mapped
for symbol, mapped in SUBCLASS_TOPIC_OVERRIDES.items():
parsed["subclass"][_normalize_symbol(symbol)] = mapped
@lru_cache(maxsize=1)
@@ -239,19 +222,17 @@ def load_ipc_openalex_mapping() -> dict[str, dict[str, MappedOpenAlexTopic]]:
if not topic_id:
continue
normalized_symbol = _normalize_symbol(symbol)
mapped = _enrich_mapped_topic(
MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=entry.get("topic_display_name"),
subfield_id=entry.get("subfield_id"),
field_id=entry.get("field_id"),
domain_id=entry.get("domain_id"),
subfield_name=entry.get("subfield"),
field_name=entry.get("field"),
domain_name=entry.get("domain"),
ipc_level=level,
ipc_symbol=normalized_symbol,
)
mapped = MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=entry.get("topic_display_name"),
subfield_id=entry.get("subfield_id"),
field_id=entry.get("field_id"),
domain_id=entry.get("domain_id"),
subfield_name=entry.get("subfield"),
field_name=entry.get("field"),
domain_name=entry.get("domain"),
ipc_level=level,
ipc_symbol=normalized_symbol,
)
parsed[level][normalized_symbol] = mapped
_apply_subclass_overrides(parsed)
@@ -260,7 +241,6 @@ def load_ipc_openalex_mapping() -> dict[str, dict[str, MappedOpenAlexTopic]]:
def clear_mapping_cache() -> None:
load_ipc_openalex_mapping.cache_clear()
_load_topic_cache.cache_clear()
from inse.patents.patents_openalex_keywords.resolver import clear_resolver_caches
clear_resolver_caches()
@@ -9,7 +9,6 @@ from typing import Any
import httpx
from inse.patents.authors.ipc_openalex_mapping import (
_load_topic_cache,
normalize_openalex_id,
)
from inse.patents.common.elastic_search_client import MissingApiKeyError
@@ -65,17 +64,7 @@ def _topic_id_variants(topic_id: str | None) -> list[str]:
def _topic_id_variants_for_item(item: KeywordPatentSearchItem) -> list[str]:
variants = _topic_id_variants(item.topic_id)
if variants:
return variants
display_name = (item.topic_display_name or "").strip()
if display_name:
info = _load_topic_cache().get(display_name)
if info and info.get("topic_id"):
return _topic_id_variants(str(info["topic_id"]))
return []
return _topic_id_variants(item.topic_id)
def _weighted_score(
@@ -1086,19 +1086,12 @@ def test_json_lookup_resolves_topic_id_from_display_name(monkeypatch) -> None:
}
},
)
monkeypatch.setattr(
"inse.patents.keywords.reverse_lookup._load_topic_cache",
lambda: {
"Science and Climate Studies": {
"topic_id": "https://openalex.org/T14329",
}
},
)
clear_reverse_lookup_caches()
items = [
KeywordPatentSearchItem(
keyword="Science and Climate Studies",
topic_id="https://openalex.org/T14329",
topic_display_name="Science and Climate Studies",
relevance_score=1.0,
)
@@ -18,7 +18,6 @@ from inse.util import get_model
logger = logging.getLogger(__name__)
TOPIC_CACHE_FILENAME = "topic_hierarchy_cache.json"
MATCH_METHOD = "sentence_transformer"
TOPIC_VECTORS_INDEX = "topicvectors"
@@ -39,31 +38,6 @@ class KeywordCandidate:
topic_display_name: str | None = None
def _data_dir() -> Path:
return Path(__file__).resolve().parents[4] / "data"
def load_topic_cache(cache_path: Path | None = None) -> list[TopicCandidate]:
path = cache_path or (_data_dir() / TOPIC_CACHE_FILENAME)
with path.open(encoding="utf-8") as handle:
raw = json.load(handle)
topics: list[TopicCandidate] = []
for display_name, info in raw.items():
topic_id = info.get("topic_id")
if not topic_id:
continue
topics.append(
TopicCandidate(
topic_id=str(topic_id),
display_name=display_name,
subfield=info.get("subfield"),
field=info.get("field"),
domain=info.get("domain"),
)
)
return topics
def topic_embedding_text(topic: TopicCandidate) -> str:
parts = [topic.display_name]
for label in (topic.subfield, topic.field, topic.domain):
@@ -8,7 +8,6 @@ from functools import lru_cache
from inse.patents.authors.ipc_openalex_mapping import (
MappedOpenAlexTopic,
_enrich_mapped_topic,
load_ipc_openalex_mapping,
normalize_openalex_id,
resolve_mapped_topics_for_code,
@@ -91,16 +90,14 @@ def mapped_topics_from_index_doc(doc: dict) -> list[MappedOpenAlexTopic]:
continue
seen.add(key)
mapped.append(
_enrich_mapped_topic(
MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=match.get("topic_display_name"),
subfield_name=match.get("subfield"),
field_name=match.get("field"),
domain_name=match.get("domain"),
ipc_level=ipc_level,
ipc_symbol=ipc_symbol,
)
MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=match.get("topic_display_name"),
subfield_name=match.get("subfield"),
field_name=match.get("field"),
domain_name=match.get("domain"),
ipc_level=ipc_level,
ipc_symbol=ipc_symbol,
)
)
@@ -113,13 +110,11 @@ def mapped_topics_from_index_doc(doc: dict) -> list[MappedOpenAlexTopic]:
continue
seen.add(key)
mapped.append(
_enrich_mapped_topic(
MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=match.get("topic_display_name"),
ipc_level=ipc_level,
ipc_symbol=ipc_symbol,
)
MappedOpenAlexTopic(
topic_id=str(topic_id),
topic_display_name=match.get("topic_display_name"),
ipc_level=ipc_level,
ipc_symbol=ipc_symbol,
)
)
+186
View File
@@ -0,0 +1,186 @@
"""
Bio generation for persons / authors.
"""
import json
import logging
import time
from pydantic import ValidationError
from inse.exceptions import NotFoundException, UpstreamAPIException
from inse.integrations import elasticsearch
from inse.model import ESIndex
from inse.persons.model import PersonBio
from .. import config
from ..integrations import llm
logger = logging.getLogger(__name__)
async def _fetch_author_display_name(author_id: str) -> str | None:
query = {
"query_string": {
"default_field": "_id",
"query": author_id,
}
}
response = await elasticsearch.search(
index=ESIndex.OPENALEX_AUTHORS,
query=query,
source=["display_name"],
)
hits = response.get("hits", {}).get("hits", [])
if not hits:
return None
return hits[0].get("_source", {}).get("display_name")
async def _fetch_works_and_topics(author_id: str) -> tuple[list, list]:
WORK_SOURCE_FIELDS = [
"title",
"display_name",
"abstract",
"cited_by_count",
"primary_topic",
]
author_url = f"https://openalex.org/{author_id.strip()}"
authorship_query = {
"nested": {
"path": "authorships",
"query": {
"bool": {
"filter": [{"term": {"authorships.author.id": author_url}}],
}
},
}
}
body = {
"size": 100,
"sort": [{"cited_by_count": {"order": "desc"}}],
"_source": WORK_SOURCE_FIELDS,
"query": authorship_query,
"aggs": {
"primary_topics": {
"terms": {"field": "primary_topic.id", "size": 5},
"aggs": {
"topic_name": {
"top_hits": {
"size": 1,
"_source": ["primary_topic.display_name"],
}
}
},
}
},
}
response = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=body,
)
works = []
for hit in response.get("hits", {}).get("hits", []):
works.append(hit.get("_source", {}))
topics = []
buckets = (
response.get("aggregations", {}).get("primary_topics", {}).get("buckets", [])
)
for bucket in buckets:
topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", [])
display_name = None
if topic_hits:
primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {})
display_name = primary_topic.get("display_name")
topics.append(
{
"id": bucket.get("key"),
"display_name": display_name,
"count": bucket.get("doc_count"),
}
)
return works, topics
def _build_papers(works: list) -> list:
papers = []
for work in works:
name = work.get("title") or work.get("display_name")
abstract = work.get("abstract")
papers.append(
{
"name": name,
"abstract": abstract,
"stats": {
"cited_by_count": work.get("cited_by_count"),
},
}
)
return papers
async def get_data_for_bio(author_id: str) -> dict | None:
display_name = await _fetch_author_display_name(author_id)
if display_name is None:
return None
works, top_topics = await _fetch_works_and_topics(author_id)
papers = _build_papers(works)
author_data = {
"display_name": display_name,
"topics": top_topics,
"papers": papers,
}
return author_data
async def generate_person_bio(author_id: str) -> str:
start_time = time.time()
author_data = await get_data_for_bio(author_id)
if author_data is None:
raise NotFoundException(f"No person found for author ID {author_id}.")
person_json = json.dumps(author_data, ensure_ascii=False)
system_prompt = """\
Beschreibe in zwei Sätzen das Hauptforschungsfeld des Autors. Formuliere dabei allgemeinverständlich, sodass auch Personen ohne Fachwissen einen Einblick in die Forschung gewinnen. Nenne keine konkreten Publikationen oder Einzelwerke, sondern konzentriere dich auf die übergeordneten Forschungsinteressen und Themen. Verzichte auf bloße Aufzählungen und verbinde die Informationen zu einem flüssigen Text.
Beschreibe anschließend in ein bis zwei Sätzen die wirtschaftliche Relevanz der Forschung anhand von Anwendungen, Technologien oder Branchen, die davon profitieren könnten.
Verwende insgesamt maximal 100 bis 120 Wörter. Formuliere die Antwort so, dass sie ohne weitere Anpassungen direkt als Kurzbiografie verwendet werden kann. Verwende keine Superlative oder übertriebene Formulierungen, sondern bleibe sachlich und informativ. Gebe den Text als One-Liner zurück, ohne Zeilenumbrüche oder Aufzählungen. Verwende keine Gedankenstriche (– oder —) zur Gliederung von Sätzen. Formuliere stattdessen mit Kommas, Klammern oder zwei getrennten Sätzen.
Gib ausschließlich ein JSON-Objekt zurück, das den Text im Feld "bio" enthält.
"""
user_prompt = f"Daten zur Person:\n{person_json}"
response = await llm.call(
system_prompt=system_prompt,
user_prompt=user_prompt,
json_schema=PersonBio.model_json_schema(),
schema_name="bio",
temperature=0.8,
top_p=0.95,
)
try:
bio = PersonBio.model_validate_json(response).bio
except ValidationError as error:
logger.warning(
f"Bio generation for author {author_id} returned no valid bio: {response}"
)
raise UpstreamAPIException("Bio generation failed.") from error
elapsed_time = time.time() - start_time
logger.info(f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds")
return bio
+3 -172
View File
@@ -4,13 +4,10 @@ Business logic for persons / authors.
"""
import hashlib
import json
import logging
import time
from datetime import datetime
from pydantic import ValidationError
from inse.exceptions import (
BadRequestException,
ElasticsearchException,
@@ -26,13 +23,11 @@ from inse.persons.model import (
CareerMetrics,
CustomAuthor,
CustomAuthorsListResponse,
PersonBio,
)
from inse.persons.query_builder import build_authors_search_rescored
from inse.works.logic import enrich_topic_descriptions
from .. import config, util
from ..integrations import llm
logger = logging.getLogger(__name__)
INDEX_NAME = "openalex-authors"
@@ -220,100 +215,6 @@ async def count_authors_by_last_name(last_name: str) -> int:
return await _count_authors(query)
async def _fetch_author_display_name(author_id: str) -> str | None:
query = {
"query_string": {
"default_field": "_id",
"query": author_id,
}
}
response = await elasticsearch.search(
index=INDEX_NAME,
query=query,
source=["display_name"],
)
hits = response.get("hits", {}).get("hits", [])
if not hits:
return None
return hits[0].get("_source", {}).get("display_name")
async def _fetch_works_and_topics(author_id: str) -> tuple[list, list]:
WORK_SOURCE_FIELDS = [
"title",
"display_name",
"abstract",
"cited_by_count",
"primary_topic",
]
author_url = f"https://openalex.org/{author_id.strip()}"
authorship_query = {
"nested": {
"path": "authorships",
"query": {
"bool": {
"filter": [{"term": {"authorships.author.id": author_url}}],
}
},
}
}
body = {
"size": 100,
"sort": [{"cited_by_count": {"order": "desc"}}],
"_source": WORK_SOURCE_FIELDS,
"query": authorship_query,
"aggs": {
"primary_topics": {
"terms": {"field": "primary_topic.id", "size": 5},
"aggs": {
"topic_name": {
"top_hits": {
"size": 1,
"_source": ["primary_topic.display_name"],
}
}
},
}
},
}
response = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=body,
)
works = []
for hit in response.get("hits", {}).get("hits", []):
works.append(hit.get("_source", {}))
topics = []
buckets = (
response.get("aggregations", {}).get("primary_topics", {}).get("buckets", [])
)
for bucket in buckets:
topic_hits = bucket.get("topic_name", {}).get("hits", {}).get("hits", [])
display_name = None
if topic_hits:
primary_topic = topic_hits[0].get("_source", {}).get("primary_topic", {})
display_name = primary_topic.get("display_name")
topics.append(
{
"id": bucket.get("key"),
"display_name": display_name,
"count": bucket.get("doc_count"),
}
)
return works, topics
async def _get_publication_years_for_author(author_id: str) -> list[int]:
author_url = f"https://openalex.org/{author_id.strip()}"
@@ -427,79 +328,6 @@ async def get_career_metrics_for_author(author_id: str) -> CareerMetrics:
return _compute_career_metrics(publication_years)
def _build_papers(works: list) -> list:
papers = []
for work in works:
name = work.get("title") or work.get("display_name")
abstract = work.get("abstract")
papers.append(
{
"name": name,
"abstract": abstract,
"stats": {
"cited_by_count": work.get("cited_by_count"),
},
}
)
return papers
async def get_data_for_bio(author_id: str) -> dict | None:
display_name = await _fetch_author_display_name(author_id)
if display_name is None:
return None
works, top_topics = await _fetch_works_and_topics(author_id)
papers = _build_papers(works)
author_data = {
"display_name": display_name,
"topics": top_topics,
"papers": papers,
}
return author_data
async def generate_person_bio(
author_id: str, include: set[str] | None = None
) -> str:
start_time = time.time()
author_data = await get_data_for_bio(author_id)
if author_data is None:
return "No person found."
person_json = json.dumps(author_data, ensure_ascii=False)
system_prompt = """\
Beschreibe in zwei Sätzen das Hauptforschungsfeld des Autors. Formuliere dabei allgemeinverständlich, sodass auch Personen ohne Fachwissen einen Einblick in die Forschung gewinnen. Nenne keine konkreten Publikationen oder Einzelwerke, sondern konzentriere dich auf die übergeordneten Forschungsinteressen und Themen. Verzichte auf bloße Aufzählungen und verbinde die Informationen zu einem flüssigen Text.
Beschreibe anschließend in ein bis zwei Sätzen die wirtschaftliche Relevanz der Forschung anhand von Anwendungen, Technologien oder Branchen, die davon profitieren könnten.
Verwende insgesamt maximal 100 bis 120 Wörter. Formuliere die Antwort so, dass sie ohne weitere Anpassungen direkt als Kurzbiografie verwendet werden kann. Verwende keine Superlative oder übertriebene Formulierungen, sondern bleibe sachlich und informativ. Gebe den Text als One-Liner zurück, ohne Zeilenumbrüche oder Aufzählungen. Verwende keine Gedankenstriche (– oder —) zur Gliederung von Sätzen. Formuliere stattdessen mit Kommas, Klammern oder zwei getrennten Sätzen.
Gib ausschließlich ein JSON-Objekt zurück, das den Text im Feld "bio" enthält.
"""
user_prompt = f"Daten zur Person:\n{person_json}"
response = await llm.call(
system_prompt=system_prompt,
user_prompt=user_prompt,
json_schema=PersonBio.model_json_schema(),
schema_name="bio",
temperature=0.8,
top_p=0.95,
)
try:
bio = PersonBio.model_validate_json(response).bio
except ValidationError:
logger.warning(f"Bio generation for author {author_id} returned no valid JSON: {response}")
bio = "Etwas ist schiefgelaufen."
elapsed_time = time.time() - start_time
logger.info(f"Bio generation for author {author_id} took {elapsed_time:.2f} seconds")
return bio
async def get_person_by_id(
author_id: str, include: str | None = None
) -> CustomAuthorsListResponse:
@@ -528,6 +356,9 @@ async def get_person_by_id(
career_metrics=career_metrics,
)
if custom_author.topics:
await enrich_topic_descriptions(custom_author.topics)
return CustomAuthorsListResponse(results=[custom_author])
+8 -36
View File
@@ -9,7 +9,7 @@ from fastapi import APIRouter, HTTPException, Path, Query, status
from inse.models.openalex.authors_list_response import AuthorsListResponse
from . import logic, model
from . import bio as bio_logic, logic, model
router = APIRouter(
prefix="/api/inse-service",
@@ -32,23 +32,7 @@ async def search_persons(
query: Annotated[
str, Query(description="Search query (e.g., Arman AND Arzani)")
] = None,
include: Annotated[
str | None,
Query(
description=(
"Comma-separated include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, sources, counts_by_year, works_api_url, dates, "
"cited_by_count_boost"
),
example="topics_full,topic_share",
),
] = None,
):
include_set = (
{tag.strip().lower() for tag in include.split(",") if tag.strip()}
if include
else None
)
return await logic.search_persons(author_id, query)
@@ -62,20 +46,8 @@ async def generate_person_bio(
author_id: Annotated[
str, Query(description="OpenAlex author ID (e.g., A5093075883)")
],
include: Annotated[
str | None,
Query(
description=("Comma-separated list to include tags"),
example="topics_full,topic_share",
),
] = None,
):
include_set = (
{tag.strip().lower() for tag in include.split(",") if tag.strip()}
if include
else None
)
bio = await logic.generate_person_bio(author_id, include_set)
bio = await bio_logic.generate_person_bio(author_id)
return model.PersonBio(bio=bio)
@router.get(
@@ -96,7 +68,7 @@ async def get_person_by_id(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
] = None,
):
@@ -119,11 +91,11 @@ async def search_persons_by_name(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
],
limit:Annotated[int | None, Query(description=("Limit of search page results"),example ="2")]= None,
page_offset : Annotated[int | None, Query(description=("Offset of the result page"),example="2")] = None,
limit:Annotated[int | None, Query(description=("Limit of search page results"),examples ="2")]= None,
page_offset : Annotated[int | None, Query(description=("Offset of the result page"),examples="2")] = None,
):
return await logic.search_persons_by_name(author_name=author_name, include=include, page_offset=page_offset, limit=limit)
@@ -141,7 +113,7 @@ async def search_persons_autocomplete(
"Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, "
"last_known_institutions, ..."
),
example="topics_full,topic_share"
examples="topics_full,topic_share"
)]):
return await logic.search_persons_autocomplete(author_name=author_name, include=include)
@@ -181,7 +153,7 @@ async def search_persons_list(
str | None,
Query(
description="Comma-separated include tags",
example="topics_full,topic_share",
examples="topics_full,topic_share",
),
] = None,
year_filter_enabled: Annotated[
+48
View File
@@ -0,0 +1,48 @@
import pytest
from inse import config
from inse.exceptions import NotFoundException
from inse.persons import service
@pytest.fixture()
def anyio_backend():
return "asyncio"
def elasticsearch_configured():
return bool(
config.settings.elasticsearch_url and config.settings.elasticsearch_api_key
)
def llm_configured():
return bool(
config.settings.llm_api_url
and config.settings.llm_api_key
and config.settings.llm_model
)
requires_elasticsearch = pytest.mark.skipif(
not elasticsearch_configured(), reason="Elasticsearch is not configured"
)
requires_elasticsearch_and_llm = pytest.mark.skipif(
not (elasticsearch_configured() and llm_configured()),
reason="Elasticsearch and/or LLM are not configured",
)
@pytest.mark.anyio
@requires_elasticsearch_and_llm
async def test_bio_is_generated_for_person():
response = await service.generate_person_bio(author_id="A5093075883")
assert len(response.bio) >= 10, f"bio is too short: {response.bio!r}"
@pytest.mark.anyio
@requires_elasticsearch
async def test_bio_generation_fails_for_unknown_author():
with pytest.raises(NotFoundException):
await service.generate_person_bio(author_id="A000")
@@ -508,7 +508,7 @@ def _eu_sort_field(sort_by: str) -> str:
"id": "id",
"project_type": "_index",
}
return mapping.get(sort_by, "title.keyword")
return mapping.get(sort_by, "")
async def get_eu_project_ids_by_organization_filters(
@@ -781,6 +781,7 @@ async def _build_eu_cordis_search_query(
topic_project_ids_by_type = await get_eu_project_ids_by_openalex_topic_ids(
project_types=project_types,
topic_ids=topic_ids,
match_all=False
)
topic_filter = _eu_project_type_index_filter(topic_project_ids_by_type)
@@ -829,13 +830,14 @@ async def _build_eu_cordis_search_query(
)
if keyword_clauses:
must_clauses.append({"bool": {"must": keyword_clauses}})
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
# === Independent OpenAlex topic filters ===
if filter_topic_ids:
filter_topic_project_ids_by_type = await get_eu_project_ids_by_openalex_topic_ids(
project_types=project_types,
topic_ids=filter_topic_ids,
match_all=True
)
topic_filter = _eu_project_type_index_filter(filter_topic_project_ids_by_type)
@@ -957,7 +959,7 @@ async def search_eu_cordis_projects(
framework_programmes: list[str] | None = None,
funding_schemes: list[str] | None = None,
statuses: list[str] | None = None,
sort_by: str = "title",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
skip_enrichment: bool = False,
@@ -1003,13 +1005,13 @@ async def search_eu_cordis_projects(
body={
"size": size,
"from": page * size,
"track_total_hits": True,
"_source": [
"id",
"title",
"acronym",
"objective",
"keywords",
"topics",
"frameworkProgramme",
"fundingScheme",
"status",
@@ -1019,12 +1021,28 @@ async def search_eu_cordis_projects(
"totalCost",
],
"query": query,
"highlight": {
"fields": {
"title": {},
"acronym": {},
"objective": {},
"keywords": {},
"topics": {},
},
"pre_tags": ["<em>"],
"post_tags": ["</em>"],
"require_field_match": True,
},
"sort": [
{
sort_field: {
"order": sort_direction,
"missing": "_last",
"unmapped_type": "keyword" if sort_field.endswith(".keyword") else "date",
"unmapped_type": (
"keyword"
if sort_field.endswith(".keyword")
else "date"
),
}
}
],
@@ -1148,7 +1166,6 @@ async def get_eu_cordis_projects_funding_data(
while True:
body: dict[str, Any] = {
"size": page_size,
"track_total_hits": False,
"_source": ["id", "startDate", "endDate", "ecMaxContribution"],
"query": query,
"sort": [{"id": {"order": "asc", "unmapped_type": "keyword"}}],
+158 -113
View File
@@ -115,134 +115,133 @@ async def get_person_ids_by_institution_ids(
}
)
async def get_bund_project_ids_by_topic_ids(topic_ids: list[str]) -> list[str]:
async def get_bund_project_ids_by_topic_ids(
topic_ids: list[str],
match_all: bool = True,
) -> list[str]:
"""
Query the `projects_bund_openalex_topics` index to find BUND project IDs
that match any of the given OpenAlex topic IDs.
that match:
- ALL of the given OpenAlex topic IDs if match_all=True
- ANY of the given OpenAlex topic IDs if match_all=False
Topics may be distributed across multiple documents for the same project.
"""
if not topic_ids:
return []
required_topics = set(topic_ids)
project_topics: dict[str, set[str]] = defaultdict(set)
page_size = 1000
from_ = 0
body = {
"size": 10000,
"_source": ["project_id", "topic_matches"],
"query": {
"terms": {
"topic_matches.topic_id.keyword": topic_ids
}
},
}
while True:
body = {
"size": page_size,
"from": from_,
"_source": ["project_id", "topic_matches"],
"query": {
"terms": {
"topic_matches.topic_id.keyword": topic_ids
}
},
}
response = await elasticsearch.search(
index=ESIndex.PROJECTS_BUND_TOPICS,
cluster=ESCluster.INSE,
body=body,
)
response = await elasticsearch.search(
index=ESIndex.PROJECTS_BUND_TOPICS,
cluster=ESCluster.INSE,
body=body,
)
hits = response.get("hits", {}).get("hits", [])
if not hits:
break
hits = response.get("hits", {}).get("hits", [])
for hit in hits:
source = hit["_source"]
for hit in hits:
source = hit["_source"]
project_id = source.get("project_id")
if not project_id:
continue
project_id = source.get("project_id")
if not project_id:
continue
topic_matches = source.get("topic_matches") or []
topic_matches = source.get("topic_matches") or []
if isinstance(topic_matches, dict):
topic_matches = [topic_matches]
if isinstance(topic_matches, dict):
topic_matches = [topic_matches]
for match in topic_matches:
topic_id = match.get("topic_id")
if topic_id in required_topics:
project_topics[project_id].add(topic_id)
for match in topic_matches:
topic_id = match.get("topic_id")
if topic_id in required_topics:
project_topics[project_id].add(topic_id)
if len(hits) < page_size:
break
if match_all:
return [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
from_ += page_size
# OR match: project has at least one requested topic
return list(project_topics.keys())
return [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
async def get_dfg_project_ids_by_topic_ids(topic_ids: list[str]) -> list[str]:
"""Fetches project IDs whose topic_matches contain EVERY given topic ID,
even if the topics are distributed across multiple documents for the same project.
async def get_dfg_project_ids_by_topic_ids(
topic_ids: list[str],
match_all: bool = True,
) -> list[str]:
"""
Fetches project IDs whose topic_matches contain:
- ALL given topic IDs if match_all=True
- ANY given topic ID if match_all=False
Topics may be distributed across multiple documents for the same project.
"""
if not topic_ids:
return []
required_topics = set(topic_ids)
project_topics: dict[str, set[str]] = defaultdict(set)
page_size = 1000
from_ = 0
body = {
"size": 10000,
"_source": ["project_id", "topic_matches"],
"query": {
"terms": {
"topic_matches.topic_id.keyword": topic_ids
}
},
}
while True:
body = {
"size": page_size,
"from": from_,
"_source": ["project_id", "topic_matches"],
"query": {
"terms": {
"topic_matches.topic_id.keyword": topic_ids
}
},
}
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_TOPICS,
cluster=ESCluster.INSE,
body=body,
)
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_TOPICS,
cluster=ESCluster.INSE,
body=body,
)
hits = response.get("hits", {}).get("hits", [])
hits = response.get("hits", {}).get("hits", [])
if not hits:
break
for hit in hits:
source = hit["_source"]
for hit in hits:
source = hit["_source"]
project_id = source.get("project_id")
if not project_id:
continue
project_id = source.get("project_id")
if not project_id:
continue
topic_matches = source.get("topic_matches") or []
topic_matches = source.get("topic_matches") or []
if isinstance(topic_matches, dict):
topic_matches = [topic_matches]
if isinstance(topic_matches, dict):
topic_matches = [topic_matches]
for match in topic_matches:
topic_id = match.get("topic_id")
if topic_id in required_topics:
project_topics[project_id].add(topic_id)
for match in topic_matches:
topic_id = match.get("topic_id")
if topic_id in required_topics:
project_topics[project_id].add(topic_id)
if match_all:
return [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
if len(hits) < page_size:
break
from_ += page_size
return [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
# OR match: project has at least one requested topic
return list(project_topics.keys())
async def get_openalex_topics_for_bund_projects(project_ids: list[str]) -> dict[str, list[dict]]:
@@ -271,17 +270,34 @@ async def get_openalex_topics_for_bund_projects(project_ids: list[str]) -> dict[
lookup: dict[str, list[dict]] = {}
for hit in response.get("hits", {}).get("hits", []):
src = hit["_source"]
pid = src.get("project_id")
if pid:
lookup[pid] = src.get("topic_matches", [])
return lookup
src = hit["_source"]
pid = src.get("project_id")
if not pid:
continue
pid = str(pid)
if pid not in lookup:
lookup[pid] = {}
for topic in src.get("topic_matches", []):
topic_id = topic.get("topic_id")
if topic_id:
lookup[pid][str(topic_id)] = topic
result = {
pid: list(topics.values())
for pid, topics in lookup.items()
}
return result
async def get_openalex_topics_for_dfg_projects(
project_ids: list[str],
) -> dict[str, list[dict]]:
"""
Retrieve OpenAlex topic details for a list of DFG project IDs.
Returns a dict mapping `project_id` -> list of topic_match objects.
Retrieve unique OpenAlex topic details for a list of DFG project IDs.
Returns a dict mapping `project_id` -> unique list of topic_match objects.
"""
if not project_ids:
return {}
@@ -293,23 +309,41 @@ async def get_openalex_topics_for_dfg_projects(
"project_id.keyword": project_ids
}
},
"_source": ["project_id", "topic_matches"]
"_source": ["project_id", "topic_matches"],
}
response = await elasticsearch.search(
index=ESIndex.PROJECTS_DFG_TOPICS,
body=body,
cluster=ESCluster.INSE
cluster=ESCluster.INSE,
)
lookup: dict[str, list[dict]] = {}
lookup: dict[str, dict[str, dict]] = {}
for hit in response.get("hits", {}).get("hits", []):
src = hit["_source"]
pid = src.get("project_id")
if pid:
lookup[str(pid)] = src.get("topic_matches", [])
return lookup
if not pid:
continue
pid = str(pid)
if pid not in lookup:
lookup[pid] = {}
for topic in src.get("topic_matches", []):
topic_id = topic.get("topic_id")
if topic_id:
lookup[pid][str(topic_id)] = topic
result = {
pid: list(topics.values())
for pid, topics in lookup.items()
}
return result
async def get_person_institutes(
person_ids: list[int],
@@ -411,14 +445,18 @@ async def get_dfg_institutes_by_ids(
#EU Cordis Projects
async def get_eu_project_ids_by_openalex_topic_ids(
project_types: list[EuCordisProjectType],
topic_ids: list[str],
match_all: bool = True,
) -> dict[EuCordisProjectType, list[str]]:
"""
Returns EU CORDIS project IDs whose mapped OpenAlex topic_matches contain
EVERY given topic ID. Same semantics as DFG topic filtering.
Returns EU CORDIS project IDs whose mapped OpenAlex topic_matches contain:
- ALL given topic IDs if match_all=True
- ANY given topic ID if match_all=False
Topics may be distributed across multiple documents for the same project.
"""
if not topic_ids:
return {project_type: [] for project_type in project_types}
@@ -457,15 +495,18 @@ async def get_eu_project_ids_by_openalex_topic_ids(
for hit in hits:
source = hit.get("_source", {})
project_id = source.get("project_id")
if not project_id:
continue
topic_matches = source.get("topic_matches") or []
if isinstance(topic_matches, dict):
topic_matches = [topic_matches]
for match in topic_matches:
topic_id = match.get("topic_id")
if topic_id in required_topics:
project_topics[project_id].add(topic_id)
@@ -474,11 +515,15 @@ async def get_eu_project_ids_by_openalex_topic_ids(
from_ += page_size
result[project_type] = [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
if match_all:
result[project_type] = [
project_id
for project_id, found_topics in project_topics.items()
if required_topics.issubset(found_topics)
]
else:
# OR match: project has at least one requested topic
result[project_type] = list(project_topics.keys())
return result
+401 -40
View File
@@ -73,7 +73,25 @@ class Page(BaseModel):
page: int = Field(default=0, description="The current page number.")
size: int = Field(default=20, description="The requested page size.")
total: int = Field(default=0, description="The total number of items.")
class BundProjectHighlight(BaseModel):
"""Highlighted matching fragments from a BUND project search."""
joint_project: list[str] = Field(
default_factory=list,
description='Highlights from the Elasticsearch field "Verbundprojekt".',
)
topic: list[str] = Field(
default_factory=list,
description='Highlights from the Elasticsearch field "Thema".',
)
recipient: list[str] = Field(
default_factory=list,
description='Highlights from the Elasticsearch field "Zuwendungsempfänger".',
)
executing_agency: list[str] = Field(
default_factory=list,
description='Highlights from the Elasticsearch field "Ausführende Stelle".',
)
class BundProjectSummary(BundProject):
oa_topics: list[Topic] | None = Field(
default=None,
@@ -86,22 +104,34 @@ class BundProjectSummary(BundProject):
description="The executing agency / recipient institution for this project, "
"derived from the project's own agency fields.",
)
highlight: BundProjectHighlight | None = Field(
default=None,
description="Highlighted matching fragments from the project search.",
)
@classmethod
def from_hit(cls, hit: dict) -> "BundProjectSummary":
def from_hit(cls, hit: dict[str, Any]) -> "BundProjectSummary":
"""Create a BundProjectSummary from an Elasticsearch hit."""
source = hit.get("_source", {})
topics_raw = source.get("oa_topics") or []
oa_topics = None
if isinstance(topics_raw, list) and topics_raw:
if isinstance(topics_raw, list) and topics_raw:
sorted_topics_raw = sorted(
(t for t in topics_raw if isinstance(t, dict)),
key=lambda t: t.get("rank") if t.get("rank") is not None else float("inf"),
(topic for topic in topics_raw if isinstance(topic, dict)),
key=lambda topic: (
topic.get("rank")
if topic.get("rank") is not None
else float("inf")
),
)
oa_topics = [cls._topic_from_match(t) for t in sorted_topics_raw]
oa_topics = [
cls._topic_from_match(topic)
for topic in sorted_topics_raw
]
return cls(
funding_code=source.get("Förderkennzeichen"),
department=source.get("Ressort"),
@@ -116,10 +146,12 @@ class BundProjectSummary(BundProject):
place=source.get("Ort"),
state=source.get("Bundesland"),
country=source.get("Staat"),
implementing_agency=source.get("Ausführende Stelle"),
executing_agency=source.get("Ausführende Stelle"),
topic=source.get("Thema"),
performance_plan_system=source.get("Leistungsplansystematik"),
performance_plan_system_text=source.get("Klartext Leistungsplansystematik"),
performance_plan_system_text=source.get(
"Klartext Leistungsplansystematik"
),
funding_start=source.get("funding_start"),
funding_end=source.get("funding_end"),
grant_amount=source.get("Fördersumme"),
@@ -133,8 +165,61 @@ class BundProjectSummary(BundProject):
duration=source.get("Laufzeit"),
oa_topics=oa_topics,
institution=BundInstitutionSummary.from_source(source),
highlight=cls._highlight_from_hit(hit),
)
@staticmethod
def _highlight_fragments(value: Any) -> list[str]:
"""Normalize an Elasticsearch highlight value to a list of strings."""
if isinstance(value, str):
return [value]
if isinstance(value, list):
return [
fragment
for fragment in value
if isinstance(fragment, str)
]
return []
@classmethod
def _highlight_from_hit(
cls,
hit: dict[str, Any],
) -> BundProjectHighlight | None:
"""Extract BUND project highlights from an Elasticsearch hit."""
raw_highlight = hit.get("highlight")
if not isinstance(raw_highlight, dict):
return None
highlight = BundProjectHighlight(
joint_project=cls._highlight_fragments(
raw_highlight.get("Verbundprojekt")
),
topic=cls._highlight_fragments(
raw_highlight.get("Thema")
),
recipient=cls._highlight_fragments(
raw_highlight.get("Zuwendungsempfänger")
),
executing_agency=cls._highlight_fragments(
raw_highlight.get("Ausführende Stelle")
),
)
has_highlights = any(
(
highlight.joint_project,
highlight.topic,
highlight.recipient,
highlight.executing_agency,
)
)
return highlight if has_highlights else None
@staticmethod
def _topic_from_match(match: dict[str, Any]) -> Topic:
"""Builds a Topic model from a flattened topic_match dict.
@@ -163,16 +248,42 @@ class BundProjectPage(Page):
default_factory=list, description="The bund projects on this page."
)
class BundProjectList(BaseModel):
elements: list[BundProjectSummary] = Field(
default_factory=list, description="All bund projects."
)
total: int = Field(default=0, description="The total number of bund projects.")
class DfgSubjectClassificationHighlight(BaseModel):
"""A highlighted nested subject classification."""
query: str = Field(
description="The keyword/inner_hits group which produced this match.",
)
offset: int | None = Field(
default=None,
description="Index of the matched item in subject_classifications.",
)
fach: list[str] = Field(default_factory=list)
fachkollegium: list[str] = Field(default_factory=list)
fachgebiet: list[str] = Field(default_factory=list)
fachgebiet_de: list[str] = Field(default_factory=list)
wissenschaftsbereich: list[str] = Field(default_factory=list)
class DfgProjectHighlight(BaseModel):
"""Highlighted fragments returned for a DFG project."""
title_de: list[str] = Field(default_factory=list)
title_en: list[str] = Field(default_factory=list)
abstract_de: list[str] = Field(default_factory=list)
abstract_en: list[str] = Field(default_factory=list)
subject_classifications: list[DfgSubjectClassificationHighlight] = Field(
default_factory=list,
)
class DfgInstitutionSummary(BaseModel):
"""A summary of a DFG institution."""
id: int
@@ -205,16 +316,22 @@ class DfgProjectSummary(BaseModel):
description="The link to the DFG project details."
)
title: str | None = Field(
title_de: str | None = Field(
default=None,
description="The title of the DFG project."
description="The title of the DFG project in German."
)
professional_classification: str | None = Field(
title_en: str | None = Field(
default=None,
description="The professional classification of the DFG project."
description="The title of the DFG project in English."
)
subject_classifications_raw: str | None = Field(
default=None,
description="The subject classifications of the DFG project."
)
abstract_de: str | None = Field( default=None, description="The abstract of the DFG project in German.")
abstract_en: str | None = Field( default=None, description="The abstract of the DFG project in English.")
funding_start: str | None = Field(
default=None,
@@ -246,11 +363,17 @@ class DfgProjectSummary(BaseModel):
default=None,
description="The topics associated with the DFG project.",
)
highlight: DfgProjectHighlight | None = Field(
default=None,
description="Highlighted matching fragments.",
)
@classmethod
def from_hit(cls, hit: dict) -> "DfgProjectSummary":
source = hit.get("_source", {})
fields = hit.get("fields", {})
source_id = source.get("id")
project_id = source_id if source_id is not None else hit.get("_id", "")
names = []
institutions = {}
project_persons = []
@@ -338,7 +461,6 @@ class DfgProjectSummary(BaseModel):
)
)
topics_raw = source.get("topics") or []
print(f"Raw topics for DFG project {hit.get('_id', '')}: {topics_raw}")
topics = None
if isinstance(topics_raw, list) and topics_raw:
# Sort by rank if present, so the most relevant topic comes first
@@ -348,34 +470,51 @@ class DfgProjectSummary(BaseModel):
)
topics = [cls._topic_from_match(t) for t in sorted_topics_raw]
subject_classifications = source.get("subject_classifications")
if not isinstance(subject_classifications, list):
subject_classifications = []
return cls(
id=hit.get("_id", ""),
id=str(project_id),
link=source.get("link") or source.get("page_url"),
title=(
source.get("title")
or source.get("title_de")
or source.get("title_en")
),
professional_classification=(
source.get("Fachliche Zuordnung")
or source.get("subject_area_de")
page_url=source.get("page_url"),
title_de=source.get("title_de"),
title_en=source.get("title_en"),
abstract_de=source.get("abstract_de"),
abstract_en=source.get("abstract_en"),
subject_classifications_raw=(
source.get("subject_area_de")
or source.get("subject_area_en")
),
funding_start=(
str(source.get("funding_start"))
str(source["funding_start"])
if source.get("funding_start") is not None
else None
),
funding_end=(
str(source.get("funding_end"))
str(source["funding_end"])
if source.get("funding_end") is not None
else None
),
institutions=list(institutions.values()),
names=names,
persons=project_persons,
subject_classifications=[DFGProjectFachgebieteInner.from_dict(cls) for cls in source.get('subject_classifications', [])],
topics=topics
subject_classifications=[
DFGProjectFachgebieteInner.from_dict(classification)
for classification in subject_classifications
if isinstance(classification, dict)
],
topics=topics or [],
highlight=cls._highlight_from_hit(hit),
)
@staticmethod
def _topic_from_match(match: dict[str, Any]) -> Topic:
@@ -412,13 +551,146 @@ class DfgProjectSummary(BaseModel):
field=field,
subfield=subfield,
)
@staticmethod
def _highlight_fragments(value: Any) -> list[str]:
"""Normalize an Elasticsearch highlight value."""
if isinstance(value, str):
return [value]
if isinstance(value, list):
return [
fragment
for fragment in value
if isinstance(fragment, str)
]
return []
@classmethod
def _highlight_from_hit(
cls,
hit: dict[str, Any],
) -> DfgProjectHighlight | None:
"""Parse top-level and nested highlights from an Elasticsearch hit."""
raw_highlight = hit.get("highlight")
if not isinstance(raw_highlight, dict):
raw_highlight = {}
result = DfgProjectHighlight(
title_de=cls._highlight_fragments(
raw_highlight.get("title_de")
),
title_en=cls._highlight_fragments(
raw_highlight.get("title_en")
),
abstract_de=cls._highlight_fragments(
raw_highlight.get("abstract_de")
),
abstract_en=cls._highlight_fragments(
raw_highlight.get("abstract_en")
),
)
raw_inner_hits = hit.get("inner_hits")
if isinstance(raw_inner_hits, dict):
for query_name, inner_hit_group in raw_inner_hits.items():
if not isinstance(inner_hit_group, dict):
continue
inner_hits_block = inner_hit_group.get("hits")
if not isinstance(inner_hits_block, dict):
continue
nested_hits = inner_hits_block.get("hits", [])
if not isinstance(nested_hits, list):
continue
for nested_hit in nested_hits:
if not isinstance(nested_hit, dict):
continue
nested_highlight = nested_hit.get("highlight")
if not isinstance(nested_highlight, dict):
continue
nested_metadata = nested_hit.get("_nested")
offset = None
if isinstance(nested_metadata, dict):
raw_offset = nested_metadata.get("offset")
if isinstance(raw_offset, int):
offset = raw_offset
parsed_nested_highlight = (
DfgSubjectClassificationHighlight(
query=str(query_name),
offset=offset,
fach=cls._highlight_fragments(
nested_highlight.get(
"subject_classifications.fach"
)
),
fachkollegium=cls._highlight_fragments(
nested_highlight.get(
"subject_classifications.fachkollegium"
)
),
fachgebiet=cls._highlight_fragments(
nested_highlight.get(
"subject_classifications.fachgebiet"
)
),
fachgebiet_de=cls._highlight_fragments(
nested_highlight.get(
"subject_classifications.fachgebiet_de"
)
),
wissenschaftsbereich=cls._highlight_fragments(
nested_highlight.get(
"subject_classifications."
"wissenschaftsbereich"
)
),
)
)
# Do not expose empty nested highlight objects.
has_nested_fragments = any(
(
parsed_nested_highlight.fach,
parsed_nested_highlight.fachkollegium,
parsed_nested_highlight.fachgebiet,
parsed_nested_highlight.fachgebiet_de,
parsed_nested_highlight.wissenschaftsbereich,
)
)
if has_nested_fragments:
result.subject_classifications.append(
parsed_nested_highlight
)
has_highlights = any(
(
result.title_de,
result.title_en,
result.abstract_de,
result.abstract_en,
result.subject_classifications,
)
)
return result if has_highlights else None
class DfgProjectPage(Page):
elements: list[DfgProjectSummary] = Field(
default_factory=list, description="The DFG projects on this page."
)
class InstitutionFunderSummary(BaseModel):
type: ProjectType = Field(
description="The type of funding data (e.g., 'bund', 'eu', 'dfg')."
@@ -706,7 +978,20 @@ class EuCordisEurosciVocSummary(BaseModel):
description=source.get("description"),
path=source.get("path"),
)
class EuCordisProjectHighlight(BaseModel):
"""Highlighted fragments returned by Elasticsearch."""
title: list[str] = Field(default_factory=list)
acronym: list[str] = Field(default_factory=list)
objective: list[str] = Field(default_factory=list)
keywords: list[str] = Field(default_factory=list)
# Elasticsearch source/highlight field is "topics", but "topics" is already
# used by the API model for mapped OpenAlex Topic objects.
cordis_topic_text: list[str] = Field(
default_factory=list,
description="Highlighted fragments from the CORDIS topics text field.",
)
class EuCordisProjectSummary(BaseModel):
id: str
@@ -731,7 +1016,18 @@ class EuCordisProjectSummary(BaseModel):
cordis_topics: list[EuCordisTopicSummary] = Field(default_factory=list)
eurosci_voc: list[EuCordisEurosciVocSummary] = Field(default_factory=list)
topics: list[Topic] = Field(default_factory=list, description="Mapped OpenAlex topics.")
cordis_topic_text: str | None = Field(
default=None,
description=(
"Original CORDIS topics text from the Elasticsearch project "
"document, for example 'MSCA-IF-2018'."
),
)
highlight: EuCordisProjectHighlight | None = Field(
default=None,
description="Highlighted matching fragments from the project search.",
)
@classmethod
@classmethod
def from_hit(
cls,
@@ -743,16 +1039,23 @@ class EuCordisProjectSummary(BaseModel):
topics: list[Topic] | None = None,
) -> "EuCordisProjectSummary":
source = hit.get("_source", {})
project_type = EuCordisProjectType.from_index_name(hit.get("_index", ""))
project_type = EuCordisProjectType.from_index_name(
hit.get("_index", "")
)
project_id = source.get("id")
if project_id is None:
project_id = hit.get("_id", "")
return cls(
id=source.get("id") or hit.get("_id", ""),
id=str(project_id),
project_type=project_type,
title=source.get("title"),
acronym=source.get("acronym"),
objective=source.get("objective"),
keywords=source.get("keywords"),
cordis_topic_text=source.get("topics"),
framework_programme=source.get("frameworkProgramme"),
funding_scheme=source.get("fundingScheme"),
@@ -764,13 +1067,71 @@ class EuCordisProjectSummary(BaseModel):
ec_max_contribution=source.get("ecMaxContribution"),
total_cost=source.get("totalCost"),
authors=authors or None,
authors=authors,
organizations=organizations or [],
cordis_topics=cordis_topics or [],
eurosci_voc=eurosci_voc or [],
topics=topics or [],
highlight=cls._highlight_from_hit(hit),
)
@staticmethod
def _highlight_fragments(value: Any) -> list[str]:
"""Normalize an Elasticsearch highlight value to a list of strings."""
if isinstance(value, str):
return [value]
if isinstance(value, list):
return [
fragment
for fragment in value
if isinstance(fragment, str)
]
return []
@classmethod
def _highlight_from_hit(
cls,
hit: dict[str, Any],
) -> EuCordisProjectHighlight | None:
"""Extract project highlights from an Elasticsearch hit."""
raw_highlight = hit.get("highlight")
if not isinstance(raw_highlight, dict):
return None
highlight = EuCordisProjectHighlight(
title=cls._highlight_fragments(
raw_highlight.get("title")
),
acronym=cls._highlight_fragments(
raw_highlight.get("acronym")
),
objective=cls._highlight_fragments(
raw_highlight.get("objective")
),
keywords=cls._highlight_fragments(
raw_highlight.get("keywords")
),
cordis_topic_text=cls._highlight_fragments(
raw_highlight.get("topics")
),
)
has_highlights = any(
(
highlight.title,
highlight.acronym,
highlight.objective,
highlight.keywords,
highlight.cordis_topic_text,
)
)
return highlight if has_highlights else None
@staticmethod
def topic_from_match(match: dict[str, Any]) -> Topic:
domain_name = match.get("domain")
@@ -100,7 +100,6 @@ async def search_bund_projects(
response = await elasticsearch.search(
index=ESIndex.PROJECTS_BUND_V1,
track_total_hits=True,
query=query,
sort=sort,
size=filter_properties.size,
@@ -365,7 +364,7 @@ async def search_dfg_projects(
title: str | None = None,
funding_start_years: list[str] | None = None,
funding_end_years: list[str] | None = None,
sort_by: str = "id",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
skip_enrichment: bool = False,
@@ -401,7 +400,6 @@ async def search_dfg_projects(
body: dict[str, Any] = {
"size": size,
"from": from_,
"track_total_hits": True,
"_source": [
"id",
"link",
@@ -409,9 +407,10 @@ async def search_dfg_projects(
"title",
"title_de",
"title_en",
"abstract_de",
"abstract_en",
"funding_start",
"funding_end",
"Fachliche Zuordnung",
"subject_area_de",
"subject_area_en",
"persons",
@@ -427,9 +426,8 @@ async def search_dfg_projects(
# === Primary search clause: mutually exclusive fuzzy(topic_ids) vs keyword phrase search ===
if fuzzy and topic_ids:
matching_project_ids = await get_dfg_project_ids_by_topic_ids(
topic_ids=topic_ids
topic_ids=topic_ids, match_all = False
)
if not matching_project_ids:
return DfgProjectPage(elements=[], total=0, page=page, size=size)
@@ -437,35 +435,94 @@ async def search_dfg_projects(
elif keywords:
keyword_clauses = []
#Add highlighting for the title and abstract fields
title_abstract_query = {
"bool": {
"should": [
{
"multi_match": {
"query": keyword,
"fields": ["title_de", "title_en", "abstract_de", "abstract_en"],
"type": "phrase_prefix",
"max_expansions": 100,
}
}
for keyword in keywords if keyword.strip()
],
"minimum_should_match": 1,
}
}
body["highlight"] = {
"fragment_size": 200,
"number_of_fragments": 0,
"pre_tags": ["<em>"],
"post_tags": ["</em>"],
"require_field_match": True,
"fields": {
"title_de": {"highlight_query": title_abstract_query},
"title_en": {"highlight_query": title_abstract_query},
"abstract_de": {"highlight_query": title_abstract_query},
"abstract_en": {"highlight_query": title_abstract_query},
},
}
for keyword in keywords:
if keyword.strip() == "":
continue
keyword_clauses.append(
{
"multi_match": {
"query": keyword,
"fields": [
"title", "title_de", "title_en",
"abstract_de", "abstract_en",
"subject_area_de", "subject_area_en",
"subject_classifications.fach",
"subject_classifications.fachkollegium",
"subject_classifications.fachgebiet",
"subject_classifications.fachgebiet_de",
"subject_classifications.wissenschaftsbereich",
],
"type": "phrase_prefix",
"max_expansions": 100,
}
keyword_clauses.append({
"bool": {
"should": [
{
"multi_match": {
"query": keyword,
"fields": ["title_de^4", "title_en^4", "abstract_de^2", "abstract_en^2"],
"type": "phrase_prefix",
"max_expansions": 100,
}
},
{
"nested": {
"path": "subject_classifications",
"query": {
"multi_match": {
"query": keyword,
"fields": [
"subject_classifications.fach^4",
"subject_classifications.fachkollegium^4",
"subject_classifications.fachgebiet^4",
"subject_classifications.fachgebiet_de^4",
"subject_classifications.wissenschaftsbereich^4",
],
"type": "phrase_prefix",
"max_expansions": 100,
}
},
"inner_hits": {
"name": keyword,
"highlight": {
"fields": {
"subject_classifications.fach": {},
"subject_classifications.fachkollegium": {},
"subject_classifications.fachgebiet": {},
"subject_classifications.fachgebiet_de": {},
"subject_classifications.wissenschaftsbereich": {},
}
}
},
}
},
],
"minimum_should_match": 1,
}
)
})
if keyword_clauses:
must_clauses.append({"bool": {"must": keyword_clauses}})
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
if filter_topic_ids:
matching_filter_project_ids = await get_dfg_project_ids_by_topic_ids(
topic_ids=filter_topic_ids
topic_ids=filter_topic_ids, match_all=True
)
if not matching_filter_project_ids:
@@ -525,7 +582,7 @@ async def search_dfg_projects(
)
if name_must_clauses:
must_clauses.append({"bool": {"must": name_must_clauses}})
must_clauses.append({"bool": {"should": name_must_clauses, "minimum_should_match": 1}})
if institution_aliases:
matching_institution_ids = await get_institution_ids_by_institution_aliases(
@@ -553,7 +610,7 @@ async def search_dfg_projects(
}
}
)
print("MATCHING_INSTITUTION_IDS", matching_institution_ids)
#print("MATCHING_INSTITUTION_IDS", matching_institution_ids)
if institution_ids:
#prevously we were filtering by person_ids, but now we are filtering by institution_ids directly
@@ -602,17 +659,19 @@ async def search_dfg_projects(
elif sort_by == "professional_classification":
sort_config = {"subject_area_de.keyword": {"order": sort_direction}}
else:
sort_config = {"id": {"order": sort_direction}}
sort_config = {"_score": {"order": "desc"}}
body["sort"] = [sort_config]
# print(f"Executing DFG project search with body: {json.dumps(body, indent=2)}")
# === Execute Search ===
print(f"Executing DFG project search with body: {body}")
response = await elasticsearch.search(
index=ESIndex.DFG_PROJECTS,
body=body,
cluster=ESCluster.INSE,
)
# print(f"Received DFG project search response: {response}")
hits = response.get("hits", {}).get("hits", [])
if skip_enrichment:
@@ -863,7 +922,7 @@ async def search_bund_projects_with_filters(
countries: list[str] | None = None,
page: int = 0,
size: int = 10,
sort_by: str = "title",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
skip_topic_enrichment: bool = False,
@@ -940,30 +999,42 @@ async def search_bund_projects_with_filters(
)
# === Primary search clause: fuzzy(topic_ids) vs keyword phrase search ===
if fuzzy and topic_ids:
matching_project_ids = await get_bund_project_ids_by_topic_ids(topic_ids=topic_ids)
matching_project_ids = await get_bund_project_ids_by_topic_ids(topic_ids=topic_ids, match_all=False)
if not matching_project_ids:
return BundProjectPage(elements=[], total=0, page=page, size=size)
must_clauses.append({"terms": {"_id": matching_project_ids}})
elif keywords:
keyword_clauses = []
#Add highlighting for the title and abstract fields
body["highlight"] = {
"fields": {
"Verbundprojekt": {},
"Thema": {},
"Zuwendungsempfänger": {},
"Ausführende Stelle": {},
},
"pre_tags": ["<em>"],
"post_tags": ["</em>"],
"require_field_match": True,
}
for kw in keywords:
if kw.strip() == "":
continue
keyword_clauses.append({
"multi_match": {
"query": kw,
"fields": ["Verbundprojekt","Thema"], # searching title/acronym field
"fields": ["Verbundprojekt^4","Thema^4"],
"type": "phrase_prefix",
"max_expansions": 100,
}
})
if keyword_clauses:
must_clauses.append({"bool": {"must": keyword_clauses}})
must_clauses.append({"bool": {"should": keyword_clauses, "minimum_should_match": 1}})
# === Additional independent filters (applied regardless of fuzzy/keyword mode) ===
if filter_topic_ids:
matching_filter_ids = await get_bund_project_ids_by_topic_ids(topic_ids=filter_topic_ids)
matching_filter_ids = await get_bund_project_ids_by_topic_ids(topic_ids=filter_topic_ids, match_all=True)
if not matching_filter_ids:
return BundProjectPage(elements=[], total=0, page=page, size=size)
must_clauses.append({"terms": {"_id": matching_filter_ids}})
@@ -1025,7 +1096,7 @@ async def search_bund_projects_with_filters(
sort_direction = sort_direction.strip().lower()
if sort_direction not in ("asc", "desc"):
sort_direction = "asc"
sort_config = {}
if sort_by == "title":
sort_config = {"Verbundprojekt.keyword": {"order": sort_direction}}
elif sort_by == "funding_start":
@@ -1033,8 +1104,7 @@ async def search_bund_projects_with_filters(
elif sort_by == "funding_end":
sort_config = {"funding_end": {"order": sort_direction}}
else:
# Fallback to project ID
sort_config = {"Förderkennzeichen.keyword": {"order": sort_direction}}
sort_config = "_score"
body["sort"] = [sort_config]
# print(f"Executing BUND project search with body: {json.dumps(body, indent=2)}")
@@ -1043,7 +1113,6 @@ async def search_bund_projects_with_filters(
index=ESIndex.PROJECTS_BUND_V1,
body=body,
cluster=ESCluster.INSE,
track_total_hits=True,
)
hits = response.get("hits", {}).get("hits", [])
@@ -1177,7 +1246,6 @@ async def search_all_projects(
offset=offset,
query=query,
sort=sort,
track_total_hits=True,
)
return _response_to_funding_project_page(response=response, page=page, size=size)
+3 -3
View File
@@ -128,7 +128,7 @@ async def get_dfg_projects(
] = None,
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
sort_by: Annotated[str, Query(description="The field to sort by.")] = "title",
sort_by: Annotated[str, Query(description="The field to sort by.")] = "",
sort_direction: Annotated[
str, Query(description="The sort direction (asc or desc).")
] = "asc",
@@ -281,7 +281,7 @@ async def search_bund_projects(
] = None,
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
sort_by: Annotated[str, Query(description="Sort field.")] = "title",
sort_by: Annotated[str, Query(description="Sort field.")] = "",
sort_direction: Annotated[
str,
Query(description="Sort direction: asc or desc."),
@@ -455,7 +455,7 @@ async def search_eu_cordis_projects_endpoint(
] = None,
page: Annotated[int, Query(description="The page number.", ge=0)] = 0,
size: Annotated[int, Query(description="The page size.", ge=1)] = 20,
sort_by: Annotated[str, Query(description="Sort field.")] = "title",
sort_by: Annotated[str, Query(description="Sort field.")] = "",
sort_direction: Annotated[
str,
Query(description="Sort direction: asc or desc."),
+3 -3
View File
@@ -184,7 +184,7 @@ async def get_dfg_projects(
funding_end_years: list[str] | None,
page: int,
size: int,
sort_by: str = "topic",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
skip_enrichment: bool = False,
@@ -461,7 +461,7 @@ async def search_bund_projects_with_filters(
countries: list[str] | None,
page: int,
size: int,
sort_by: str = "title",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
active_from_year: int | None = None,
@@ -672,7 +672,7 @@ async def search_eu_cordis_projects(
framework_programmes: list[str] | None = None,
funding_schemes: list[str] | None = None,
statuses: list[str] | None = None,
sort_by: str = "title",
sort_by: str = "",
sort_direction: str = "asc",
fuzzy: bool = False,
skip_enrichment: bool = False,
+252 -98
View File
@@ -2,7 +2,6 @@
import asyncio
import logging
from dataclasses import dataclass
from math import floor
from time import time
from typing import Any
@@ -21,13 +20,16 @@ from .model import (
AuthorTopicStats,
CareerStage,
CompanyStatusFilter,
FilterType,
KeywordOperator,
PublicationType,
PublicationTypeCount,
RankedAuthor,
RankingWeights,
SubfieldShare,
Timespan,
FieldNode,
SubfieldNode,
TopicNode,
)
logger = logging.getLogger(__name__)
@@ -65,59 +67,88 @@ async def _get_author_ids_from_institution(institution_id: str) -> list[str]:
@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."""
def _topics_nested_clause(should_clauses: list[dict]) -> dict:
"""Wraps should-clauses on the nested topics of a work."""
return {
"nested": {
"path": config.path,
"path": "topics",
"query": {
"term": {config.match_field: value},
"bool": {
"should": should_clauses,
"minimum_should_match": 1,
},
},
},
}
def _topic_id_clause(topic_id: str) -> dict:
"""Matches one OpenAlex topic id against a work (fuzzy mode).
A work matches when the topic is either its primary topic or one of its
other topics.
"""
return {
"bool": {
"should": [
_topics_nested_clause([{"term": {"topics.id": topic_id}}]),
{"term": {"primary_topic.id": topic_id}},
],
"minimum_should_match": 1,
},
}
def _keyword_clause(keyword: str) -> dict:
"""Matches one raw keyword as a phrase against a work (non-fuzzy mode).
The keyword has to occur as a phrase in at least one of the work's own text
fields or in one of the names of its topic hierarchy.
"""
return {
"bool": {
"should": [
{
"nested": {
"path": "keywords",
"query": {
"match_phrase": {"keywords.display_name": keyword},
},
},
},
{"match_phrase": {"primary_topic.display_name": keyword}},
{"match_phrase": {"title": keyword}},
{"match_phrase": {"abstract": keyword}},
_topics_nested_clause(
[
{"match_phrase": {"topics.display_name": keyword}},
{"match_phrase": {"topics.field.display_name": keyword}},
{"match_phrase": {"topics.subfield.display_name": keyword}},
{"match_phrase": {"topics.domain.display_name": keyword}},
]
),
],
"minimum_should_match": 1,
},
}
def _build_keyword_query(
keywords: list[str],
operator: KeywordOperator,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> 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.
AND: a work must match all values (every clause is required).
OR: a work must match at least one of the values.
"""
clauses = []
for keyword in keywords:
clauses.append(_keyword_clause(keyword, config))
if fuzzy:
clauses.append(_topic_id_clause(keyword))
else:
clauses.append(_keyword_clause(keyword))
if operator == KeywordOperator.OR:
return {
@@ -152,12 +183,12 @@ def _topic_stats_query(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds a single query with all stats for Section 1"""
filters = [
_build_keyword_query(keywords, operator, config),
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
@@ -279,38 +310,6 @@ def _topic_stats_query(
"_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},
},
},
},
},
},
},
},
},
@@ -343,17 +342,16 @@ async def topic_stats_for_authors(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> 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
author_ids, keywords, operator, publication_types, timespan, fuzzy
),
cluster=ESCluster.NES,
)
@@ -371,12 +369,6 @@ async def topic_stats_for_authors(
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", [])
@@ -409,8 +401,6 @@ async def topic_stats_for_authors(
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),
@@ -420,13 +410,29 @@ async def topic_stats_for_authors(
return results
def _primary_topic_match(keywords: list[str], fuzzy: bool) -> dict:
"""Matches works whose primary topic is one of the searched topics/keywords."""
if fuzzy:
return {"terms": {"primary_topic.id": keywords}}
return {
"bool": {
"should": [
{"match_phrase": {"primary_topic.display_name": keyword}}
for keyword in keywords
],
"minimum_should_match": 1,
},
}
def _topic_profile_query(
author_ids: list[str],
keywords: list[str],
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds the Section 3 query"""
@@ -470,14 +476,10 @@ def _topic_profile_query(
"reverse_nested": {},
"aggs": {
"matched": {
"filter": _build_keyword_query(keywords, operator, config),
"filter": _build_keyword_query(keywords, operator, fuzzy),
"aggs": {
"primary_match": {
"filter": {
"terms": {
"primary_topic.display_name.keyword": keywords,
},
},
"filter": _primary_topic_match(keywords, fuzzy),
},
},
},
@@ -487,6 +489,49 @@ def _topic_profile_query(
"size": 10,
},
},
# topic treemap
"by_field": {
"terms": {
"field": "primary_topic.field.id",
"size": 30,
},
"aggs": {
"field_name": {
"terms": {
"field": "primary_topic.field.display_name.keyword",
"size": 1,
},
},
"by_subfield": {
"terms": {
"field": "primary_topic.subfield.id",
"size": 30,
},
"aggs": {
"subfield_name": {
"terms": {
"field": "primary_topic.subfield.display_name.keyword",
"size": 1,
},
},
"by_topic": {
"terms": {
"field": "primary_topic.id",
"size": 30,
},
"aggs": {
"topic_name": {
"terms": {
"field": "primary_topic.display_name.keyword",
"size": 1,
},
},
},
},
},
},
},
},
"distinct_topics": {
"cardinality": {"field": "primary_topic.id"},
},
@@ -514,17 +559,16 @@ async def topic_profile_for_authors(
operator: KeywordOperator,
publication_types: list[PublicationType],
timespan: Timespan | None,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> 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
author_ids, keywords, operator, publication_types, timespan, fuzzy
),
cluster=ESCluster.NES,
)
@@ -549,6 +593,30 @@ async def topic_profile_for_authors(
)
for bucket in to_work.get("by_subfield", {}).get("buckets", [])
]
field_tree = [
FieldNode(
id=field_bucket.get("key", ""),
name=_bucket_name(field_bucket, "field_name", field_bucket.get("key", "")),
count=field_bucket.get("doc_count", 0),
subfields=[
SubfieldNode(
id=subfield_bucket.get("key", ""),
name=_bucket_name(subfield_bucket, "subfield_name", subfield_bucket.get("key", "")),
count=subfield_bucket.get("doc_count", 0),
topics=[
TopicNode(
id=topic_bucket.get("key", ""),
name=_bucket_name(topic_bucket, "topic_name", topic_bucket.get("key", "")),
count=topic_bucket.get("doc_count", 0),
)
for topic_bucket in subfield_bucket.get("by_topic", {}).get("buckets", [])
],
)
for subfield_bucket in field_bucket.get("by_subfield", {}).get("buckets", [])
],
)
for field_bucket in to_work.get("by_field", {}).get("buckets", [])
]
results.append(
AuthorTopicProfile(
author_id=author_bucket.get("key", ""),
@@ -560,6 +628,7 @@ async def topic_profile_for_authors(
distinct_subfields=to_work.get("distinct_subfields", {}).get("value", 0),
distinct_fields=to_work.get("distinct_fields", {}).get("value", 0),
subfields=subfields,
field_tree=field_tree,
)
)
@@ -655,11 +724,11 @@ def _build_query(
author_ids: list[str],
publication_types: list[PublicationType],
timespan: Timespan | None,
config: MatchConfig = _KEYWORD_MATCH,
fuzzy: bool = False,
) -> dict:
"""Builds the Elasticsearch query that returns the raw stats per author."""
work_filters = [
_build_keyword_query(keywords, operator, config),
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
if publication_types:
@@ -717,6 +786,84 @@ def _build_query(
}
def _build_publication_type_counts_query(
keywords: list[str],
operator: KeywordOperator,
author_ids: list[str],
timespan: Timespan | None,
fuzzy: bool = False,
) -> dict:
"""Builds the query that counts matching works per publication type.
Mirrors _build_query's work filters but leaves out the publication_types
filter itself, since it aggregates over all types instead of one score.
"""
work_filters = [
_build_keyword_query(keywords, operator, fuzzy),
_author_filter(author_ids),
]
if timespan is not None:
work_filters.append(_timespan_filter(timespan))
return {
"size": 0,
"query": {
"bool": {
"filter": work_filters,
},
},
"aggs": {
"by_type": {
"terms": {
"field": "type",
"size": len(PublicationType),
},
},
},
}
async def publication_type_counts_for_keywords(
keywords: list[str],
operator: KeywordOperator,
institution_id: str,
career_stages: list[CareerStage],
timespan: Timespan | None,
fuzzy: bool = False,
) -> list[PublicationTypeCount]:
"""Counts the university's matching works per publication type, largest first."""
author_ids = await _get_author_ids_from_institution(institution_id)
if not author_ids:
return []
if career_stages:
author_ids = await _filter_author_ids_by_career_stage(author_ids, career_stages)
query_body = _build_publication_type_counts_query(
keywords, operator, author_ids, timespan, fuzzy,
)
response: dict[str, Any] = await elasticsearch.search(
index=config.settings.openalex_works_search_index,
body=query_body,
cluster=ESCluster.NES,
)
type_buckets = response.get("aggregations", {}).get("by_type", {}).get("buckets", [])
counts = []
for bucket in type_buckets:
try:
publication_type = PublicationType(bucket["key"])
except ValueError:
continue
counts.append(PublicationTypeCount(type=publication_type, count=bucket["doc_count"]))
counts.sort(key=lambda c: c.count, reverse=True)
return counts
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", [])
@@ -725,6 +872,14 @@ def _display_name_from_bucket(author_bucket: dict) -> str:
return ""
def _bucket_name(bucket: dict, name_agg_key: str, fallback: str) -> str:
"""Reads a display name out of a bucket's name sub-aggregation, falling back to its id."""
name_buckets = bucket.get(name_agg_key, {}).get("buckets", [])
if name_buckets and name_buckets[0].get("key"):
return str(name_buckets[0]["key"])
return fallback
def _citations_from_bucket(author_bucket: dict) -> int:
"""Reads the summed citations out of the reverse_nested sub-aggregation."""
citations_value = (
@@ -1017,7 +1172,7 @@ async def rank_authors_by_keywords(
publication_types: list[PublicationType],
timespan: Timespan | None,
company_status: CompanyStatusFilter = CompanyStatusFilter.ALL,
filter_type: FilterType = FilterType.KEYWORD,
fuzzy: bool = False,
) -> list[RankedAuthor]:
"""Ranks the university's authors by a weighted score over works and citations.
@@ -1035,8 +1190,7 @@ async def rank_authors_by_keywords(
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),
keywords, operator, author_ids, publication_types, timespan, fuzzy,
)
response: dict[str, Any] = await elasticsearch.search(
+83 -31
View File
@@ -12,11 +12,6 @@ class KeywordOperator(StrEnum):
OR = "or"
class FilterType(StrEnum):
KEYWORD = "keyword"
TOPIC = "topic"
class CompanyStatusFilter(StrEnum):
ALL = "all"
ACTIVE = "active"
@@ -107,10 +102,12 @@ class KeywordToAuthorRequest(BaseModel):
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'.",
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
weights: RankingWeights = Field(
description="Weights for the ranking metrics. Required.",
@@ -133,7 +130,7 @@ class KeywordToAuthorRequest(BaseModel):
"'all', only 'active' (non-deleted), or only 'deleted'.",
)
@field_validator("operator", "filter_type", mode="before")
@field_validator("operator", mode="before")
@classmethod
def operator_case_insensitive(cls, value):
if isinstance(value, str):
@@ -154,10 +151,12 @@ class SelectedAuthorsRequest(BaseModel):
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'.",
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
publication_types: list[PublicationType] = Field(
default_factory=list,
@@ -175,13 +174,6 @@ class SelectedAuthorsRequest(BaseModel):
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(
@@ -195,6 +187,44 @@ class AuthorMetricsRequest(BaseModel):
)
class PublicationTypeCountsRequest(BaseModel):
keywords: list[str] = Field(
min_length=1,
description="One or more keywords to match works against.",
)
operator: KeywordOperator = Field(
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
fuzzy: bool = Field(
default=False,
description="How the 'keywords' values are matched: True means they are "
"OpenAlex topic ids matched against the work's topics, False means they are "
"raw keywords matched as phrases in the work's title, abstract, keywords and "
"topic names. Defaults to False.",
)
career_stages: list[CareerStage] = Field(
default_factory=list,
description="Optional filter: only count works of authors in one of these career stages. Empty = no filter.",
)
timespan: Timespan | None = 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
class PublicationTypeCount(BaseModel):
type: PublicationType = Field(description="The OpenAlex work type.")
count: int = Field(description="Number of matching works of this type.")
class AuthorTopicStats(BaseModel):
"""Section 1: combined stats over an author's works that match the topic filter."""
@@ -254,15 +284,6 @@ class AuthorTopicStats(BaseModel):
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.",
@@ -282,6 +303,32 @@ class SubfieldShare(BaseModel):
count: int = Field(description="Number of works whose primary topic belongs to this subfield.")
class TopicNode(BaseModel):
id: str = Field(description="The OpenAlex ID of the primary topic.")
name: str = Field(description="The primary-topic display name.")
count: int = Field(description="Number of works whose primary topic is this topic.")
class SubfieldNode(BaseModel):
id: str = Field(description="The OpenAlex ID of the subfield.")
name: str = Field(description="The subfield display name.")
count: int = Field(description="Number of works whose primary topic belongs to this subfield.")
topics: list[TopicNode] = Field(
default_factory=list,
description="Primary topics within this subfield, largest first.",
)
class FieldNode(BaseModel):
id: str = Field(description="The OpenAlex ID of the field.")
name: str = Field(description="The field display name.")
count: int = Field(description="Number of works whose primary topic belongs to this field.")
subfields: list[SubfieldNode] = Field(
default_factory=list,
description="Subfields within this field, largest first.",
)
class AuthorTopicProfile(BaseModel):
author_id: str = Field(description="The OpenAlex ID of the author.")
display_name: str = Field(description="The name of the author.")
@@ -293,7 +340,7 @@ class AuthorTopicProfile(BaseModel):
)
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').",
"primary topic.",
)
distinct_topics: int = Field(
description="Number of distinct primary topics across all works.",
@@ -308,6 +355,11 @@ class AuthorTopicProfile(BaseModel):
default_factory=list,
description="Top subfields over all works, by primary topic, largest first.",
)
field_tree: list[FieldNode] = Field(
default_factory=list,
description="Field -> subfield -> topic hierarchy over all works, by primary "
"topic, each level largest first. Drives the interactive topic treemap.",
)
class AuthorStaticStats(BaseModel):
@@ -116,6 +116,16 @@ Content-Type: application/json
"timespan": { "from": 2018, "to": 2025 }
}
###
POST http://localhost:8000/api/rank/topic-profile
Content-Type: application/json
{
"author_ids": ["https://openalex.org/A504035360", "https://openalex.org/A5019137844"],
"keywords": ["Augmented Reality Applications"],
"operator": "or"
}
###
GET https://project.nes.uni-due.de/elastic/_aliases
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
+45 -9
View File
@@ -14,6 +14,8 @@ from .model import (
AuthorTopicProfile,
AuthorTopicStats,
KeywordToAuthorRequest,
PublicationTypeCount,
PublicationTypeCountsRequest,
RankedAuthor,
SelectedAuthorsRequest,
)
@@ -46,11 +48,11 @@ async def rank_author(
)
logger.info(
"rank-author keywords=%s operator=%s filter_type=%s institution_id=%s career_stages=%s "
"rank-author keywords=%s operator=%s fuzzy=%s institution_id=%s career_stages=%s "
"publication_types=%s timespan=%s",
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
institution_id,
request.career_stages,
request.publication_types,
@@ -65,18 +67,52 @@ async def rank_author(
publication_types=request.publication_types,
timespan=request.timespan,
company_status=request.company_status,
filter_type=request.filter_type,
fuzzy=request.fuzzy,
)
# Publication-type facet counts for the "Art der Work" filter
@router.post("/publication-type-counts", response_model=list[PublicationTypeCount])
async def publication_type_counts(
request: PublicationTypeCountsRequest,
access_token_metadata: Annotated[
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
],
):
institution_id = access_token_metadata.effective_institution_id
if not institution_id:
raise HTTPException(
status_code=status.HTTP_403_FORBIDDEN,
detail="No OpenAlex institution is assigned to the current organization.",
)
logger.info(
"publication-type-counts keywords=%s operator=%s fuzzy=%s institution_id=%s "
"career_stages=%s timespan=%s",
request.keywords,
request.operator,
request.fuzzy,
institution_id,
request.career_stages,
request.timespan,
)
return await logic.publication_type_counts_for_keywords(
keywords=request.keywords,
operator=request.operator,
institution_id=institution_id,
career_stages=request.career_stages,
timespan=request.timespan,
fuzzy=request.fuzzy,
)
# 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",
"topic-stats author_ids=%s keywords=%s operator=%s fuzzy=%s publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
request.publication_types,
request.timespan,
)
@@ -86,19 +122,19 @@ async def topic_stats(request: SelectedAuthorsRequest):
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
request.fuzzy,
)
# 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 "
"topic-profile author_ids=%s keywords=%s operator=%s fuzzy=%s "
"publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.fuzzy,
request.publication_types,
request.timespan,
)
@@ -108,7 +144,7 @@ async def topic_profile(request: SelectedAuthorsRequest):
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
request.fuzzy,
)
# Compare authors table 2 (author-level stats, keyword/time-independent)
-84
View File
@@ -1,84 +0,0 @@
"""
This module contains the rest api of the
service.
"""
import logging
from typing import Annotated
from fastapi import APIRouter, Query
from inse.config import get_settings
from . import logic
logger = logging.getLogger(__name__)
### startup
settings = get_settings()
router = APIRouter(
prefix="/api/inse-service",
tags=["INSE Service"],
responses={404: {"description": "Not found"}},
)
### topics
# hierarchy cache (temporaray => should be called by a scheduled job, with new openalex data indexing)
@router.get(
"/topics/cache",
operation_id="buildTopicCache",
response_model=dict,
summary="Builds the topic hierarchy cache.",
tags=["Topics"],
)
def build_topic_cache(
page_size: Annotated[
int, Query(description="Page size for each search page.", ge=1, le=1000)
] = 200,
save_json: Annotated[
bool, Query(description="Persist cache JSON to data folder.")
] = True,
):
return logic.build_topic_cache(page_size=page_size, save_json=save_json)
@router.get(
"/topics/count",
operation_id="countTopicHierarchy",
response_model=dict,
summary="Counts topic hierarchy occurrences from cache.",
tags=["Topics"],
)
def count_topic_hierarchy(
topic_names: Annotated[
list[str],
Query(
alias="topic",
description="Topic names (repeat parameter).",
example=[
"Big Data and Business Intelligence",
"Big Data and Business Intelligence",
"Topic Modeling",
"Entrepreneurship Studies and Influences",
"Complex Network Analysis Techniques",
"Semantic Web and Ontologies",
],
),
],
):
return logic.count_topic_hierarchy(topic_names)
@router.get(
"/topics/hierarchy",
operation_id="getTopicHierarchy",
response_model=dict,
summary="Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics).",
tags=["Topics"],
)
def get_topic_hierarchy():
return logic.get_topic_hierarchy()
+125
View File
@@ -0,0 +1,125 @@
import re
SNIPPET_FRAGMENT_CHARS = 500
SNIPPET_FRAGMENT_COUNT = 3
SNIPPET_FRAGMENT_SEPARATOR = " … "
SNIPPET_CONTEXT_BEFORE_CHARS = 400
SNIPPET_CONTEXT_AFTER_CHARS = 1100
SNIPPET_BOUNDARY_CHARS = 150
SNIPPET_ELLIPSIS = "…"
_EM_TAG = re.compile(r"<em>(.*?)</em>", re.DOTALL)
_SENTENCE_BREAK = re.compile(r"(?<![0-9]\.)(?<=[.!?])\s+|\n+")
FRAGMENT_FIELD = {
"fragment_size": SNIPPET_FRAGMENT_CHARS,
"number_of_fragments": SNIPPET_FRAGMENT_COUNT,
}
WHOLE_FIELD = {"number_of_fragments": 0}
HIGHLIGHT_TAGS = {"pre_tags": ["<em>"], "post_tags": ["</em>"]}
def snippet_with_context(text: str | None, fragments: list) -> str:
joined = SNIPPET_FRAGMENT_SEPARATOR.join(fragments)
terms = marked_terms(joined)
if not text or not terms:
return joined
span = _first_term_span(text, terms)
if span is None:
return joined
start, end = _window_bounds(text, *span)
window = _mark_terms(text[start:end], terms)
if start > 0:
window = f"{SNIPPET_ELLIPSIS} {window}"
if end < len(text):
window = f"{window} {SNIPPET_ELLIPSIS}"
return window
def marked_terms(fragment_text: str) -> list:
by_key: dict[str, str] = {}
for match in _EM_TAG.finditer(fragment_text):
term = match.group(1).strip()
if term:
by_key.setdefault(term.lower(), term)
return list(by_key.values())
def _first_term_span(text: str, terms: list) -> tuple | None:
lowered = text.lower()
spans = [
(index, index + len(term))
for term, index in ((term, lowered.find(term.lower())) for term in terms)
if index >= 0
]
return min(spans) if spans else None
def _window_bounds(text: str, match_start: int, match_end: int) -> tuple:
start = max(0, match_start - SNIPPET_CONTEXT_BEFORE_CHARS)
end = min(len(text), match_end + SNIPPET_CONTEXT_AFTER_CHARS)
if start > 0:
start = _forward_to_boundary(text, start, match_start)
if end < len(text):
end = _back_to_boundary(text, end, match_end)
return start, end
def _forward_to_boundary(text: str, start: int, limit: int) -> int:
ahead = _SENTENCE_BREAK.search(text, start, min(limit, start + SNIPPET_BOUNDARY_CHARS))
if ahead:
return ahead.end()
behind_from = max(0, start - SNIPPET_BOUNDARY_CHARS)
behind = list(_SENTENCE_BREAK.finditer(text, behind_from, start))
if behind:
return behind[-1].end()
if behind_from == 0:
return 0
space = text.find(" ", start, start + SNIPPET_BOUNDARY_CHARS)
return space + 1 if space >= 0 else start
def _back_to_boundary(text: str, end: int, floor: int) -> int:
sentence = _SENTENCE_BREAK.search(text, end, end + SNIPPET_BOUNDARY_CHARS)
if sentence:
return sentence.start()
space = text.rfind(" ", floor, end)
return space if space > floor else end
def _mark_terms(window: str, terms: list) -> str:
lowered = window.lower()
spans = sorted(
(index, index + len(term))
for term, index in ((term, lowered.find(term.lower())) for term in terms)
if index >= 0
)
marked = []
cursor = 0
for start, end in spans:
if start < cursor:
continue
marked.append(window[cursor:start])
marked.append(f"<em>{window[start:end]}</em>")
cursor = end
marked.append(window[cursor:])
return "".join(marked)
+2 -103
View File
@@ -1,111 +1,10 @@
from fastapi.testclient import TestClient
from inse.main import app
client = TestClient(app)
URL_SERVICE_PREFIX="/inse-service"
def test_redirect_root():
response = client.get("/", follow_redirects=False)
assert response.status_code == 307
# def test_get_person_by_id_success():
# mock_person = model.Person(
# id="A5093075883",
# name="Arman Arzani",
# works_count=6,
# cited_by_count=4,
# affiliations=[],
# topics=[]
# )
# with patch("inse.logic.get_person_by_id", return_value=mock_person):
# response = client.get(
# URL_SERVICE_PREFIX + "/persons/id",
# params={"author_id": "A5093075883"}
# )
# assert response.status_code == 200
# data = response.json()
# assert data["id"] == "A5093075883"
# assert data["name"] == "Arman Arzani"
# assert data["works_count"] == 6
# assert data["cited_by_count"] == 4
# def test_get_person_by_id_not_found():
# invalid_id = "INVALID"
# with patch(
# "inse.logic.get_person_by_id",
# side_effect=HTTPException(
# status_code=404,
# detail="Person with id INVALID not found"
# )
# ):
# response = client.get(
# URL_SERVICE_PREFIX + "/persons/id",
# params={"author_id": invalid_id}
# )
# assert response.status_code == 404
# def test_get_person_by_id_missing_query_param():
# response = client.get(URL_SERVICE_PREFIX + "/persons/id")
# assert response.status_code == 422
# def test_search_persons_by_name_success():
# mock_result = model.PersonSearchResult(
# persons=[
# model.Person(
# id="A5047117780",
# name="Pedro José Marrón",
# works_count=285,
# cited_by_count=2638,
# )
# ]
# )
# with patch(
# "inse.logic.search_persons_by_name",
# return_value=mock_result
# ):
# response = client.get(
# URL_SERVICE_PREFIX + "/persons/searchByName",
# params={"author_name": "Pedro José Marrón"}
# )
# assert response.status_code == 200
# data = response.json()
# assert "persons" in data
# assert data["persons"][0]["name"] == "Pedro José Marrón"
# def test_search_persons_by_name_empty_result():
# response = client.get(
# URL_SERVICE_PREFIX + "/persons/searchByName",
# params={"author_name": "zzzz_nonexistent_name_123"}
# )
# assert response.status_code == 200
# data = response.json()
# assert data["persons"] == []
# def test_search_persons_by_name_missing_query_param():
# response = client.get(URL_SERVICE_PREFIX + "/persons/searchByName")
# assert response.status_code == 422
assert response.status_code == 307
+23
View File
@@ -1,4 +1,5 @@
from enum import StrEnum
from pydantic import BaseModel
from inse.model import Page
from inse.models.openalex.topic import Topic
@@ -12,3 +13,25 @@ class TopicSortBy(StrEnum):
class TopicPageV2(Page[Topic]):
pass
class TopicHierarchySubfield(BaseModel):
id: str | None = None
name: str
topics: list[Topic] = []
class TopicHierarchyField(BaseModel):
id: str | None = None
name: str
subfields: list[TopicHierarchySubfield] = []
class TopicHierarchyDomain(BaseModel):
id: str | None = None
name: str
fields: list[TopicHierarchyField] = []
class TopicHierarchyResponse(BaseModel):
domains: list[TopicHierarchyDomain] = []
+14 -1
View File
@@ -10,7 +10,11 @@ from inse.models.openalex.subfield import Subfield
from inse.models.openalex.topic import Topic
from inse.router_prefixes import RouterPrefixes
from inse.tags import Tags
from inse.topics.v2.model import TopicPageV2, TopicSortBy
from inse.topics.v2.model import (
TopicHierarchyResponse,
TopicPageV2,
TopicSortBy,
)
logger = logging.getLogger(__name__)
@@ -18,6 +22,15 @@ logger = logging.getLogger(__name__)
router = APIRouter(prefix=RouterPrefixes.TOPICS_V2, tags=[Tags.TOPICS_V2])
@router.get(
"/hierarchy",
operation_id="getTopicHierarchy",
summary="Returns the full topic hierarchy tree (Domain -> Field -> Subfield -> Topics).",
)
async def get_topic_hierarchy() -> TopicHierarchyResponse:
return await topics_service.get_topic_hierarchy()
@router.get(
"/search",
operation_id="searchTopics",
+123 -1
View File
@@ -5,7 +5,14 @@ from inse.models.openalex.domain import Domain
from inse.models.openalex.model_field import ModelField
from inse.models.openalex.subfield import Subfield
from inse.models.openalex.topic import Topic
from inse.topics.v2.model import TopicPageV2, TopicSortBy
from inse.topics.v2.model import (
TopicHierarchyDomain,
TopicHierarchyField,
TopicHierarchyResponse,
TopicHierarchySubfield,
TopicPageV2,
TopicSortBy,
)
async def _search_topics(
@@ -322,3 +329,118 @@ async def get_topics_by_ids(topic_ids: list[str]) -> TopicPageV2:
"domain",
],
)
_cached_hierarchy: TopicHierarchyResponse | None = None #cache is small, data is static => reduces database calls
def clear_topic_hierarchy_cache() -> None:
global _cached_hierarchy
_cached_hierarchy = None
async def get_topic_hierarchy() -> TopicHierarchyResponse:
"""Builds and returns a hierarchical tree structure of topics:
Domains -> Fields -> Subfields -> Topics
Data is dynamically streamed from Elasticsearch openalex-topics using PIT+search_after scan and cached in-memory.
"""
global _cached_hierarchy
if _cached_hierarchy is not None:
return _cached_hierarchy
domains_map: dict[str, dict] = {}
async for hit in elasticsearch.scan(
index=ESIndex.OPENALEX_TOPICS,
query={"match_all": {}},
source=[
"id",
"display_name",
"description",
"subfield",
"field",
"domain",
"works_count",
"cited_by_count",
],
page_size=2000,
):
source = hit.get("_source", {})
topic_name = source.get("display_name")
topic_id = source.get("id") or hit.get("_id")
if not topic_name or not topic_id:
continue
domain_info = source.get("domain") or {}
field_info = source.get("field") or {}
subfield_info = source.get("subfield") or {}
domain_name = domain_info.get("display_name") or "Unbekannter Bereich"
domain_id = domain_info.get("id")
field_name = field_info.get("display_name") or "Unbekanntes Feld"
field_id = field_info.get("id")
subfield_name = subfield_info.get("display_name") or "Unbekanntes Teilfeld"
subfield_id = subfield_info.get("id")
if domain_name not in domains_map:
domains_map[domain_name] = {
"id": domain_id,
"name": domain_name,
"fields": {},
}
fields_map = domains_map[domain_name]["fields"]
if field_name not in fields_map:
fields_map[field_name] = {
"id": field_id,
"name": field_name,
"subfields": {},
}
subfields_map = fields_map[field_name]["subfields"]
if subfield_name not in subfields_map:
subfields_map[subfield_name] = {
"id": subfield_id,
"name": subfield_name,
"topics": [],
}
topic_obj = Topic.from_dict(source) if hasattr(Topic, "from_dict") else Topic(**source)
subfields_map[subfield_name]["topics"].append(topic_obj)
formatted_domains: list[TopicHierarchyDomain] = []
for d_name, d_val in sorted(domains_map.items(), key=lambda x: x[0]):
formatted_fields: list[TopicHierarchyField] = []
for f_name, f_val in sorted(d_val["fields"].items(), key=lambda x: x[0]):
formatted_subfields: list[TopicHierarchySubfield] = []
for sf_name, sf_val in sorted(
f_val["subfields"].items(), key=lambda x: x[0]
):
sf_val["topics"].sort(
key=lambda t: t.display_name or ""
)
formatted_subfields.append(
TopicHierarchySubfield(
id=sf_val["id"],
name=sf_name,
topics=sf_val["topics"],
)
)
formatted_fields.append(
TopicHierarchyField(
id=f_val["id"],
name=f_name,
subfields=formatted_subfields,
)
)
formatted_domains.append(
TopicHierarchyDomain(
id=d_val["id"],
name=d_name,
fields=formatted_fields,
)
)
result = TopicHierarchyResponse(domains=formatted_domains)
_cached_hierarchy = result
return result
+23 -6
View File
@@ -20,6 +20,10 @@ from inse.models.openalex.topics_by_time import TopicsByTime
from inse.models.openalex.topics_by_year import TopicsByYear
from inse.models.openalex.work import Work
from inse.models.openalex.work_page import WorkPage
from inse.models.openalex.work_topic import WorkTopic
from inse.models.openalex.work_topic_domain import WorkTopicDomain
from inse.models.openalex.work_topic_field import WorkTopicField
from inse.models.openalex.work_topic_subfield import WorkTopicSubfield
from inse.models.openalex.works_list_response import WorksListResponse
from .search_client import OpenAlexWorksSearchClient
@@ -235,26 +239,39 @@ async def get_work(
return elements[0]
async def enrich_topic_descriptions(topics: list) -> None:
"""Batch-fill missing descriptions on dehydrated topics.
async def enrich_topic_descriptions(topics: list[WorkTopic]) -> None:
"""Batch-fill missing hierarchy metadata and descriptions on dehydrated topics.
OpenAlex work and author documents carry dehydrated topics without a
description, so we batch-load the details from the openalex-topics index.
description, subfield, field, or domain, so we batch-load the details from
the openalex-topics index.
"""
pending = [topic for topic in topics if topic.id and not topic.description]
pending = [
topic
for topic in topics
if topic.id and (not topic.description or not topic.var_field or not topic.domain)
]
if not pending:
return
details = await _get_topic_details(list({topic.id for topic in pending}))
if not details:
return
for topic in pending:
info = details.get(topic.id)
if info:
if not info:
continue
if not topic.description:
topic.description = info.get("description")
if not topic.subfield and info.get("subfield"):
topic.subfield = WorkTopicSubfield.from_dict(info["subfield"])
if not topic.var_field and info.get("field"):
topic.var_field = WorkTopicField.from_dict(info["field"])
if not topic.domain and info.get("domain"):
topic.domain = WorkTopicDomain.from_dict(info["domain"])
async def _enrich_work_topic_descriptions(works: list[Work]) -> None:
+73
View File
@@ -6,6 +6,12 @@ from inse.exceptions import ElasticsearchNotFoundException, NotFoundException
from inse.integrations import elasticsearch
from inse.model import ESCluster, ESIndex, SortDirection
from inse.models.openalex.work import Work
from inse.snippets import (
FRAGMENT_FIELD,
HIGHLIGHT_TAGS,
WHOLE_FIELD,
snippet_with_context,
)
from inse.works.v2.model import (
PrimaryCategoryYearAggregation,
PrimaryCategoryYearAggregationPage,
@@ -372,6 +378,17 @@ async def get_works_by_keywords(
track_total_hits=True,
offset=page * size,
sort=sort,
# A work matches on its topic and keyword metadata as well as on its
# text, so roughly half the hits contain the searched keyword nowhere in
# title or abstract. Highlighting tells the two apart: a fragment comes
# back only for the works that really do carry the phrase.
highlight={
"fields": {
"title": WHOLE_FIELD,
"abstract": FRAGMENT_FIELD,
},
**HIGHLIGHT_TAGS,
},
cluster=ESCluster.NES,
)
print(f"Elasticsearch response: {response}")
@@ -388,11 +405,67 @@ async def get_works_by_keywords(
work = Work.from_dict(source) # type: ignore
if work is not None:
snippet, snippet_field = _keyword_snippet(hit)
work.snippet = snippet
work.snippet_field = snippet_field
work.matched_via = _matched_via(source, keywords)
elements.append(work)
return WorkPageV2(elements=elements, total=total, page=page, size=size)
def _keyword_snippet(hit: dict) -> tuple[str | None, str | None]:
"""Picks the passage to show for a hit, preferring the title over the abstract."""
highlight = hit.get("highlight") or {}
title_fragments = highlight.get("title")
if title_fragments:
return title_fragments[0], "title"
abstract_fragments = highlight.get("abstract")
if abstract_fragments:
abstract = (hit.get("_source") or {}).get("abstract")
return snippet_with_context(abstract, abstract_fragments), "abstract"
return None, None
def _matched_via(source: dict, keywords: list[str] | None) -> list[str] | None:
"""Names the topics and keywords a work was matched through.
Only needed when there is no snippet: those works carry the searched term in
their metadata rather than in their text, and would otherwise expand into an
empty row. Matching mirrors the `match_phrase` clauses above closely enough
for a label - it is not used for retrieval.
"""
wanted = [kw.strip().lower() for kw in (keywords or []) if kw and kw.strip()]
if not wanted:
return None
candidates: list[str] = []
primary_topic = source.get("primary_topic") or {}
candidates.append(primary_topic.get("display_name"))
for topic in source.get("topics") or []:
candidates.append(topic.get("display_name"))
for level in ("field", "subfield", "domain"):
candidates.append((topic.get(level) or {}).get("display_name"))
for keyword in source.get("keywords") or []:
candidates.append(keyword.get("display_name"))
names: list[str] = []
for name in candidates:
if not name or name in names:
continue
lowered = name.lower()
if any(kw in lowered for kw in wanted):
names.append(name)
return names or None
async def get_author_works(
raw_oa_author_id: str,
page: int,
+23 -2
View File
@@ -14,7 +14,6 @@ api/dFGInstitutions.service.ts
api/dFGPersons.service.ts
api/dashboard.service.ts
api/funding.service.ts
api/iNSEService.service.ts
api/institutions.service.ts
api/institutionsV2.service.ts
api/keywords.service.ts
@@ -73,8 +72,10 @@ model/bodyResetPassword.ts
model/bundInstitutionSummary.ts
model/bundInstitutionSummaryPage.ts
model/bundProjectDetails.ts
model/bundProjectHighlight.ts
model/bundProjectPage.ts
model/bundProjectSummary.ts
model/bundProjectTopics.ts
model/careerMetrics.ts
model/careerStage.ts
model/collaborationGraph.ts
@@ -102,6 +103,7 @@ model/dfgInstitutionSummaryPage.ts
model/dfgPersonSummary.ts
model/dfgPersonSummaryPage.ts
model/dfgProjectDetails.ts
model/dfgProjectHighlight.ts
model/dfgProjectInstitutionRole.ts
model/dfgProjectKeyword.ts
model/dfgProjectPage.ts
@@ -112,12 +114,17 @@ model/dfgProjectSubprojectSummary.ts
model/dfgProjectSummary.ts
model/dfgProjectTopic.ts
model/dfgProjectTopics.ts
model/dfgSubjectClassificationHighlight.ts
model/dockerHealth.ts
model/domain.ts
model/domainFieldsInner.ts
model/domainIds.ts
model/edge.ts
model/euCordisEurosciVocSummary.ts
model/euCordisOrganizationSelectorPage.ts
model/euCordisOrganizationSelectorSummary.ts
model/euCordisOrganizationSummary.ts
model/euCordisProjectHighlight.ts
model/euCordisProjectResponse.ts
model/euCordisProjectSearchPage.ts
model/euCordisProjectSummary.ts
@@ -125,11 +132,12 @@ model/euCordisProjectType.ts
model/euCordisTopicSummary.ts
model/euProjectData.ts
model/euProjectStatusStatistics.ts
model/euProjectTopics.ts
model/extractedKeywords.ts
model/extractedKeywordsLLM.ts
model/extractedKeywordsResponse.ts
model/fieldNode.ts
model/fileUpload.ts
model/filterType.ts
model/fp7EurosciVoc.ts
model/fp7LegalBasis.ts
model/fp7Organization.ts
@@ -209,6 +217,7 @@ model/matchedTopic.ts
model/mentionedPerson.ts
model/meta.ts
model/model2YrMeanCitedness.ts
model/modelField.ts
model/models.ts
model/newsArticle.ts
model/newsArticleDetail.ts
@@ -234,6 +243,8 @@ model/projectsSortBy.ts
model/publicationDetailByFunder.ts
model/publicationIdsByAuthorPosition.ts
model/publicationType.ts
model/publicationTypeCount.ts
model/publicationTypeCountsRequest.ts
model/publicationsByAuthorResponse.ts
model/rankedAuthor.ts
model/rankingResponse.ts
@@ -244,10 +255,15 @@ model/score.ts
model/selectedAuthorsRequest.ts
model/sortDirection.ts
model/startCollaborationGraphResponse.ts
model/subfield.ts
model/subfieldDomain.ts
model/subfieldField.ts
model/subfieldNode.ts
model/subfieldShare.ts
model/timespan.ts
model/tokenType.ts
model/topAuthor.ts
model/topAuthorAnalysis.ts
model/topAuthorStatistics.ts
model/topInstitutionItem.ts
model/topTopicItem.ts
@@ -261,7 +277,12 @@ model/topicHeatmapField.ts
model/topicHeatmapSubfield.ts
model/topicHeatmapTopic.ts
model/topicHeatmapValue.ts
model/topicHierarchyDomain.ts
model/topicHierarchyField.ts
model/topicHierarchyResponse.ts
model/topicHierarchySubfield.ts
model/topicIds.ts
model/topicNode.ts
model/topicPageV2.ts
model/topicSortBy.ts
model/topicSubfield.ts
+26 -3
View File
@@ -18,8 +18,6 @@ export * from './dashboard.service';
import { DashboardService } from './dashboard.service';
export * from './funding.service';
import { FundingService } from './funding.service';
export * from './iNSEService.service';
import { INSEServiceService } from './iNSEService.service';
export * from './institutions.service';
import { InstitutionsService } from './institutions.service';
export * from './institutionsV2.service';
@@ -48,4 +46,29 @@ export * from './works.service';
import { WorksService } from './works.service';
export * from './worksV2.service';
import { WorksV2Service } from './worksV2.service';
export const APIS = [AuthService, AuthorsV2Service, BUNDInstitutionsService, BackgroundJobsService, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonsService, ProjectsService, RankingService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service];
export const APIS = [
AuthService,
AuthorsV2Service,
BUNDInstitutionsService,
BackgroundJobsService,
BookmarksService,
CompanyConnectionsService,
DFGInstitutionsService,
DFGPersonsService,
DashboardService,
FundingService,
InstitutionsService,
InstitutionsV2Service,
KeywordsService,
NewsService,
OrganizationService,
PatentsService,
PersonsService,
ProjectsService,
RankingService,
TopicsService,
TopicsV2Service,
UniversityRankingsService,
WorksService,
WorksV2Service,
];
File diff suppressed because it is too large Load Diff
+584 -298
View File
@@ -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 { Author } from '../model/author';
@@ -28,333 +34,613 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { StartCollaborationGraphResponse } from '../model/startCollaborationGraphResponse';
// @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/authors/v2/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<AuthorPage>;
public autocompleteAuthorsForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<AuthorPage>>;
public autocompleteAuthorsForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<AuthorPage>>;
public autocompleteAuthorsForSelector(
query?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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/authors/v2/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<AuthorPage>;
public autocompleteAuthorsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorPage>>;
public autocompleteAuthorsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorPage>>;
public autocompleteAuthorsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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/authors/v2/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
/**
* Returns an author for a given author ID.
* @endpoint get /api/authors/v2/{raw_oa_author_id}
* @param rawOaAuthorId The ID of the author 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 getAuthorById(
rawOaAuthorId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Author>;
public getAuthorById(
rawOaAuthorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Author>>;
public getAuthorById(
rawOaAuthorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Author>>;
public getAuthorById(
rawOaAuthorId: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error(
'Required parameter rawOaAuthorId was null or undefined when calling getAuthorById.',
);
}
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,
);
}
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 localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarPath = `/api/authors/v2/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
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/authors/v2/${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<Author>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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/authors/v2/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<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<AuthorPage>;
public getAuthorsByIds(
authorIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<AuthorPage>>;
public getAuthorsByIds(
authorIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<AuthorPage>>;
public getAuthorsByIds(
authorIds?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (authorIds) {
authorIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'author_ids',
);
});
}
/**
* Returns an author for a given author ID.
* @endpoint get /api/authors/v2/{raw_oa_author_id}
* @param rawOaAuthorId The ID of the author 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 getAuthorById(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Author>;
public getAuthorById(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Author>>;
public getAuthorById(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Author>>;
public getAuthorById(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorById.');
}
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/authors/v2/authors/id`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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 the status of a collaboration graph generation task.
* @endpoint get /api/authors/v2/collaboration-graph/{graph_id}/status
* @param graphId The ID of the collaboration graph generation task.
* @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 getCollaborationGraphStatus(
graphId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<CollaborationGraphStatusResponse>;
public getCollaborationGraphStatus(
graphId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<CollaborationGraphStatusResponse>>;
public getCollaborationGraphStatus(
graphId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<CollaborationGraphStatusResponse>>;
public getCollaborationGraphStatus(
graphId: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (graphId === null || graphId === undefined) {
throw new Error(
'Required parameter graphId was null or undefined when calling getCollaborationGraphStatus.',
);
}
let localVarPath = `/api/authors/v2/${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<Author>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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/authors/v2/collaboration-graph/${this.configuration.encodeParam({ name: 'graphId', value: graphId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/status`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CollaborationGraphStatusResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns a collaboration graph for a given author ID.
* @endpoint post /api/authors/v2/collaboration-graph
* @param rawOaAuthorId The raw OpenAlex author ID for which to retrieve the collaboration graph.
* @param yearFrom The starting year to filter the works by (optional).
* @param yearTo The ending year to filter the works by (optional).
* @param minCollaborators The minimum number of collaborators to filter the works by (optional).
* @param maxCollaborators The maximum number of collaborators to filter the works by (optional).
* @param topicIds A list of topic IDs to filter the works by (optional).
* @param institutionIds A list of institution IDs to filter the works by (optional).
* @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 startCollaborationGraph(
rawOaAuthorId: string,
yearFrom?: number,
yearTo?: number,
minCollaborators?: number,
maxCollaborators?: number,
topicIds?: Array<string>,
institutionIds?: Array<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<StartCollaborationGraphResponse>;
public startCollaborationGraph(
rawOaAuthorId: string,
yearFrom?: number,
yearTo?: number,
minCollaborators?: number,
maxCollaborators?: number,
topicIds?: Array<string>,
institutionIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<StartCollaborationGraphResponse>>;
public startCollaborationGraph(
rawOaAuthorId: string,
yearFrom?: number,
yearTo?: number,
minCollaborators?: number,
maxCollaborators?: number,
topicIds?: Array<string>,
institutionIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<StartCollaborationGraphResponse>>;
public startCollaborationGraph(
rawOaAuthorId: string,
yearFrom?: number,
yearTo?: number,
minCollaborators?: number,
maxCollaborators?: number,
topicIds?: Array<string>,
institutionIds?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error(
'Required parameter rawOaAuthorId was null or undefined when calling startCollaborationGraph.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>rawOaAuthorId,
'raw_oa_author_id',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>yearFrom,
'year_from',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>yearTo,
'year_to',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>minCollaborators,
'min_collaborators',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>maxCollaborators,
'max_collaborators',
);
if (topicIds) {
topicIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'topic_ids',
);
});
}
/**
* Returns a paginated list of authors for a given list of author IDs.
* @endpoint get /api/authors/v2/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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AuthorPage>;
public getAuthorsByIds(authorIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorPage>>;
public getAuthorsByIds(authorIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorPage>>;
public getAuthorsByIds(authorIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (authorIds) {
authorIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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/authors/v2/authors/id`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'institution_ids',
);
});
}
/**
* Returns the status of a collaboration graph generation task.
* @endpoint get /api/authors/v2/collaboration-graph/{graph_id}/status
* @param graphId The ID of the collaboration graph generation task.
* @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 getCollaborationGraphStatus(graphId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CollaborationGraphStatusResponse>;
public getCollaborationGraphStatus(graphId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CollaborationGraphStatusResponse>>;
public getCollaborationGraphStatus(graphId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CollaborationGraphStatusResponse>>;
public getCollaborationGraphStatus(graphId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (graphId === null || graphId === undefined) {
throw new Error('Required parameter graphId was null or undefined when calling getCollaborationGraphStatus.');
}
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/authors/v2/collaboration-graph/${this.configuration.encodeParam({name: "graphId", value: graphId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/status`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CollaborationGraphStatusResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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 collaboration graph for a given author ID.
* @endpoint post /api/authors/v2/collaboration-graph
* @param rawOaAuthorId The raw OpenAlex author ID for which to retrieve the collaboration graph.
* @param yearFrom The starting year to filter the works by (optional).
* @param yearTo The ending year to filter the works by (optional).
* @param minCollaborators The minimum number of collaborators to filter the works by (optional).
* @param maxCollaborators The maximum number of collaborators to filter the works by (optional).
* @param topicIds A list of topic IDs to filter the works by (optional).
* @param institutionIds A list of institution IDs to filter the works by (optional).
* @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 startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<StartCollaborationGraphResponse>;
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<StartCollaborationGraphResponse>>;
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<StartCollaborationGraphResponse>>;
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling startCollaborationGraph.');
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>rawOaAuthorId, 'raw_oa_author_id');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>yearFrom, 'year_from');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>yearTo, 'year_to');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>minCollaborators, 'min_collaborators');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>maxCollaborators, 'max_collaborators');
if (topicIds) {
topicIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'topic_ids');
})
}
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'institution_ids');
})
}
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/authors/v2/collaboration-graph`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<StartCollaborationGraphResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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/authors/v2/collaboration-graph`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<StartCollaborationGraphResponse>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+222 -122
View File
@@ -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 { BundInstitutionSummaryPage } from '../model/bundInstitutionSummaryPage';
@@ -22,137 +28,231 @@ import { BundInstitutionSummaryPage } from '../model/bundInstitutionSummaryPage'
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 BUNDInstitutionsService 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/bund/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 getBundInstitutionAutocompleteForSelector(
query?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<BundInstitutionSummaryPage>;
public getBundInstitutionAutocompleteForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<BundInstitutionSummaryPage>>;
public getBundInstitutionAutocompleteForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<BundInstitutionSummaryPage>>;
public getBundInstitutionAutocompleteForSelector(
query?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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/bund/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 getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<BundInstitutionSummaryPage>;
public getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BundInstitutionSummaryPage>>;
public getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BundInstitutionSummaryPage>>;
public getBundInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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/bund/institutions/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<BundInstitutionSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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/bund/institutions/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<BundInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
/**
* Returns a list of institutions based on their names.
* @endpoint get /api/bund/institutions/names
* @param institutionNames A list of institution names 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 getBundInstitutionsByName(
institutionNames?: Array<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<BundInstitutionSummaryPage>;
public getBundInstitutionsByName(
institutionNames?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<BundInstitutionSummaryPage>>;
public getBundInstitutionsByName(
institutionNames?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<BundInstitutionSummaryPage>>;
public getBundInstitutionsByName(
institutionNames?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (institutionNames) {
institutionNames.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'institution_names',
);
});
}
/**
* Returns a list of institutions based on their names.
* @endpoint get /api/bund/institutions/names
* @param institutionNames A list of institution names 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 getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<BundInstitutionSummaryPage>;
public getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BundInstitutionSummaryPage>>;
public getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BundInstitutionSummaryPage>>;
public getBundInstitutionsByName(institutionNames?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (institutionNames) {
institutionNames.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'institution_names');
})
}
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/bund/institutions/names`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<BundInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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/bund/institutions/names`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<BundInstitutionSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
File diff suppressed because it is too large Load Diff
+366 -191
View File
@@ -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<PersonBookmarkResponse>;
public bookmarkPerson(
personId: string,
createPersonBookmark: CreatePersonBookmark,
secureFgpAcc?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PersonBookmarkResponse>>;
public bookmarkPerson(
personId: string,
createPersonBookmark: CreatePersonBookmark,
secureFgpAcc?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PersonBookmarkResponse>>;
public bookmarkPerson(
personId: string,
createPersonBookmark: CreatePersonBookmark,
secureFgpAcc?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
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<PersonBookmarkResponse>;
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PersonBookmarkResponse>>;
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PersonBookmarkResponse>>;
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
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<PersonBookmarkResponse>('put', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createPersonBookmark,
responseType: <any>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<Array<PersonBookmarkResponse>>;
public listPersonBookmarks(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<PersonBookmarkResponse>>>;
public listPersonBookmarks(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<PersonBookmarkResponse>>>;
public listPersonBookmarks(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
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<Array<PersonBookmarkResponse>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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<any>;
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
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<any>('delete', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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<PersonBookmarkResponse>(
'put',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createPersonBookmark,
responseType: <any>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<Array<PersonBookmarkResponse>>;
public listPersonBookmarks(
secureFgpAcc?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<PersonBookmarkResponse>>>;
public listPersonBookmarks(
secureFgpAcc?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<PersonBookmarkResponse>>>;
public listPersonBookmarks(
secureFgpAcc?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
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<Array<PersonBookmarkResponse>>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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<any>;
public removePersonBookmark(
personId: string,
secureFgpAcc?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<any>>;
public removePersonBookmark(
personId: string,
secureFgpAcc?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<any>>;
public removePersonBookmark(
personId: string,
secureFgpAcc?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
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<any>(
'delete',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
@@ -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 { CompanyConnectionsAvailability } from '../model/companyConnectionsAvailability';
@@ -24,137 +30,249 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'
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 CompanyConnectionsService 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);
/**
* Check whether company connections are available for an author.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability
* @param authorId
* @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 getCompanyConnectionsAvailability(
authorId: string,
secureFgpAcc?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<CompanyConnectionsAvailability>;
public getCompanyConnectionsAvailability(
authorId: string,
secureFgpAcc?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<CompanyConnectionsAvailability>>;
public getCompanyConnectionsAvailability(
authorId: string,
secureFgpAcc?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<CompanyConnectionsAvailability>>;
public getCompanyConnectionsAvailability(
authorId: string,
secureFgpAcc?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error(
'Required parameter authorId was null or undefined when calling getCompanyConnectionsAvailability.',
);
}
/**
* Check whether company connections are available for an author.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability
* @param authorId
* @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 getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CompanyConnectionsAvailability>;
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CompanyConnectionsAvailability>>;
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CompanyConnectionsAvailability>>;
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsAvailability.');
}
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/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections/availability`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CompanyConnectionsAvailability>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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 possible company connections by OpenAlex author ID.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
* @param authorId
* @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 getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CompanyConnectionsResponse>;
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.');
}
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/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CompanyConnectionsResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections/availability`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CompanyConnectionsAvailability>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get possible company connections by OpenAlex author ID.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
* @param authorId
* @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 getCompanyConnectionsByAuthor(
authorId: string,
secureFgpAcc?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<CompanyConnectionsResponse>;
public getCompanyConnectionsByAuthor(
authorId: string,
secureFgpAcc?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(
authorId: string,
secureFgpAcc?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(
authorId: string,
secureFgpAcc?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error(
'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.',
);
}
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/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CompanyConnectionsResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+222 -122
View File
@@ -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<DfgInstitutionSummaryPage>;
public getDfgInstitutionAutocompleteForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
public getDfgInstitutionAutocompleteForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
public getDfgInstitutionAutocompleteForSelector(
query?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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<DfgInstitutionSummaryPage>;
public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
public getDfgInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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<DfgInstitutionSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<DfgInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<DfgInstitutionSummaryPage>;
public getDfgInstitutionsByIds(
institutionIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
public getDfgInstitutionsByIds(
institutionIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
public getDfgInstitutionsByIds(
institutionIds?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgInstitutionSummaryPage>;
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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<DfgInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<DfgInstitutionSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+222 -122
View File
@@ -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<DfgPersonSummaryPage>;
public getDfgPersonAutocompleteForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<DfgPersonSummaryPage>>;
public getDfgPersonAutocompleteForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<DfgPersonSummaryPage>>;
public getDfgPersonAutocompleteForSelector(
query?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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<DfgPersonSummaryPage>;
public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgPersonSummaryPage>>;
public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgPersonSummaryPage>>;
public getDfgPersonAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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<DfgPersonSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<DfgPersonSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<DfgPersonSummaryPage>;
public getDfgPersonsByIds(
personIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<DfgPersonSummaryPage>>;
public getDfgPersonsByIds(
personIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<DfgPersonSummaryPage>>;
public getDfgPersonsByIds(
personIds?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (personIds) {
personIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgPersonSummaryPage>;
public getDfgPersonsByIds(personIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgPersonSummaryPage>>;
public getDfgPersonsByIds(personIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgPersonSummaryPage>>;
public getDfgPersonsByIds(personIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (personIds) {
personIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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<DfgPersonSummaryPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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<DfgPersonSummaryPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
File diff suppressed because it is too large Load Diff
@@ -1,213 +0,0 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
})
export class INSEServiceService extends BaseService {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* Builds the topic hierarchy cache.
* @endpoint get /api/inse-service/topics/cache
* @param pageSize Page size for each search page.
* @param saveJson Persist cache JSON to data folder.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>pageSize, 'page_size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>saveJson, 'save_json');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/cache`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Counts topic hierarchy occurrences from cache.
* @endpoint get /api/inse-service/topics/count
* @param topic Topic names (repeat parameter).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public countTopicHierarchy(topic: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public countTopicHierarchy(topic: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public countTopicHierarchy(topic: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public countTopicHierarchy(topic: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (topic) {
topic.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'topic');
})
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/count`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns the nested topic hierarchy (Domains -&gt; Fields -&gt; Subfields -&gt; Topics).
* @endpoint get /api/inse-service/topics/hierarchy
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/hierarchy`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+316 -169
View File
@@ -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';
@@ -24,192 +30,333 @@ import { Institution } from '../model/institution';
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/institutions/v2/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<InstitutionPageV2>;
public getInstitutionAutocompleteForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<InstitutionPageV2>>;
public getInstitutionAutocompleteForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<InstitutionPageV2>>;
public getInstitutionAutocompleteForSelector(
query?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>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/institutions/v2/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<InstitutionPageV2>;
public getInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionPageV2>>;
public getInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionPageV2>>;
public getInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>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/institutions/v2/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
/**
* Returns an institution based on its ID.
* @endpoint get /api/institutions/v2/single/{institution_id}
* @param institutionId The ID of the institution 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 getInstitutionById2(
institutionId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Institution>;
public getInstitutionById2(
institutionId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Institution>>;
public getInstitutionById2(
institutionId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Institution>>;
public getInstitutionById2(
institutionId: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (institutionId === null || institutionId === undefined) {
throw new Error(
'Required parameter institutionId was null or undefined when calling getInstitutionById2.',
);
}
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,
);
}
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 localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarPath = `/api/institutions/v2/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/institutions/v2/single/${this.configuration.encodeParam({ name: 'institutionId', value: institutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Institution>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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/institutions/v2/multiple/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<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<InstitutionPageV2>;
public getInstitutionsByIds(
institutionIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<InstitutionPageV2>>;
public getInstitutionsByIds(
institutionIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<InstitutionPageV2>>;
public getInstitutionsByIds(
institutionIds?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'institution_ids',
);
});
}
/**
* Returns an institution based on its ID.
* @endpoint get /api/institutions/v2/single/{institution_id}
* @param institutionId The ID of the institution 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 getInstitutionById2(institutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Institution>;
public getInstitutionById2(institutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Institution>>;
public getInstitutionById2(institutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Institution>>;
public getInstitutionById2(institutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (institutionId === null || institutionId === undefined) {
throw new Error('Required parameter institutionId was null or undefined when calling getInstitutionById2.');
}
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/institutions/v2/single/${this.configuration.encodeParam({name: "institutionId", value: institutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Institution>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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 list of institutions based on their IDs.
* @endpoint get /api/institutions/v2/multiple/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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<InstitutionPageV2>;
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionPageV2>>;
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionPageV2>>;
public getInstitutionsByIds(institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (institutionIds) {
institutionIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'institution_ids');
})
}
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/institutions/v2/multiple/ids`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>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/institutions/v2/multiple/ids`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+20
View File
@@ -563,6 +563,7 @@ export class NewsService extends BaseService {
* @param yearFrom Earliest publication year (inclusive).
* @param yearTo Latest publication year (inclusive).
* @param sortOrder Overrides relevance ranking with a date sort: \&#39;desc\&#39; (newest first) or \&#39;asc\&#39; (oldest first).
* @param title Narrows the results to articles whose title matches this text.
* @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.
*/
@@ -577,6 +578,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
@@ -596,6 +598,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
@@ -615,6 +618,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
@@ -634,6 +638,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
@@ -705,6 +710,11 @@ export class NewsService extends BaseService {
<any>sortOrder,
'sortOrder',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>title,
'title',
);
let localVarHeaders = this.defaultHeaders;
@@ -769,6 +779,7 @@ export class NewsService extends BaseService {
* @param yearFrom Earliest publication year (inclusive).
* @param yearTo Latest publication year (inclusive).
* @param sortOrder Overrides relevance ranking with a date sort: \&#39;desc\&#39; (newest first) or \&#39;asc\&#39; (oldest first).
* @param title Narrows the results to articles whose title matches this text.
* @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.
*/
@@ -783,6 +794,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
@@ -802,6 +814,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
@@ -821,6 +834,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
@@ -840,6 +854,7 @@ export class NewsService extends BaseService {
yearFrom?: number,
yearTo?: number,
sortOrder?: string,
title?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
@@ -911,6 +926,11 @@ export class NewsService extends BaseService {
<any>sortOrder,
'sortOrder',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>title,
'title',
);
let localVarHeaders = this.defaultHeaders;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -35,6 +35,8 @@ import { Subfield } from '../model/subfield';
// @ts-ignore
import { Topic } from '../model/topic';
// @ts-ignore
import { TopicHierarchyResponse } from '../model/topicHierarchyResponse';
// @ts-ignore
import { TopicPageV2 } from '../model/topicPageV2';
// @ts-ignore
import { TopicSortBy } from '../model/topicSortBy';
@@ -564,6 +566,97 @@ export class TopicsV2Service extends BaseService {
});
}
/**
* Returns the full topic hierarchy tree (Domain -&gt; Field -&gt; Subfield -&gt; Topics).
* @endpoint get /api/topics/v2/hierarchy
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicHierarchy(
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<TopicHierarchyResponse>;
public getTopicHierarchy(
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<TopicHierarchyResponse>>;
public getTopicHierarchy(
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<TopicHierarchyResponse>>;
public getTopicHierarchy(
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/topics/v2/hierarchy`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicHierarchyResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>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/topics/v2/topics/id
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+44 -48
View File
@@ -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<UserRole>;
/**
* 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<UserRole>;
/**
* 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 {}
+13 -15
View File
@@ -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<UserRole>;
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<UserRole>;
organization_id: string;
organization_name: string;
deleted: boolean;
activated: boolean;
is_current?: boolean;
is_real_account?: boolean;
is_impersonating?: boolean;
}
@@ -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,14 @@
*/
import { CompanyStatusFilter } from './companyStatusFilter';
export interface AuthorMetricsRequest {
/**
* OpenAlex IDs of the authors.
*/
author_ids: Array<string>;
/**
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
*/
company_status?: CompanyStatusFilter;
export interface AuthorMetricsRequest {
/**
* OpenAlex IDs of the authors.
*/
author_ids: Array<string>;
/**
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
*/
company_status?: CompanyStatusFilter;
}
export namespace AuthorMetricsRequest {
}
export namespace AuthorMetricsRequest {}
+14 -16
View File
@@ -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 AuthorNode {
/**
* The ID of the author.
*/
id: string;
/**
* The display name of the author.
*/
display_name: string;
/**
* IDs of institutions this author is affiliated with.
*/
institution_ids?: Array<string>;
export interface AuthorNode {
/**
* The ID of the author.
*/
id: string;
/**
* The display name of the author.
*/
display_name: string;
/**
* IDs of institutions this author is affiliated with.
*/
institution_ids?: Array<string>;
}
@@ -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,18 @@
*/
import { AuthorOrientationProfileStatus } from './authorOrientationProfileStatus';
/**
* Aggregated research-orientation result for one selected author.
*/
export interface AuthorOrientationProfile {
/**
* The full OpenAlex author ID.
*/
author_id: string;
status: AuthorOrientationProfileStatus;
orientation_score?: number | null;
primary_category_counts?: { [key: string]: number; } | null;
classified_work_count?: number | null;
scored_work_count?: number | null;
export interface AuthorOrientationProfile {
/**
* The full OpenAlex author ID.
*/
author_id: string;
status: AuthorOrientationProfileStatus;
orientation_score?: number | null;
primary_category_counts?: { [key: string]: number } | null;
classified_work_count?: number | null;
scored_work_count?: number | null;
}
export namespace AuthorOrientationProfile {
}
export namespace AuthorOrientationProfile {}
@@ -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 AuthorOrientationProfileStatus = {
Available: 'available',
InsufficientScoredPublications: 'insufficient_scored_publications',
NoClassifiedPublications: 'no_classified_publications',
NoOrientationScore: 'no_orientation_score',
Restricted: 'restricted'
Available: 'available',
InsufficientScoredPublications: 'insufficient_scored_publications',
NoClassifiedPublications: 'no_classified_publications',
NoOrientationScore: 'no_orientation_score',
Restricted: 'restricted',
} as const;
export type AuthorOrientationProfileStatus = typeof AuthorOrientationProfileStatus[keyof typeof AuthorOrientationProfileStatus];
export type AuthorOrientationProfileStatus =
(typeof AuthorOrientationProfileStatus)[keyof typeof AuthorOrientationProfileStatus];
@@ -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,19 +10,17 @@
import { Timespan } from './timespan';
import { PublicationType } from './publicationType';
/**
* Filters used to compare the research orientation of selected authors.
*/
export interface AuthorOrientationProfilesRequest {
/**
* One to four unique OpenAlex author IDs.
*/
author_ids: Array<string>;
/**
* Optional publication-type filter. Empty means all types.
*/
publication_types?: Array<PublicationType>;
timespan?: Timespan | null;
export interface AuthorOrientationProfilesRequest {
/**
* One to four unique OpenAlex author IDs.
*/
author_ids: Array<string>;
/**
* Optional publication-type filter. Empty means all types.
*/
publication_types?: Array<PublicationType>;
timespan?: Timespan | null;
}
+18 -20
View File
@@ -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<Author>;
/**
* 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<Author>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+22 -24
View File
@@ -1,37 +1,35 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Section 2: author-level stats independent of any keyword/topic/time filter.
*/
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;
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;
}
+43 -40
View File
@@ -1,51 +1,54 @@
/**
* Innovation Search Engine 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 { FieldNode } from './fieldNode';
import { SubfieldShare } from './subfieldShare';
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 (only meaningful for filter_type \'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<SubfieldShare>;
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<SubfieldShare>;
/**
* Field -> subfield -> topic hierarchy over all works, by primary topic, each level largest first. Drives the interactive topic treemap.
*/
field_tree?: Array<FieldNode>;
}
+72 -82
View File
@@ -1,95 +1,85 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Section 1: combined stats over an author\'s works that match the topic filter.
*/
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 (cited more than the field/year/type average).
*/
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; works without an FWCI value are excluded.
*/
avg_fwci?: number;
/**
* Number of the author\'s topic works with at least one co-author institution of type \'company\'.
*/
industry_works_count?: number;
first_year?: number | null;
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;
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 (cited more than the field/year/type average).
*/
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; works without an FWCI value are excluded.
*/
avg_fwci?: number;
/**
* Number of the author\'s topic works with at least one co-author institution of type \'company\'.
*/
industry_works_count?: number;
first_year?: number | null;
last_year?: number | null;
/**
* 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;
}
+4 -6
View File
@@ -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 AvailableImages {
images: Array<string>;
detail?: string;
export interface AvailableImages {
images: Array<string>;
detail?: string;
}
+14 -16
View File
@@ -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,19 +9,17 @@
*/
import { JobRun } from './jobRun';
export interface BackgroundJobTask {
id: number;
name: string;
description: string;
target_index: string;
image: string | null;
command: string | null;
env: { [key: string]: string; };
schedule: string | null;
enabled: boolean;
next_run_at: string | null;
last_run: JobRun | null;
status: string;
export interface BackgroundJobTask {
id: number;
name: string;
description: string;
target_index: string;
image: string | null;
command: string | null;
env: { [key: string]: string };
schedule: string | null;
enabled: boolean;
next_run_at: string | null;
last_run: JobRun | null;
status: string;
}
@@ -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.
*/
export interface BmbfProjectStatusStatistics {
institution_id: string;
organization_name: string;
ongoing: number;
upcoming: number;
completed: number;
export interface BmbfProjectStatusStatistics {
institution_id: string;
organization_name: string;
ongoing: number;
upcoming: number;
completed: number;
}
@@ -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 single institution entry derived from a BUND project record. Note: this index has no dedicated institution entity — each entry is reconstructed from the agency/recipient fields on a single project hit, so the same institution may appear multiple times (once per project).
*/
export interface BundInstitutionSummary {
department?: string | null;
department_fullname?: string | null;
name?: string | null;
recepient?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
export interface BundInstitutionSummary {
department?: string | null;
department_fullname?: string | null;
name?: string | null;
recepient?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
}
@@ -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 { BundInstitutionSummary } from './bundInstitutionSummary';
/**
* A paginated response containing a list of institutions.
*/
export interface BundInstitutionSummaryPage {
/**
* The elements of the page.
*/
elements?: Array<BundInstitutionSummary>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface BundInstitutionSummaryPage {
/**
* The elements of the page.
*/
elements?: Array<BundInstitutionSummary>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+43 -45
View File
@@ -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,51 +9,49 @@
*/
import { Topic } from './topic';
/**
* Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types.
*/
export interface BundProjectDetails {
/**
* The ID of the Bund project
*/
id: string;
funding_reference?: string | null;
title?: string | null;
description?: string | null;
joint_project?: string | null;
funding_type?: string | null;
funding_profile?: string | null;
funding_amount?: number | null;
funding_start_date?: string | null;
funding_end_date?: string | null;
duration?: string | null;
performance_plan_code?: string | null;
performance_plan_fullname?: string | null;
executing_agency?: string | null;
funding_recipient?: string | null;
project_agency?: string | null;
project_agency_fullname?: string | null;
department?: string | null;
department_fullname?: string | null;
division?: string | null;
location?: string | null;
municipality?: string | null;
state?: string | null;
country?: string | null;
municipality_code?: string | null;
publication_date?: string | null;
is_new?: boolean | null;
record_date?: string | null;
unix_timestamp?: number | null;
/**
* All persons associated with the Bund project (from nested Arb object)
*/
associated_persons?: Array<string>;
/**
* All institutions associated with the Bund project
*/
institutions?: Array<string>;
oa_topics?: Array<Topic> | null;
export interface BundProjectDetails {
/**
* The ID of the Bund project
*/
id: string;
funding_reference?: string | null;
title?: string | null;
description?: string | null;
joint_project?: string | null;
funding_type?: string | null;
funding_profile?: string | null;
funding_amount?: number | null;
funding_start_date?: string | null;
funding_end_date?: string | null;
duration?: string | null;
performance_plan_code?: string | null;
performance_plan_fullname?: string | null;
executing_agency?: string | null;
funding_recipient?: string | null;
project_agency?: string | null;
project_agency_fullname?: string | null;
department?: string | null;
department_fullname?: string | null;
division?: string | null;
location?: string | null;
municipality?: string | null;
state?: string | null;
country?: string | null;
municipality_code?: string | null;
publication_date?: string | null;
is_new?: boolean | null;
record_date?: string | null;
unix_timestamp?: number | null;
/**
* All persons associated with the Bund project (from nested Arb object)
*/
associated_persons?: Array<string>;
/**
* All institutions associated with the Bund project
*/
institutions?: Array<string>;
oa_topics?: Array<Topic> | null;
}
@@ -0,0 +1,31 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Highlighted matching fragments from a BUND project search.
*/
export interface BundProjectHighlight {
/**
* Highlights from the Elasticsearch field \"Verbundprojekt\".
*/
joint_project?: Array<string>;
/**
* Highlights from the Elasticsearch field \"Thema\".
*/
topic?: Array<string>;
/**
* Highlights from the Elasticsearch field \"Zuwendungsempfänger\".
*/
recipient?: Array<string>;
/**
* Highlights from the Elasticsearch field \"Ausführende Stelle\".
*/
executing_agency?: Array<string>;
}
+18 -20
View File
@@ -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 { BundProjectSummary } from './bundProjectSummary';
export interface BundProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The bund projects on this page.
*/
elements?: Array<BundProjectSummary>;
export interface BundProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The bund projects on this page.
*/
elements?: Array<BundProjectSummary>;
}
+34 -34
View File
@@ -1,46 +1,46 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { BundProjectHighlight } from './bundProjectHighlight';
import { Topic } from './topic';
import { BundInstitutionSummary } from './bundInstitutionSummary';
export interface BundProjectSummary {
funding_code?: string | null;
department?: string | null;
department_fullname?: string | null;
referat?: string | null;
project_sponsor?: string | null;
project_sponsor_fullname?: string | null;
work_unit?: string | null;
recipient?: string | null;
municipal_code?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
implementing_agency?: string | null;
topic?: string | null;
performance_plan_system?: string | null;
performance_plan_system_text?: string | null;
funding_start?: string | null;
funding_end?: string | null;
grant_amount?: number | null;
funding_profile?: string | null;
joint_project?: string | null;
funding_type?: string | null;
publication_date?: string | null;
unix_timestamp?: number | null;
date?: string | null;
'new'?: boolean | null;
duration?: string | null;
oa_topics?: Array<Topic> | null;
institution?: BundInstitutionSummary | null;
export interface BundProjectSummary {
funding_code?: string | null;
department?: string | null;
department_fullname?: string | null;
referat?: string | null;
project_sponsor?: string | null;
project_sponsor_fullname?: string | null;
work_unit?: string | null;
recipient?: string | null;
municipal_code?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
executing_agency?: string | null;
topic?: string | null;
performance_plan_system?: string | null;
performance_plan_system_text?: string | null;
funding_start?: string | null;
funding_end?: string | null;
grant_amount?: number | null;
funding_profile?: string | null;
joint_project?: string | null;
funding_type?: string | null;
publication_date?: string | null;
unix_timestamp?: number | null;
date?: string | null;
new?: boolean | null;
duration?: string | null;
oa_topics?: Array<Topic> | null;
institution?: BundInstitutionSummary | null;
highlight?: BundProjectHighlight | null;
}
@@ -0,0 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { DfgProjectTopic } from './dfgProjectTopic';
export interface BundProjectTopics {
institution_id: string;
organization_name: string;
project_count: number;
matched_project_count: number;
topics: Array<DfgProjectTopic>;
}
+22 -24
View File
@@ -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
@@ -12,27 +12,25 @@ import { Edge } from './edge';
import { InstitutionNode } from './institutionNode';
import { AuthorNode } from './authorNode';
export interface CollaborationGraph {
/**
* The ID of the root author.
*/
root_author_id: string;
/**
* A list of author nodes.
*/
authors?: Array<AuthorNode>;
/**
* A list of institution nodes.
*/
institutions?: Array<InstitutionNode>;
/**
* A list of work nodes.
*/
works?: Array<WorkNode>;
/**
* A list of edges in the collaboration graph.
*/
edges?: Array<Edge>;
export interface CollaborationGraph {
/**
* The ID of the root author.
*/
root_author_id: string;
/**
* A list of author nodes.
*/
authors?: Array<AuthorNode>;
/**
* A list of institution nodes.
*/
institutions?: Array<InstitutionNode>;
/**
* A list of work nodes.
*/
works?: Array<WorkNode>;
/**
* A list of edges in the collaboration graph.
*/
edges?: Array<Edge>;
}
@@ -1,18 +1,17 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const CollaborationGraphStatus = {
Pending: 'pending',
Completed: 'completed',
Failed: 'failed'
Pending: 'pending',
Completed: 'completed',
Failed: 'failed',
} as const;
export type CollaborationGraphStatus = typeof CollaborationGraphStatus[keyof typeof CollaborationGraphStatus];
export type CollaborationGraphStatus =
(typeof CollaborationGraphStatus)[keyof typeof CollaborationGraphStatus];
@@ -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,16 +10,12 @@
import { CollaborationGraph } from './collaborationGraph';
import { CollaborationGraphStatus } from './collaborationGraphStatus';
export interface CollaborationGraphStatusResponse {
/**
* The status of the collaboration graph.
*/
status: CollaborationGraphStatus;
result?: CollaborationGraph | null;
error_message?: string | null;
export interface CollaborationGraphStatusResponse {
/**
* The status of the collaboration graph.
*/
status: CollaborationGraphStatus;
result?: CollaborationGraph | null;
error_message?: string | null;
}
export namespace CollaborationGraphStatusResponse {
}
export namespace CollaborationGraphStatusResponse {}
@@ -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 CompanyConnectionsAvailability {
available: boolean;
export interface CompanyConnectionsAvailability {
available: boolean;
}
@@ -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 { CompanyConnection } from './companyConnection';
export interface CompanyConnectionsResponse {
author_id: string;
display_name?: string | null;
matching_method?: string | null;
company_count: number;
has_more_results: boolean;
common_name_warning: boolean;
connections?: Array<CompanyConnection>;
export interface CompanyConnectionsResponse {
author_id: string;
display_name?: string | null;
matching_method?: string | null;
company_count: number;
has_more_results: boolean;
common_name_warning: boolean;
connections?: Array<CompanyConnection>;
}
@@ -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<UserRole>;
organization_id: string;
password: string;
openalex_person_id?: string | null;
export interface CreateAccountRequest {
email: string;
name: string;
roles?: Array<UserRole>;
organization_id: string;
password: string;
openalex_person_id?: string | null;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
+10 -12
View File
@@ -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;
}
@@ -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;
}
@@ -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<DfgInstitutionSummary>;
/**
* 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<DfgInstitutionSummary>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+9 -11
View File
@@ -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;
}
@@ -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<DfgPersonSummary>;
/**
* 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<DfgPersonSummary>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+63 -65
View File
@@ -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,71 +14,69 @@ import { DFGProjectFachgebieteInner } from './dFGProjectFachgebieteInner';
import { Topic } from './topic';
import { DfgProjectPublicationSummary } from './dfgProjectPublicationSummary';
/**
* Clean, enriched summary model for a DFG project.
*/
export interface DfgProjectDetails {
id?: number | null;
link?: string | null;
page_url?: string | null;
external_link?: string | null;
title_de?: string | null;
title_en?: string | null;
description_de?: string | null;
description_en?: string | null;
final_report_abstract_de?: string | null;
final_report_abstract_en?: string | null;
project_identifier_de?: string | null;
project_identifier_en?: string | null;
funding_start?: number | null;
funding_end?: number | null;
funding_period_de?: string | null;
funding_period_en?: string | null;
funding_type_de?: string | null;
funding_type_en?: string | null;
funding_type_key?: string | null;
dfg_procedure?: string | null;
is_transfer_project?: boolean | null;
website_html_de?: string | null;
website_html_en?: string | null;
equipment_group?: string | null;
equipment_name?: string | null;
subject_area_de?: string | null;
subject_area_en?: string | null;
/**
* Detailed DFG subject-area classification entries (Fachsystematik)
*/
subject_classifications?: Array<DFGProjectFachgebieteInner>;
international_relation_de?: string | null;
international_relation_en?: string | null;
/**
* All persons associated with the project, each with their role
*/
persons?: Array<DfgProjectPersonRole>;
/**
* All institutions associated with the project, each with their role
*/
institutions?: Array<DfgProjectInstitutionRole>;
/**
* Flat, de-duplicated list of all person full names (convenience view)
*/
associated_persons?: Array<string>;
/**
* Flat, de-duplicated list of all institution names (convenience view)
*/
associated_institutions?: Array<string>;
parent_project_id?: number | null;
parent_title_de?: string | null;
parent_title_en?: string | null;
/**
* Sub-projects of this project, if any
*/
subprojects?: Array<DfgProjectSubprojectSummary>;
/**
* Publications resulting from the project
*/
publications?: Array<DfgProjectPublicationSummary>;
topics?: Array<Topic> | null;
export interface DfgProjectDetails {
id?: number | null;
link?: string | null;
page_url?: string | null;
external_link?: string | null;
title_de?: string | null;
title_en?: string | null;
description_de?: string | null;
description_en?: string | null;
final_report_abstract_de?: string | null;
final_report_abstract_en?: string | null;
project_identifier_de?: string | null;
project_identifier_en?: string | null;
funding_start?: number | null;
funding_end?: number | null;
funding_period_de?: string | null;
funding_period_en?: string | null;
funding_type_de?: string | null;
funding_type_en?: string | null;
funding_type_key?: string | null;
dfg_procedure?: string | null;
is_transfer_project?: boolean | null;
website_html_de?: string | null;
website_html_en?: string | null;
equipment_group?: string | null;
equipment_name?: string | null;
subject_area_de?: string | null;
subject_area_en?: string | null;
/**
* Detailed DFG subject-area classification entries (Fachsystematik)
*/
subject_classifications?: Array<DFGProjectFachgebieteInner>;
international_relation_de?: string | null;
international_relation_en?: string | null;
/**
* All persons associated with the project, each with their role
*/
persons?: Array<DfgProjectPersonRole>;
/**
* All institutions associated with the project, each with their role
*/
institutions?: Array<DfgProjectInstitutionRole>;
/**
* Flat, de-duplicated list of all person full names (convenience view)
*/
associated_persons?: Array<string>;
/**
* Flat, de-duplicated list of all institution names (convenience view)
*/
associated_institutions?: Array<string>;
parent_project_id?: number | null;
parent_title_de?: string | null;
parent_title_en?: string | null;
/**
* Sub-projects of this project, if any
*/
subprojects?: Array<DfgProjectSubprojectSummary>;
/**
* Publications resulting from the project
*/
publications?: Array<DfgProjectPublicationSummary>;
topics?: Array<Topic> | null;
}
@@ -0,0 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { DfgSubjectClassificationHighlight } from './dfgSubjectClassificationHighlight';
/**
* Highlighted fragments returned for a DFG project.
*/
export interface DfgProjectHighlight {
title_de?: Array<string>;
title_en?: Array<string>;
abstract_de?: Array<string>;
abstract_en?: Array<string>;
subject_classifications?: Array<DfgSubjectClassificationHighlight>;
}
@@ -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.
*/
/**
* An institution associated with the project, together with its role.
*/
export interface DfgProjectInstitutionRole {
institute_id?: number | null;
name_de?: string | null;
name_en?: string | null;
role_key?: string | null;
role_label_de?: string | null;
role_label_en?: string | null;
is_dissolved?: boolean | null;
is_head?: boolean | null;
export interface DfgProjectInstitutionRole {
institute_id?: number | null;
name_de?: string | null;
name_en?: string | null;
role_key?: string | null;
role_label_de?: string | null;
role_label_en?: string | null;
is_dissolved?: boolean | null;
is_head?: boolean | null;
}
@@ -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 DfgProjectKeyword {
name: string;
project_count: number;
export interface DfgProjectKeyword {
name: string;
project_count: number;
}

Some files were not shown because too many files have changed in this diff Show More