[develop | DONE | FIXED] linking update parsing of the datacite API

This commit is contained in:
argirok 2024-03-21 09:46:11 +02:00
parent c33af181bb
commit 95097beaae
1 changed files with 7 additions and 9 deletions

View File

@ -58,22 +58,20 @@ export class SearchDataciteService {
entity.result.journal = null; entity.result.journal = null;
entity.result.DOI = item.attributes.doi; entity.result.DOI = item.attributes.doi;
entity.id = item.attributes.doi; entity.id = item.attributes.doi;
entity.title = item.attributes.title; entity.title = Array.isArray(item.attributes.titles) && item.attributes.titles[0].title?item.attributes.titles[0].title:null;
entity.result.url = properties.doiURL + item.attributes.doi; entity.result.url = properties.doiURL + item.attributes.doi;
entity.result.source = 'datacite'; entity.result.source = 'datacite';
entity.type = 'dataset'; entity.type = 'dataset';
entity.result.date = item.attributes.published; entity.result.date = item.attributes.publicationYear;
entity.result.accessRights = "OPEN"; entity.result.accessRights = "OPEN";
entity.result.publisher = item.attributes['container-title']; entity.result.publisher = item.attributes['publisher'];
entity.result.journal = null; entity.result.journal = null;
entity.result.record = item; entity.result.record = item;
if (item.attributes.author) { if (item.attributes.creators) {
entity.result.authors = []; entity.result.authors = [];
for (let j = 0; j < item.attributes.author.length; j++) { for (let j = 0; j < item.attributes.creators.length; j++) {
const author = item.attributes.author[j]; const author = item.attributes.creators[j].name;
if(author.family || author.literal) { entity.result.authors.push(author);
entity.result.authors.push((author.family) ? author.family + (author.given ? ', ' + author.given : '') : author.literal);
}
} }
} }
results.push(entity); results.push(entity);