Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis

This commit is contained in:
2026-07-22 23:43:32 +02:00
131 changed files with 59928 additions and 4913 deletions
@@ -0,0 +1,543 @@
{
"author": {
"id": "https://openalex.org/A5034365278",
"display_name": "Dirk Schadendorf",
"card_works_count": 2376,
"cited_by_count": 221896
},
"webapp_publication_list": {
"endpoint": "/api/v2/works/author/A5034365278?page=0&size=50",
"raw_hits_total_value": 2406,
"raw_hits_total_relation": "eq",
"raw_documents_scanned": 2406,
"unique_openalex_work_ids": 2370,
"duplicate_raw_documents": 36,
"work_ids_with_multiple_source_documents": 36
},
"classification_pipeline": {
"minimum_publication_year": 1950,
"eligible_unique_work_ids": 2369,
"pre_threshold_unique_work_ids": 0,
"missing_year_unique_work_ids": 1,
"classified_by_target_id": 2369,
"eligible_but_missing_in_target": 0,
"classified_target_documents_containing_author": 2369,
"classified_by_id_but_author_missing_from_target_document": 0
},
"institution": {
"id": "https://openalex.org/I62318514",
"pipeline_selected_source_works_matching_institution": 422
},
"important_differences": [
"The author card reads openalex-authors.works_count directly.",
"The publication list counts raw hits from openalex-works* and does not deduplicate by work ID.",
"The classification pipeline deduplicates by normalized OpenAlex work ID.",
"The classification pipeline excludes works with publication_year below 1950 or missing.",
"A work can exist in the classification index but be absent from a per-author target-index count if the stored authors array does not contain that author."
],
"examples": {
"eligible_but_missing_in_target": [],
"publication_year_before_threshold": [],
"publication_year_missing": [
{
"work_id": "W4211208194",
"full_work_id": "https://openalex.org/W4211208194",
"title": "",
"publication_year": null,
"type": "article",
"doi": null,
"updated_date": "2025-11-06T04:12:42.849Z",
"source_index": "openalex-works-3",
"variant_count": 1,
"variant_indices": ["openalex-works-3"],
"classified_by_id": false,
"classification_contains_author": false,
"institution_match": true,
"reason": "publication_year_missing"
}
],
"multiple_source_documents_same_id": [
{
"work_id": "W4409451759",
"full_work_id": "https://openalex.org/W4409451759",
"title": "Clinical validation of droplet digital PCR assays in detecting BRAFV600-mutant circulating tumour DNA as a prognostic biomarker in patients with resected stage III melanoma receiving adjuvant therapy (COMBI-AD): a biomarker analysis from a double-blind, randomised phase 3 trial",
"publication_year": 2025,
"type": "article",
"doi": "https://doi.org/10.1016/s1470-2045(25)00139-1",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4409145101",
"full_work_id": "https://openalex.org/W4409145101",
"title": "Acral lentiginous melanoma shows a poorer response to immune checkpoint inhibition in the non-resectable or metastatic setting – A EUMelaReg real world outcome study",
"publication_year": 2025,
"type": "article",
"doi": "https://doi.org/10.1016/j.ejcskn.2025.100527",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4405380398",
"full_work_id": "https://openalex.org/W4405380398",
"title": "A comparison of real-world data on adjuvant treatment in patients with stage III BRAF V600 mutated melanoma – Results of systematic literature research",
"publication_year": 2024,
"type": "review",
"doi": "https://doi.org/10.1016/j.ejca.2024.115160",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4402565731",
"full_work_id": "https://openalex.org/W4402565731",
"title": "LBA43 10-y survival outcomes from the phase III CheckMate 067 trial of nivolumab plus ipilimumab in advanced melanoma",
"publication_year": 2024,
"type": "article",
"doi": "https://doi.org/10.1016/j.annonc.2024.08.2284",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4402560903",
"full_work_id": "https://openalex.org/W4402560903",
"title": "1078MO Pembrolizumab (pembro) vs placebo as adjuvant therapy for high-risk stage II melanoma: Long-term follow-up, rechallenge, and crossover in KEYNOTE-716",
"publication_year": 2024,
"type": "article",
"doi": "https://doi.org/10.1016/j.annonc.2024.08.1146",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4391886851",
"full_work_id": "https://openalex.org/W4391886851",
"title": "Biomarker and pharmacodynamic activity of the transforming growth factor‐beta (<scp>TGFβ)</scp> inhibitor <scp>SAR439459</scp> as monotherapy and in combination with cemiplimab in a phase I clinical study in patients with advanced solid tumors",
"publication_year": 2024,
"type": "article",
"doi": "https://doi.org/10.1111/cts.13736",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4391430347",
"full_work_id": "https://openalex.org/W4391430347",
"title": "Prognostic and predictive value of non-steroidal anti-inflammatory drugs in the EORTC 1325/KEYNOTE-054 phase III trial of pembrolizumab versus placebo in resected high-risk stage III melanoma",
"publication_year": 2024,
"type": "article",
"doi": "https://doi.org/10.1016/j.ejca.2024.113585",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4362505674",
"full_work_id": "https://openalex.org/W4362505674",
"title": "The Latest Option: Nivolumab and Relatlimab in Advanced Melanoma",
"publication_year": 2023,
"type": "review",
"doi": "https://doi.org/10.1007/s11912-023-01406-4",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": true,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4353055387",
"full_work_id": "https://openalex.org/W4353055387",
"title": "Health-related quality of life with nivolumab plus relatlimab versus nivolumab monotherapy in patients with previously untreated unresectable or metastatic melanoma: RELATIVITY-047 trial",
"publication_year": 2023,
"type": "article",
"doi": "https://doi.org/10.1016/j.ejca.2023.03.014",
"updated_date": "2026-03-13T14:20:09.374Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W4282559953",
"full_work_id": "https://openalex.org/W4282559953",
"title": "Innate immune receptor signaling induces transient melanoma dedifferentiation while preserving immunogenicity",
"publication_year": 2022,
"type": "article",
"doi": "https://doi.org/10.1136/jitc-2021-003863",
"updated_date": "2025-11-06T03:46:38.306Z",
"source_index": "openalex-works",
"variant_count": 2,
"variant_indices": ["openalex-works", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": true,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W3157996908",
"full_work_id": "https://openalex.org/W3157996908",
"title": "Computed tomography-guided biopsy of radiologically unclear lesions in advanced skin cancer: A retrospective analysis of 47 cases",
"publication_year": 2021,
"type": "article",
"doi": "https://doi.org/10.1016/j.ejca.2021.03.026",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W3108194869",
"full_work_id": "https://openalex.org/W3108194869",
"title": "Surveillance of patients with conjunctival melanoma in German-speaking countries: A multinational survey of the German dermatologic cooperative oncology group",
"publication_year": 2020,
"type": "letter",
"doi": "https://doi.org/10.1016/j.ejca.2020.10.021",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2967473922",
"full_work_id": "https://openalex.org/W2967473922",
"title": "Deep neural networks are superior to dermatologists in melanoma image classification",
"publication_year": 2019,
"type": "article",
"doi": "https://doi.org/10.1016/j.ejca.2019.05.023",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2950219014",
"full_work_id": "https://openalex.org/W2950219014",
"title": "The X-Linked DDX3X RNA Helicase Dictates Translation Reprogramming and Metastasis in Melanoma",
"publication_year": 2019,
"type": "article",
"doi": "https://doi.org/10.1016/j.celrep.2019.05.069",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2790093035",
"full_work_id": "https://openalex.org/W2790093035",
"title": "Clinical outcome of concomitant vs interrupted BRAF inhibitor therapy during radiotherapy in melanoma patients",
"publication_year": 2018,
"type": "article",
"doi": "https://doi.org/10.1038/bjc.2017.489",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2773801101",
"full_work_id": "https://openalex.org/W2773801101",
"title": "Eighth American Joint Committee on Cancer (AJCC) melanoma classification: Let us reconsider stage III",
"publication_year": 2017,
"type": "letter",
"doi": "https://doi.org/10.1016/j.ejca.2017.11.023",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2767826944",
"full_work_id": "https://openalex.org/W2767826944",
"title": "A phase 2 study of ontuxizumab, a monoclonal antibody targeting endosialin, in metastatic melanoma",
"publication_year": 2017,
"type": "article",
"doi": "https://doi.org/10.1007/s10637-017-0530-4",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2901161788",
"full_work_id": "https://openalex.org/W2901161788",
"title": "7503-114079-1-Sp",
"publication_year": 2016,
"type": "article",
"doi": null,
"updated_date": "2025-11-06T04:12:42.849Z",
"source_index": "openalex-works-2",
"variant_count": 2,
"variant_indices": ["openalex-works-2", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2308247172",
"full_work_id": "https://openalex.org/W2308247172",
"title": "Integrating first-line treatment options into clinical practice",
"publication_year": 2015,
"type": "review",
"doi": "https://doi.org/10.1097/cmr.0000000000000200",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2053545055",
"full_work_id": "https://openalex.org/W2053545055",
"title": "Expression of stress ligands of the immunoreceptor NKG2D in melanoma: Regulation and clinical significance",
"publication_year": 2014,
"type": "review",
"doi": "https://doi.org/10.1016/j.ejcb.2014.01.009",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2112537584",
"full_work_id": "https://openalex.org/W2112537584",
"title": "Adjuvant pegylated interferon α-2b therapy for melanoma",
"publication_year": 2010,
"type": "article",
"doi": "https://doi.org/10.3892/ol_00000042",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W1967863327",
"full_work_id": "https://openalex.org/W1967863327",
"title": "Screening of Human Tumor Antigens for CD4+ T Cell Epitopes by Combination of HLA-Transgenic Mice, Recombinant Adenovirus and Antigen Peptide Libraries",
"publication_year": 2010,
"type": "article",
"doi": "https://doi.org/10.1371/journal.pone.0014137",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2124806374",
"full_work_id": "https://openalex.org/W2124806374",
"title": "Multiple Melanomas After Treatment for Hodgkin Lymphoma in a Non-Dutch p16-Leiden Mutation Carrier With 2 MC1R High-Risk Variants",
"publication_year": 2007,
"type": "article",
"doi": "https://doi.org/10.1001/archderm.143.4.495",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2149012823",
"full_work_id": "https://openalex.org/W2149012823",
"title": "P-glycoprotein expression in primary and metastatic malignant melanoma",
"publication_year": 2006,
"type": "article",
"doi": "https://doi.org/10.1111/j.1365-2133.1995.tb08710.x",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2047303314",
"full_work_id": "https://openalex.org/W2047303314",
"title": "Expression of GAGE family proteins in malignant melanoma",
"publication_year": 2006,
"type": "article",
"doi": "https://doi.org/10.1016/j.canlet.2006.11.022",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W1963965528",
"full_work_id": "https://openalex.org/W1963965528",
"title": "Photoreceptor proteins as cancer‐retina antigens",
"publication_year": 2006,
"type": "article",
"doi": "https://doi.org/10.1002/ijc.22458",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2404943841",
"full_work_id": "https://openalex.org/W2404943841",
"title": "[Acute juvenile pityriasis rubra pilaris in a 2-year-old child].",
"publication_year": 2004,
"type": "article",
"doi": null,
"updated_date": "2025-11-06T04:12:42.849Z",
"source_index": "openalex-works-3",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2037452525",
"full_work_id": "https://openalex.org/W2037452525",
"title": "mRNA expression of tumor‐associated antigens in melanoma tissues and cell lines",
"publication_year": 2002,
"type": "article",
"doi": "https://doi.org/10.1034/j.1600-0625.2002.110402.x",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-4", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W1983494843",
"full_work_id": "https://openalex.org/W1983494843",
"title": "Study of Therapy Resistance in Cancer Cells with Functional Proteome Analysis",
"publication_year": 2002,
"type": "review",
"doi": "https://doi.org/10.1515/cclm.2002.037",
"updated_date": "2026-01-13T01:12:25.745Z",
"source_index": "openalex-works-5",
"variant_count": 2,
"variant_indices": ["openalex-works-3", "openalex-works-5"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
},
{
"work_id": "W2598959332",
"full_work_id": "https://openalex.org/W2598959332",
"title": "‘PEG meets Liposome’ – zwei Technologien führen zu einer Substanz mit neuem Profil",
"publication_year": 2001,
"type": "article",
"doi": "https://doi.org/10.1159/000050295",
"updated_date": "2025-11-06T03:46:38.306Z",
"source_index": "openalex-works",
"variant_count": 2,
"variant_indices": ["openalex-works", "openalex-works-2"],
"classified_by_id": true,
"classification_contains_author": true,
"institution_match": false,
"reason": "multiple_source_documents_same_openalex_id"
}
],
"classified_but_author_missing": []
}
}
@@ -0,0 +1,755 @@
#!/usr/bin/env python3
"""Compare the three publication-counting approaches for one OpenAlex author.
The script compares:
1. The author card value from openalex-authors.works_count.
2. The publication-list backend query used by /person/{id}/publications.
3. The classification-pipeline set based on unique OpenAlex work IDs since 1950.
4. Existing documents in work-classifications.
It also writes concrete discrepancy examples to JSON and CSV files.
No credentials are hardcoded. The script reads:
- ELASTICSEARCH_URL
- ELASTICSEARCH_API_KEY
from service/src/main/inse/.env or from the process environment.
python compare_author_publication_counts.py ^ --project-root . ^ --author-id A5034365278 ^ --institution-id I62318514
"""
from __future__ import annotations
import argparse
import csv
import json
import os
import sys
from collections import defaultdict
from pathlib import Path
from typing import Any, Iterable
import requests
DEFAULT_AUTHOR_ID = "A5034365278"
DEFAULT_WORK_YEAR_GTE = 1950
SOURCE_INDEX = "openalex-works*"
AUTHOR_INDEX = "openalex-authors"
TARGET_INDEX = "work-classifications"
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Compare author publication counts across the webapp and classification index."
)
parser.add_argument(
"--author-id",
default=DEFAULT_AUTHOR_ID,
help="OpenAlex author ID, for example A5034365278.",
)
parser.add_argument(
"--project-root",
type=Path,
default=Path.cwd(),
help="Project root containing service/src/main/inse/.env.",
)
parser.add_argument(
"--env-file",
type=Path,
default=None,
help="Explicit .env file. Defaults to service/src/main/inse/.env.",
)
parser.add_argument(
"--institution-id",
default=None,
help=(
"Optional OpenAlex institution ID used to inspect institution-specific works, "
"for example I62318514."
),
)
parser.add_argument(
"--work-year-gte",
type=int,
default=DEFAULT_WORK_YEAR_GTE,
help="Minimum publication year used by the classification pipeline.",
)
parser.add_argument(
"--output-dir",
type=Path,
default=Path("author_publication_comparison"),
help="Directory for JSON and CSV output.",
)
parser.add_argument(
"--example-limit",
type=int,
default=30,
help="Maximum number of examples per discrepancy group.",
)
return parser.parse_args()
def read_env_file(path: Path) -> dict[str, str]:
values: dict[str, str] = {}
if not path.exists():
return values
for raw_line in path.read_text(encoding="utf-8").splitlines():
line = raw_line.strip()
if not line or line.startswith("#") or "=" not in line:
continue
key, value = line.split("=", 1)
values[key.strip()] = value.strip().strip('"').strip("'")
return values
def load_credentials(args: argparse.Namespace) -> tuple[str, str]:
env_file = args.env_file
if env_file is None:
env_file = args.project_root / "service" / "src" / "main" / "inse" / ".env"
file_values = read_env_file(env_file)
base_url = (
os.getenv("ELASTICSEARCH_URL") or file_values.get("ELASTICSEARCH_URL") or ""
).rstrip("/")
api_key = (
os.getenv("ELASTICSEARCH_API_KEY")
or file_values.get("ELASTICSEARCH_API_KEY")
or ""
).strip()
if not base_url:
raise RuntimeError(
f"ELASTICSEARCH_URL is missing. Set it in the environment or in {env_file}."
)
if not api_key:
raise RuntimeError(
"ELASTICSEARCH_API_KEY is missing. Set it in the environment or in "
f"{env_file}."
)
return base_url, api_key
def full_openalex_id(value: str, prefix: str) -> str:
clean = value.strip().rstrip("/").rsplit("/", 1)[-1]
if not clean.startswith(prefix):
raise ValueError(f"Unexpected OpenAlex ID: {value}")
return f"https://openalex.org/{clean}"
def short_openalex_id(value: Any) -> str | None:
if not isinstance(value, str) or not value.strip():
return None
return value.strip().rstrip("/").rsplit("/", 1)[-1]
class ElasticsearchClient:
def __init__(self, base_url: str, api_key: str) -> None:
self.base_url = base_url.rstrip("/")
self.session = requests.Session()
self.session.headers.update(
{
"Authorization": f"ApiKey {api_key}",
"Content-Type": "application/json",
"Accept": "application/json",
}
)
def request(
self,
method: str,
path: str,
*,
body: dict[str, Any] | None = None,
params: dict[str, Any] | None = None,
timeout: float = 120.0,
) -> dict[str, Any]:
response = self.session.request(
method,
f"{self.base_url}/{path.lstrip('/')}",
json=body,
params=params,
timeout=timeout,
)
if not response.ok:
raise RuntimeError(
f"Elasticsearch {response.status_code} for {path}: "
f"{response.text[:1000]}"
)
if not response.content:
return {}
return response.json()
def get_author(self, short_author_id: str) -> dict[str, Any]:
result = self.request(
"GET",
f"{AUTHOR_INDEX}/_doc/{short_author_id}",
params={"_source": "id,display_name,works_count,cited_by_count"},
)
source = result.get("_source")
if not isinstance(source, dict):
raise RuntimeError(f"Author not found: {short_author_id}")
return source
def search_publication_page(
self,
full_author_id: str,
*,
page: int = 0,
size: int = 50,
) -> dict[str, Any]:
query = author_query(full_author_id)
body = {
"query": query,
"_source": [
"id",
"title",
"type",
"publication_year",
"language",
"cited_by_count",
"authorships.author",
"authorships.institutions.id",
"topics",
],
"from": page * size,
"size": size,
"sort": [{"publication_year": "desc"}],
}
return self.request("POST", f"{SOURCE_INDEX}/_search", body=body)
def scroll_author_works(
self,
full_author_id: str,
*,
page_size: int = 1000,
) -> list[dict[str, Any]]:
body = {
"size": page_size,
"track_total_hits": True,
"query": author_query(full_author_id),
"_source": [
"id",
"doi",
"title",
"display_name",
"publication_year",
"updated_date",
"type",
"authorships.author.id",
"authorships.author.display_name",
"authorships.institutions.id",
"authorships.institutions.display_name",
],
"sort": ["_doc"],
}
result = self.request(
"POST",
f"{SOURCE_INDEX}/_search",
body=body,
params={"scroll": "2m"},
)
scroll_id = result.get("_scroll_id")
hits: list[dict[str, Any]] = []
try:
while True:
page_hits = result.get("hits", {}).get("hits", [])
if not page_hits:
break
hits.extend(hit for hit in page_hits if isinstance(hit, dict))
if not scroll_id:
break
result = self.request(
"POST",
"_search/scroll",
body={"scroll": "2m", "scroll_id": scroll_id},
)
scroll_id = result.get("_scroll_id", scroll_id)
finally:
if scroll_id:
try:
self.request(
"DELETE",
"_search/scroll",
body={"scroll_id": [scroll_id]},
)
except Exception:
pass
return hits
def mget_classifications(
self,
short_work_ids: list[str],
*,
chunk_size: int = 500,
) -> dict[str, dict[str, Any]]:
result: dict[str, dict[str, Any]] = {}
for start in range(0, len(short_work_ids), chunk_size):
chunk = short_work_ids[start : start + chunk_size]
response = self.request(
"POST",
f"{TARGET_INDEX}/_mget",
body={"ids": chunk},
params={
"_source_includes": ",".join(
[
"work_id",
"title",
"publication_year",
"authors.id",
"classification.primary_category",
"classification_meta.prompt_version",
]
)
},
)
for document in response.get("docs", []):
if isinstance(document, dict):
result[str(document.get("_id"))] = document
return result
def count_classifications_by_author(self, full_author_id: str) -> int:
response = self.request(
"POST",
f"{TARGET_INDEX}/_count",
body={
"query": {
"nested": {
"path": "authors",
"query": {"term": {"authors.id": full_author_id}},
}
}
},
)
return int(response.get("count", 0))
def author_query(full_author_id: str) -> dict[str, Any]:
return {
"nested": {
"path": "authorships",
"query": {"term": {"authorships.author.id": full_author_id}},
}
}
def choose_pipeline_hit(
current: dict[str, Any] | None,
candidate: dict[str, Any],
) -> dict[str, Any]:
"""Reproduce classify_ude_works_to_index.py source-version selection."""
if current is None:
return candidate
current_index = current.get("_index")
candidate_index = candidate.get("_index")
if candidate_index == "openalex-works" and current_index != "openalex-works":
return candidate
if current_index == "openalex-works" and candidate_index != "openalex-works":
return current
current_source = current.get("_source")
candidate_source = candidate.get("_source")
current_updated = (
current_source.get("updated_date") if isinstance(current_source, dict) else None
)
candidate_updated = (
candidate_source.get("updated_date")
if isinstance(candidate_source, dict)
else None
)
if isinstance(candidate_updated, str):
if not isinstance(current_updated, str) or candidate_updated > current_updated:
return candidate
return current
def work_record(hit: dict[str, Any]) -> dict[str, Any]:
source = hit.get("_source")
if not isinstance(source, dict):
source = {}
work_id = short_openalex_id(source.get("id") or hit.get("_id"))
return {
"work_id": work_id,
"full_work_id": (f"https://openalex.org/{work_id}" if work_id else None),
"title": source.get("title") or source.get("display_name"),
"publication_year": source.get("publication_year"),
"type": source.get("type"),
"doi": source.get("doi"),
"updated_date": source.get("updated_date"),
"source_index": hit.get("_index"),
}
def author_ids_in_source(source: dict[str, Any]) -> set[str]:
result: set[str] = set()
for authorship in source.get("authorships") or []:
if not isinstance(authorship, dict):
continue
author = authorship.get("author")
if not isinstance(author, dict):
continue
author_id = author.get("id")
if isinstance(author_id, str):
result.add(author_id)
return result
def institution_ids_in_source(source: dict[str, Any]) -> set[str]:
result: set[str] = set()
for authorship in source.get("authorships") or []:
if not isinstance(authorship, dict):
continue
for institution in authorship.get("institutions") or []:
if not isinstance(institution, dict):
continue
institution_id = institution.get("id")
if isinstance(institution_id, str):
result.add(institution_id)
return result
def classification_author_ids(document: dict[str, Any]) -> set[str]:
source = document.get("_source")
if not isinstance(source, dict):
return set()
result: set[str] = set()
for author in source.get("authors") or []:
if isinstance(author, dict) and isinstance(author.get("id"), str):
result.add(author["id"])
return result
def sort_work_records(records: Iterable[dict[str, Any]]) -> list[dict[str, Any]]:
return sorted(
records,
key=lambda item: (
item.get("publication_year") is not None,
item.get("publication_year") or -1,
item.get("work_id") or "",
),
reverse=True,
)
def write_csv(path: Path, rows: list[dict[str, Any]]) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
fieldnames = [
"work_id",
"full_work_id",
"title",
"publication_year",
"type",
"doi",
"updated_date",
"source_index",
"variant_count",
"variant_indices",
"classified_by_id",
"classification_contains_author",
"institution_match",
"reason",
]
with path.open("w", encoding="utf-8-sig", newline="") as handle:
writer = csv.DictWriter(handle, fieldnames=fieldnames, extrasaction="ignore")
writer.writeheader()
writer.writerows(rows)
def main() -> int:
args = parse_args()
base_url, api_key = load_credentials(args)
client = ElasticsearchClient(base_url, api_key)
short_author_id = short_openalex_id(args.author_id)
if short_author_id is None:
raise RuntimeError("Author ID is empty.")
full_author_id = full_openalex_id(short_author_id, "A")
full_institution_id: str | None = None
if args.institution_id:
short_institution_id = short_openalex_id(args.institution_id)
if short_institution_id is None:
raise RuntimeError("Institution ID is empty.")
full_institution_id = full_openalex_id(short_institution_id, "I")
output_dir = args.output_dir
output_dir.mkdir(parents=True, exist_ok=True)
print(f"Loading author {short_author_id}...")
author = client.get_author(short_author_id)
print("Reproducing the publication-list query...")
publication_page = client.search_publication_page(
full_author_id,
page=0,
size=50,
)
page_total = publication_page.get("hits", {}).get("total", {})
page_total_value = (
int(page_total.get("value", 0))
if isinstance(page_total, dict)
else int(page_total or 0)
)
page_total_relation = (
page_total.get("relation") if isinstance(page_total, dict) else None
)
print("Scanning all matching source documents...")
raw_hits = client.scroll_author_works(full_author_id)
variants_by_work_id: dict[str, list[dict[str, Any]]] = defaultdict(list)
pipeline_hit_by_work_id: dict[str, dict[str, Any]] = {}
for hit in raw_hits:
source = hit.get("_source")
if not isinstance(source, dict):
continue
work_id = short_openalex_id(source.get("id") or hit.get("_id"))
if not work_id:
continue
variants_by_work_id[work_id].append(hit)
pipeline_hit_by_work_id[work_id] = choose_pipeline_hit(
pipeline_hit_by_work_id.get(work_id),
hit,
)
unique_work_ids = sorted(pipeline_hit_by_work_id)
eligible_work_ids: list[str] = []
pre_threshold_work_ids: list[str] = []
missing_year_work_ids: list[str] = []
for work_id, hit in pipeline_hit_by_work_id.items():
source = hit.get("_source")
if not isinstance(source, dict):
continue
year = source.get("publication_year")
if isinstance(year, bool) or not isinstance(year, int):
missing_year_work_ids.append(work_id)
elif year < args.work_year_gte:
pre_threshold_work_ids.append(work_id)
else:
eligible_work_ids.append(work_id)
print("Loading matching classification documents...")
classification_docs = client.mget_classifications(eligible_work_ids)
classified_author_count = client.count_classifications_by_author(full_author_id)
classified_by_id: list[str] = []
unclassified_eligible: list[str] = []
classified_but_author_missing: list[str] = []
for work_id in eligible_work_ids:
document = classification_docs.get(work_id)
if document and document.get("found"):
classified_by_id.append(work_id)
if full_author_id not in classification_author_ids(document):
classified_but_author_missing.append(work_id)
else:
unclassified_eligible.append(work_id)
duplicate_work_ids = [
work_id
for work_id, variants in variants_by_work_id.items()
if len(variants) > 1
]
institution_matching_work_ids: list[str] = []
if full_institution_id:
for work_id, hit in pipeline_hit_by_work_id.items():
source = hit.get("_source")
if not isinstance(source, dict):
continue
if full_institution_id in institution_ids_in_source(source):
institution_matching_work_ids.append(work_id)
def enrich(work_id: str, reason: str) -> dict[str, Any]:
hit = pipeline_hit_by_work_id[work_id]
record = work_record(hit)
variants = variants_by_work_id.get(work_id, [])
classification = classification_docs.get(work_id)
source = hit.get("_source")
institution_match = None
if full_institution_id and isinstance(source, dict):
institution_match = full_institution_id in institution_ids_in_source(source)
record.update(
{
"variant_count": len(variants),
"variant_indices": sorted(
{
str(variant.get("_index"))
for variant in variants
if variant.get("_index")
}
),
"classified_by_id": bool(
classification and classification.get("found")
),
"classification_contains_author": bool(
classification
and classification.get("found")
and full_author_id in classification_author_ids(classification)
),
"institution_match": institution_match,
"reason": reason,
}
)
return record
unclassified_examples = sort_work_records(
enrich(work_id, "eligible_since_threshold_but_missing_in_target")
for work_id in unclassified_eligible
)
pre_threshold_examples = sort_work_records(
enrich(work_id, f"publication_year_before_{args.work_year_gte}")
for work_id in pre_threshold_work_ids
)
missing_year_examples = sort_work_records(
enrich(work_id, "publication_year_missing") for work_id in missing_year_work_ids
)
duplicate_examples = sort_work_records(
enrich(work_id, "multiple_source_documents_same_openalex_id")
for work_id in duplicate_work_ids
)
author_missing_examples = sort_work_records(
enrich(work_id, "classified_target_document_does_not_contain_author")
for work_id in classified_but_author_missing
)
summary = {
"author": {
"id": full_author_id,
"display_name": author.get("display_name"),
"card_works_count": author.get("works_count"),
"cited_by_count": author.get("cited_by_count"),
},
"webapp_publication_list": {
"endpoint": f"/api/v2/works/author/{short_author_id}?page=0&size=50",
"raw_hits_total_value": page_total_value,
"raw_hits_total_relation": page_total_relation,
"raw_documents_scanned": len(raw_hits),
"unique_openalex_work_ids": len(unique_work_ids),
"duplicate_raw_documents": len(raw_hits) - len(unique_work_ids),
"work_ids_with_multiple_source_documents": len(duplicate_work_ids),
},
"classification_pipeline": {
"minimum_publication_year": args.work_year_gte,
"eligible_unique_work_ids": len(eligible_work_ids),
"pre_threshold_unique_work_ids": len(pre_threshold_work_ids),
"missing_year_unique_work_ids": len(missing_year_work_ids),
"classified_by_target_id": len(classified_by_id),
"eligible_but_missing_in_target": len(unclassified_eligible),
"classified_target_documents_containing_author": classified_author_count,
"classified_by_id_but_author_missing_from_target_document": len(
classified_but_author_missing
),
},
"institution": {
"id": full_institution_id,
"pipeline_selected_source_works_matching_institution": (
len(institution_matching_work_ids) if full_institution_id else None
),
},
"important_differences": [
"The author card reads openalex-authors.works_count directly.",
"The publication list counts raw hits from openalex-works* and does not deduplicate by work ID.",
"The classification pipeline deduplicates by normalized OpenAlex work ID.",
f"The classification pipeline excludes works with publication_year below {args.work_year_gte} or missing.",
"A work can exist in the classification index but be absent from a per-author target-index count if the stored authors array does not contain that author.",
],
"examples": {
"eligible_but_missing_in_target": unclassified_examples[
: args.example_limit
],
"publication_year_before_threshold": pre_threshold_examples[
: args.example_limit
],
"publication_year_missing": missing_year_examples[: args.example_limit],
"multiple_source_documents_same_id": duplicate_examples[
: args.example_limit
],
"classified_but_author_missing": author_missing_examples[
: args.example_limit
],
},
}
json_path = output_dir / f"{short_author_id}_publication_count_comparison.json"
json_path.write_text(
json.dumps(summary, ensure_ascii=False, indent=2),
encoding="utf-8",
)
write_csv(
output_dir / f"{short_author_id}_eligible_but_unclassified.csv",
unclassified_examples,
)
write_csv(
output_dir / f"{short_author_id}_source_duplicates.csv",
duplicate_examples,
)
write_csv(
output_dir / f"{short_author_id}_excluded_by_year.csv",
pre_threshold_examples + missing_year_examples,
)
write_csv(
output_dir / f"{short_author_id}_classified_but_author_missing.csv",
author_missing_examples,
)
print()
print("Comparison")
print("----------")
print(f"Author card works_count: {author.get('works_count')}")
print(
f"Publication page raw total: {page_total_value} ({page_total_relation})"
)
print(f"Publication page unique OpenAlex IDs: {len(unique_work_ids)}")
print(f"Pipeline-eligible unique IDs: {len(eligible_work_ids)}")
print(f"Classified by target document ID: {len(classified_by_id)}")
print(f"Eligible but missing in target: {len(unclassified_eligible)}")
print(f"Target documents containing this author: {classified_author_count}")
print(
f"Raw duplicate documents: {len(raw_hits) - len(unique_work_ids)}"
)
print(
f"Works before {args.work_year_gte}: {len(pre_threshold_work_ids)}"
)
print(f"Works with missing publication year: {len(missing_year_work_ids)}")
print()
print(f"Report: {json_path.resolve()}")
print(f"CSV files: {output_dir.resolve()}")
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except KeyboardInterrupt:
print("\nInterrupted.", file=sys.stderr)
raise SystemExit(130)
except Exception as exc:
print(f"Error: {exc}", file=sys.stderr)
raise SystemExit(1)
@@ -0,0 +1,181 @@
{
"summary": {
"created_at": "2026-07-19T23:22:32.712141Z",
"index": "work-classifications",
"read_only": true,
"expected_count": null,
"documents": 183661,
"initial_count": 183661,
"final_count": 183661,
"count_consistent": true,
"expected_count_matches": true,
"index_integrity_valid": true
},
"mapping": {
"valid": true,
"error_count": 0,
"errors": []
},
"documents": {
"schema_valid": 183661,
"schema_invalid": 0,
"field_order_valid": 183661,
"field_order_invalid": 0,
"unique_work_ids": 183661,
"duplicate_work_id_count": 0,
"duplicate_work_ids": {},
"schema_error_counts": {},
"field_order_error_counts": {}
},
"classification": {
"categories": {
"basic_research": {
"count": 83310,
"percentage": 45.36
},
"applied_research": {
"count": 73026,
"percentage": 39.76
},
"non_research": {
"count": 14584,
"percentage": 7.94
},
"experimental_development": {
"count": 12741,
"percentage": 6.94
}
},
"quadrants": {
"pure_applied": {
"count": 85767,
"percentage": 46.7
},
"use_inspired_basic": {
"count": 54366,
"percentage": 29.6
},
"pure_basic": {
"count": 28944,
"percentage": 15.76
},
"not_applicable": {
"count": 14584,
"percentage": 7.94
}
},
"confidence": {
"high": {
"count": 113822,
"percentage": 61.97
},
"medium": {
"count": 68830,
"percentage": 37.48
},
"low": {
"count": 1009,
"percentage": 0.55
}
},
"insufficient_context": {
"false": {
"count": 173892,
"percentage": 94.68
},
"true": {
"count": 9769,
"percentage": 5.32
}
},
"signals_used": {
"topics": 181324,
"title": 179981,
"work_type": 175947,
"venue": 141807,
"abstract": 110404,
"funders": 38567,
"language": 6695,
"year": 85
},
"applied_orientation_score": {
"overall": {
"count": 169077,
"min": 0.0,
"max": 92.0,
"mean": 47.18,
"median": 50.0
},
"by_category": {
"applied_research": {
"count": 73026,
"min": 31.0,
"max": 70.0,
"mean": 62.08,
"median": 60.0
},
"basic_research": {
"count": 83310,
"min": 0.0,
"max": 45.0,
"mean": 28.74,
"median": 35.0
},
"experimental_development": {
"count": 12741,
"min": 75.0,
"max": 92.0,
"mean": 82.34,
"median": 80.0
},
"non_research": {
"count": 0,
"min": null,
"max": null,
"mean": null,
"median": null
}
}
},
"current_rule_consistency": {
"consistent": 183661,
"inconsistent": 0,
"consistent_percentage": 100.0,
"error_counts": {}
},
"stored_validation": {
"states": {
"valid": 183661
},
"valid_state_consistent_with_error_list": 183661,
"valid_state_inconsistent_with_error_list": 0,
"error_occurrences": 0,
"error_counts": {}
}
},
"metadata": {
"missing_title": 120,
"missing_doi": 18865,
"missing_publication_year": 0,
"empty_authors": 0,
"empty_institutions": 47038,
"empty_topics": 2233,
"publication_year": {
"min": 1950,
"max": 2026
},
"classified_at": {
"min": "2026-07-10T18:42:03Z",
"max": "2026-07-19T06:14:05Z"
}
},
"provenance": {
"models": {
"gemma4-e4b": 183661
},
"prompt_versions": {
"frascati_hard_ranges_v2": 141643,
"frascati_v1": 42018
}
}
}
@@ -0,0 +1,44 @@
{
"run_id": "20260718_080350_493424",
"started_at": "2026-07-18T08:03:50Z",
"finished_at": "2026-07-18T11:25:02Z",
"duration_seconds": 12070.563,
"status": "completed",
"error": null,
"parameters": {
"limit": 15000,
"workers": 25,
"model": "gemma4-e4b",
"prompt_version": "frascati_hard_ranges_v2",
"target_index": "work-classifications",
"bulk_batch_size": 200,
"state_storage": "memory_only",
"preflight_only": false
},
"classification": {
"llm_completed": 15000,
"valid": 15000,
"invalid": 0,
"categories": {
"experimental_development": 1037,
"basic_research": 6608,
"applied_research": 6062,
"non_research": 1293
},
"validation_errors": {}
},
"indexing": {
"newly_indexed": 15000,
"bulk_requests": 82,
"bulk_documents_submitted": 15350,
"bulk_failures": 0
},
"token_usage": {
"prompt_tokens": 56119646,
"cached_prompt_tokens": 51428736,
"uncached_prompt_tokens": 4690910,
"completion_tokens": 13741519,
"real_total_usage": 18432429
},
"throughput_indexed_per_hour": 4473.69
}
+2 -1
View File
@@ -19,7 +19,8 @@ RUN pip install --root-user-action=ignore --no-cache-dir --disable-pip-version-c
"partial-json-parser==0.2.1.1.post7" \
"sqlmodel~=0.0.33" \
"argon2-cffi~=25.1.0" \
"pypdf==6.14.2"
"pandas~=2.3.3" \
"pypdf==6.14.2"
COPY [ "src/main", "/home" ]
COPY [ "src/data", "/data" ]
+1
View File
@@ -22,6 +22,7 @@ dependencies = [
"torch",
"sqlmodel~=0.0.33",
"argon2-cffi~=25.1.0",
"pandas~=2.3.3",
]
[[tool.uv.index]]
@@ -16,9 +16,7 @@
"relevance_score": 1.0
}
],
"expected_ipc_prefixes": [
"H01M"
],
"expected_ipc_prefixes": ["H01M"],
"mapping_status": "mapped",
"diagnostics": {
"search_path": "ipc",
@@ -57,12 +55,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/90 20060101AFI20240910BHUS",
@@ -91,12 +85,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/083 20160101AFI20210209BHUS",
@@ -142,12 +132,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20160101AFI20201124BHUS",
@@ -178,12 +164,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/0221 20160101AFI20201124BHUS",
@@ -229,12 +211,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"A62C 3/06 20060101AFI20190820BHEP",
@@ -260,12 +238,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 12/08 20060101AFI20190521BHUS",
@@ -301,12 +275,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/36 20060101AFI20181009BHUS",
@@ -338,12 +308,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20160101AFI20180626BHUS",
@@ -379,12 +345,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/0656 20160101AFI20170424BHEP",
@@ -411,12 +373,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20160101AFI20170207BHUS",
@@ -445,12 +403,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20160614BHUS",
@@ -484,12 +438,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20151215BHUS",
@@ -515,12 +465,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/04 20060101AFI20150714BHUS",
@@ -548,12 +494,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/22 20060101AFI20150310BHUS",
@@ -579,12 +521,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/10 20060101AFI20150310BHUS",
@@ -621,12 +559,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20141125BHUS",
@@ -652,12 +586,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20060101AFI20140930BHUS",
@@ -685,12 +615,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/90 20060101AFI20251230BHUS",
@@ -719,12 +645,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/04082 20160101AFI20250909BHUS",
@@ -754,12 +676,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/083 20160101AFI20250722BHUS",
@@ -825,10 +743,7 @@
"US12412912",
"US12368175"
],
"irrelevant_patent_ids": [
"US10847825",
"EP3549641"
]
"irrelevant_patent_ids": ["US10847825", "EP3549641"]
},
{
"id": "speech-recognition",
@@ -844,9 +759,7 @@
"relevance_score": 1.0
}
],
"expected_ipc_prefixes": [
"G10L"
],
"expected_ipc_prefixes": ["G10L"],
"mapping_status": "mapped",
"diagnostics": {
"search_path": "ipc",
@@ -895,12 +808,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20241105BHUS",
@@ -947,12 +856,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20230411BHUS",
@@ -999,12 +904,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/42 20060101AFI20230307BHUS",
@@ -1033,12 +934,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/42 20060101AFI20200811BHUS",
@@ -1085,12 +982,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20170919BHUS",
@@ -1142,12 +1035,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 17/00 20130101AFI20170620BHUS",
@@ -1180,12 +1069,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G06F 3/16 20060101AFI20160628BHUS",
@@ -1220,12 +1105,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 1/64 20060101AFI20170815BHUS",
@@ -1258,12 +1139,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"G10L 17/14 20130101AFI20260317BHUS",
@@ -1299,12 +1176,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20190827BHUS",
@@ -1335,12 +1208,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20160614BHUS",
@@ -1376,12 +1245,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20260428BHUS",
@@ -1424,12 +1289,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 17/26 20130101AFI20260331BHUS",
@@ -1480,12 +1341,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/00 20060101AFI20170214BHUS",
@@ -1526,12 +1383,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/183 20130101AFI20251125BHUS",
@@ -1568,12 +1421,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20241029BHUS",
@@ -1616,12 +1465,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20240910BHUS",
@@ -1664,12 +1509,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20231107BHUS",
@@ -1712,12 +1553,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20230718BHUS",
@@ -1760,12 +1597,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 11/00 20060101AFI20201208BHUS",
@@ -1837,9 +1670,7 @@
"US11706338",
"US10863033"
],
"irrelevant_patent_ids": [
"US10397400"
]
"irrelevant_patent_ids": ["US10397400"]
}
],
"labeling_status": {
@@ -1851,4 +1682,4 @@
},
"warning": "KI-gestützte Vorlabelierung anhand von Titel sowie IPC/CPC-Evidenz. Für einen wissenschaftlichen Goldstandard sollten Grenzfälle fachlich geprüft werden."
}
}
}
@@ -2,11 +2,7 @@
"version": 1,
"presentation": true,
"description": "goldset for two IPC cases.",
"ks": [
5,
10,
20
],
"ks": [5, 10, 20],
"cases": [
{
"id": "fuel-cell",
@@ -22,9 +18,7 @@
"relevance_score": 1.0
}
],
"expected_ipc_prefixes": [
"H01M"
],
"expected_ipc_prefixes": ["H01M"],
"relevant_patent_ids": [
"US12087951",
"US10916789",
@@ -45,10 +39,7 @@
"US12412912",
"US12368175"
],
"irrelevant_patent_ids": [
"US10847825",
"EP3549641"
],
"irrelevant_patent_ids": ["US10847825", "EP3549641"],
"relevance_grades": {
"US12087951": 2,
"US10916789": 2,
@@ -82,12 +73,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/90 20060101AFI20240910BHUS",
@@ -116,12 +103,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/083 20160101AFI20210209BHUS",
@@ -167,12 +150,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20160101AFI20201124BHUS",
@@ -203,12 +182,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/0221 20160101AFI20201124BHUS",
@@ -254,12 +229,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"A62C 3/06 20060101AFI20190820BHEP",
@@ -285,12 +256,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 12/08 20060101AFI20190521BHUS",
@@ -326,12 +293,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/36 20060101AFI20181009BHUS",
@@ -363,12 +326,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20160101AFI20180626BHUS",
@@ -404,12 +363,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/0656 20160101AFI20170424BHEP",
@@ -436,12 +391,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20160101AFI20170207BHUS",
@@ -470,12 +421,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20160614BHUS",
@@ -509,12 +456,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20151215BHUS",
@@ -540,12 +483,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/04 20060101AFI20150714BHUS",
@@ -573,12 +512,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/22 20060101AFI20150310BHUS",
@@ -604,12 +539,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/10 20060101AFI20150310BHUS",
@@ -646,12 +577,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/06 20060101AFI20141125BHUS",
@@ -677,12 +604,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/08 20060101AFI20140930BHUS",
@@ -710,12 +633,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 4/90 20060101AFI20251230BHUS",
@@ -744,12 +663,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/04082 20160101AFI20250909BHUS",
@@ -779,12 +694,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"fuel cell"
],
"matched_ipc_symbols": [
"H01M8/083"
],
"matched_keywords": ["fuel cell"],
"matched_ipc_symbols": ["H01M8/083"],
"text_retrieval": false,
"ipc": [
"H01M 8/083 20160101AFI20250722BHUS",
@@ -823,9 +734,7 @@
"relevance_score": 1.0
}
],
"expected_ipc_prefixes": [
"G10L"
],
"expected_ipc_prefixes": ["G10L"],
"relevant_patent_ids": [
"US12137183",
"US11627221",
@@ -847,9 +756,7 @@
"US11706338",
"US10863033"
],
"irrelevant_patent_ids": [
"US10397400"
],
"irrelevant_patent_ids": ["US10397400"],
"relevance_grades": {
"US12137183": 2,
"US11627221": 2,
@@ -883,12 +790,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20241105BHUS",
@@ -935,12 +838,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20230411BHUS",
@@ -987,12 +886,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/42 20060101AFI20230307BHUS",
@@ -1021,12 +916,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/42 20060101AFI20200811BHUS",
@@ -1073,12 +964,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20170919BHUS",
@@ -1130,12 +1017,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 17/00 20130101AFI20170620BHUS",
@@ -1168,12 +1051,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G06F 3/16 20060101AFI20160628BHUS",
@@ -1208,12 +1087,8 @@
"topic_score": 1.0,
"text_score": 1.0,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 1/64 20060101AFI20170815BHUS",
@@ -1246,12 +1121,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"G10L 17/14 20130101AFI20260317BHUS",
@@ -1287,12 +1158,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20190827BHUS",
@@ -1323,12 +1190,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"G10L17/14"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["G10L17/14"],
"text_retrieval": false,
"ipc": [
"H04M 3/493 20060101AFI20160614BHUS",
@@ -1364,12 +1227,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/00 20130101AFI20260428BHUS",
@@ -1412,12 +1271,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 17/26 20130101AFI20260331BHUS",
@@ -1468,12 +1323,8 @@
"topic_score": 1.0,
"text_score": 0.3333333333333333,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/00 20060101AFI20170214BHUS",
@@ -1514,12 +1365,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"G10L 15/183 20130101AFI20251125BHUS",
@@ -1556,12 +1403,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20241029BHUS",
@@ -1604,12 +1447,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20240910BHUS",
@@ -1652,12 +1491,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20231107BHUS",
@@ -1700,12 +1535,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 3/51 20060101AFI20230718BHUS",
@@ -1748,12 +1579,8 @@
"topic_score": 1.0,
"text_score": 0.6666666666666666,
"topic_match_kind": "topic_id",
"matched_keywords": [
"speech recognition"
],
"matched_ipc_symbols": [
"H04M2201/405"
],
"matched_keywords": ["speech recognition"],
"matched_ipc_symbols": ["H04M2201/405"],
"text_retrieval": false,
"ipc": [
"H04M 11/00 20060101AFI20201208BHUS",
@@ -1784,4 +1611,4 @@
]
}
]
}
}
+161 -12
View File
@@ -1,9 +1,11 @@
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Set
from inse.authors.v2.model import AuthorPage
from inse.integrations import elasticsearch
from inse.institutions.v2 import service as institution_service
from inse.model import ESIndex
from inse.models.openalex.author import Author
from inse.models.openalex.institution import Institution
async def search_authors(
@@ -128,18 +130,165 @@ async def author_currently_belongs_to_institution(
bool: True if the author belongs to the institution in any of the specified years, False otherwise.
"""
author = await get_author_by_id(raw_oa_author_id)
if not author:
if not current_years:
return False
for affiliation in author.affiliations or []:
institution = affiliation.institution
if not institution:
continue
matching_author_ids = await _authors_belong_to_institution(
[raw_oa_author_id],
raw_oa_institution_id,
affiliation_year_filter={"terms": {"affiliations.years": current_years}},
)
return bool(matching_author_ids)
if institution.id == f"https://openalex.org/{raw_oa_institution_id}" and any(
year in (affiliation.years or []) for year in current_years
):
return True
return False
def _prefix_openalex_id(raw_id: str) -> str:
if raw_id.startswith("https://openalex.org/"):
return raw_id
return f"https://openalex.org/{raw_id}"
async def _get_institution_identity(
raw_oa_institution_id: str,
) -> Optional[Institution]:
page = await institution_service.get_institutions_by_ids(
[_prefix_openalex_id(raw_oa_institution_id)]
)
return page.elements[0] if page.elements else None
def _current_institution_cohort_query(
author_ids: List[str],
institution_id: str,
institution_ror: Optional[str],
institution_display_name: str,
affiliation_year_filter: Dict,
) -> Dict:
"""Build the author cohort query used by work classification access."""
affiliation_identifiers = [
{"term": {"affiliations.institution.id": institution_id}},
]
if institution_ror:
affiliation_identifiers.append(
{"term": {"affiliations.institution.ror": institution_ror}}
)
affiliation_identifiers.append(
{
"match_phrase": {
"affiliations.institution.display_name": institution_display_name
}
}
)
recent_affiliation = {
"nested": {
"path": "affiliations",
"query": {
"bool": {
"filter": [
{
"bool": {
"should": affiliation_identifiers,
"minimum_should_match": 1,
}
},
affiliation_year_filter,
]
}
},
}
}
matching_last_known_institution = {
"nested": {
"path": "last_known_institutions",
"query": {
"match_phrase": {
"last_known_institutions.display_name": institution_display_name
}
},
}
}
missing_last_known_institutions = {
"bool": {
"must_not": [
{
"nested": {
"path": "last_known_institutions",
"query": {
"exists": {
"field": "last_known_institutions.display_name"
}
},
}
}
]
}
}
return {
"bool": {
"filter": [
{
"terms": {
"id": [_prefix_openalex_id(author_id) for author_id in author_ids]
}
},
recent_affiliation,
{
"bool": {
"should": [
matching_last_known_institution,
missing_last_known_institutions,
],
"minimum_should_match": 1,
}
},
]
}
}
async def authors_currently_belong_to_institution(
raw_oa_author_ids: List[str],
raw_oa_institution_id: str,
) -> Set[str]:
"""Return current cohort members using one query for all author IDs."""
return await _authors_belong_to_institution(
raw_oa_author_ids,
raw_oa_institution_id,
affiliation_year_filter={
"range": {"affiliations.years": {"gte": 2025}}
},
)
async def _authors_belong_to_institution(
raw_oa_author_ids: List[str],
raw_oa_institution_id: str,
affiliation_year_filter: Dict,
) -> Set[str]:
"""Return matching author IDs for the supplied affiliation-year filter."""
author_ids = list(dict.fromkeys(filter(None, raw_oa_author_ids)))
if not author_ids:
return set()
institution = await _get_institution_identity(raw_oa_institution_id)
if not institution or not institution.display_name:
return set()
authors = await search_authors(
page=0,
size=len(author_ids),
query=_current_institution_cohort_query(
author_ids=author_ids,
institution_id=institution.id
or _prefix_openalex_id(raw_oa_institution_id),
institution_ror=institution.ror,
institution_display_name=institution.display_name,
affiliation_year_filter=affiliation_year_filter,
),
source=["id"],
)
return {author.id for author in authors.elements if author.id}
@@ -73,6 +73,28 @@ async def get_company_connections_by_author_id(
)
async def get_company_counts_by_names(
names: list[str],
company_status: str = "all",
client: CompanyConnectionsSearchClient | None = None,
) -> dict[str, int]:
"""Bulk variant of the per-author lookup for the ranking pipeline.
Returns a mapping ``display_name -> company_count`` for the given names in a
single Elasticsearch aggregation. Names without a match are absent from the
mapping (callers should treat them as 0). ``company_status`` selects which
companies to count: ``all``, only ``active`` (non-deleted), or only ``deleted``.
"""
search_client = client or CompanyConnectionsSearchClient()
cleaned = [name for name in (_clean(n) for n in names) if name]
if not cleaned:
return {}
return await search_client.count_companies_by_founder_names(
cleaned, company_status=str(company_status)
)
def _get_ude_institution_scope(source: dict[str, Any]) -> tuple[str | None, list[str]]:
institutions = source.get("last_known_institutions") or []
@@ -58,6 +58,112 @@ class CompanyConnectionsSearchClient:
cluster=ESCluster.NES,
)
async def count_companies_by_founder_names(
self,
founder_names: list[str],
company_status: str = "all",
) -> dict[str, int]:
"""Returns the number of companies they are linked to a author.
``company_status`` selects which companies are counted: ``all``, only
``active`` (non-deleted), or only ``deleted`` (``current_status: removed``).
"""
names = sorted({name for name in founder_names if name})
if not names:
return {}
payload = self.handelsregister_founder_counts_query(names, company_status)
response = await elasticsearch.search(
index=self.handelsregister_index,
body=payload,
cluster=ESCluster.NES,
)
buckets = (
response.get("aggregations", {})
.get("founders", {})
.get("matched", {})
.get("by_name", {})
.get("buckets", [])
)
counts: dict[str, int] = {}
for bucket in buckets:
name = bucket.get("key", "")
if not name:
continue
counts[name] = int(bucket.get("companies", {}).get("doc_count", 0))
return counts
@staticmethod
def handelsregister_founder_counts_query(
founder_names: list[str],
company_status: str = "all",
) -> dict[str, Any]:
"""Aggregation that counts distinct companies per founder name.
The ``matched`` filter keeps only the founders whose name is one of the
candidates, then ``reverse_nested`` steps back to the company level so the
per-name ``doc_count`` is a company count, not a founder-occurrence count.
``company_status`` restricts which companies are counted at the company
level: ``all`` (no restriction), only ``active`` (exclude
``current_status: removed``), or only ``deleted`` (only that status).
"""
query_filters: list[dict[str, Any]] = [
{
"nested": {
"path": "officers",
"query": {
"bool": {
"filter": [
{"term": {"officers.type": "person"}},
{"terms": {"officers.name.keyword": founder_names}},
]
}
},
}
}
]
bool_query: dict[str, Any] = {"filter": query_filters}
if company_status == "active":
bool_query["must_not"] = [{"term": {"current_status": "removed"}}]
elif company_status == "deleted":
query_filters.append({"term": {"current_status": "removed"}})
return {
"size": 0,
"track_total_hits": False,
"query": {"bool": bool_query},
"aggs": {
"founders": {
"nested": {"path": "officers"},
"aggs": {
"matched": {
"filter": {
"terms": {"officers.name.keyword": founder_names},
},
"aggs": {
"by_name": {
"terms": {
"field": "officers.name.keyword",
"size": len(founder_names),
"execution_hint": "map",
},
"aggs": {
# step back to the company (parent) level so
# the count is distinct companies per name
"companies": {"reverse_nested": {}},
},
},
},
},
},
},
},
}
@staticmethod
def handelsregister_officer_name_query(
officer_name: str,
+2
View File
@@ -24,6 +24,7 @@ from inse.exceptions import (
)
from inse.funders.service import router as funders_service_router
from inse.projects.router import router as projects_router
from inse.ranking.router import router as ranking_router
from inse.university_ranking.service import router as university_ranking_router
from inse.keywords.service import router as keywords_service_router
from inse.patents.keywords.service import router as keywords_patents_router
@@ -100,6 +101,7 @@ app.include_router(news_service_router)
app.include_router(company_connections_router)
app.include_router(patents_service_router)
app.include_router(university_ranking_router)
app.include_router(ranking_router)
app.include_router(projects_router)
app.include_router(patents_all_router)
app.include_router(keywords_service_router)
+59 -39
View File
@@ -1,50 +1,15 @@
from typing import Any, List, Optional, Set
def build_authors_search_rescored(
using: Any = None,
index: Optional[str] = None,
query: Optional[str] = None,
def build_author_filter_clauses(
institution_name: Optional[str] = None,
sort_by: Optional[str] = None,
sort_order: Optional[str] = None,
topics: Optional[List[str]] = None,
page: int = 1,
page_size: int = 10,
include: Optional[Set[str]] = None,
strict: Optional[bool] = False,
track_total_hits: Optional[bool] = False,
filter_mode: Optional[str] = "from",
filter_year: Optional[int] = None,
name_quality_boost=True,
h_index_boost=True,
citations_boost=True,
works_boost=True,
_2yr_mean_citedness_boost=True,
) -> dict:
"""
Builds an Elasticsearch search request query body for authors as a dictionary.
"""
# 1. Build Query Clauses
query_clause = None
if query:
query_clause = {
"bool": {
"should": [
{"match_phrase": {"display_name": {"query": query, "boost": 5}}},
{
"match_phrase_prefix": {
"display_name": {"query": query, "boost": 3}
}
},
{"match": {"display_name": {"query": query}}},
],
"minimum_should_match": 1,
}
}
# 2. Build Filters
filter_clauses = []
) -> List[dict]:
"""Builds the list of Elasticsearch ``filter`` clauses used to select authors."""
filter_clauses: List[dict] = []
# Filter against false entries (nested ((Works > 2 AND Year > 2020) OR has last_known_institution))
filter_clauses.append(
@@ -196,6 +161,61 @@ def build_authors_search_rescored(
}
}
)
return filter_clauses
def build_authors_search_rescored(
using: Any = None,
index: Optional[str] = None,
query: Optional[str] = None,
institution_name: Optional[str] = None,
sort_by: Optional[str] = None,
sort_order: Optional[str] = None,
topics: Optional[List[str]] = None,
page: int = 1,
page_size: int = 10,
include: Optional[Set[str]] = None,
strict: Optional[bool] = False,
track_total_hits: Optional[bool] = False,
filter_mode: Optional[str] = "from",
filter_year: Optional[int] = None,
name_quality_boost=True,
h_index_boost=True,
citations_boost=True,
works_boost=True,
_2yr_mean_citedness_boost=True,
) -> dict:
"""
Builds an Elasticsearch search request query body for authors as a dictionary.
"""
# 1. Build Query Clauses
query_clause = None
if query:
query_clause = {
"bool": {
"should": [
{"match_phrase": {"display_name": {"query": query, "boost": 5}}},
{
"match_phrase_prefix": {
"display_name": {"query": query, "boost": 3}
}
},
{"match": {"display_name": {"query": query}}},
],
"minimum_should_match": 1,
}
}
# 2. Build Filters
filter_clauses = build_author_filter_clauses(
institution_name=institution_name,
topics=topics,
strict=strict,
filter_mode=filter_mode,
filter_year=filter_year,
)
functions = []
if not sort_by:
# if (name_quality_boost): # Name quality boost, boost names which are not "Value Value"
File diff suppressed because it is too large Load Diff
+364
View File
@@ -0,0 +1,364 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data models for author ranking.
"""
from enum import StrEnum
from typing import List, Optional
from pydantic import BaseModel, Field, field_validator, model_validator
class KeywordOperator(StrEnum):
AND = "and"
OR = "or"
class FilterType(StrEnum):
KEYWORD = "keyword"
TOPIC = "topic"
class CompanyStatusFilter(StrEnum):
ALL = "all"
ACTIVE = "active"
DELETED = "deleted"
class CareerStage(StrEnum):
UNKNOWN = "unknown"
EARLY = "Early"
EMERGING = "Emerging"
ESTABLISHED = "Established"
SENIOR = "Senior"
class PublicationType(StrEnum):
ARTICLE = "article"
OTHER = "other"
DATASET = "dataset"
BOOK_CHAPTER = "book-chapter"
BOOK = "book"
DISSERTATION = "dissertation"
PREPRINT = "preprint"
PARATEXT = "paratext"
LIBGUIDES = "libguides"
REVIEW = "review"
LETTER = "letter"
REFERENCE_ENTRY = "reference-entry"
EDITORIAL = "editorial"
PEER_REVIEW = "peer-review"
REPORT = "report"
STANDARD = "standard"
ERRATUM = "erratum"
RETRACTION = "retraction"
SUPPLEMENTARY_MATERIALS = "supplementary-materials"
BOOK_SECTION = "book-section"
DATABASE = "database"
SOFTWARE = "software"
REPORT_COMPONENT = "report-component"
GRANT = "grant"
class Timespan(BaseModel):
from_year: int = Field(alias="from", description="Start year (inclusive).")
to_year: int = Field(alias="to", description="End year (inclusive).")
@model_validator(mode="after")
def check_order(self):
if self.from_year > self.to_year:
raise ValueError("timespan 'from' must not be greater than 'to'.")
return self
class RankingWeights(BaseModel):
citation: float = Field(
ge=0.0,
le=1.0,
description="Weight for the citation metric (0.0 - 1.0).",
)
works: float = Field(
ge=0.0,
le=1.0,
description="Weight for the works metric (0.0 - 1.0).",
)
companies: float = Field(
default=0.0,
ge=0.0,
le=1.0,
description="Weight for the company-foundations metric (0.0 - 1.0).",
)
news: float = Field(
default=0.0,
ge=0.0,
le=1.0,
description="Weight for the news/media-visibility metric (0.0 - 1.0).",
)
patents: float = Field(
default=0.0,
ge=0.0,
le=1.0,
description="Weight for the patents metric (0.0 - 1.0).",
)
class KeywordToAuthorRequest(BaseModel):
keywords: List[str] = Field(
min_length=1,
description="One or more keywords to rank the author by.",
)
operator: KeywordOperator = Field(
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
filter_type: FilterType = Field(
default=FilterType.KEYWORD,
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
"keyword display names) or 'topic' (OpenAlex topic display names). Defaults to 'keyword'.",
)
institution_name: str = Field(
default="University of Duisburg-Essen",
description="The selected institution display name. (Default Uni-Due)",
)
weights: RankingWeights = Field(
description="Weights for the ranking metrics. Required.",
)
career_stages: List[CareerStage] = Field(
default_factory=list,
description="Optional filter: only keep authors in one of these career stages. Empty = no filter.",
)
publication_types: List[PublicationType] = Field(
default_factory=list,
description="Optional filter: only count works of these publication types. Empty = no filter.",
)
timespan: Optional[Timespan] = Field(
default=None,
description="Optional filter: only count works whose publication_year is within [from, to].",
)
company_status: CompanyStatusFilter = Field(
default=CompanyStatusFilter.ALL,
description="Which companies to count for the company-foundations metric: "
"'all', only 'active' (non-deleted), or only 'deleted'.",
)
@field_validator("operator", "filter_type", mode="before")
@classmethod
def operator_case_insensitive(cls, value):
if isinstance(value, str):
return value.lower()
return value
class SelectedAuthorsRequest(BaseModel):
author_ids: List[str] = Field(
min_length=1,
description="OpenAlex IDs of the authors to rank.",
)
keywords: List[str] = Field(
min_length=1,
description="One or more keywords defining the topic.",
)
operator: KeywordOperator = Field(
default=KeywordOperator.AND,
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
)
filter_type: FilterType = Field(
default=FilterType.KEYWORD,
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
"keyword display names) or 'topic' (OpenAlex topic ids). Defaults to 'keyword'.",
)
publication_types: List[PublicationType] = Field(
default_factory=list,
description="Optional filter: only count works of these publication types. Empty = no filter.",
)
timespan: Optional[Timespan] = Field(
default=None,
description="Optional filter: only count works whose publication_year is within [from, to].",
)
@field_validator("operator", mode="before")
@classmethod
def operator_case_insensitive(cls, value):
if isinstance(value, str):
return value.lower()
return value
@field_validator("filter_type", mode="before")
@classmethod
def filter_type_case_insensitive(cls, value):
if isinstance(value, str):
return value.lower()
return value
class AuthorMetricsRequest(BaseModel):
author_ids: List[str] = Field(
min_length=1,
description="OpenAlex IDs of the authors.",
)
company_status: CompanyStatusFilter = Field(
default=CompanyStatusFilter.ALL,
description="Which companies to count for the company-foundations metric: "
"'all', only 'active' (non-deleted), or only 'deleted'.",
)
class AuthorTopicStats(BaseModel):
"""Section 1: combined stats over an author's works that match the topic filter."""
author_id: str = Field(description="The OpenAlex ID of the author.")
display_name: str = Field(description="The name of the author.")
works_total: int = Field(
description="Number of the author's works matching the topic filter.",
)
corresponding_count: int = Field(
description="Number of the author's topic works where they are the corresponding author.",
)
avg_percentile: float = Field(
description="Average field-normalized citation percentile (0-1) over the author's topic works.",
)
top1_count: int = Field(
description="Number of the author's topic works in the top 1% most-cited.",
)
top10_count: int = Field(
description="Number of the author's topic works in the top 10% most-cited.",
)
fwci_above_one_count: int = Field(
default=0,
description="Number of the author's topic works with a field-weighted citation "
"impact (FWCI) above 1 (cited more than the field/year/type average).",
)
citations_total: int = Field(
default=0,
description="Total citations across the author's topic works.",
)
avg_citations: float = Field(
default=0.0,
description="Average citations per topic work.",
)
max_citations: int = Field(
default=0,
description="Citations of the author's most-cited topic work.",
)
h_index: int = Field(
default=0,
description="h-index over the author's topic works (capped at 100).",
)
avg_fwci: float = Field(
default=0.0,
description="Average field-weighted citation impact (FWCI) over the author's "
"topic works; works without an FWCI value are excluded.",
)
industry_works_count: int = Field(
default=0,
description="Number of the author's topic works with at least one co-author "
"institution of type 'company'.",
)
first_year: Optional[int] = Field(
default=None,
description="Earliest publication year among the author's topic works.",
)
last_year: Optional[int] = Field(
default=None,
description="Latest publication year among the author's topic works.",
)
relevance_above_80_count: int = Field(
default=0,
description="Number of the author's topic works where the matched keyword's "
"relevance score is above 0.8.",
)
avg_relevance: float = Field(
default=0.0,
description="Average matched-keyword relevance score (0-1) over the author's topic works.",
)
first_author_count: int = Field(
default=0,
description="Number of the author's topic works where they are the first author.",
)
middle_author_count: int = Field(
default=0,
description="Number of the author's topic works where they are a middle author.",
)
last_author_count: int = Field(
default=0,
description="Number of the author's topic works where they are the last author.",
)
class SubfieldShare(BaseModel):
name: str = Field(description="The subfield display name.")
count: int = Field(description="Number of works whose primary topic belongs to this subfield.")
class AuthorTopicProfile(BaseModel):
author_id: str = Field(description="The OpenAlex ID of the author.")
display_name: str = Field(description="The name of the author.")
works_total: int = Field(
description="All works of the author in the timespan, regardless of the topic filter.",
)
matched_works: int = Field(
description="Works matching the topic filter (same subset as Section 1).",
)
primary_topic_matches: int = Field(
description="Matched works where one of the searched topics is the work's "
"primary topic (only meaningful for filter_type 'topic').",
)
distinct_topics: int = Field(
description="Number of distinct primary topics across all works.",
)
distinct_subfields: int = Field(
description="Number of distinct primary-topic subfields across all works.",
)
distinct_fields: int = Field(
description="Number of distinct primary-topic fields across all works.",
)
subfields: List[SubfieldShare] = Field(
default_factory=list,
description="Top subfields over all works, by primary topic, largest first.",
)
class AuthorStaticStats(BaseModel):
"""Section 2: author-level stats independent of any keyword/topic/time filter."""
author_id: str = Field(description="The OpenAlex ID of the author.")
display_name: str = Field(description="The name of the author.")
companies_count: int = Field(
description="Number of Handelsregister company connections matched by the author's name.",
)
news_count: int = Field(
description="Number of news articles that mention the author by exact name.",
)
patents_count: int = Field(
description="Number of patents matched to the author (from the org_patents index).",
)
class RankedAuthor(BaseModel):
author_id: str = Field(description="The OpenAlex ID of the author.")
display_name: str = Field(description="The name of the author.")
works_count: int = Field(description="Number of matching works by this author.")
citations_count: int = Field(
description="Total citations across this author's matching works.",
)
companies_count: int = Field(
default=0,
description="Number of Handelsregister company connections matched by the "
"author's name (proxy for company foundations).",
)
news_count: int = Field(
default=0,
description="Number of news articles that mention the author by exact name "
"(proxy for media visibility).",
)
patents_count: int = Field(
default=0,
description="Number of patents matched to the author (from the precomputed "
"org_patents index).",
)
score: float = Field(
default=0.0,
description="Normalized weighted score used for ranking.",
)
career_stage: CareerStage = Field(
default=CareerStage.UNKNOWN,
description="Career stage derived from the author's active publication years.",
)
+280
View File
@@ -0,0 +1,280 @@
### Autoren-Ranking: ein Keyword
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Computer science"],
"filter_by_university": "https://openalex.org/I62318514",
"latest_publication_year": 2025
}
### Autoren-Ranking: nur Autoren mit juengster Arbeit ab 2023
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Computer science"],
"latest_publication_year": 2023
}
### Autoren-Ranking: mehrere Keywords mit OR
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Waste management", "Public transport"],
"operator": "or"
}
### Autoren-Ranking: mehrere Keywords mit AND
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Waste management", "Public transport"],
"operator": "and"
}
### Autoren-Ranking: gefiltert nach Career Stage (nur Senior + Established)
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Waste management"],
"career_stages": ["Senior", "Established"]
}
### Autoren-Ranking: nur Autoren der Uni Duisburg-Essen
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Waste management"],
"filter_by_university": "https://openalex.org/I62318514"
}
### Autoren-Ranking: alle Filter kombiniert
POST http://localhost:8000/api/search/rank
Content-Type: application/json
{
"keywords": ["Context-Aware Activity Recognition Systems"],
//"career_stages": ["Senior"],
"filter_by_university": "https://openalex.org/I62318514"
}
### Autor in die Rangliste einer (fremden) Uni einsortieren (publications)
POST http://localhost:8000/api/search/rank-author
Content-Type: application/json
{
"author_id": "https://openalex.org/A5036533333",
"universities": ["https://openalex.org/I62318514"],
"keywords": ["Control theory (sociology)"],
"metric": "publications"
}
###
POST http://localhost:8000/api/search/rank-author
Content-Type: application/json
{
"author_id": "https://openalex.org/A5036533333",
"universities": ["https://openalex.org/I8204097"],
"keywords": ["Control theory (sociology)"],
"metric": "citations"
}
###
POST http://localhost:8000/api/search/rank-author
Content-Type: application/json
{
"author_id": "https://openalex.org/A5036533333",
"universities": ["https://openalex.org/I8204097"],
"keywords": ["Control theory (sociology)"],
"metric": "publications"
}
###
POST http://localhost:8000/api/rank/rank-author
Content-Type: application/json
{
//"author_id": "https://openalex.org/A5036533333"
"keywords": ["Computer science"]
}
###
POST http://localhost:8000/api/rank/rank-author
Content-Type: application/json
{
"keywords": ["Middleware (distributed applications)"],
"weights": { "citation": 0.2, "works": 1.0 },
"career_stages": ["Senior"],
"timespan": { "from": 2018, "to": 2025 }
}
###
GET https://project.nes.uni-due.de/elastic/_aliases
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
###
GET https://inse.nes.uni-due.de/elastic/_aliases
Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw==
###
GET https://inse.nes.uni-due.de/elastic/multiplicators_v1/_search
Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw==
Content-Type: application/json
{
"size": 1,
"query": {
"match_all": {}
}
}
###
GET https://project.nes.uni-due.de/elastic/work-classifications/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
Content-Type: application/json
{
"size": 1,
"query": {
"match_all": {}
}
}
###
GET https://project.nes.uni-due.de/elastic/openalex-keywords/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
Content-Type: application/json
{
"size": 5,
"query": {
"match_all": {}
}
}
###
GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_search
Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw==
Content-Type: application/json
{
"size": 25,
"query": {
"match_all": {}
}
}
###
GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_search
Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw==
Content-Type: application/json
{
"size": 0,
"aggs": {
"authors_leer": {
"filter": {
"bool": { "must_not": { "exists": { "field": "authors" } } }
}
},
"keywords_leer": {
"filter": {
"bool": { "must_not": { "exists": { "field": "keywords" } } }
}
}
}
}
###
GET https://inse.nes.uni-due.de/elastic/aktuell_postproc/_count
Authorization: ApiKey bG1NSWc1NEJPZ3FnTGZCZXRSSEg6VnJXRFd5SnpSTTNWc1VPT01FMEhMZw==
###
POST https://project.nes.uni-due.de/elastic/openalex-works*/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
Content-Type: application/json
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"nested": {
"path": "authorships",
"query": {
"term": { "authorships.author.id": "https://openalex.org/A5007170803" }
}
}
}
]
}
},
"aggs": {
"by_field": {
"terms": {
"field": "primary_topic.field.display_name.keyword",
"size": 30
}
}
}
}
###
POST https://project.nes.uni-due.de/elastic/openalex-works*/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
Content-Type: application/json
{
"size": 0,
"query": {
"bool": {
"filter": [
{
"nested": {
"path": "authorships",
"query": {
"term": { "authorships.author.id": "https://openalex.org/A5007170803" }
}
}
}
]
}
},
"aggs": {
"by_field": {
"terms": {
"field": "primary_topic.field.display_name.keyword",
"size": 30
},
"aggs": {
"works": {
"top_hits": {
"size": 100,
"_source": ["id"]
}
}
}
}
}
}
###
POST https://project.nes.uni-due.de/elastic/topicvectors/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
+105
View File
@@ -0,0 +1,105 @@
import logging
from typing import List
from fastapi import APIRouter
from inse.tags import Tags
from . import logic
from .model import (
AuthorMetricsRequest,
AuthorStaticStats,
AuthorTopicProfile,
AuthorTopicStats,
KeywordToAuthorRequest,
RankedAuthor,
SelectedAuthorsRequest,
)
logger = logging.getLogger(__name__)
router = APIRouter(
prefix="/api/rank",
tags=[Tags.RANKING],
)
# Author ranking
@router.post("/rank-author", response_model=List[RankedAuthor])
async def rank_author(request: KeywordToAuthorRequest):
logger.info(
"rank-author keywords=%s operator=%s filter_type=%s institution_name=%s career_stages=%s "
"publication_types=%s timespan=%s",
request.keywords,
request.operator,
request.filter_type,
request.institution_name,
request.career_stages,
request.publication_types,
request.timespan,
)
return await logic.rank_authors_by_keywords(
request.keywords,
request.operator,
request.institution_name,
request.weights,
request.career_stages,
request.publication_types,
request.timespan,
request.company_status,
request.filter_type,
)
# Compare authors table 1 (topic stats)
@router.post("/topic-stats", response_model=List[AuthorTopicStats])
async def topic_stats(request: SelectedAuthorsRequest):
logger.info(
"topic-stats author_ids=%s keywords=%s operator=%s filter_type=%s publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.publication_types,
request.timespan,
)
return await logic.topic_stats_for_authors(
request.author_ids,
request.keywords,
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
)
# Compare authors section 3 (topic profile over ALL works of each author)
@router.post("/topic-profile", response_model=List[AuthorTopicProfile])
async def topic_profile(request: SelectedAuthorsRequest):
logger.info(
"topic-profile author_ids=%s keywords=%s operator=%s filter_type=%s "
"publication_types=%s timespan=%s",
request.author_ids,
request.keywords,
request.operator,
request.filter_type,
request.publication_types,
request.timespan,
)
return await logic.topic_profile_for_authors(
request.author_ids,
request.keywords,
request.operator,
request.publication_types,
request.timespan,
request.filter_type,
)
# Compare authors table 2 (author-level stats, keyword/time-independent)
@router.post("/static-stats", response_model=List[AuthorStaticStats])
async def static_stats(request: AuthorMetricsRequest):
logger.info(
"static-stats author_ids=%s company_status=%s",
request.author_ids,
request.company_status,
)
return await logic.static_stats_for_authors(
request.author_ids,
request.company_status,
)
+1
View File
@@ -13,6 +13,7 @@ class Tags(StrEnum):
ACCOUNT = "Account"
ORGANIZATION = "Organization"
UNIVERSITY_RANKINGS = "University Rankings"
RANKING = "Ranking"
DASHBOARD = "Dashboard"
AUTHORS_V2 = "Authors V2"
@@ -571,6 +571,27 @@ class AuthorsTrendStrategy(TrendStrategy):
return TrendResponse(series=series_list, years=years_range)
USPTO_PATENT_FIELDS = [
"title",
"abstract",
"description_paragraph",
"claims",
"claims_text",
"openalex_topics.topic_display_name",
"openalex_topics.topic_id",
]
EPO_PATENT_FIELDS = [
"title_de",
"title_en",
"abstract",
"description_paragraph",
"claims_en",
"claims_de",
"openalex_topics.topic_display_name",
"openalex_topics.topic_id",
]
class PatentsTrendStrategy(TrendStrategy):
async def get_trend(
self,
@@ -588,48 +609,29 @@ class PatentsTrendStrategy(TrendStrategy):
primary_inst_id = DEFAULT_INSTITUTION_ID
primary_inst_name = DEFAULT_INSTITUTION_NAME
world_inst_id = "WORLD"
world_inst_name = "Rest der Welt"
query_institutions = []
if institutions:
query_institutions = [i.strip() for i in institutions]
if primary_inst_id not in query_institutions:
query_institutions.insert(0, primary_inst_id)
series_entities = [
(primary_inst_id, primary_inst_name),
(world_inst_id, world_inst_name),
]
# 1. Resolve institution names from openalex-institutions index
resolved_names = {primary_inst_id: primary_inst_name}
try:
res = await elasticsearch.search(
index=str(ESIndex.OPENALEX_INSTITUTIONS),
query={"terms": {"id": query_institutions}},
size=len(query_institutions),
source=["id", "display_name"],
cluster="nes"
)
for hit in res.get("hits", {}).get("hits", []):
source = hit["_source"]
resolved_names[source["id"]] = source.get("display_name", source["id"])
except Exception as e:
logger.warning("Failed to resolve institution details from ES: %s", e)
# 2. Fetch patents using the existing API endpoint / logic
# 1. Fetch UDE patents using get_org_patents_by_institution_id
from inse.patents.org.logic import get_org_patents_by_institution_id
async def fetch_patents(inst_id: str):
try:
res = await get_org_patents_by_institution_id(
institution_id=inst_id,
match_type="all",
page=0,
size=10000
)
return inst_id, res.patents, res.institution_name
except Exception as e:
logger.error("Failed to fetch org-patents for institution %s: %s", inst_id, e)
return inst_id, [], None
ude_patents = []
try:
res = await get_org_patents_by_institution_id(
institution_id=primary_inst_id,
match_type="all",
page=0,
size=10000,
)
ude_patents = res.patents
except Exception as e:
logger.error("Failed to fetch org-patents for UDE: %s", e)
fetched = await asyncio.gather(*(fetch_patents(inst_id) for inst_id in query_institutions))
# Helper matching functions (case-insensitive substring topic and keyword matching)
def matches_topic(patent, topic: str) -> bool:
if not patent.openalex_topics:
return False
@@ -643,10 +645,10 @@ class PatentsTrendStrategy(TrendStrategy):
return True
return False
def matches_patent(patent, topic: str, keyword: Optional[str], fuzzy: bool) -> bool:
def matches_patent(patent, topic: str, keyword: Optional[str], is_fuzzy: bool) -> bool:
if matches_topic(patent, topic):
return True
if not fuzzy and keyword:
if not is_fuzzy and keyword:
kw_lower = keyword.lower()
if patent.title and kw_lower in patent.title.lower():
return True
@@ -658,35 +660,116 @@ class PatentsTrendStrategy(TrendStrategy):
return True
return False
# 3. For each institution & topic, filter patents and group by year
accumulated_data = {
f"inst_{inst_id}": {t: {yr: (0, 1) for yr in years_range} for t in topics}
for inst_id in query_institutions
f"inst_{primary_inst_id}": {
t: {yr: (0, 1) for yr in years_range} for t in topics
},
f"inst_{world_inst_id}": {
t: {yr: (0, 1) for yr in years_range} for t in topics
},
}
for inst_id, patents, name in fetched:
if name:
resolved_names[inst_id] = name
for idx, t in enumerate(topics):
keyword = keywords[idx] if keywords and idx < len(keywords) else None
for p in patents:
if matches_patent(p, t, keyword, fuzzy):
# Filter UDE patents per topic
for idx, t in enumerate(topics):
kw = keywords[idx] if keywords and idx < len(keywords) else None
for p in ude_patents:
if matches_patent(p, t, kw, fuzzy):
try:
yr_val = int(p.publication_year) if p.publication_year else None
if yr_val in years_range:
c_count, _ = accumulated_data[f"inst_{primary_inst_id}"][t][yr_val]
accumulated_data[f"inst_{primary_inst_id}"][t][yr_val] = (c_count + 1, 1)
except Exception:
pass
# 2. Fetch Global / Rest der Welt patent counts via ES aggregations across EPO and USPTO
for idx, t in enumerate(topics):
search_term = (
t if fuzzy else (keywords[idx] if keywords and idx < len(keywords) else t)
)
if not search_term:
continue
uspto_query = {
"size": 0,
"query": {
"multi_match": {
"query": search_term,
"fields": USPTO_PATENT_FIELDS,
"type": "best_fields",
"operator": "or",
}
},
"aggs": {
"by_year": {
"terms": {"field": "publication_year", "size": 50}
}
},
}
epo_query = {
"size": 0,
"query": {
"multi_match": {
"query": search_term,
"fields": EPO_PATENT_FIELDS,
"type": "best_fields",
"operator": "or",
}
},
"aggs": {
"by_year": {
"terms": {"field": "date_publication_year", "size": 50}
}
},
}
try:
uspto_res, epo_res = await asyncio.gather(
elasticsearch.search(
index="uspto_patents_3.0",
body=uspto_query,
cluster=ESCluster.INSE,
),
elasticsearch.search(
index="epo_index_1.0",
body=epo_query,
cluster=ESCluster.INSE,
),
return_exceptions=True,
)
if not isinstance(uspto_res, Exception):
buckets = uspto_res.get("aggregations", {}).get("by_year", {}).get("buckets", [])
for b in buckets:
try:
yr_val = int(p.publication_year) if p.publication_year else None
yr_val = int(b.get("key"))
if yr_val in years_range:
count, _ = accumulated_data[f"inst_{inst_id}"][t][yr_val]
accumulated_data[f"inst_{inst_id}"][t][yr_val] = (count + 1, 1)
cnt, _ = accumulated_data[f"inst_{world_inst_id}"][t][yr_val]
accumulated_data[f"inst_{world_inst_id}"][t][yr_val] = (cnt + int(b.get("doc_count", 0)), 1)
except Exception:
pass
if not isinstance(epo_res, Exception):
buckets = epo_res.get("aggregations", {}).get("by_year", {}).get("buckets", [])
for b in buckets:
try:
yr_val = int(b.get("key"))
if yr_val in years_range:
cnt, _ = accumulated_data[f"inst_{world_inst_id}"][t][yr_val]
accumulated_data[f"inst_{world_inst_id}"][t][yr_val] = (cnt + int(b.get("doc_count", 0)), 1)
except Exception:
pass
except Exception as exc:
logger.error("Failed to query global patent trends: %s", exc)
normalized_lookup = self._normalize_series(years_range, accumulated_data, topics)
series_list = []
for inst_id in query_institutions:
for inst_id, entity_name in series_entities:
entity_key = f"inst_{inst_id}"
topic_dict = accumulated_data[entity_key]
entity_name = resolved_names.get(inst_id, inst_id).split("/")[-1]
topic_data_map = {}
for topic, year_dict in topic_dict.items():
@@ -697,24 +780,30 @@ class PatentsTrendStrategy(TrendStrategy):
for idx, yr in enumerate(years_range):
count, _ = year_dict[yr]
yearly_data_items.append(TopicYearlyData(
year=yr,
raw=count,
normalized=norm_vals[idx],
cumulative=cum_vals[idx],
institutions_count=1
))
yearly_data_items.append(
TopicYearlyData(
year=yr,
raw=count,
normalized=norm_vals[idx],
cumulative=cum_vals[idx],
institutions_count=1,
)
)
topic_data_map[topic] = yearly_data_items
series_list.append(TrendSeries(
entity_id=inst_id,
entity_name=entity_name,
entity_type="institution",
country_code=None,
topic_data=topic_data_map
))
series_list.append(
TrendSeries(
entity_id=inst_id,
entity_name=entity_name,
entity_type="institution",
country_code=None,
topic_data=topic_data_map,
)
)
return TrendResponse(series=series_list, years=years_range, location_mappings={})
return TrendResponse(
series=series_list, years=years_range, location_mappings={}
)
DFG_INSTITUTION_FIELDS = [
+11 -2
View File
@@ -787,12 +787,21 @@ async def get_work_classification_by_work_id(
return None
work = await get_work(
raw_oa_work_id=raw_oa_work_id, source=["id", "authorships.institutions.id"]
raw_oa_work_id=raw_oa_work_id, source=["id", "authorships.author.id"]
)
if not work:
return None
if not _work_has_authorship_with_institution_id(work, raw_account_institution_id):
author_ids = list(
dict.fromkeys(
authorship.author.id
for authorship in work.authorships or []
if authorship.author and authorship.author.id
)
)
if not await author_service.authors_currently_belong_to_institution(
author_ids, raw_account_institution_id
):
return None
return await _get_work_classification_by_work_id(
+28 -1
View File
@@ -42,6 +42,33 @@ export * from './universityRankings.service';
import { UniversityRankingsService } from './universityRankings.service';
export * from './works.service';
import { WorksService } from './works.service';
export * from './ranking.service';
import { RankingService } from './ranking.service';
export * from './worksV2.service';
import { WorksV2Service } from './worksV2.service';
export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service];
export const APIS = [
AuthService,
AuthorsV2Service,
BookmarksService,
CompanyConnectionsService,
DFGInstitutionsService,
DFGPersonsService,
DashboardService,
FundingService,
INSEServiceService,
InstitutionsService,
InstitutionsV2Service,
KeywordsService,
NewsService,
OrganizationService,
PatentsService,
PersonNetworkService,
PersonsService,
ProjectsService,
RankingService,
TopicsService,
TopicsV2Service,
UniversityRankingsService,
WorksService,
WorksV2Service,
];
+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 { AuthorPage } from '../model/authorPage';
@@ -22,137 +28,231 @@ import { AuthorPage } from '../model/authorPage';
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class AuthorsV2Service extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
/**
* Returns a paginated list of authors for a given search term based on their display name.
* @endpoint get /api/v2/authors/autocomplete/selector
* @param query A search term to filter authors by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteAuthorsForSelector(
query?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<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/v2/authors/autocomplete/selector
* @param query A search term to filter authors by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteAuthorsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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/v2/authors/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();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/authors/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
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/v2/authors/authors/id
* @param authorIds A list of author IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAuthorsByIds(
authorIds?: Array<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 a paginated list of authors for a given list of author IDs.
* @endpoint get /api/v2/authors/authors/id
* @param authorIds A list of author IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAuthorsByIds(authorIds?: Array<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 localVarHeaders = this.defaultHeaders;
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/v2/authors/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
}
);
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/authors/authors/id`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+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,
},
);
}
}
+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
+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 { HTTPValidationError } from '../model/hTTPValidationError';
@@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { InstitutionPageV2 } from '../model/institutionPageV2';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class InstitutionsV2Service extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
/**
* Returns a list of institutions based on a search term for autocomplete functionality.
* @endpoint get /api/v2/institutions/autocomplete/selector
* @param query A search term to filter institutions by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionAutocompleteForSelector(
query?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<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/v2/institutions/autocomplete/selector
* @param query A search term to filter institutions by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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/v2/institutions/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();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/institutions/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>('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/v2/institutions/ids
* @param institutionIds A list of institution IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionsByIds(
institutionIds?: Array<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 a list of institutions based on their IDs.
* @endpoint get /api/v2/institutions/ids
* @param institutionIds A list of institution IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionsByIds(institutionIds?: Array<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 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/v2/institutions/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
}
);
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/institutions/ids`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPageV2>(
'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
File diff suppressed because it is too large Load Diff
+518
View File
@@ -0,0 +1,518 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { KeywordToAuthorRequest } from '../model/keywordToAuthorRequest';
// @ts-ignore
import { RankedAuthor } from '../model/rankedAuthor';
// @ts-ignore
import { RankSelectedAuthorRequest } from '../model/rankSelectedAuthorRequest';
// @ts-ignore
import { AuthorTopicStats } from '../model/authorTopicStats';
// @ts-ignore
import { AuthorTopicProfile } from '../model/authorTopicProfile';
// @ts-ignore
import { AuthorStaticStats } from '../model/authorStaticStats';
// @ts-ignore
import { AuthorMetricsRequest } from '../model/authorMetricsRequest';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
})
export class RankingService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Ranks a university\'s authors by a weighted score over works and citations.
* @endpoint post /api/rank/rank-author
* @param keywordToAuthorRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public rankAuthor(
keywordToAuthorRequest: KeywordToAuthorRequest,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<RankedAuthor>>;
public rankAuthor(
keywordToAuthorRequest: KeywordToAuthorRequest,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<RankedAuthor>>>;
public rankAuthor(
keywordToAuthorRequest: KeywordToAuthorRequest,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<RankedAuthor>>>;
public rankAuthor(
keywordToAuthorRequest: KeywordToAuthorRequest,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (
keywordToAuthorRequest === null ||
keywordToAuthorRequest === undefined
) {
throw new Error(
'Required parameter keywordToAuthorRequest was null or undefined when calling rankAuthor.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/rank/rank-author`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<RankedAuthor>>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: keywordToAuthorRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Section 1: combined stats over each selected author\'s topic-filtered works.
* @endpoint post /api/rank/topic-stats
* @param rankSelectedAuthorRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public topicStats(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<AuthorTopicStats>>;
public topicStats(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<AuthorTopicStats>>>;
public topicStats(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<AuthorTopicStats>>>;
public topicStats(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (
rankSelectedAuthorRequest === null ||
rankSelectedAuthorRequest === undefined
) {
throw new Error(
'Required parameter rankSelectedAuthorRequest was null or undefined when calling topicStats.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/rank/topic-stats`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<AuthorTopicStats>>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: rankSelectedAuthorRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Section 3: topic profile over ALL works of each selected author.
* @endpoint post /api/rank/topic-profile
* @param rankSelectedAuthorRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public topicProfile(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<AuthorTopicProfile>>;
public topicProfile(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<AuthorTopicProfile>>>;
public topicProfile(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<AuthorTopicProfile>>>;
public topicProfile(
rankSelectedAuthorRequest: RankSelectedAuthorRequest,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (
rankSelectedAuthorRequest === null ||
rankSelectedAuthorRequest === undefined
) {
throw new Error(
'Required parameter rankSelectedAuthorRequest was null or undefined when calling topicProfile.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/rank/topic-profile`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<AuthorTopicProfile>>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: rankSelectedAuthorRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Section 2: keyword-independent author-level stats (companies, news, patents).
* @endpoint post /api/rank/static-stats
* @param authorMetricsRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public staticStats(
authorMetricsRequest: AuthorMetricsRequest,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<AuthorStaticStats>>;
public staticStats(
authorMetricsRequest: AuthorMetricsRequest,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<AuthorStaticStats>>>;
public staticStats(
authorMetricsRequest: AuthorMetricsRequest,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<AuthorStaticStats>>>;
public staticStats(
authorMetricsRequest: AuthorMetricsRequest,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (authorMetricsRequest === null || authorMetricsRequest === undefined) {
throw new Error(
'Required parameter authorMetricsRequest was null or undefined when calling staticStats.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/rank/static-stats`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<AuthorStaticStats>>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: authorMetricsRequest,
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 { HTTPValidationError } from '../model/hTTPValidationError';
@@ -22,137 +28,231 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { TopicPageV2 } from '../model/topicPageV2';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class TopicsV2Service extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
/**
* Returns a paginated list of topics for a given search term based on their display name.
* @endpoint get /api/v2/topics/autocomplete/selector
* @param query A search term to filter topics by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteTopicsForSelector(
query?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<TopicPageV2>;
public autocompleteTopicsForSelector(
query?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<TopicPageV2>>;
public autocompleteTopicsForSelector(
query?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<TopicPageV2>>;
public autocompleteTopicsForSelector(
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 topics for a given search term based on their display name.
* @endpoint get /api/v2/topics/autocomplete/selector
* @param query A search term to filter topics by (partial matches allowed).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteTopicsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<TopicPageV2>;
public autocompleteTopicsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<TopicPageV2>>;
public autocompleteTopicsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<TopicPageV2>>;
public autocompleteTopicsForSelector(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/v2/topics/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicPageV2>(
'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/v2/topics/autocomplete/selector`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicPageV2>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
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/v2/topics/topics/id
* @param topicIds A list of topic IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicsByIds(
topicIds?: Array<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<TopicPageV2>;
public getTopicsByIds(
topicIds?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<TopicPageV2>>;
public getTopicsByIds(
topicIds?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<TopicPageV2>>;
public getTopicsByIds(
topicIds?: 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 (topicIds) {
topicIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'topic_ids',
);
});
}
/**
* Returns a paginated list of topics for a given list of topic IDs.
* @endpoint get /api/v2/topics/topics/id
* @param topicIds A list of topic IDs to retrieve.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicsByIds(topicIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<TopicPageV2>;
public getTopicsByIds(topicIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<TopicPageV2>>;
public getTopicsByIds(topicIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<TopicPageV2>>;
public getTopicsByIds(topicIds?: 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 (topicIds) {
topicIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'topic_ids');
})
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/topics/topics/id`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicPageV2>('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/v2/topics/topics/id`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicPageV2>(
'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
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;
}
@@ -0,0 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AuthorMetricsRequest {
/**
* OpenAlex IDs of the authors.
*/
author_ids: Array<string>;
/**
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
*/
company_status?: 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,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;
}
@@ -0,0 +1,32 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AuthorStaticStats {
/**
* The OpenAlex ID of the author.
*/
author_id: string;
/**
* The name of the author.
*/
display_name: string;
/**
* Number of Handelsregister company connections matched by the author\'s name.
*/
companies_count: number;
/**
* Number of news articles that mention the author by exact name.
*/
news_count: number;
/**
* Number of patents matched to the author (from the org_patents index).
*/
patents_count: number;
}
@@ -0,0 +1,65 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* One slice of an author\'s topic profile: works whose primary topic is in this subfield.
*/
export interface SubfieldShare {
/**
* The subfield display name.
*/
name: string;
/**
* Number of works whose primary topic belongs to this subfield.
*/
count: number;
}
/**
* Section 3: how an author\'s complete body of work distributes over topics. All counts are based on each work\'s primary topic.
*/
export interface AuthorTopicProfile {
/**
* The OpenAlex ID of the author.
*/
author_id: string;
/**
* The name of the author.
*/
display_name: string;
/**
* All works of the author in the timespan, regardless of the topic filter.
*/
works_total: number;
/**
* Works matching the topic filter (same subset as Section 1).
*/
matched_works: number;
/**
* Matched works where one of the searched topics is the work\'s primary topic.
*/
primary_topic_matches: number;
/**
* Number of distinct primary topics across all works.
*/
distinct_topics: number;
/**
* Number of distinct primary-topic subfields across all works.
*/
distinct_subfields: number;
/**
* Number of distinct primary-topic fields across all works.
*/
distinct_fields: number;
/**
* Top subfields over all works, by primary topic, largest first.
*/
subfields: Array<SubfieldShare>;
}
@@ -0,0 +1,96 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AuthorTopicStats {
/**
* The OpenAlex ID of the author.
*/
author_id: string;
/**
* The name of the author.
*/
display_name: string;
/**
* Number of the author\'s works matching the topic filter.
*/
works_total: number;
/**
* Number of the author\'s topic works where they are the corresponding author.
*/
corresponding_count: number;
/**
* Average field-normalized citation percentile (0-1) over the author\'s topic works.
*/
avg_percentile: number;
/**
* Number of the author\'s topic works in the top 1% most-cited.
*/
top1_count: number;
/**
* Number of the author\'s topic works in the top 10% most-cited.
*/
top10_count: number;
/**
* Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1.
*/
fwci_above_one_count: number;
/**
* Total citations across the author\'s topic works.
*/
citations_total: number;
/**
* Average citations per topic work.
*/
avg_citations: number;
/**
* Citations of the author\'s most-cited topic work.
*/
max_citations: number;
/**
* h-index over the author\'s topic works (capped at 100).
*/
h_index: number;
/**
* Average field-weighted citation impact (FWCI) over the author\'s topic works.
*/
avg_fwci: number;
/**
* Number of the author\'s topic works with at least one co-author institution of type \'company\'.
*/
industry_works_count: number;
/**
* Earliest publication year among the author\'s topic works.
*/
first_year: number | null;
/**
* Latest publication year among the author\'s topic works.
*/
last_year: number | null;
/**
* Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8.
*/
relevance_above_80_count: number;
/**
* Average matched-keyword relevance score (0-1) over the author\'s topic works.
*/
avg_relevance: number;
/**
* Number of the author\'s topic works where they are the first author.
*/
first_author_count: number;
/**
* Number of the author\'s topic works where they are a middle author.
*/
middle_author_count: number;
/**
* Number of the author\'s topic works where they are the last author.
*/
last_author_count: number;
}
@@ -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;
}
+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 FileUpload {
/**
* The name of the uploaded file.
*/
filename: string;
/**
* The base64-encoded content of the uploaded file.
*/
content_base64: string;
/**
* The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc.
*/
mime_type: string;
export interface FileUpload {
/**
* The name of the uploaded file.
*/
filename: string;
/**
* The base64-encoded content of the uploaded file.
*/
content_base64: string;
/**
* The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc.
*/
mime_type: string;
}
+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 { Institution } from './institution';
/**
* A paginated response containing a list of institutions.
*/
export interface InstitutionPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Institution>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface InstitutionPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Institution>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+13 -15
View File
@@ -1,28 +1,26 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Traceable title/abstract evidence for keyword text retrieval.
*/
export interface KeywordEvidence {
phrase_in_title?: boolean;
phrase_in_abstract?: boolean;
full_token_match?: boolean;
partial_token_match?: boolean;
word_match_score?: number;
matched_phrases?: Array<string>;
matched_words?: Array<string>;
/**
* phrase_title | phrase_abstract | full_token | partial_token | none
*/
text_match_kind?: string;
export interface KeywordEvidence {
phrase_in_title?: boolean;
phrase_in_abstract?: boolean;
full_token_match?: boolean;
partial_token_match?: boolean;
word_match_score?: number;
matched_phrases?: Array<string>;
matched_words?: Array<string>;
/**
* phrase_title | phrase_abstract | full_token | partial_token | none
*/
text_match_kind?: string;
}
@@ -1,19 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const KeywordPatentLevel = {
Broad: 'broad',
Coarse: 'coarse',
Fine: 'fine',
Custom: 'custom'
Broad: 'broad',
Coarse: 'coarse',
Fine: 'fine',
Custom: 'custom',
} as const;
export type KeywordPatentLevel = typeof KeywordPatentLevel[keyof typeof KeywordPatentLevel];
export type KeywordPatentLevel =
(typeof KeywordPatentLevel)[keyof typeof KeywordPatentLevel];
@@ -1,20 +1,19 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const KeywordPatentMappingStatus = {
Mapped: 'mapped',
Uncertain: 'uncertain',
NoMapping: 'no_mapping',
NoPatentsFound: 'no_patents_found',
SearchError: 'search_error'
Mapped: 'mapped',
Uncertain: 'uncertain',
NoMapping: 'no_mapping',
NoPatentsFound: 'no_patents_found',
SearchError: 'search_error',
} as const;
export type KeywordPatentMappingStatus = typeof KeywordPatentMappingStatus[keyof typeof KeywordPatentMappingStatus];
export type KeywordPatentMappingStatus =
(typeof KeywordPatentMappingStatus)[keyof typeof KeywordPatentMappingStatus];
+27 -29
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,32 +10,30 @@
import { KeywordEvidence } from './keywordEvidence';
import { PatentEntry } from './patentEntry';
export interface KeywordPatentMatch {
patent: PatentEntry;
/**
* Combined match quality score.
*/
match_score: number;
/**
* IPC/CPC classification match score.
*/
ipc_score: number;
/**
* Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none.
*/
topic_score: number;
/**
* Title/abstract keyword overlap score.
*/
text_score: number;
matched_keywords?: Array<string>;
matched_ipc_symbols?: Array<string>;
/**
* True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits.
*/
text_retrieval?: boolean;
keyword_evidence?: KeywordEvidence | null;
topic_match_kind?: string | null;
export interface KeywordPatentMatch {
patent: PatentEntry;
/**
* Combined match quality score.
*/
match_score: number;
/**
* IPC/CPC classification match score.
*/
ipc_score: number;
/**
* Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none.
*/
topic_score: number;
/**
* Title/abstract keyword overlap score.
*/
text_score: number;
matched_keywords?: Array<string>;
matched_ipc_symbols?: Array<string>;
/**
* True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits.
*/
text_retrieval?: boolean;
keyword_evidence?: KeywordEvidence | null;
topic_match_kind?: string | null;
}
@@ -1,32 +1,30 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Pipeline counters for evaluation (no effect on ranking thresholds).
*/
export interface KeywordPatentSearchDiagnostics {
/**
* ipc | text | none
*/
search_path: string;
es_query_size_per_index?: number;
raw_patents_after_dedupe?: number;
filtered_by_ipc?: number;
filtered_by_relevance_gate?: number;
filtered_by_min_score?: number;
passed_relevance_gate?: number;
scored_before_cap?: number;
returned?: number;
max_patents_cap?: number;
hit_return_cap?: boolean;
ipc_cluster_selections?: Array<object>;
export interface KeywordPatentSearchDiagnostics {
/**
* ipc | text | none
*/
search_path: string;
es_query_size_per_index?: number;
raw_patents_after_dedupe?: number;
filtered_by_ipc?: number;
filtered_by_relevance_gate?: number;
filtered_by_min_score?: number;
passed_relevance_gate?: number;
scored_before_cap?: number;
returned?: number;
max_patents_cap?: number;
hit_return_cap?: boolean;
ipc_cluster_selections?: Array<object>;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,23 +9,19 @@
*/
import { KeywordPatentLevel } from './keywordPatentLevel';
export interface KeywordPatentSearchItem {
/**
* Extracted keyword text.
*/
keyword: string;
keyword_level?: KeywordPatentLevel | null;
topic_id?: string | null;
topic_display_name?: string | null;
subfield_name?: string | null;
field_name?: string | null;
/**
* LLM relevance score for the keyword.
*/
relevance_score?: number;
export interface KeywordPatentSearchItem {
/**
* Extracted keyword text.
*/
keyword: string;
keyword_level?: KeywordPatentLevel | null;
topic_id?: string | null;
topic_display_name?: string | null;
subfield_name?: string | null;
field_name?: string | null;
/**
* LLM relevance score for the keyword.
*/
relevance_score?: number;
}
export namespace KeywordPatentSearchItem {
}
export namespace KeywordPatentSearchItem {}
@@ -0,0 +1,49 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RankingWeights } from './rankingWeights';
export interface KeywordToAuthorRequest {
/**
* One or more keywords to rank the author by.
*/
keywords: Array<string>;
/**
* Weights for the ranking metrics. Required.
*/
weights: RankingWeights;
/**
* How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'.
*/
operator?: string;
/**
* What the \'keywords\' values match against: \'keyword\' or \'topic\'. Defaults to \'keyword\'.
*/
filter_type?: string;
/**
* The selected institution display name. (Default Uni-Due)
*/
institution_name?: string;
/**
* Optional filter: only keep authors in one of these career stages.
*/
career_stages?: Array<string>;
/**
* Optional filter: only count works of these publication types.
*/
publication_types?: Array<string>;
/**
* Optional filter: only count works whose publication_year is within [from, to].
*/
timespan?: { from: number; to: number };
/**
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
*/
company_status?: string;
}
+15 -17
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,20 +9,18 @@
*/
import { FileUpload } from './fileUpload';
export interface KeywordsRequest {
/**
* The input text from which to extract keywords.
*/
query: string;
files?: Array<FileUpload> | null;
/**
* The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'.
*/
mode: string;
/**
* The maximum number of keywords to extract.
*/
limit?: number;
export interface KeywordsRequest {
/**
* The input text from which to extract keywords.
*/
query: string;
files?: Array<FileUpload> | null;
/**
* The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'.
*/
mode: string;
/**
* The maximum number of keywords to extract.
*/
limit?: number;
}
+8
View File
@@ -238,3 +238,11 @@ export * from './workTopicSubfield';
export * from './worksFilterProperties';
export * from './worksListResponse';
export * from './yearlyData';
export * from './rankingWeights';
export * from './rankedAuthor';
export * from './keywordToAuthorRequest';
export * from './rankSelectedAuthorRequest';
export * from './authorTopicStats';
export * from './authorTopicProfile';
export * from './authorStaticStats';
export * from './authorMetricsRequest';
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -11,17 +11,13 @@ import { KeywordPatentMappingStatus } from './keywordPatentMappingStatus';
import { KeywordPatentSearchDiagnostics } from './keywordPatentSearchDiagnostics';
import { KeywordPatentMatch } from './keywordPatentMatch';
export interface PatentsByKeywordsResponse {
patent_count: number;
patents: Array<KeywordPatentMatch>;
/**
* IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend).
*/
mapping_status: KeywordPatentMappingStatus;
diagnostics?: KeywordPatentSearchDiagnostics | null;
export interface PatentsByKeywordsResponse {
patent_count: number;
patents: Array<KeywordPatentMatch>;
/**
* IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend).
*/
mapping_status: KeywordPatentMappingStatus;
diagnostics?: KeywordPatentSearchDiagnostics | null;
}
export namespace PatentsByKeywordsResponse {
}
export namespace PatentsByKeywordsResponse {}
@@ -1,17 +1,15 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface PersonBookmarkResponse {
person_id: string;
person_name: string | null;
created_at: string;
export interface PersonBookmarkResponse {
person_id: string;
person_name: string | null;
created_at: string;
}
@@ -1,22 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface PrimaryCategoryYearAggregation {
/**
* The publication year.
*/
publication_year: number;
/**
* A mapping of primary categories to their counts for the given year.
*/
categories?: { [key: string]: number; };
export interface PrimaryCategoryYearAggregation {
/**
* The publication year.
*/
publication_year: number;
/**
* A mapping of primary categories to their counts for the given year.
*/
categories?: { [key: string]: number };
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,23 +9,21 @@
*/
import { PrimaryCategoryYearAggregation } from './primaryCategoryYearAggregation';
export interface PrimaryCategoryYearAggregationPage {
/**
* The elements of the page.
*/
elements?: Array<PrimaryCategoryYearAggregation>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface PrimaryCategoryYearAggregationPage {
/**
* The elements of the page.
*/
elements?: Array<PrimaryCategoryYearAggregation>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
@@ -0,0 +1,36 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface RankSelectedAuthorRequest {
/**
* OpenAlex IDs of the authors to rank.
*/
author_ids: Array<string>;
/**
* One or more keywords defining the topic.
*/
keywords: Array<string>;
/**
* How to combine the keywords: \'and\' or \'or\'. Defaults to \'and\'.
*/
operator?: string;
/**
* What the \'keywords\' values match against: \'keyword\' or \'topic\'. Defaults to \'keyword\'.
*/
filter_type?: string;
/**
* Optional filter: only count works of these publication types.
*/
publication_types?: Array<string>;
/**
* Optional filter: only count works whose publication_year is within [from, to].
*/
timespan?: { from: number; to: number };
}
+48
View File
@@ -0,0 +1,48 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface RankedAuthor {
/**
* The OpenAlex ID of the author.
*/
author_id: string;
/**
* The name of the author.
*/
display_name: string;
/**
* Number of matching works by this author.
*/
works_count: number;
/**
* Total citations across this author\'s matching works.
*/
citations_count: number;
/**
* Number of Handelsregister company connections matched by the author\'s name (proxy for company foundations).
*/
companies_count?: number;
/**
* Number of news articles that mention the author by exact name (proxy for media visibility).
*/
news_count?: number;
/**
* Number of patents matched to the author (from the precomputed org_patents index).
*/
patents_count?: number;
/**
* Normalized weighted score used for ranking.
*/
score?: number;
/**
* Career stage derived from the author\'s active publication years.
*/
career_stage?: string;
}
@@ -0,0 +1,32 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface RankingWeights {
/**
* Weight for the citation metric (0.0 - 1.0).
*/
citation: number;
/**
* Weight for the works metric (0.0 - 1.0).
*/
works: number;
/**
* Weight for the company-foundations metric (0.0 - 1.0).
*/
companies?: number;
/**
* Weight for the news/media-visibility metric (0.0 - 1.0).
*/
news?: number;
/**
* Weight for the patents metric (0.0 - 1.0).
*/
patents?: number;
}
+5 -7
View File
@@ -1,17 +1,15 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface TopAuthor {
id?: string | null;
name: string;
count: number;
export interface TopAuthor {
id?: string | null;
name: string;
count: number;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,12 +9,10 @@
*/
import { TopAuthor } from './topAuthor';
export interface TopAuthorStatistics {
institution_id: string;
works: Array<TopAuthor>;
projects: Array<TopAuthor>;
patents: Array<TopAuthor>;
news: Array<TopAuthor>;
export interface TopAuthorStatistics {
institution_id: string;
works: Array<TopAuthor>;
projects: Array<TopAuthor>;
patents: Array<TopAuthor>;
news: Array<TopAuthor>;
}
+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 TopTopicItem {
name: string;
count: number;
export interface TopTopicItem {
name: string;
count: number;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,8 +9,6 @@
*/
import { TopTopicItem } from './topTopicItem';
export interface TopTopicsResponse {
items: Array<TopTopicItem>;
export interface TopTopicsResponse {
items: Array<TopTopicItem>;
}
+6 -8
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,11 +9,9 @@
*/
import { TopicHeatmapField } from './topicHeatmapField';
export interface TopicHeatmap {
institution_id: string;
organization_name: string;
years: Array<number>;
fields: Array<TopicHeatmapField>;
export interface TopicHeatmap {
institution_id: string;
organization_name: string;
years: Array<number>;
fields: Array<TopicHeatmapField>;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,11 +9,9 @@
*/
import { TopicHeatmapValue } from './topicHeatmapValue';
export interface TopicHeatmapField {
id: string;
name: string;
total: number;
values: Array<TopicHeatmapValue>;
export interface TopicHeatmapField {
id: string;
name: string;
total: number;
values: Array<TopicHeatmapValue>;
}
@@ -1,17 +1,15 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface TopicHeatmapValue {
year: number;
count: number;
share: number;
export interface TopicHeatmapValue {
year: number;
count: number;
share: number;
}
+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 { Topic } from './topic';
export interface TopicPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Topic>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface TopicPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Topic>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
+9 -10
View File
@@ -1,21 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const TrendSearchType = {
Publications: 'publications',
Authors: 'authors',
Patents: 'patents',
Projects: 'projects',
News: 'news',
All: 'all'
Publications: 'publications',
Authors: 'authors',
Patents: 'patents',
Projects: 'projects',
News: 'news',
All: 'all',
} as const;
export type TrendSearchType = typeof TrendSearchType[keyof typeof TrendSearchType];
export type TrendSearchType =
(typeof TrendSearchType)[keyof typeof TrendSearchType];
+15 -17
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,22 +9,20 @@
*/
import { TopicYearlyData } from './topicYearlyData';
export interface TrendSeries {
entity_id: string;
entity_name: string;
entity_type: TrendSeries.EntityTypeEnum;
country_code?: string | null;
topic_data: { [key: string]: Array<TopicYearlyData>; };
export interface TrendSeries {
entity_id: string;
entity_name: string;
entity_type: TrendSeries.EntityTypeEnum;
country_code?: string | null;
topic_data: { [key: string]: Array<TopicYearlyData> };
}
export namespace TrendSeries {
export const EntityTypeEnum = {
Institution: 'institution',
Country: 'country',
Region: 'region',
Author: 'author'
} as const;
export type EntityTypeEnum = typeof EntityTypeEnum[keyof typeof EntityTypeEnum];
export const EntityTypeEnum = {
Institution: 'institution',
Country: 'country',
Region: 'region',
Author: 'author',
} as const;
export type EntityTypeEnum =
(typeof EntityTypeEnum)[keyof typeof EntityTypeEnum];
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,15 +9,13 @@
*/
import { UserRole } from './userRole';
export interface UpdateAccountRequest {
email?: string | null;
name?: string | null;
roles?: Array<UserRole> | null;
organization_id?: string | null;
password?: string | null;
openalex_person_id?: string | null;
deleted?: boolean | null;
activated?: boolean | null;
export interface UpdateAccountRequest {
email?: string | null;
name?: string | null;
roles?: Array<UserRole> | null;
organization_id?: string | null;
password?: string | null;
openalex_person_id?: string | null;
deleted?: boolean | null;
activated?: boolean | null;
}
+24 -26
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,32 +14,30 @@ import { WorkClassificationMeta } from './workClassificationMeta';
import { WorkClassificationValidation } from './workClassificationValidation';
import { WorkClassificationAuthor } from './workClassificationAuthor';
/**
* Represents a full work-classification document.
*/
export interface WorkClassification {
/**
* The full OpenAlex work id/URL.
*/
work_id: string;
doi?: string | null;
title?: string | null;
publication_year?: number | null;
/**
* The authors of the work.
*/
authors?: Array<WorkClassificationAuthor>;
/**
* The institutions associated with the work.
*/
institutions?: Array<WorkClassificationInstitution>;
/**
* The topics associated with the work.
*/
topics?: Array<WorkClassificationTopic>;
classification?: WorkClassificationDetails | null;
classification_meta?: WorkClassificationMeta | null;
validation?: WorkClassificationValidation | null;
export interface WorkClassification {
/**
* The full OpenAlex work id/URL.
*/
work_id: string;
doi?: string | null;
title?: string | null;
publication_year?: number | null;
/**
* The authors of the work.
*/
authors?: Array<WorkClassificationAuthor>;
/**
* The institutions associated with the work.
*/
institutions?: Array<WorkClassificationInstitution>;
/**
* The topics associated with the work.
*/
topics?: Array<WorkClassificationTopic>;
classification?: WorkClassificationDetails | null;
classification_meta?: WorkClassificationMeta | null;
validation?: WorkClassificationValidation | null;
}
@@ -1,20 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* An author entry within a work classification document.
*/
export interface WorkClassificationAuthor {
id?: string | null;
display_name?: string | null;
orcid?: string | null;
export interface WorkClassificationAuthor {
id?: string | null;
display_name?: string | null;
orcid?: string | null;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,20 +9,16 @@
*/
import { WorkPrimaryCategory } from './workPrimaryCategory';
/**
* The core classification result for a work.
*/
export interface WorkClassificationDetails {
primary_category?: WorkPrimaryCategory | null;
confidence?: string | null;
pasteur_quadrant?: string | null;
applied_orientation_score?: number | null;
insufficient_context?: boolean | null;
signals_used?: Array<string> | null;
classification_reason?: string | null;
export interface WorkClassificationDetails {
primary_category?: WorkPrimaryCategory | null;
confidence?: string | null;
pasteur_quadrant?: string | null;
applied_orientation_score?: number | null;
insufficient_context?: boolean | null;
signals_used?: Array<string> | null;
classification_reason?: string | null;
}
export namespace WorkClassificationDetails {
}
export namespace WorkClassificationDetails {}
@@ -1,20 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* An institution entry within a work classification document.
*/
export interface WorkClassificationInstitution {
id?: string | null;
display_name?: string | null;
ror?: string | null;
export interface WorkClassificationInstitution {
id?: string | null;
display_name?: string | null;
ror?: string | null;
}
@@ -1,20 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Metadata about how and when a classification was produced.
*/
export interface WorkClassificationMeta {
model?: string | null;
prompt_version?: string | null;
classified_at?: string | null;
export interface WorkClassificationMeta {
model?: string | null;
prompt_version?: string | null;
classified_at?: string | null;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,23 +9,21 @@
*/
import { WorkClassification } from './workClassification';
export interface WorkClassificationPage {
/**
* The elements of the page.
*/
elements?: Array<WorkClassification>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface WorkClassificationPage {
/**
* The elements of the page.
*/
elements?: Array<WorkClassification>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,16 +9,14 @@
*/
import { WorkClassificationTopicGroup } from './workClassificationTopicGroup';
/**
* A topic entry within a work classification document.
*/
export interface WorkClassificationTopic {
id?: string | null;
display_name?: string | null;
score?: number | null;
domain?: WorkClassificationTopicGroup | null;
field?: WorkClassificationTopicGroup | null;
subfield?: WorkClassificationTopicGroup | null;
export interface WorkClassificationTopic {
id?: string | null;
display_name?: string | null;
score?: number | null;
domain?: WorkClassificationTopicGroup | null;
field?: WorkClassificationTopicGroup | null;
subfield?: WorkClassificationTopicGroup | null;
}
@@ -1,19 +1,17 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* A domain/field/subfield group referenced within a classification topic.
*/
export interface WorkClassificationTopicGroup {
id?: string | null;
display_name?: string | null;
export interface WorkClassificationTopicGroup {
id?: string | null;
display_name?: string | null;
}
@@ -1,20 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Validation results for a classification.
*/
export interface WorkClassificationValidation {
valid?: boolean | null;
errors?: Array<string> | null;
corrections?: Array<string> | null;
export interface WorkClassificationValidation {
valid?: boolean | null;
errors?: Array<string> | null;
corrections?: Array<string> | null;
}
+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
@@ -9,27 +9,25 @@
*/
import { Work } from './work';
export interface WorkPage {
/**
* Total number of works matching the query
*/
total: number;
/**
* List of works on the current page
*/
elements: Array<Work>;
/**
* Offset of the current page
*/
offset: number;
/**
* Size of the current page
*/
size: number;
/**
* Indicates if the current page is the last page
*/
last_page: boolean;
export interface WorkPage {
/**
* Total number of works matching the query
*/
total: number;
/**
* List of works on the current page
*/
elements: Array<Work>;
/**
* Offset of the current page
*/
offset: number;
/**
* Size of the current page
*/
size: number;
/**
* Indicates if the current page is the last page
*/
last_page: boolean;
}
+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 { Work } from './work';
export interface WorkPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Work>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
export interface WorkPageV2 {
/**
* The elements of the page.
*/
elements?: Array<Work>;
/**
* The page number. (0-based)
*/
page?: number;
/**
* The page size in elements.
*/
size?: number;
/**
* The total number of elements.
*/
total?: number;
}
@@ -1,23 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Represents the primary category of a work.
*/
export const WorkPrimaryCategory = {
BasicResearch: 'basic_research',
AppliedResearch: 'applied_research',
NonResearch: 'non_research',
ExperimentalDevelopment: 'experimental_development',
NotClassified: 'not_classified'
BasicResearch: 'basic_research',
AppliedResearch: 'applied_research',
NonResearch: 'non_research',
ExperimentalDevelopment: 'experimental_development',
NotClassified: 'not_classified',
} as const;
export type WorkPrimaryCategory = typeof WorkPrimaryCategory[keyof typeof WorkPrimaryCategory];
export type WorkPrimaryCategory =
(typeof WorkPrimaryCategory)[keyof typeof WorkPrimaryCategory];
+7 -9
View File
@@ -1,20 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const WorkSortBy = {
Title: 'title',
Type: 'type',
PublicationYear: 'publication_year',
Language: 'language',
CitedByCount: 'cited_by_count'
Title: 'title',
Type: 'type',
PublicationYear: 'publication_year',
Language: 'language',
CitedByCount: 'cited_by_count',
} as const;
export type WorkSortBy = typeof WorkSortBy[keyof typeof WorkSortBy];
export type WorkSortBy = (typeof WorkSortBy)[keyof typeof WorkSortBy];
+15
View File
@@ -94,6 +94,21 @@ export const routes: Routes = [
(mod) => mod.DashboardComponent,
),
},
{
path: 'compare',
canActivate: [
roleGuard([
UserRole.User,
UserRole.Manager,
UserRole.Admin,
UserRole.SuperAdmin,
]),
],
loadComponent: () =>
import('./modules/compare-authors/compare-authors.component').then(
(mod) => mod.CompareAuthorsComponent,
),
},
{
path: 'bookmarks',
canActivate: [
@@ -0,0 +1,179 @@
<div class="compare-layout">
<header class="compare-header">
<h1>Autoren-Vergleich</h1>
<div class="compare-meta">
@if (keywords().length > 0) {
<span class="meta-chip">
<mat-icon>topic</mat-icon>
{{ keywords().join(', ') }}
</span>
}
@if (timespan(); as span) {
<span class="meta-chip">
<mat-icon>date_range</mat-icon>
{{ span.from }}–{{ span.to }}
</span>
}
</div>
@if (hasData()) {
<ul class="author-legend">
@for (author of summary(); track author.authorId) {
<li class="legend-item">
<span
class="legend-swatch"
[style.background]="author.color"></span>
<span class="legend-name">{{ author.name }}</span>
</li>
}
</ul>
}
</header>
@if (loading()) {
<p class="compare-hint">Lädt…</p>
} @else if (!hasData()) {
<p class="compare-hint">Keine Daten für die ausgewählten Autoren.</p>
} @else {
<!-- section 1: stats over the topic-filtered works -->
<section class="card">
<h2 class="card-title">Kennzahlen zu den Keywords</h2>
<p class="card-sub">
Bester Wert je Zeile ist hervorgehoben. „–“ bedeutet, dass der Wert für
diese:n Autor:in nicht vorliegt.
</p>
<ng-container
[ngTemplateOutlet]="statsTable"
[ngTemplateOutletContext]="{ rows: topicRows() }" />
</section>
<!-- section 2: author-level stats, independent of the keywords and time -->
<section class="card">
<h2 class="card-title">Kennzahlen zur Person</h2>
<p class="card-sub">Unabhängig von den Keywords und Zeitraum.</p>
<ng-container
[ngTemplateOutlet]="statsTable"
[ngTemplateOutletContext]="{ rows: staticRows() }" />
</section>
<!-- section 3: topic profile over ALL works of each author -->
<section class="card">
<h2 class="card-title">Themenprofil</h2>
<p class="card-sub">"Topic-Analyse"</p>
@if (profileLoading()) {
<p class="compare-hint">Lädt…</p>
} @else if (orderedProfiles().length > 0) {
<h3 class="chart-title">Themenverteilung nach Subfield</h3>
<p class="chart-hint">
Von allen Arbeiten der Autor:innen im Zeitraum: der Anteil je
Subfield, bestimmt über das Primärthema jeder Arbeit. (Top 5)
</p>
<div
echarts
[options]="subfieldChart()"
class="profile-chart profile-chart-wide"></div>
<div class="chart-grid">
<div class="chart-box">
<h3 class="chart-title">Themen-Fokus</h3>
<p class="chart-hint">
Anzahl der Werke zum Suchthema im Verhältnis zum Gesamtwerk – und
wie viele davon das Suchthema als Primärthema tragen.
</p>
<div echarts [options]="focusChart()" class="profile-chart"></div>
</div>
<div class="chart-box">
<h3 class="chart-title">Themenbreite</h3>
<p class="chart-hint">
Einzigartige Primärthemen, Subfields und Fields im Gesamtwerk
(Primary Topic)
</p>
<div echarts [options]="breadthChart()" class="profile-chart"></div>
</div>
</div>
} @else {
<p class="compare-hint">Keine Daten für das Themenprofil.</p>
}
</section>
}
</div>
<ng-template #statsTable let-rows="rows">
<div class="table-scroll">
<table class="compare-table">
<thead>
<tr>
<th class="metric-col">Kennzahl</th>
@for (author of summary(); track author.authorId) {
<th class="author-col">
<span class="th-name">
<span
class="legend-swatch"
[style.background]="author.color"></span>
{{ author.name }}
</span>
</th>
}
</tr>
</thead>
<tbody>
@for (row of rows; track row.label) {
<tr>
<th scope="row" class="metric-col">
<span class="metric-label">{{ row.label }}</span>
<span class="metric-hint">{{ row.hint }}</span>
@if (row.kind === 'group') {
<span class="position-legend">
@for (seg of row.segments; track $index; let i = $index) {
@if (i > 0) {
<span class="pos-sep">|</span>
}
<span class="pos {{ seg.colorClass }}">{{
seg.label
}}</span>
}
</span>
}
</th>
@if (row.kind === 'group') {
@for (gc of row.groupCells; track $index) {
<td class="value-cell position-cell">
@for (v of gc.values; track $index; let i = $index) {
@if (i > 0) {
<span class="pos-sep">|</span>
}
<span class="pos {{ row.segments[i].colorClass }}">
{{
v === null
? '–'
: row.segments[i].plain
? v
: row.segments[i].decimals
? (v | number: '1.2-2')
: (v | number)
}}
</span>
}
</td>
}
} @else {
@for (cell of row.cells; track $index) {
<td class="value-cell" [class.best]="cell.best">
@if (cell.raw === null) {
<span class="value-empty">–</span>
} @else if (row.decimals) {
{{ cell.raw | number: '1.2-2' }}
} @else {
{{ cell.raw | number }}
}
</td>
}
}
</tr>
}
</tbody>
</table>
</div>
</ng-template>
@@ -0,0 +1,279 @@
.compare-layout {
padding: 28px 32px 42px;
display: flex;
flex-direction: column;
gap: 18px;
max-width: 1280px;
margin: 0 auto;
box-sizing: border-box;
}
/* ---- header ---- */
.compare-header {
display: flex;
flex-direction: column;
gap: 12px;
h1 {
margin: 0;
font-size: 24px;
font-weight: 700;
color: var(--sg-text, #101a3d);
}
}
.compare-meta {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.meta-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 12px;
border-radius: 999px;
background: var(--sg-surface-muted, #f7f9ff);
border: 1px solid var(--sg-border, #dde5f2);
color: var(--sg-text-muted, #64708f);
font-size: 13px;
mat-icon {
font-size: 16px;
width: 16px;
height: 16px;
color: var(--sg-text-soft, #8a95b3);
}
}
.author-legend {
list-style: none;
margin: 0;
padding: 0;
display: flex;
flex-wrap: wrap;
gap: 8px 18px;
}
.legend-item {
display: inline-flex;
align-items: center;
gap: 8px;
font-size: 14px;
font-weight: 600;
color: var(--sg-text, #101a3d);
}
.legend-swatch {
width: 12px;
height: 12px;
border-radius: 3px;
flex: 0 0 auto;
}
/* ---- cards ---- */
.card {
background: #fff;
border: 1px solid #d7e4ff;
border-radius: 16px;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
padding: 20px 22px;
}
.card-title {
margin: 0;
font-size: 16px;
font-weight: 700;
color: var(--sg-text, #101a3d);
}
.card-sub {
margin: 4px 0 0;
font-size: 13px;
color: var(--sg-text-muted, #64708f);
}
.compare-hint {
padding: 24px;
text-align: center;
color: var(--sg-text-muted, #64708f);
}
/* ---- comparison table ---- */
.table-scroll {
margin-top: 14px;
overflow-x: auto;
}
.compare-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
thead th {
text-align: left;
padding: 0 16px 10px;
border-bottom: 2px solid var(--sg-border, #dde5f2);
vertical-align: bottom;
}
.author-col {
text-align: right;
}
.th-name {
display: inline-flex;
align-items: center;
gap: 8px;
font-weight: 700;
color: var(--sg-text, #101a3d);
}
tbody tr + tr th,
tbody tr + tr td {
border-top: 1px solid var(--sg-border, #dde5f2);
}
tbody th,
tbody td {
padding: 12px 16px;
}
}
.metric-col {
min-width: 220px;
}
.metric-label {
display: block;
font-weight: 600;
color: var(--sg-text, #101a3d);
}
.metric-hint {
display: block;
margin-top: 2px;
font-size: 12px;
font-weight: 400;
color: var(--sg-text-soft, #8a95b3);
}
.value-cell {
text-align: right;
font-variant-numeric: tabular-nums;
color: var(--sg-text, #101a3d);
white-space: nowrap;
&.best {
font-weight: 700;
color: var(--sg-primary, #0b1020);
background: var(--sg-surface-soft, #f3f6fd);
}
}
.value-empty {
color: var(--sg-text-soft, #8a95b3);
}
/* author-position row: first / middle / last shown together, colour-coded */
.position-cell {
white-space: nowrap;
}
.pos {
font-weight: 700;
font-variant-numeric: tabular-nums;
&.pos-first {
color: #16a34a;
}
&.pos-middle {
color: #d97706;
}
&.pos-last {
color: #2563eb;
}
&.rel-count {
color: #7c3aed;
}
&.rel-avg {
color: #0891b2;
}
&.cit-total {
color: #b91c1c;
}
&.cit-avg {
color: #ea580c;
}
&.fwci-count {
color: #4d7c0f;
}
&.fwci-avg {
color: #0d9488;
}
&.year-from {
color: #6d28d9;
}
&.year-to {
color: #be185d;
}
&.ind-count {
color: #92400e;
}
&.ind-share {
color: #1d4ed8;
}
}
.pos-sep {
margin: 0 4px;
color: var(--sg-text-soft, #b6bed6);
font-weight: 400;
}
.position-legend {
display: block;
margin-top: 4px;
font-size: 11px;
font-weight: 600;
}
/* ---- section 3: topic profile charts ---- */
.chart-title {
margin: 18px 0 0;
font-size: 14px;
font-weight: 700;
color: var(--sg-text, #101a3d);
}
.chart-hint {
margin: 2px 0 8px;
font-size: 12px;
color: var(--sg-text-muted, #64708f);
}
.profile-chart {
width: 100%;
height: 260px;
}
.profile-chart-wide {
height: 320px;
}
.chart-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px 24px;
}
@media (max-width: 900px) {
.compare-layout {
padding: 20px 16px 32px;
}
.chart-grid {
grid-template-columns: 1fr;
}
}
@@ -0,0 +1,701 @@
import { Component, OnInit, computed, inject, signal } from '@angular/core';
import { DecimalPipe, NgTemplateOutlet } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { MatIconModule } from '@angular/material/icon';
import { EChartsOption } from 'echarts';
import { NgxEchartsDirective } from 'ngx-echarts';
import {
AuthorStaticStats,
AuthorTopicProfile,
AuthorTopicStats,
RankingService,
} from '../../api';
const AUTHOR_COLORS = ['#1565c0', '#e6550d', '#2ca02c', '#9467bd'];
const SUBFIELD_COLORS = [
'#2563eb',
'#16a34a',
'#d97706',
'#7c3aed',
'#0891b2',
'#db2777',
'#65a30d',
'#b45309',
];
const OTHER_COLOR = '#9ca3af';
const SUBFIELD_LIMIT = 5;
interface AuthorSummary {
authorId: string;
name: string;
color: string;
// section 1
// topic stats
totalWorks: number | null;
corresponding: number | null;
avgPercentile: number | null;
top10: number | null;
top1: number | null;
fwciAboveOne: number | null;
avgFwci: number | null;
// citations over the topic works
citationsTotal: number | null;
avgCitations: number | null;
maxCitations: number | null;
hIndex: number | null;
// industry collaboration (works with a company co-author institution)
industryWorks: number | null;
industryShare: number | null;
// active years within the topic
firstYear: number | null;
lastYear: number | null;
// topic-relevance (matched keyword score)
relevanceAbove80: number | null;
avgRelevance: number | null;
// author-position split (first / middle / last)
firstAuthor: number | null;
middleAuthor: number | null;
lastAuthor: number | null;
// section 2: author-level stats (keyword-independent)
companies: number | null;
news: number | null;
patents: number | null;
}
interface MetricCell {
raw: number | null;
best: boolean;
}
interface GroupSegment {
label: string;
colorClass: string;
decimals: boolean;
// render the value as-is, without the number pipe (e.g. years)
plain: boolean;
}
interface GroupCell {
values: (number | null)[];
}
interface MetricRow {
label: string;
hint: string;
decimals: boolean;
kind: 'scalar' | 'group';
cells: MetricCell[];
segments: GroupSegment[];
groupCells: GroupCell[];
}
interface RowDef {
label: string;
hint: string;
select: (a: AuthorSummary) => number | null;
decimals?: boolean;
}
interface SegmentDef {
label: string;
colorClass: string;
select: (a: AuthorSummary) => number | null;
decimals?: boolean;
plain?: boolean;
}
@Component({
selector: 'app-compare-authors',
standalone: true,
imports: [DecimalPipe, NgTemplateOutlet, MatIconModule, NgxEchartsDirective],
templateUrl: './compare-authors.component.html',
styleUrl: './compare-authors.component.scss',
})
export class CompareAuthorsComponent implements OnInit {
private readonly route = inject(ActivatedRoute);
private readonly rankingService = inject(RankingService);
readonly keywords = signal<string[]>([]);
readonly timespan = signal<{ from: number; to: number } | null>(null);
// full OpenAlex ids in the requested order — the source of truth for colour + order
readonly authorIds = signal<string[]>([]);
// section 1: combined topic stats, one entry per author
readonly topic = signal<AuthorTopicStats[]>([]);
// section 2: keyword-independent author-level stats
readonly staticStats = signal<AuthorStaticStats[]>([]);
// section 3: topic profile over ALL works of each author
readonly profile = signal<AuthorTopicProfile[]>([]);
readonly profileLoading = signal(false);
readonly loading = signal(false);
// maps both sections onto one row per author, in the requested order
readonly summary = computed<AuthorSummary[]>(() => {
const topicById = new Map(this.topic().map((a) => [a.author_id, a]));
const staticById = new Map(this.staticStats().map((a) => [a.author_id, a]));
return this.authorIds().map((id, index) => {
const t = topicById.get(id);
const m = staticById.get(id);
const name =
t?.display_name ?? m?.display_name ?? id.split('/').pop() ?? id;
return {
authorId: id,
name,
color: AUTHOR_COLORS[index % AUTHOR_COLORS.length],
totalWorks: t ? t.works_total : null,
corresponding: t ? t.corresponding_count : null,
avgPercentile: t ? t.avg_percentile : null,
top10: t ? t.top10_count : null,
top1: t ? t.top1_count : null,
fwciAboveOne: t ? t.fwci_above_one_count : null,
avgFwci: t ? t.avg_fwci : null,
citationsTotal: t ? t.citations_total : null,
avgCitations: t ? t.avg_citations : null,
maxCitations: t ? t.max_citations : null,
hIndex: t ? t.h_index : null,
industryWorks: t ? t.industry_works_count : null,
industryShare:
t && t.works_total > 0
? t.industry_works_count / t.works_total
: null,
firstYear: t ? t.first_year : null,
lastYear: t ? t.last_year : null,
relevanceAbove80: t ? t.relevance_above_80_count : null,
avgRelevance: t ? t.avg_relevance : null,
firstAuthor: t ? t.first_author_count : null,
middleAuthor: t ? t.middle_author_count : null,
lastAuthor: t ? t.last_author_count : null,
companies: m ? m.companies_count : null,
news: m ? m.news_count : null,
patents: m ? m.patents_count : null,
};
});
});
readonly hasData = computed(() => this.summary().length > 0);
// section 1 table: stats over the topic-filtered works
readonly topicRows = computed<MetricRow[]>(() => [
...this.buildRows([
{
label: 'Werke gesamt',
hint: 'Publikationen zum Thema im Zeitraum',
select: (a) => a.totalWorks,
},
{
label: 'Corresponding-Author-Werke',
hint: 'Werke, in denen die Person korrespondierende:r Autor:in ist',
select: (a) => a.corresponding,
},
]),
this.buildGroupRow(
'Zitationen',
'Zitationen der Themen-Werke: gesamt | Ø pro Werk',
[
{
label: 'gesamt',
colorClass: 'cit-total',
select: (a) => a.citationsTotal,
},
{
label: 'Ø',
colorClass: 'cit-avg',
decimals: true,
select: (a) => a.avgCitations,
},
],
),
...this.buildRows([
{
label: 'Ø Impact-Perzentil',
hint: 'Feld-normalisiertes Zitations-Perzentil (0–1)',
select: (a) => a.avgPercentile,
decimals: true,
},
{
label: 'h-Index',
hint: 'h-Index über die Werke zum Thema',
select: (a) => a.hIndex,
},
{
label: 'Meistzitiertes Werk',
hint: 'Zitationen des meistzitierten Werks zum Thema',
select: (a) => a.maxCitations,
},
{
label: 'Top-10%-Werke',
hint: 'Werke unter den 10% meistzitierten',
select: (a) => a.top10,
},
{
label: 'Top-1%-Werke',
hint: 'Werke unter den 1% meistzitierten',
select: (a) => a.top1,
},
]),
this.buildGroupRow(
'FWCI',
'Field-Weighted Citation Impact: Werke über Feld-Durchschnitt | Ø über alle',
[
{
label: '> 1',
colorClass: 'fwci-count',
select: (a) => a.fwciAboveOne,
},
{
label: 'Ø',
colorClass: 'fwci-avg',
decimals: true,
select: (a) => a.avgFwci,
},
],
),
this.buildGroupRow(
'Themen-Relevanz',
'Match-Score der Keywords: Werke > 80% | Ø über alle',
[
{
label: '> 80%',
colorClass: 'rel-count',
select: (a) => a.relevanceAbove80,
},
{
label: 'Ø',
colorClass: 'rel-avg',
decimals: true,
select: (a) => a.avgRelevance,
},
],
),
this.buildGroupRow(
'Autor-Position',
'Werke nach Position (Erst | Mittel | Letzt)',
[
{
label: 'Erst',
colorClass: 'pos-first',
select: (a) => a.firstAuthor,
},
{
label: 'Mittel',
colorClass: 'pos-middle',
select: (a) => a.middleAuthor,
},
{ label: 'Letzt', colorClass: 'pos-last', select: (a) => a.lastAuthor },
],
),
this.buildGroupRow(
'Industrie-Kollaboration',
'Werke mit Co-Autor:in aus einem Unternehmen: Anzahl | Anteil',
[
{
label: 'Anzahl',
colorClass: 'ind-count',
select: (a) => a.industryWorks,
},
{
label: 'Anteil',
colorClass: 'ind-share',
decimals: true,
select: (a) => a.industryShare,
},
],
),
this.buildGroupRow(
'Aktiv im Thema',
'Erstes und letztes Publikationsjahr zum Thema',
[
{
label: 'von',
colorClass: 'year-from',
plain: true,
select: (a) => a.firstYear,
},
{
label: 'bis',
colorClass: 'year-to',
plain: true,
select: (a) => a.lastYear,
},
],
),
]);
// section 2 table: author-level stats, independent of the keywords
readonly staticRows = computed<MetricRow[]>(() =>
this.buildRows([
{
label: 'Unternehmensgründungen',
hint: 'Handelsregister-Verbindungen über den Namen',
select: (a) => a.companies,
},
{
label: 'News-Artikel',
hint: 'Nachrichtenartikel, die die Person namentlich nennen',
select: (a) => a.news,
},
{
label: 'Patente',
hint: 'Der Person zugeordnete Patente',
select: (a) => a.patents,
},
]),
);
// section 3: profiles in the requested author order (drives all charts)
readonly orderedProfiles = computed<AuthorTopicProfile[]>(() => {
const byId = new Map(this.profile().map((p) => [p.author_id, p]));
return this.authorIds()
.map((id) => byId.get(id))
.filter((p): p is AuthorTopicProfile => p !== undefined);
});
// colours the author names on the chart axes like the legend chips
private authorAxisLabel(profiles: AuthorTopicProfile[]) {
const rich: Record<string, { color: string; fontWeight: number }> = {};
profiles.forEach((_, i) => {
rich[`a${i}`] = {
color: AUTHOR_COLORS[i % AUTHOR_COLORS.length],
fontWeight: 600,
};
});
return {
formatter: (value: string) => {
const index = profiles.findIndex((p) => p.display_name === value);
return index >= 0 ? `{a${index}|${value}}` : value;
},
rich,
// rich-text labels are measured slightly too narrow — leave some slack
margin: 12,
};
}
// chart 1: how each author's complete body of work distributes over subfields
readonly subfieldChart = computed<EChartsOption>(() => {
const profiles = this.orderedProfiles();
if (profiles.length === 0) return {};
// union of the biggest subfields across all authors, one colour each
const totals = new Map<string, number>();
for (const p of profiles) {
for (const s of p.subfields) {
totals.set(s.name, (totals.get(s.name) ?? 0) + s.count);
}
}
const topSubfields = [...totals.entries()]
.sort((a, b) => b[1] - a[1])
.slice(0, SUBFIELD_LIMIT)
.map(([name]) => name);
const shownCounts = profiles.map((p) =>
topSubfields.map(
(name) => p.subfields.find((s) => s.name === name)?.count ?? 0,
),
);
const series: any[] = topSubfields.map((name, si) => ({
name,
type: 'bar',
stack: 'profil',
barWidth: 22,
emphasis: { focus: 'series' },
itemStyle: { color: SUBFIELD_COLORS[si % SUBFIELD_COLORS.length] },
data: profiles.map((p, ai) => {
const count = shownCounts[ai][si];
return {
value:
p.works_total > 0
? Math.round((count / p.works_total) * 1000) / 10
: 0,
count,
};
}),
}));
// everything outside the shown subfields (incl. works without primary topic)
series.push({
name: 'Sonstige',
type: 'bar',
stack: 'profil',
barWidth: 22,
emphasis: { focus: 'series' },
itemStyle: { color: OTHER_COLOR },
data: profiles.map((p, ai) => {
const rest =
p.works_total - shownCounts[ai].reduce((sum, c) => sum + c, 0);
return {
value:
p.works_total > 0
? Math.round((rest / p.works_total) * 1000) / 10
: 0,
count: rest,
};
}),
});
return {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
formatter: (params: any) => {
const lines = params
.filter((p: any) => p.data.count > 0)
.map(
(p: any) =>
`${p.marker} ${p.seriesName}: <b>${p.data.value} %</b> (${p.data.count} Werke)`,
);
return `<b>${params[0]?.name ?? ''}</b><br/>${lines.join('<br/>')}`;
},
},
legend: { type: 'scroll', top: 0 },
grid: { left: 16, right: 24, top: 56, bottom: 8, containLabel: true },
xAxis: {
type: 'value',
max: 100,
axisLabel: { formatter: '{value} %' },
},
yAxis: {
type: 'category',
inverse: true,
data: profiles.map((p) => p.display_name),
axisLabel: this.authorAxisLabel(profiles),
},
series,
} as EChartsOption;
});
// chart 2: topic focus — how much of the complete body of work is on the searched topic
readonly focusChart = computed<EChartsOption>(() => {
const profiles = this.orderedProfiles();
if (profiles.length === 0) return {};
const pct = (part: number, whole: number) =>
whole > 0 ? Math.round((part / whole) * 1000) / 10 : 0;
return {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' },
formatter: (params: any) => {
const lines = params.map(
(p: any) =>
`${p.marker} ${p.seriesName}: <b>${p.data.value} %</b> (${p.data.part} von ${p.data.whole} Werken)`,
);
return `<b>${params[0]?.name ?? ''}</b><br/>${lines.join('<br/>')}`;
},
},
legend: { top: 0 },
grid: { left: 16, right: 40, top: 32, bottom: 8, containLabel: true },
xAxis: {
type: 'value',
max: 100,
axisLabel: { formatter: '{value} %' },
},
yAxis: {
type: 'category',
inverse: true,
data: profiles.map((p) => p.display_name),
axisLabel: this.authorAxisLabel(profiles),
},
series: [
{
name: 'Anteil am Gesamtwerk',
type: 'bar',
itemStyle: { color: '#2563eb' },
label: { show: true, position: 'right', formatter: '{c} %' },
data: profiles.map((p) => ({
value: pct(p.matched_works, p.works_total),
part: p.matched_works,
whole: p.works_total,
})),
},
{
name: 'davon Primärthema',
type: 'bar',
itemStyle: { color: '#7c3aed' },
label: { show: true, position: 'right', formatter: '{c} %' },
data: profiles.map((p) => ({
value: pct(p.primary_topic_matches, p.matched_works),
part: p.primary_topic_matches,
whole: p.matched_works,
})),
},
],
} as EChartsOption;
});
// chart 3: topic breadth — how many distinct (sub)fields the author publishes in
readonly breadthChart = computed<EChartsOption>(() => {
const profiles = this.orderedProfiles();
if (profiles.length === 0) return {};
return {
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: { top: 0 },
grid: { left: 16, right: 40, top: 32, bottom: 8, containLabel: true },
xAxis: { type: 'value' },
yAxis: {
type: 'category',
inverse: true,
data: profiles.map((p) => p.display_name),
axisLabel: this.authorAxisLabel(profiles),
},
series: [
{
name: 'Themen',
type: 'bar',
itemStyle: { color: '#0891b2' },
label: { show: true, position: 'right' },
data: profiles.map((p) => p.distinct_topics),
},
{
name: 'Subfields',
type: 'bar',
itemStyle: { color: '#d97706' },
label: { show: true, position: 'right' },
data: profiles.map((p) => p.distinct_subfields),
},
{
name: 'Fields',
type: 'bar',
itemStyle: { color: '#16a34a' },
label: { show: true, position: 'right' },
data: profiles.map((p) => p.distinct_fields),
},
],
} as EChartsOption;
});
// turns row definitions into table rows, marking the best value per row
private buildRows(defs: RowDef[]): MetricRow[] {
const authors = this.summary();
return defs.map((def) => {
const values = authors.map(def.select);
const present = values.filter((v): v is number => v !== null);
const max = present.length ? Math.max(...present) : null;
return {
label: def.label,
hint: def.hint,
decimals: def.decimals ?? false,
kind: 'scalar' as const,
cells: values.map((raw) => ({
raw,
best: raw !== null && max !== null && raw === max && max > 0,
})),
segments: [],
groupCells: [],
};
});
}
private buildGroupRow(
label: string,
hint: string,
segs: SegmentDef[],
): MetricRow {
return {
label,
hint,
decimals: false,
kind: 'group' as const,
cells: [],
segments: segs.map((s) => ({
label: s.label,
colorClass: s.colorClass,
decimals: s.decimals ?? false,
plain: s.plain ?? false,
})),
groupCells: this.summary().map((a) => ({
values: segs.map((s) => s.select(a)),
})),
};
}
ngOnInit(): void {
// everything is read from the URL so a shared link lands on the same view
const rawAuthors = this.route.snapshot.queryParamMap.get('authors') ?? '';
const rawKeywords = this.route.snapshot.queryParamMap.get('keywords') ?? '';
const rawOperator = this.route.snapshot.queryParamMap.get('operator');
const rawPubType = this.route.snapshot.queryParamMap.get('pubType');
const rawTFrom = this.route.snapshot.queryParamMap.get('tFrom');
const rawTTo = this.route.snapshot.queryParamMap.get('tTo');
const authorIds = this.parseList(rawAuthors);
const keywords = this.parseList(rawKeywords);
this.keywords.set(keywords);
if (authorIds.length === 0 || keywords.length === 0) {
return;
}
const operator = rawOperator === 'and' ? 'and' : 'or';
const publication_types = rawPubType
? this.parseList(rawPubType)
: undefined;
const timespan =
rawTFrom && rawTTo ? { from: +rawTFrom, to: +rawTTo } : undefined;
this.timespan.set(timespan ?? null);
// ids in the url are bare (A5036...); the endpoint expects full OpenAlex urls
const fullIds = authorIds.map((id) => `https://openalex.org/${id}`);
this.authorIds.set(fullIds);
const request = {
author_ids: fullIds,
keywords: keywords,
operator: operator,
filter_type: 'topic',
publication_types: publication_types,
timespan: timespan,
};
// section 1: topic-filtered works stats
this.loading.set(true);
this.rankingService.topicStats(request).subscribe({
next: (results) => {
this.topic.set(results);
this.loading.set(false);
},
error: (error) => {
console.error(error);
this.topic.set([]);
this.loading.set(false);
},
});
// section 3: topic profile over ALL works (same filter, own endpoint)
this.profileLoading.set(true);
this.rankingService.topicProfile(request).subscribe({
next: (results) => {
this.profile.set(results);
this.profileLoading.set(false);
},
error: (error) => {
console.error(error);
this.profile.set([]);
this.profileLoading.set(false);
},
});
// section 2: keyword-independent author-level stats
this.rankingService.staticStats({ author_ids: fullIds }).subscribe({
next: (results) => {
this.staticStats.set(results);
},
error: (error) => {
console.error(error);
this.staticStats.set([]);
},
});
}
private parseList(raw: string): string[] {
return raw
.split(',')
.map((value) => value.trim())
.filter(Boolean);
}
}
@@ -54,18 +54,21 @@ export class InstitutionComponent implements OnInit {
this.institution = institution;
});
const institutionId = this.activatedRoute.snapshot.paramMap.get('institutionId');
const institutionId =
this.activatedRoute.snapshot.paramMap.get('institutionId');
if (!institutionId) return;
// The "Patente" tab only makes sense once org_patents has been indexed for
// this institution (currently a manual, ~30-40 min-per-institution process),
// so only show it once we know there is actually data behind it.
this.patentsApi.getOrgPatentsByInstitution(institutionId, undefined, 0, 0).subscribe({
next: (result) => {
if ((result.patent_count ?? 0) > 0) {
this.links = [...this.links, PATENTS_LINK];
}
},
});
this.patentsApi
.getOrgPatentsByInstitution(institutionId, undefined, 0, 0)
.subscribe({
next: (result) => {
if ((result.patent_count ?? 0) > 0) {
this.links = [...this.links, PATENTS_LINK];
}
},
});
}
}
@@ -59,17 +59,21 @@ export class InstitutionsComponent {
const id = this.extractInstitutionId(institution);
if (!id || this.patentsAvailable.has(id)) continue;
this.patentsAvailable.set(id, false);
this.patentsApi.getOrgPatentsByInstitution(id, undefined, 0, 0).subscribe({
next: (result) => {
this.patentsAvailable.set(id, (result.patent_count ?? 0) > 0);
},
});
this.patentsApi
.getOrgPatentsByInstitution(id, undefined, 0, 0)
.subscribe({
next: (result) => {
this.patentsAvailable.set(id, (result.patent_count ?? 0) > 0);
},
});
}
});
}
hasPatents(institution: Institution): boolean {
return this.patentsAvailable.get(this.extractInstitutionId(institution)) ?? false;
return (
this.patentsAvailable.get(this.extractInstitutionId(institution)) ?? false
);
}
sortingOptions: SelectorOption[] = [

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