[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:
parent
a833a091d1
commit
5ab6ff142f
|
@ -414,18 +414,23 @@ export class ParsingFunctions {
|
||||||
class: "",
|
class: "",
|
||||||
provenanceAction: provenanceAction
|
provenanceAction: provenanceAction
|
||||||
};
|
};
|
||||||
if (relation['resulttype'].classname == "publication") {
|
if(relation['resulttype']) {
|
||||||
researchResult['class'] = "publication";
|
if (relation['resulttype'].classname == "publication") {
|
||||||
} else if (relation['resulttype'].classname == "dataset") {
|
researchResult['class'] = "publication";
|
||||||
researchResult['class'] = "dataset";
|
} else if (relation['resulttype'].classname == "dataset") {
|
||||||
} else if (relation['resulttype'].classname == "software") {
|
researchResult['class'] = "dataset";
|
||||||
researchResult['class'] = "software";
|
} else if (relation['resulttype'].classname == "software") {
|
||||||
} else if (relation['resulttype'].classname == "other") {
|
researchResult['class'] = "software";
|
||||||
researchResult['class'] = "other";
|
} else if (relation['resulttype'].classname == "other") {
|
||||||
|
researchResult['class'] = "other";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
researchResult['id'] = relation['to'].content;
|
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;
|
researchResult['name'] = titleName;
|
||||||
|
if(!researchResult['name']) {
|
||||||
|
researchResult['name'] = "[no title available]";
|
||||||
|
}
|
||||||
if (relation.hasOwnProperty("dateofacceptance")) {
|
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
|
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;
|
researchResult['date'] = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
|
||||||
|
|
Loading…
Reference in New Issue