person_interested_in shows top topics of works #112

Merged
tischer merged 5 commits from feature/person_interested_in into dev 2026-06-06 09:53:00 +02:00
29 changed files with 689 additions and 100 deletions
+26
View File
@@ -90,6 +90,32 @@ async def get_all_author_works(
)
async def get_primary_topic_counts(
author_id: str,
client: OpenAlexWorksSearchClient | None = None,
) -> List[TopicCount]:
works = await get_all_author_works(author_id, client=client)
counts = {}
for work in works.results or []:
primary_topic = work.primary_topic
if not primary_topic or not primary_topic.display_name:
continue
name = primary_topic.display_name
if name not in counts:
counts[name] = {"id": primary_topic.id, "name": name, "count": 0}
counts[name]["count"] += 1
items = sorted(counts.values(), key=lambda item: item["count"], reverse=True)
return [
TopicCount(id=item["id"], name=item["name"], count=item["count"])
for item in items
]
async def get_topics_by_time_by_author(
author_id: str,
max_topics_per_year: int = 3,
+12
View File
@@ -17,6 +17,7 @@ from .. import security
from . import logic
from inse.models.work_page import WorkPage
from inse.models.works_list_response import WorksListResponse
from inse.models.topic_count import TopicCount
from inse.models.topics_by_time import TopicsByTime
@@ -71,6 +72,17 @@ async def get_all_author_works(
return await logic.get_all_author_works(author_id)
@router.get("/{author_id}/primary-topic-counts",
operation_id="getPrimaryTopicCountsByAuthor",
response_model=list[TopicCount],
summary="Returns work counts per primary topic for an author.")
async def get_primary_topic_counts(
author_id: Annotated[str, Path(description="The author id, for example A5023888391.")],
principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])),
):
return await logic.get_primary_topic_counts(author_id)
@router.get("/{author_id}/topics-by-time",
operation_id="getTopicsByTimeByAuthor",
response_model=TopicsByTime,
+10 -6
View File
@@ -1,9 +1,10 @@
.gitignore
.openapi-generator-ignore
README.md
api.base.service.ts
api.module.ts
api/api.ts
api/funding.service.ts
api/funding.serviceInterface.ts
api/inse-account-service.service.ts
api/inse-account-service.serviceInterface.ts
api/inse-service.service.ts
@@ -31,6 +32,7 @@ model/author-affiliations-inner.ts
model/author-counts-by-year-inner.ts
model/author-ids.ts
model/author-parsed-longest-name.ts
model/author-position-count.ts
model/author-summary-stats.ts
model/author.ts
model/authors-list-response.ts
@@ -49,6 +51,8 @@ model/dehydrated-institution.ts
model/dehydrated-source.ts
model/filter-information.ts
model/filter-properties.ts
model/funder-by-author.ts
model/funders-by-author-response.ts
model/fwci.ts
model/group-by-result.ts
model/http-validation-error.ts
@@ -63,14 +67,14 @@ model/model2-yr-mean-citedness.ts
model/models.ts
model/open-access.ts
model/person-bio.ts
model/publication-ids-by-author-position.ts
model/publications-by-author-response.ts
model/score.ts
model/topic-count.ts
model/topics-by-time.ts
model/topics-by-year.ts
model/validation-error-loc-inner.ts
model/validation-error.ts
model/topicCount.ts
model/topicsByTime.ts
model/topicsByYear.ts
model/validationError.ts
model/validationErrorLocInner.ts
model/value.ts
model/work-biblio.ts
model/work-citation-normalized-percentile.ts
+4 -1
View File
@@ -1,3 +1,6 @@
export * from './funding.service';
import { FundingService } from './funding.service';
export * from './funding.serviceInterface';
export * from './inse-account-service.service';
import { INSEAccountServiceService } from './inse-account-service.service';
export * from './inse-account-service.serviceInterface';
@@ -22,4 +25,4 @@ export * from './topics.serviceInterface';
export * from './works.service';
import { WorksService } from './works.service';
export * from './works.serviceInterface';
export const APIS = [INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService];
export const APIS = [FundingService, INSEAccountServiceService, INSEServiceService, ItemsService, PersonNetworkService, PersonsService, PersonsSearchService, TopicsService, WorksService];
+164
View File
@@ -0,0 +1,164 @@
/**
* 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 { FundersByAuthorResponse } from '../model/funders-by-author-response';
// @ts-ignore
import { HTTPValidationError } from '../model/http-validation-error';
// @ts-ignore
import { PublicationsByAuthorResponse } from '../model/publications-by-author-response';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
import {
FundingServiceInterface
} from './funding.serviceInterface';
@Injectable({
providedIn: 'root'
})
export class FundingService extends BaseService implements FundingServiceInterface {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
/**
* Get funding organizations by author.
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<FundersByAuthorResponse>;
public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<FundersByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Get funded publications by author.
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
* @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 getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PublicationsByAuthorResponse>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>pageSize, 'page_size');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PublicationsByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
@@ -0,0 +1,45 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { FundersByAuthorResponse } from '../model/models';
import { HTTPValidationError } from '../model/models';
import { PublicationsByAuthorResponse } from '../model/models';
import { Configuration } from '../configuration';
export interface FundingServiceInterface {
defaultHeaders: HttpHeaders;
configuration: Configuration;
/**
* Get funding organizations by author.
*
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
*/
getFundersByAuthor(authorId: string, extraHttpRequestParams?: any): Observable<FundersByAuthorResponse>;
/**
* Get funded publications by author.
*
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
*/
getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, extraHttpRequestParams?: any): Observable<PublicationsByAuthorResponse>;
}
@@ -19,6 +19,8 @@ import { Observable } from 'rxjs';
// @ts-ignore
import { AuthorsListResponse } from '../model/authors-list-response';
// @ts-ignore
import { FundersByAuthorResponse } from '../model/funders-by-author-response';
// @ts-ignore
import { HTTPValidationError } from '../model/http-validation-error';
// @ts-ignore
import { Item } from '../model/item';
@@ -28,6 +30,8 @@ import { ItemCreate } from '../model/item-create';
import { ItemPage } from '../model/item-page';
// @ts-ignore
import { PersonBio } from '../model/person-bio';
// @ts-ignore
import { PublicationsByAuthorResponse } from '../model/publications-by-author-response';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
@@ -361,6 +365,61 @@ export class INSEServiceService extends BaseService implements INSEServiceServic
);
}
/**
* Get funding organizations by author.
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<FundersByAuthorResponse>;
public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<FundersByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns the item with the id.
* @endpoint get /api/inse-service/items/{id}
@@ -546,6 +605,70 @@ export class INSEServiceService extends BaseService implements INSEServiceServic
);
}
/**
* Get funded publications by author.
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
* @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 getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PublicationsByAuthorResponse>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>pageSize, 'page_size');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PublicationsByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Searches for persons by ID or name.
* @endpoint get /api/inse-service/persons/search
@@ -12,11 +12,13 @@ import { HttpHeaders } from '@angular/comm
import { Observable } from 'rxjs';
import { AuthorsListResponse } from '../model/models';
import { FundersByAuthorResponse } from '../model/models';
import { HTTPValidationError } from '../model/models';
import { Item } from '../model/models';
import { ItemCreate } from '../model/models';
import { ItemPage } from '../model/models';
import { PersonBio } from '../model/models';
import { PublicationsByAuthorResponse } from '../model/models';
import { Configuration } from '../configuration';
@@ -69,6 +71,14 @@ export interface INSEServiceServiceInterface {
*/
generatePersonBio(authorId: string, include?: string, extraHttpRequestParams?: any): Observable<PersonBio>;
/**
* Get funding organizations by author.
*
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
*/
getFundersByAuthor(authorId: string, extraHttpRequestParams?: any): Observable<FundersByAuthorResponse>;
/**
* Returns the item with the id.
*
@@ -95,6 +105,16 @@ export interface INSEServiceServiceInterface {
*/
getPersonByID(id: string, include: string, extraHttpRequestParams?: any): Observable<AuthorsListResponse>;
/**
* Get funded publications by author.
*
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
*/
getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, extraHttpRequestParams?: any): Observable<PublicationsByAuthorResponse>;
/**
* Searches for persons by ID or name.
*
@@ -49,6 +49,7 @@ export class PersonsSearchService extends BaseService implements PersonsSearchSe
* @param page Page number (1-indexed)
* @param pageSize Results per page
* @param include Comma-separated include tags
* @param strict Strict institution search by target year
* @param 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.
*/
@@ -33,7 +33,7 @@ export interface PersonsSearchServiceInterface {
* @param page Page number (1-indexed)
* @param pageSize Results per page
* @param include Comma-separated include tags
* @param strict Strict search parameter
* @param strict Strict institution search by target year
*/
searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, extraHttpRequestParams?: any): Observable<CustomAuthorsListResponse>;
+9 -28
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,7 +11,7 @@
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
@@ -375,13 +375,14 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa
* @param page Page number (1-indexed)
* @param pageSize Results per page
* @param include Comma-separated include tags
* @param strict Strict institution search by target year
* @param 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 searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CustomAuthorsListResponse>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CustomAuthorsListResponse>>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CustomAuthorsListResponse>>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CustomAuthorsListResponse>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CustomAuthorsListResponse>>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CustomAuthorsListResponse>>;
public searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
@@ -400,6 +401,8 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa
<any>pageSize, 'pageSize');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>include, 'include');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>strict, 'strict');
let localVarHeaders = this.defaultHeaders;
@@ -442,26 +445,4 @@ export class PersonsService extends BaseService implements PersonsServiceInterfa
);
}
public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
let localVarPath = `/api/inse-service/authors/${encodeURIComponent(authorId)}/funders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<any>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: 'json',
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
);
}
}
@@ -81,7 +81,8 @@ export interface PersonsServiceInterface {
* @param page Page number (1-indexed)
* @param pageSize Results per page
* @param include Comma-separated include tags
* @param strict Strict institution search by target year
*/
searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, extraHttpRequestParams?: any): Observable<CustomAuthorsListResponse>;
searchPersonsList(query?: string, institutionName?: string, topic?: Array<string>, page?: number, pageSize?: number, include?: string, strict?: boolean, extraHttpRequestParams?: any): Observable<CustomAuthorsListResponse>;
}
+95 -36
View File
@@ -9,26 +9,27 @@
*/
/* 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/http-validation-error';
// @ts-ignore
import { TopicsByTime } from '../model/topicsByTime';
import { TopicCount } from '../model/topic-count';
// @ts-ignore
import { WorkPage } from '../model/workPage';
import { TopicsByTime } from '../model/topics-by-time';
// @ts-ignore
import { WorkPage } from '../model/work-page';
// @ts-ignore
import { WorksListResponse } from '../model/works-list-response';
// @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';
import {
WorksServiceInterface
@@ -37,11 +38,11 @@ import {
@Injectable({
providedIn: 'root'
providedIn: 'root'
})
export class WorksService extends BaseService implements WorksServiceInterface {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string | string[], @Optional() configuration?: Configuration) {
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
@@ -52,10 +53,10 @@ export class WorksService extends BaseService implements WorksServiceInterface {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<WorksListResponse>;
public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpResponse<WorksListResponse>>;
public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpEvent<WorksListResponse>>;
public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<any> {
public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorksListResponse>;
public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorksListResponse>>;
public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorksListResponse>>;
public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.');
}
@@ -88,7 +89,7 @@ export class WorksService extends BaseService implements WorksServiceInterface {
}
}
let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/all`;
let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<WorksListResponse>('get', `${basePath}${localVarPath}`,
{
@@ -115,35 +116,35 @@ export class WorksService extends BaseService implements WorksServiceInterface {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<WorkPage>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpResponse<WorkPage>>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpEvent<WorkPage>>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<any> {
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkPage>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkPage>>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkPage>>;
public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.');
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>size, 'size');
<any>size, 'size');
if (publicationYear) {
publicationYear.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'publication_year');
<any>element, 'publication_year');
})
}
if (type) {
type.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'type');
<any>element, 'type');
})
}
if (language) {
language.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'language');
<any>element, 'language');
})
}
@@ -175,7 +176,7 @@ export class WorksService extends BaseService implements WorksServiceInterface {
}
}
let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`;
let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<WorkPage>('get', `${basePath}${localVarPath}`,
{
@@ -191,6 +192,64 @@ export class WorksService extends BaseService implements WorksServiceInterface {
);
}
/**
* Returns work counts per primary topic for an author.
* @endpoint get /api/works/{author_id}/primary-topic-counts
* @param authorId The author id, for example A5023888391.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<TopicCount>>;
public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<TopicCount>>>;
public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<TopicCount>>>;
public getPrimaryTopicCountsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.');
}
let localVarHeaders = this.defaultHeaders;
// authentication (bearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('bearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-topic-counts`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<TopicCount>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns topics grouped by publication year for an author.
* @endpoint get /api/works/{author_id}/topics-by-time
@@ -199,17 +258,17 @@ export class WorksService extends BaseService implements WorksServiceInterface {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<TopicsByTime>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpResponse<TopicsByTime>>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<HttpEvent<TopicsByTime>>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: { httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean }): Observable<any> {
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<TopicsByTime>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<TopicsByTime>>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<TopicsByTime>>;
public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (authorId === null || authorId === undefined) {
throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.');
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>maxTopicsPerYear, 'max_topics_per_year');
<any>maxTopicsPerYear, 'max_topics_per_year');
let localVarHeaders = this.defaultHeaders;
@@ -239,7 +298,7 @@ export class WorksService extends BaseService implements WorksServiceInterface {
}
}
let localVarPath = `/api/works/${this.configuration.encodeParam({ name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/topics-by-time`;
let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TopicsByTime>('get', `${basePath}${localVarPath}`,
{
@@ -12,6 +12,8 @@ import { HttpHeaders } from '@angular/comm
import { Observable } from 'rxjs';
import { HTTPValidationError } from '../model/models';
import { TopicCount } from '../model/models';
import { TopicsByTime } from '../model/models';
import { WorkPage } from '../model/models';
import { WorksListResponse } from '../model/models';
@@ -45,4 +47,21 @@ export interface WorksServiceInterface {
*/
getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array<number>, type?: Array<string>, language?: Array<string>, extraHttpRequestParams?: any): Observable<WorkPage>;
/**
* Returns work counts per primary topic for an author.
*
* @endpoint get /api/works/{author_id}/primary-topic-counts
* @param authorId The author id, for example A5023888391.
*/
getPrimaryTopicCountsByAuthor(authorId: string, extraHttpRequestParams?: any): Observable<Array<TopicCount>>;
/**
* Returns topics grouped by publication year for an author.
*
* @endpoint get /api/works/{author_id}/topics-by-time
* @param authorId The author id, for example A5023888391.
* @param maxTopicsPerYear The maximum number of topics per year.
*/
getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, extraHttpRequestParams?: any): Observable<TopicsByTime>;
}
@@ -0,0 +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 interface AuthorPositionCount {
first?: number;
middle?: number;
last?: number;
unknown?: number;
}
@@ -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.
*/
import { PublicationIdsByAuthorPosition } from './publication-ids-by-author-position';
import { AuthorPositionCount } from './author-position-count';
export interface FunderByAuthor {
funder_id?: string | null;
funder_name?: string | null;
publication_count: number;
author_position_count: AuthorPositionCount;
publication_ids: PublicationIdsByAuthorPosition;
publication_urls?: { [key: string]: string; };
}
@@ -0,0 +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.
*/
import { FunderByAuthor } from './funder-by-author';
export interface FundersByAuthorResponse {
author_id: string;
author_name?: string | null;
funder_count: number;
funders: Array<FunderByAuthor>;
}
+8 -3
View File
@@ -6,6 +6,7 @@ export * from './author-affiliations-inner';
export * from './author-counts-by-year-inner';
export * from './author-ids';
export * from './author-parsed-longest-name';
export * from './author-position-count';
export * from './author-summary-stats';
export * from './authors-list-response';
export * from './authorship';
@@ -23,6 +24,8 @@ export * from './dehydrated-institution';
export * from './dehydrated-source';
export * from './filter-information';
export * from './filter-properties';
export * from './funder-by-author';
export * from './funders-by-author-response';
export * from './fwci';
export * from './group-by-result';
export * from './http-validation-error';
@@ -36,12 +39,14 @@ export * from './meta';
export * from './model2-yr-mean-citedness';
export * from './open-access';
export * from './person-bio';
export * from './publication-ids-by-author-position';
export * from './publications-by-author-response';
export * from './score';
export * from './topic-count';
export * from './topics-by-time';
export * from './topics-by-year';
export * from './validation-error';
export * from './validation-error-loc-inner';
export * from './topicCount';
export * from './topicsByTime';
export * from './topicsByYear';
export * from './value';
export * from './work';
export * from './work-biblio';
@@ -0,0 +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 interface PublicationIdsByAuthorPosition {
first?: Array<string>;
middle?: Array<string>;
last?: Array<string>;
unknown?: Array<string>;
}
@@ -0,0 +1,21 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface PublicationsByAuthorResponse {
author_id: string;
page: number;
page_size: number;
total_works: number;
total: number;
results_count: number;
results: Array<object>;
}
@@ -10,6 +10,7 @@
export interface TopicCount {
id?: string | null;
/**
* The topic display name.
*/
@@ -7,7 +7,7 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { TopicsByYear } from './topicsByYear';
import { TopicsByYear } from './topics-by-year';
export interface TopicsByTime {
@@ -7,7 +7,7 @@
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { TopicCount } from './topicCount';
import { TopicCount } from './topic-count';
export interface TopicsByYear {
@@ -2,7 +2,7 @@ import { Component, OnInit, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';
import { PersonsService } from '../../api';
import { FundingService } from '../../api';
@Component({
selector: 'app-person-funding',
@@ -13,7 +13,7 @@ import { PersonsService } from '../../api';
export class PersonFundingComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private personsApi = inject(PersonsService);
private fundingApi = inject(FundingService);
private initialSelectedFunderKey: string | null = null;
private initialPublicationPage = 1;
private initialFunderListPage = 1;
@@ -43,7 +43,7 @@ export class PersonFundingComponent implements OnInit {
}
if (authorId) {
this.personsApi.getFundersByAuthor(authorId).subscribe({
this.fundingApi.getFundersByAuthor(authorId).subscribe({
next: (result: any) => {
this.funders = result.funders ?? [];
this.applyFilter();
@@ -1,9 +1,14 @@
<aside class="interest-card">
<h3>Interessant für</h3>
<div class="interest-header">
<h3>Interessant für</h3>
@if (tags().length > 0) {
<span class="interest-footnote">* Anzahl Publikationen zum Thema</span>
}
</div>
<div class="interest-tags">
@if (tags().length > 0) {
@for (tag of tags(); track tag.label) {
<button type="button" class="interest-tag-button">{{ tag.label }}</button>
<button type="button" class="interest-tag-button">{{ tag.label }} ({{ tag.count }}*)</button>
}
} @else {
<span class="interest-empty">Keine Themen gefunden</span>
@@ -10,8 +10,15 @@
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.interest-card h3 {
.interest-header {
display: flex;
align-items: baseline;
gap: 10px;
margin: 0 0 18px;
}
.interest-card h3 {
margin: 0;
font-size: 14px;
font-weight: 700;
}
@@ -48,6 +55,11 @@
}
}
.interest-footnote {
color: var(--sg-text-muted);
font-size: 11px;
}
.interest-tags .interest-empty {
padding: 9px 16px;
border: 1px solid #e2e8f0;
@@ -1,12 +1,14 @@
import { Component, input, computed } from '@angular/core';
import { WorkTopic } from '../../api';
import { TopicCount } from '../../api';
interface InterestTag {
label: string;
score: number;
count: number;
}
const MAX_TAGS = 5;
@Component({
selector: 'app-person-interesting',
imports: [],
@@ -14,23 +16,19 @@ interface InterestTag {
styleUrl: './person-interesting.component.scss',
})
export class PersonInterestingComponent {
readonly topics = input<WorkTopic[] | null>(null);
readonly topics = input<TopicCount[] | null>(null);
readonly tags = computed<InterestTag[]>(() => {
const topicsList = this.topics() ?? [];
const grouped = new Map<string, number>();
const tags: InterestTag[] = [];
for (const topic of topicsList) {
const label = (topic.subfield?.display_name ?? '').trim();
const label = (topic.name ?? '').trim();
if (!label) continue;
const score = typeof topic.score === 'number' ? (topic.score as number) : 0;
grouped.set(label, (grouped.get(label) ?? 0) + score);
tags.push({ label, count: topic.count ?? 0 });
}
return Array.from(grouped.entries())
.map(([label, score]) => ({ label, score }))
.sort((a, b) => b.score - a.score)
.slice(0, 8);
return tags.sort((a, b) => b.count - a.count).slice(0, MAX_TAGS);
});
}
@@ -64,7 +64,7 @@
}
</div>
</aside>
<app-person-interesting [topics]="topicsFull()"></app-person-interesting>
<app-person-interesting [topics]="primaryTopicCounts()"></app-person-interesting>
</section>
<nav class="person-tabs" mat-tab-nav-bar [tabPanel]="tabPanel">
@for (link of links; track link.path) {
@@ -8,7 +8,7 @@ import { ActivatedRoute, RouterModule, RouterOutlet } from '@angular/router';
import { of, switchMap, finalize, map, catchError } from 'rxjs';
import { PersonInterestingComponent } from '../person-interesting/person-interesting.component';
import { PersonsService } from '../../api';
import { PersonsService, WorksService } from '../../api';
const PERSON_INCLUDE_TAGS =
'topics_full,topic_share,summary_stats,ids,last_known_institutions,' +
@@ -30,6 +30,7 @@ const PERSON_INCLUDE_TAGS =
export class PersonComponent {
private route = inject(ActivatedRoute);
private readonly personsApi = inject(PersonsService);
private readonly worksApi = inject(WorksService);
private readonly destroyRef = inject(DestroyRef);
@@ -50,7 +51,7 @@ export class PersonComponent {
switchMap((id) => {
if (!id) return of(null);
this.isPersonLoading.set(true);
return this.personsApi.searchPersons(id, PERSON_INCLUDE_TAGS).pipe(
return this.personsApi.searchPersons(id, undefined, PERSON_INCLUDE_TAGS).pipe(
map((result) => result.results?.[0] ?? null),
catchError((err) => {
console.error('Failed to load person:', err);
@@ -114,8 +115,19 @@ readonly personBio = toSignal(
readonly worksApiUrl = computed(() => this.person()?.works_api_url ?? null);
readonly openAlexId = computed(() => this.person()?.id ?? null);
readonly topicsFull = computed(
() => this.person()?.topics ?? [],
readonly primaryTopicCounts = toSignal(
toObservable(this.authorId).pipe(
switchMap((id) => {
if (!id) return of([]);
return this.worksApi.getPrimaryTopicCountsByAuthor(id).pipe(
catchError((err) => {
console.error('Failed to load primary topic counts:', err);
return of([]);
})
);
})
),
{ initialValue: [] }
);
links = [
{ label: 'Übersicht', path: 'overview', disabled: false },