From a9cb541994c379776a6f33fc0e22d3f4067161c8 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Wed, 16 Sep 2020 13:27:13 +0000 Subject: [PATCH] [Library|Trunk] jsonld parser: complete fix with description as a number instead of string git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59402 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../schema2jsonld/service/open-aire-jsonld-converter.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts index 90b1a29a..618d279e 100644 --- a/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts +++ b/sharedComponents/schema2jsonld/service/open-aire-jsonld-converter.service.ts @@ -196,7 +196,7 @@ convertDatasource(datasource: any, URL, otherUrl): Organization { private getDescription(result: any): String[] { const item = _.get(result, "result.metadata.oaf:entity.oaf:result.description", null); if (!item) return this.getTitle(result); - let descr = Array.isArray(item) ? item[0]:item + ""; // +"" to make string: if description is number descr.substring returns error + let descr = Array.isArray(item) ? item[0]+ "":item + ""; // +"" to make string: if description is number descr.substring returns error return [descr?(descr.substring(0,4997)+(descr.substring(0,4997).length == 4997?'...':'')):"" as String]; }