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

This commit is contained in:
2026-07-17 15:15:09 +02:00
36 changed files with 1078 additions and 548 deletions
+10 -3
View File
@@ -39,7 +39,6 @@ model/authorNetworkNode.ts
model/authorParsedLongestName.ts
model/authorPositionCount.ts
model/authorSummaryStats.ts
model/authorWorkPurposes.ts
model/authorsFilterProperties.ts
model/authorsListResponse.ts
model/authorship.ts
@@ -185,7 +184,6 @@ model/rankingResponse.ts
model/rebuildResponse.ts
model/score.ts
model/sortDirection.ts
model/specificWorkPurpose.ts
model/tokenType.ts
model/topAuthor.ts
model/topAuthorStatistics.ts
@@ -221,13 +219,22 @@ model/work.ts
model/workBiblio.ts
model/workCitationNormalizedPercentile.ts
model/workCitedByPercentileYear.ts
model/workClassification.ts
model/workClassificationAuthor.ts
model/workClassificationDetails.ts
model/workClassificationInstitution.ts
model/workClassificationMeta.ts
model/workClassificationPage.ts
model/workClassificationTopic.ts
model/workClassificationTopicGroup.ts
model/workClassificationValidation.ts
model/workCountsByYearInner.ts
model/workHasContent.ts
model/workIds.ts
model/workKeyword.ts
model/workMeshInner.ts
model/workNetworkNode.ts
model/workPurpose.ts
model/workPrimaryCategory.ts
model/workSortBy.ts
model/workSustainableDevelopmentGoalsInner.ts
model/workTopic.ts
-114
View File
@@ -16,15 +16,11 @@ import { HttpClient, HttpHeaders, HttpParams,
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AuthorWorkPurposes } from '../model/authorWorkPurposes';
// @ts-ignore
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { InseModelsOpenalexWorkPageWorkPage } from '../model/inseModelsOpenalexWorkPageWorkPage';
// @ts-ignore
import { SpecificWorkPurpose } from '../model/specificWorkPurpose';
// @ts-ignore
import { TopicCount } from '../model/topicCount';
// @ts-ignore
import { TopicsByTime } from '../model/topicsByTime';
@@ -104,61 +100,6 @@ export class WorksService extends BaseService {
);
}
/**
* Returns the purposes of an author based on their ID.
* @endpoint get /api/purpose/{raw_oa_author_id}/purposes
* @param rawOaAuthorId The raw OpenAlex author id.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAuthorWorkPurposes(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AuthorWorkPurposes>;
public getAuthorWorkPurposes(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorWorkPurposes>>;
public getAuthorWorkPurposes(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorWorkPurposes>>;
public getAuthorWorkPurposes(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPurposes.');
}
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/purpose/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/purposes`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AuthorWorkPurposes>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns a page of works for an author.
* @endpoint get /api/works/{author_id}
@@ -444,59 +385,4 @@ export class WorksService extends BaseService {
);
}
/**
* Returns the purpose of a work based on its ID.
* @endpoint get /api/purpose/{raw_oa_work_id}/purpose
* @param rawOaWorkId The raw OpenAlex work id.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getWorkPurpose(rawOaWorkId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<SpecificWorkPurpose>;
public getWorkPurpose(rawOaWorkId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<SpecificWorkPurpose>>;
public getWorkPurpose(rawOaWorkId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<SpecificWorkPurpose>>;
public getWorkPurpose(rawOaWorkId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaWorkId === null || rawOaWorkId === undefined) {
throw new Error('Required parameter rawOaWorkId was null or undefined when calling getWorkPurpose.');
}
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/purpose/${this.configuration.encodeParam({name: "rawOaWorkId", value: rawOaWorkId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/purpose`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<SpecificWorkPurpose>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
}
+181
View File
@@ -29,6 +29,10 @@ import { SortDirection } from '../model/sortDirection';
// @ts-ignore
import { Topic } from '../model/topic';
// @ts-ignore
import { WorkClassification } from '../model/workClassification';
// @ts-ignore
import { WorkClassificationPage } from '../model/workClassificationPage';
// @ts-ignore
import { WorkSortBy } from '../model/workSortBy';
// @ts-ignore
import { WorkTopic } from '../model/workTopic';
@@ -106,6 +110,61 @@ 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 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 getAuthorWorkClassifications(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkClassificationPage>;
public getAuthorWorkClassifications(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkClassificationPage>>;
public getAuthorWorkClassifications(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkClassificationPage>>;
public getAuthorWorkClassifications(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkClassifications.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/works/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<WorkClassificationPage>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
/**
* Returns a paginated list of works for a given author based on their ID.
* @endpoint get /api/v2/works/author/{raw_oa_author_id}
@@ -558,6 +617,128 @@ export class WorksV2Service extends BaseService {
);
}
/**
* Returns the classifications of a work based on its ID.
* @endpoint get /api/v2/works/classification/work/{work_id}
* @param workId The OpenAlex work id.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getWorkClassificationByWorkId(workId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkClassification>;
public getWorkClassificationByWorkId(workId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkClassification>>;
public getWorkClassificationByWorkId(workId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkClassification>>;
public getWorkClassificationByWorkId(workId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (workId === null || workId === undefined) {
throw new Error('Required parameter workId was null or undefined when calling getWorkClassificationByWorkId.');
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/v2/works/classification/work/${this.configuration.encodeParam({name: "workId", value: workId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<WorkClassification>('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
* @param workIds A list of OpenAlex work IDs to retrieve classifications for.
* @param page The page number to retrieve. (0-based)
* @param size The number of classifications to retrieve per page.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getWorkClassificationsByWorkIds(workIds?: Array<string>, page?: number, size?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<WorkClassificationPage>;
public getWorkClassificationsByWorkIds(workIds?: Array<string>, page?: number, size?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<WorkClassificationPage>>;
public getWorkClassificationsByWorkIds(workIds?: Array<string>, page?: number, size?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<WorkClassificationPage>>;
public getWorkClassificationsByWorkIds(workIds?: Array<string>, page?: number, size?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (workIds) {
workIds.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'work_ids');
})
}
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>size, '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/v2/works/classification/works/search`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<WorkClassificationPage>('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 work topics based on their IDs.
* @endpoint get /api/v2/works/topics/search
@@ -1,30 +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 { SpecificWorkPurpose } from './specificWorkPurpose';
/**
* Represents the purposes of an author, including their ID and a list of specific work purposes.
*/
export interface AuthorWorkPurposes {
/**
* The raw OpenAlex author id.
*/
raw_oa_author_id: string;
/**
* The total number of works for the author.
*/
total?: number;
/**
* The list of specific work purposes.
*/
purposes?: Array<SpecificWorkPurpose>;
}
+23 -12
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,15 +9,26 @@
*/
import { PatentEntry } from './patentEntry';
export interface KeywordPatentMatch {
patent: PatentEntry;
/**
* Combined match quality score.
*/
match_score: number;
ipc_score: number;
topic_score: number;
text_score: number;
matched_keywords?: Array<string>;
matched_ipc_symbols?: Array<string>;
export interface KeywordPatentMatch {
patent: PatentEntry;
/**
* Combined match quality score.
*/
match_score: number;
/**
* IPC/CPC classification match score.
*/
ipc_score: number;
/**
* OpenAlex topic overlap score (0 or 1).
*/
topic_score: number;
/**
* Title/abstract keyword overlap score.
*/
text_score: number;
matched_keywords?: Array<string>;
matched_ipc_symbols?: Array<string>;
}
+10 -3
View File
@@ -11,7 +11,6 @@ export * from './authorNetworkNode';
export * from './authorParsedLongestName';
export * from './authorPositionCount';
export * from './authorSummaryStats';
export * from './authorWorkPurposes';
export * from './authorsFilterProperties';
export * from './authorsListResponse';
export * from './authorship';
@@ -156,7 +155,6 @@ export * from './rankingResponse';
export * from './rebuildResponse';
export * from './score';
export * from './sortDirection';
export * from './specificWorkPurpose';
export * from './tokenType';
export * from './topAuthor';
export * from './topAuthorStatistics';
@@ -192,13 +190,22 @@ export * from './work';
export * from './workBiblio';
export * from './workCitationNormalizedPercentile';
export * from './workCitedByPercentileYear';
export * from './workClassification';
export * from './workClassificationAuthor';
export * from './workClassificationDetails';
export * from './workClassificationInstitution';
export * from './workClassificationMeta';
export * from './workClassificationPage';
export * from './workClassificationTopic';
export * from './workClassificationTopicGroup';
export * from './workClassificationValidation';
export * from './workCountsByYearInner';
export * from './workHasContent';
export * from './workIds';
export * from './workKeyword';
export * from './workMeshInner';
export * from './workNetworkNode';
export * from './workPurpose';
export * from './workPrimaryCategory';
export * from './workSortBy';
export * from './workSustainableDevelopmentGoalsInner';
export * from './workTopic';
@@ -1,31 +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 { WorkPurpose } from './workPurpose';
/**
* Represents the purpose of a specific work, including its ID, purpose, and optional reasoning.
*/
export interface SpecificWorkPurpose {
/**
* The raw OpenAlex work id.
*/
raw_oa_work_id: string;
publication_year?: number | null;
/**
* The purpose of the work.
*/
purpose: WorkPurpose;
reasoning?: string | null;
}
export namespace SpecificWorkPurpose {
}
@@ -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 { WorkClassificationTopic } from './workClassificationTopic';
import { WorkClassificationDetails } from './workClassificationDetails';
import { WorkClassificationInstitution } from './workClassificationInstitution';
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;
}
@@ -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.
*/
/**
* An author entry within a work classification document.
*/
export interface WorkClassificationAuthor {
id?: string | null;
display_name?: string | null;
orcid?: string | null;
}
@@ -0,0 +1,28 @@
/**
* 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 { 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 namespace WorkClassificationDetails {
}
@@ -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.
*/
/**
* An institution entry within a work classification document.
*/
export interface WorkClassificationInstitution {
id?: string | null;
display_name?: string | null;
ror?: string | null;
}
@@ -0,0 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Metadata about how and when a classification was produced.
*/
export interface WorkClassificationMeta {
model?: string | null;
prompt_version?: string | null;
classified_at?: string | null;
}
@@ -0,0 +1,31 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
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;
}
@@ -0,0 +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.
*/
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;
}
@@ -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.
*/
/**
* A domain/field/subfield group referenced within a classification topic.
*/
export interface WorkClassificationTopicGroup {
id?: string | null;
display_name?: string | null;
}
@@ -0,0 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Validation results for a classification.
*/
export interface WorkClassificationValidation {
valid?: boolean | null;
errors?: Array<string> | null;
corrections?: Array<string> | null;
}
@@ -0,0 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* 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'
} as const;
export type WorkPrimaryCategory = typeof WorkPrimaryCategory[keyof typeof WorkPrimaryCategory];
-23
View File
@@ -1,23 +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.
*/
/**
* Represents the purpose of a work.
*/
export const WorkPurpose = {
BasicResearch: 'Basic Research',
AppliedResearch: 'Applied Research',
NonResearch: 'Non-Research',
ExperimentalDevelopment: 'Experimental Development',
NotClassified: 'Not Classified'
} as const;
export type WorkPurpose = typeof WorkPurpose[keyof typeof WorkPurpose];
+2 -2
View File
@@ -28,7 +28,6 @@ import { KeywordsToPatentsResultsComponent } from './modules/keywords-search/sea
import { KeywordsToNewsResultsComponent } from './modules/keywords-search/search-results/news-results/news-results.component';
import { KeywordsToWorksResultsComponent } from './modules/keywords-search/search-results/works-results/works-results.component';
import { UniTrendParentComponent } from './modules/university-ranking/uni-trend-parent/uni-trend-parent.component';
import { authorWorkPurposesResolver } from './resolvers/author-work-purposes.resolver';
import {
RESOLVING_WORK_PAGE_FOR,
workPageResolver,
@@ -40,6 +39,7 @@ import { roleGuard } from './shared/guards/role.guard';
import { UserRole } from './api';
import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver';
import { selectedAuthorsResolver } from './resolvers/selected-authors.resolver';
import { authorWorkClassificationPageResolver } from './resolvers/author-work-classification-page.resolver';
export const routes: Routes = [
{
path: '',
@@ -388,7 +388,7 @@ export const routes: Routes = [
selectedTopics: selectedTopicsResolver,
selectedInstitutions: selectedInstitutionsResolver,
authorWorkPage: workPageResolver,
authorWorkPurposes: authorWorkPurposesResolver,
authorWorkClassificationPage: authorWorkClassificationPageResolver,
},
data: {
resolvingFor: RESOLVING_WORK_PAGE_FOR.PERSON,
@@ -8,7 +8,7 @@
<mat-expansion-panel-header>
<mat-panel-title>Forschungszwecke</mat-panel-title>
</mat-expansion-panel-header>
@if (this.authorWorkPurposes().purposes?.length === 0) {
@if (this.authorWorkClassifications().length === 0) {
<div class="no-results">
Keine klassifizierten Publikationen gefunden.
</div>
@@ -21,19 +21,32 @@
<div class="purpose-info-cards">
<app-info-card
[value]="this.basicResearchAmount() + ''"
description="Grundlagenforschung" />
[description]="this.basicResearchLabel" />
<app-info-card
[value]="this.appliedResearchAmount() + ''"
description="Anwendungsbasierte Forschung" />
[description]="this.appliedResearchLabel" />
<app-info-card
[value]="this.nonResearchAmount() + ''"
description="Nicht-forschende Tätigkeit" />
[description]="this.nonResearchLabel" />
<app-info-card
[value]="this.experimentalDevelopmentAmount() + ''"
description="Experimentelle Entwicklung" />
[description]="this.experimentalDevelopmentLabel" />
<app-info-card
[value]="this.notClassifiedAmmount() + ''"
description="Nicht klassifiziert" />
[description]="this.notClassifiedLabel" />
<div>
<div class="classification-disclaimer">
<button
mat-icon-button
matTooltip="Die Klassifizierung der Publikationen erfolgt nur für eine ausgewählte Anzahl von Institutionen. Wenn eine Publikation nicht zu einer dieser Institutionen gehört, wird sie nicht klassifiziert.">
<mat-icon>info_outline</mat-icon>
</button>
<span
>Im Diagramm sind ausschließlich klassifizierte Publikationen
enthalten.</span
>
</div>
</div>
</div>
</mat-expansion-panel>
<mat-expansion-panel class="mat-elevation-z1" [expanded]="true">
@@ -37,3 +37,23 @@ mat-panel-description {
flex-direction: column;
gap: 1rem;
}
.classification-disclaimer {
display: inline-flex;
align-items: center;
gap: 4px;
}
.classification-disclaimer button {
width: 20px;
height: 20px;
line-height: 20px;
padding: 0;
}
.classification-disclaimer mat-icon {
font-size: 18px;
width: 18px;
height: 18px;
line-height: 18px;
}
@@ -1,12 +1,12 @@
import { Component, computed, effect, input } from '@angular/core';
import {
AuthorWorkPurposes,
InseWorksV2ModelWorkPage,
Author,
SpecificWorkPurpose,
WorkPurpose,
WorkTopic,
WorkClassificationPage,
WorkClassification,
WorkPrimaryCategory,
} from '../../api';
import { NgxEchartsDirective } from 'ngx-echarts';
import * as echarts from 'echarts/core';
@@ -22,6 +22,10 @@ import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-pagina
import { AppInfoCardComponent } from '../../shared/ui/app-info-card/app-info-card.component';
import { PublicationTableComponent } from '../../shared/ui/publication-table/publication-table.component';
import { PublicationFilterComponent } from '../../shared/ui/publication-filters/publication-filters.component';
import { transformWorkPrimaryCategory } from '../../shared/pipes/work-primary-category.pipe';
import { MatIconModule } from '@angular/material/icon';
import { MatButtonModule } from '@angular/material/button';
import { MatTooltipModule } from '@angular/material/tooltip';
echarts.use([
GridComponent,
CanvasRenderer,
@@ -39,24 +43,13 @@ interface YearlyPurposeCounts {
notClassified: number;
}
const PURPOSE_LABELS: Record<
| 'BASIC_RESEARCH'
| 'APPLIED_RESEARCH'
| 'NON_RESEARCH'
| 'EXPERIMENTAL_DEVELOPMENT'
| 'NOT_CLASSIFIED',
string
> = {
BASIC_RESEARCH: 'Grundlagenforschung',
APPLIED_RESEARCH: 'anwendungsbasierte Forschung',
NON_RESEARCH: 'nicht-forschende Tätigkeit',
EXPERIMENTAL_DEVELOPMENT: 'experimentelle Entwicklung',
NOT_CLASSIFIED: 'nicht klassifiziert',
};
@Component({
selector: 'app-person-publications',
imports: [
MatIconModule,
MatButtonModule,
MatExpansionModule,
MatTooltipModule,
NgxEchartsDirective,
AppInfoCardComponent,
PublicationTableComponent,
@@ -74,49 +67,74 @@ export class PersonPublicationsComponent {
selectedInstitutions = input.required<Array<Author>>();
selectedTopics = input.required<Array<WorkTopic>>();
authorWorkPurposes = input.required<AuthorWorkPurposes>();
authorWorkClassificationPage = input.required<WorkClassificationPage>();
authorWorkClassifications = computed(
() => this.authorWorkClassificationPage().elements ?? [],
);
specificWorkPurposesByYear = computed(() => {
const authorWorkPurposes = this.authorWorkPurposes();
return this.getAuthorSpecificWorkPurposesByYear(authorWorkPurposes);
const authorWorkClassifications = this.authorWorkClassifications();
return this.getAuthorWorkClassificationByYear(authorWorkClassifications);
});
basicResearchAmount = computed(() => {
return this.countPurpose(
this.authorWorkPurposes().purposes || [],
WorkPurpose.BasicResearch,
this.authorWorkClassifications(),
WorkPrimaryCategory.BasicResearch,
);
});
basicResearchLabel = transformWorkPrimaryCategory(
WorkPrimaryCategory.BasicResearch,
);
appliedResearchAmount = computed(() => {
return this.countPurpose(
this.authorWorkPurposes().purposes || [],
WorkPurpose.AppliedResearch,
this.authorWorkClassifications(),
WorkPrimaryCategory.AppliedResearch,
);
});
appliedResearchLabel = transformWorkPrimaryCategory(
WorkPrimaryCategory.AppliedResearch,
);
nonResearchAmount = computed(() => {
return this.countPurpose(
this.authorWorkPurposes().purposes || [],
WorkPurpose.NonResearch,
this.authorWorkClassifications(),
WorkPrimaryCategory.NonResearch,
);
});
nonResearchLabel = transformWorkPrimaryCategory(
WorkPrimaryCategory.NonResearch,
);
experimentalDevelopmentAmount = computed(() => {
return this.countPurpose(
this.authorWorkPurposes().purposes || [],
WorkPurpose.ExperimentalDevelopment,
this.authorWorkClassifications(),
WorkPrimaryCategory.ExperimentalDevelopment,
);
});
experimentalDevelopmentLabel = transformWorkPrimaryCategory(
WorkPrimaryCategory.ExperimentalDevelopment,
);
notClassifiedAmmount = computed(() => {
return this.countPurpose(
this.authorWorkPurposes().purposes || [],
WorkPurpose.NotClassified,
this.authorWorkClassifications(),
WorkPrimaryCategory.NotClassified,
);
});
notClassifiedLabel = transformWorkPrimaryCategory(
WorkPrimaryCategory.NotClassified,
);
countPurpose = (
specificWorkPurposes: SpecificWorkPurpose[],
purpose: WorkPurpose,
workClassifications: WorkClassification[],
primaryCategory: WorkPrimaryCategory,
) => {
let count = 0;
for (const specificWorkPurpose of specificWorkPurposes) {
if (specificWorkPurpose.purpose == purpose) {
for (const workClassification of workClassifications) {
if (
workClassification.classification?.primary_category == primaryCategory
) {
count++;
}
}
@@ -134,28 +152,31 @@ export class PersonPublicationsComponent {
});
}
getAuthorSpecificWorkPurposesByYear(
authorWorkPurposes: AuthorWorkPurposes,
): Record<number, Array<SpecificWorkPurpose>> {
const purposesByYear: Record<number, Array<SpecificWorkPurpose>> = {};
for (const purpose of authorWorkPurposes.purposes ?? []) {
const year = purpose.publication_year;
getAuthorWorkClassificationByYear(
authorWorkClassifications: WorkClassification[],
): Record<number, Array<WorkClassification>> {
const workClassificationsByYear: Record<
number,
Array<WorkClassification>
> = {};
for (const classification of authorWorkClassifications) {
const year = classification.publication_year;
if (!year) continue;
if (!purposesByYear[year]) {
purposesByYear[year] = [];
if (!workClassificationsByYear[year]) {
workClassificationsByYear[year] = [];
}
purposesByYear[year].push(purpose);
workClassificationsByYear[year].push(classification);
}
return purposesByYear;
return workClassificationsByYear;
}
buildYearlyCounts(
purposesByYear: Record<number, Array<SpecificWorkPurpose>>,
workClassificationsByYear: Record<number, Array<WorkClassification>>,
): YearlyPurposeCounts[] {
return Object.entries(purposesByYear)
.map(([year, purposes]) => {
return Object.entries(workClassificationsByYear)
.map(([year, classificiations]) => {
const counts: YearlyPurposeCounts = {
year: Number(year),
basicResearch: 0,
@@ -164,16 +185,22 @@ export class PersonPublicationsComponent {
experimentalDevelopment: 0,
notClassified: 0,
};
for (const purpose of purposes) {
if (purpose.purpose == WorkPurpose.BasicResearch) {
for (const classification of classificiations) {
const primaryCategory =
classification.classification?.primary_category;
if (!primaryCategory) continue;
if (primaryCategory == WorkPrimaryCategory.BasicResearch) {
counts.basicResearch++;
} else if (purpose.purpose == WorkPurpose.AppliedResearch) {
} else if (primaryCategory == WorkPrimaryCategory.AppliedResearch) {
counts.appliedResearch++;
} else if (purpose.purpose == WorkPurpose.NonResearch) {
} else if (primaryCategory == WorkPrimaryCategory.NonResearch) {
counts.nonResearch++;
} else if (purpose.purpose == WorkPurpose.ExperimentalDevelopment) {
} else if (
primaryCategory == WorkPrimaryCategory.ExperimentalDevelopment
) {
counts.experimentalDevelopment++;
} else if (purpose.purpose == WorkPurpose.NotClassified) {
} else if (primaryCategory == WorkPrimaryCategory.NotClassified) {
counts.notClassified++;
}
}
@@ -187,11 +214,11 @@ export class PersonPublicationsComponent {
tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' } },
legend: {
data: [
PURPOSE_LABELS.BASIC_RESEARCH,
PURPOSE_LABELS.APPLIED_RESEARCH,
PURPOSE_LABELS.NON_RESEARCH,
PURPOSE_LABELS.EXPERIMENTAL_DEVELOPMENT,
PURPOSE_LABELS.NOT_CLASSIFIED,
this.basicResearchLabel,
this.appliedResearchLabel,
this.nonResearchLabel,
this.experimentalDevelopmentLabel,
this.notClassifiedLabel,
],
bottom: 0,
itemGap: 40,
@@ -210,35 +237,35 @@ export class PersonPublicationsComponent {
yAxis: { type: 'value' },
series: [
{
name: PURPOSE_LABELS.BASIC_RESEARCH,
name: this.basicResearchLabel,
type: 'bar',
stack: 'total',
emphasis: { focus: 'series' },
data: data.map((d) => d.basicResearch),
},
{
name: PURPOSE_LABELS.APPLIED_RESEARCH,
name: this.appliedResearchLabel,
type: 'bar',
stack: 'total',
emphasis: { focus: 'series' },
data: data.map((d) => d.appliedResearch),
},
{
name: PURPOSE_LABELS.NON_RESEARCH,
name: this.nonResearchLabel,
type: 'bar',
stack: 'total',
emphasis: { focus: 'series' },
data: data.map((d) => d.nonResearch),
},
{
name: PURPOSE_LABELS.EXPERIMENTAL_DEVELOPMENT,
name: this.experimentalDevelopmentLabel,
type: 'bar',
stack: 'total',
emphasis: { focus: 'series' },
data: data.map((d) => d.experimentalDevelopment),
},
{
name: PURPOSE_LABELS.NOT_CLASSIFIED,
name: this.notClassifiedLabel,
type: 'bar',
stack: 'total',
emphasis: { focus: 'series' },
@@ -0,0 +1,16 @@
import { ResolveFn } from '@angular/router';
import { WorkClassificationPage, WorksV2Service } from '../api';
import { inject } from '@angular/core';
export const authorWorkClassificationPageResolver: ResolveFn<
WorkClassificationPage
> = (route, state) => {
const id = route.parent?.paramMap.get('id') || route.paramMap.get('id');
if (!id) {
throw new Error(
'Author ID is required to resolve author work classification page.',
);
}
return inject(WorksV2Service).getAuthorWorkClassifications(id);
};
@@ -1,15 +0,0 @@
import { ResolveFn } from '@angular/router';
import { AuthorWorkPurposes, WorksService } from '../api';
import { inject } from '@angular/core';
export const authorWorkPurposesResolver: ResolveFn<AuthorWorkPurposes> = (
route,
state,
) => {
const id = route.parent?.paramMap.get('id') || route.paramMap.get('id');
if (!id) {
throw new Error('Author ID is required to resolve author work purposes.');
}
return inject(WorksService).getAuthorWorkPurposes(id);
};
@@ -68,7 +68,7 @@ export const workPageResolver: ResolveFn<InseWorksV2ModelWorkPage> = (
const rawOaAuthorId =
route.parent?.paramMap.get('id') || route.paramMap.get('id');
if (!rawOaAuthorId) {
throw new Error('Author ID is required to resolve author work purposes.');
throw new Error('Author ID is required to resolve author works.');
}
return inject(WorksV2Service).getAuthorWorkPage(
rawOaAuthorId,
@@ -90,7 +90,7 @@ export const workPageResolver: ResolveFn<InseWorksV2ModelWorkPage> = (
route.paramMap.get('institutionId');
if (!rawOaInstitutionId) {
throw new Error(
'Institution ID is required to resolve institution work purposes.',
'Institution ID is required to resolve institution works.',
);
}
return inject(WorksV2Service).getInstitutionWorkPage(
@@ -0,0 +1,31 @@
import { Pipe, PipeTransform } from '@angular/core';
import { WorkPrimaryCategory } from '../../api';
export const workPrimaryCategoryLabels: Record<WorkPrimaryCategory, string> = {
[WorkPrimaryCategory.AppliedResearch]: 'Anwendungsbasierte Forschung',
[WorkPrimaryCategory.BasicResearch]: 'Grundlagenforschung',
[WorkPrimaryCategory.ExperimentalDevelopment]: 'Experimentelle Entwicklung',
[WorkPrimaryCategory.NonResearch]: 'Nicht-forschende Tätigkeit',
[WorkPrimaryCategory.NotClassified]: 'Nicht klassifiziert',
};
export const transformWorkPrimaryCategory = (
value: WorkPrimaryCategory | null | undefined,
): string => {
if (!value) {
return '';
}
return workPrimaryCategoryLabels[value] || value;
};
@Pipe({
name: 'workPrimaryCategory',
})
export class WorkPrimaryCategoryPipe implements PipeTransform {
transform(
value: WorkPrimaryCategory | null | undefined,
...args: unknown[]
): unknown {
return transformWorkPrimaryCategory(value);
}
}
@@ -58,6 +58,19 @@
}
</ng-template>
<ng-template #classificationTmp let-work>
@let classification = getWorkClassification(work.id);
@if (classification) {
<button type="button" class="cell-filter-pill" matTooltipPosition="above">
{{
classification.classification?.primary_category | workPrimaryCategory
}}
</button>
} @else {
<span class="empty-text">-</span>
}
</ng-template>
<ng-template #authorsTmp let-work>
@let workAuthors = getWorkAuthors(work);
@let workAuthorsExpanded = isWorkAuthorsExpanded(work);
@@ -1,9 +1,11 @@
import {
Component,
computed,
effect,
inject,
input,
OnInit,
signal,
TemplateRef,
viewChild,
} from '@angular/core';
@@ -16,6 +18,8 @@ import {
InseWorksV2ModelWorkPage,
Institution,
Work,
WorkClassification,
WorksV2Service,
WorkTopic,
} from '../../../api';
import { TopicChipComponent } from '../topic-chip/topic-chip.component';
@@ -29,6 +33,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
import { topicHierarchyColor } from '../../../resolvers/utils/topic-colors';
import { MatButtonModule } from '@angular/material/button';
import { workQueryParamKeys } from '../../../resolvers/work-page.resolver';
import { WorkPrimaryCategoryPipe } from '../../pipes/work-primary-category.pipe';
@Component({
selector: 'app-publication-table',
@@ -42,6 +47,7 @@ import { workQueryParamKeys } from '../../../resolvers/work-page.resolver';
ChipComponent,
WorkTypePipe,
LanguageCodePipe,
WorkPrimaryCategoryPipe,
],
templateUrl: './publication-table.component.html',
styleUrl: './publication-table.component.scss',
@@ -59,6 +65,7 @@ export class PublicationTableComponent implements OnInit {
typeTmp = viewChild.required<TemplateRef<any>>('typeTmp');
yearTmp = viewChild.required<TemplateRef<any>>('yearTmp');
languageTmp = viewChild.required<TemplateRef<any>>('languageTmp');
classificationTmp = viewChild.required<TemplateRef<any>>('classificationTmp');
authorsTmp = viewChild.required<TemplateRef<any>>('authorsTmp');
institutionsTmp = viewChild.required<TemplateRef<any>>('institutionsTmp');
topicsTmp = viewChild.required<TemplateRef<any>>('topicsTmp');
@@ -126,12 +133,19 @@ export class PublicationTableComponent implements OnInit {
accessorKey: 'language',
cellTemplate: this.languageTmp(),
},
{
id: 'classification',
header: 'Klassifikation',
type: 'display',
cellTemplate: this.classificationTmp(),
},
{
id: 'authors',
header: 'Autoren',
type: 'display',
cellTemplate: this.authorsTmp(),
},
{
id: 'institutions',
header: 'Institutionen',
@@ -161,6 +175,36 @@ export class PublicationTableComponent implements OnInit {
];
}
workIds = computed(
() =>
this.elements()
.map((work) => work.id)
.filter(Boolean) as string[],
);
workClassifications = signal<WorkClassification[]>([]);
getWorkClassification(workId: string): WorkClassification | undefined {
return this.workClassifications().find(
(classification) => classification.work_id === workId,
);
}
constructor(private readonly worksV2Service: WorksV2Service) {
effect(() => {
const ids = this.workIds();
if (ids.length > 0) {
this.worksV2Service
.getWorkClassificationsByWorkIds(ids)
.subscribe((classificationPage) => {
this.workClassifications.set(classificationPage.elements ?? []);
});
} else {
this.workClassifications.set([]);
}
});
}
isTypeActive(type: string): boolean {
return this.selectedTypesQueryParams().includes(type);
}