[new-search-json | WIP | CHANGED]: Updated parsing according to new json schema - parsingFunctions.class.ts & deletedByInference.component.ts: Parse header.recordType field instead of result.resulttype.

This commit is contained in:
Konstantina Galouni 2024-10-29 15:18:48 +02:00
parent 01ccbb9d68
commit 83f547aca5
2 changed files with 10 additions and 6 deletions

View File

@ -489,14 +489,14 @@ export class ParsingFunctions {
// researchResult.relationName = relation.to.class;
if (relation['resulttype']) {
if (relation['resulttype'] == "publication") {
if (relation['header'] && relation.header.recordType) {
if (relation.header.recordType == "publication") {
researchResult['class'] = "publication";
} else if (relation['resulttype'] == "dataset") {
} else if (relation.header.recordType == "dataset") {
researchResult['class'] = "dataset";
} else if (relation['resulttype'] == "software") {
} else if (relation.header.recordType == "software") {
researchResult['class'] = "software";
} else if (relation['resulttype'] == "other") {
} else if (relation.header.recordType == "other") {
researchResult['class'] = "other";
}
}

View File

@ -110,7 +110,11 @@ export class DeletedByInferenceComponent {
if(result.hasOwnProperty("description")) {
preview.description = result.description;
}
preview.resultType = result?.resulttype ? result.resulttype : this.resultType;
if(result.header) {
// preview.resultType = result?.resulttype ? result.resulttype : this.resultType;
preview.resultType = result.header?.recordType ? result.result.header.recordType : this.resultType;
}
if (result.hasOwnProperty("instances")) {
preview.hostedBy_collectedFrom = new Array<HostedByCollectedFrom>();