feat(work-classifications): optimized aggregation retrieval, moved chart to own component, and added chart for institution publications
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Mats Paul Tončik
2026-07-20 21:11:17 +02:00
parent 9da17840ad
commit a5664e01fe
29 changed files with 980 additions and 667 deletions
+2 -2
View File
@@ -188,6 +188,8 @@ model/patentsByKeywordsRequest.ts
model/patentsByKeywordsResponse.ts
model/personBio.ts
model/personBookmarkResponse.ts
model/primaryCategoryYearAggregation.ts
model/primaryCategoryYearAggregationPage.ts
model/projectType.ts
model/projectsFilteringProperties.ts
model/projectsSortBy.ts
@@ -238,8 +240,6 @@ model/workClassification.ts
model/workClassificationAuthor.ts
model/workClassificationDetails.ts
model/workClassificationInstitution.ts
model/workClassificationMerge.ts
model/workClassificationMergePage.ts
model/workClassificationMeta.ts
model/workClassificationPage.ts
model/workClassificationTopic.ts
+138 -61
View File
@@ -19,12 +19,12 @@ import { Observable } from 'rxjs';
// @ts-ignore
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { PrimaryCategoryYearAggregationPage } from '../model/primaryCategoryYearAggregationPage';
// @ts-ignore
import { SortDirection } from '../model/sortDirection';
// @ts-ignore
import { WorkClassification } from '../model/workClassification';
// @ts-ignore
import { WorkClassificationMergePage } from '../model/workClassificationMergePage';
// @ts-ignore
import { WorkClassificationPage } from '../model/workClassificationPage';
// @ts-ignore
import { WorkPageV2 } from '../model/workPageV2';
@@ -263,6 +263,142 @@ export class WorksV2Service extends BaseService {
);
}
/**
* Returns the primary category aggregations of works for a given author based on their ID
* @endpoint get /api/v2/works/author/{raw_oa_author_id}/primary-category-aggregations
* @param rawOaAuthorId The raw OpenAlex author id.
* @param yearSize The number of years to retrieve aggregations for.
* @param categorySize The number of categories to retrieve aggregations for.
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PrimaryCategoryYearAggregationPage>;
public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PrimaryCategoryYearAggregationPage>>;
public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PrimaryCategoryYearAggregationPage>>;
public getPrimaryCategoryAggregationsByAuthorId(rawOaAuthorId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getPrimaryCategoryAggregationsByAuthorId.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>yearSize, 'year_size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>categorySize, 'category_size');
let localVarHeaders = this.defaultHeaders;
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/works/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PrimaryCategoryYearAggregationPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns the primary category aggregations of works for a given institution based on their ID.
* @endpoint get /api/v2/works/institution/{raw_oa_institution_id}/primary-category-aggregations
* @param rawOaInstitutionId The raw OpenAlex institution id.
* @param yearSize The number of years to retrieve aggregations for.
* @param categorySize The number of categories to retrieve aggregations for.
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PrimaryCategoryYearAggregationPage>;
public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PrimaryCategoryYearAggregationPage>>;
public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PrimaryCategoryYearAggregationPage>>;
public getPrimaryCategoryAggregationsByInstitutionId(rawOaInstitutionId: string, yearSize?: number, categorySize?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) {
throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getPrimaryCategoryAggregationsByInstitutionId.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>yearSize, 'year_size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>categorySize, 'category_size');
let localVarHeaders = this.defaultHeaders;
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/works/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-category-aggregations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PrimaryCategoryYearAggregationPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns the classifications of a work based on its ID.
* @endpoint get /api/v2/works/classification/work/{raw_oa_work_id}
@@ -322,65 +458,6 @@ export class WorksV2Service extends BaseService {
);
}
/**
* Returns the classifications of an author\&#39;s works based on their ID.
* @endpoint get /api/v2/works/classification/author/{raw_oa_author_id}
* @param rawOaAuthorId The raw OpenAlex author id.
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkClassificationMergePage>;
public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkClassificationMergePage>>;
public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkClassificationMergePage>>;
public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getWorkClassificationsByAuthorId.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/works/classification/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<WorkClassificationMergePage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns the classifications of works based on their IDs.
* @endpoint get /api/v2/works/classification/works/search
+3
View File
@@ -10,6 +10,9 @@
import { Author } from './author';
/**
* A paginated response containing a list of authors.
*/
export interface AuthorPage {
/**
* The elements of the page.
@@ -1,23 +1,25 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* 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;
}
+11 -9
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,14 @@
*/
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;
}
+26 -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
@@ -11,27 +11,29 @@ import { DfgInstitutionSummary } from './dfgInstitutionSummary';
import { DFGProjectFachgebieteInner } from './dFGProjectFachgebieteInner';
import { DfgPersonSummary } from './dfgPersonSummary';
export interface DfgProjectSummary {
/**
* The unique identifier of the DFG project.
*/
id: string;
link?: string | null;
title?: string | null;
professional_classification?: string | null;
funding_start?: string | null;
funding_end?: string | null;
/**
* Institutions associated with the project.
*/
institutions?: Array<DfgInstitutionSummary>;
/**
* The names of the persons involved in the DFG project.
*/
names?: Array<string>;
/**
* The persons involved in the DFG project.
*/
persons?: Array<DfgPersonSummary>;
subject_classifications?: Array<DFGProjectFachgebieteInner> | null;
export interface DfgProjectSummary {
/**
* The unique identifier of the DFG project.
*/
id: string;
link?: string | null;
title?: string | null;
professional_classification?: string | null;
funding_start?: string | null;
funding_end?: string | null;
/**
* Institutions associated with the project.
*/
institutions?: Array<DfgInstitutionSummary>;
/**
* The names of the persons involved in the DFG project.
*/
names?: Array<string>;
/**
* The persons involved in the DFG project.
*/
persons?: Array<DfgPersonSummary>;
subject_classifications?: Array<DFGProjectFachgebieteInner> | null;
}
@@ -10,6 +10,9 @@
import { Institution } from './institution';
/**
* A paginated response containing a list of institutions.
*/
export interface InstitutionPageV2 {
/**
* The elements of the page.
+2 -2
View File
@@ -154,6 +154,8 @@ export * from './patentsByKeywordsRequest';
export * from './patentsByKeywordsResponse';
export * from './personBio';
export * from './personBookmarkResponse';
export * from './primaryCategoryYearAggregation';
export * from './primaryCategoryYearAggregationPage';
export * from './projectType';
export * from './projectsFilteringProperties';
export * from './projectsSortBy';
@@ -204,8 +206,6 @@ export * from './workClassification';
export * from './workClassificationAuthor';
export * from './workClassificationDetails';
export * from './workClassificationInstitution';
export * from './workClassificationMerge';
export * from './workClassificationMergePage';
export * from './workClassificationMeta';
export * from './workClassificationPage';
export * from './workClassificationTopic';
@@ -0,0 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface PrimaryCategoryYearAggregation {
/**
* The publication year.
*/
publication_year: number;
/**
* A mapping of primary categories to their counts for the given year.
*/
categories?: { [key: string]: number; };
}
@@ -7,14 +7,14 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { WorkClassificationMerge } from './workClassificationMerge';
import { PrimaryCategoryYearAggregation } from './primaryCategoryYearAggregation';
export interface WorkClassificationMergePage {
export interface PrimaryCategoryYearAggregationPage {
/**
* The elements of the page.
*/
elements?: Array<WorkClassificationMerge>;
elements?: Array<PrimaryCategoryYearAggregation>;
/**
* The page number. (0-based)
*/
@@ -1,21 +0,0 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { WorkClassification } from './workClassification';
import { Work } from './work';
export interface WorkClassificationMerge {
/**
* The OpenAlex work object.
*/
work: Work;
classification?: WorkClassification | null;
}