[Library|Trunk]

parsingFunctions:
	Add checks for relations (similar, supplumentary, etc) that have no type and title


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58496 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-04-15 14:31:01 +00:00
parent a833a091d1
commit 5ab6ff142f
1 changed files with 14 additions and 9 deletions

View File

@ -414,18 +414,23 @@ export class ParsingFunctions {
class: "",
provenanceAction: provenanceAction
};
if (relation['resulttype'].classname == "publication") {
researchResult['class'] = "publication";
} else if (relation['resulttype'].classname == "dataset") {
researchResult['class'] = "dataset";
} else if (relation['resulttype'].classname == "software") {
researchResult['class'] = "software";
} else if (relation['resulttype'].classname == "other") {
researchResult['class'] = "other";
if(relation['resulttype']) {
if (relation['resulttype'].classname == "publication") {
researchResult['class'] = "publication";
} else if (relation['resulttype'].classname == "dataset") {
researchResult['class'] = "dataset";
} else if (relation['resulttype'].classname == "software") {
researchResult['class'] = "software";
} else if (relation['resulttype'].classname == "other") {
researchResult['class'] = "other";
}
}
researchResult['id'] = relation['to'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : (relation['title']?relation['title'].content:null);
researchResult['name'] = titleName;
if(!researchResult['name']) {
researchResult['name'] = "[no title available]";
}
if (relation.hasOwnProperty("dateofacceptance")) {
var date: string = ((Array.isArray(relation.dateofacceptance)) ? (relation.dateofacceptance[0]) : (relation.dateofacceptance)) + ""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;