diff --git a/src/app/dataset/dataset.component.ts b/src/app/dataset/dataset.component.ts index 156fdaa1e70a62d4a4183379f1152369e400be73..b902f26ceac881c0e4e8fa758e7d7efdf9722ec9 100644 --- a/src/app/dataset/dataset.component.ts +++ b/src/app/dataset/dataset.component.ts @@ -101,23 +101,23 @@ export class DatasetComponent implements OnInit { const concepts = new DataConcept(); concepts.url = this.dataset.url; concepts.iris = []; - Object.values(this.dataset.keywords).forEach((data: ESModel) => { - if ((null !== data && data.results.filter(e => e.checked).length > 0)) { - if (data) { - data.results.forEach((result: Result) => { + this.dataset.keywords.forEach((value: ESModel, key: string) => { + if ((null !== value && value.results.filter(e => e.checked).length > 0)) { + if (value) { + value.results.forEach((result: Result) => { if (result.checked) { - concepts.iris.push(result.source.document.iri); + concepts.iris.push({iri: result.source.document.iri, label: result.source.document.label, originalKeyword: key}); } }); } } }); if (this.autocompleteResults && this.autocompleteResults.length > 0) { - this.autocompleteResults.forEach((result: Result) => concepts.iris.push(result.source.document.iri)); + this.autocompleteResults.forEach((result: Result) => concepts.iris.push({iri: result.source.document.iri, label: result.source.document.label, originalKeyword: null})); } if (this.dataset.conceptIri && this.dataset.conceptIri.length > 0) { - this.dataset.conceptIri.forEach((iri: string) => concepts.iris.push(iri)); + this.dataset.conceptIri.forEach((iri: string) => concepts.iris.push({iri, label: null, originalKeyword: null})); } mappingData.dataConcepts.push(concepts); console.log(mappingData); diff --git a/src/app/semantic-enrichment/ConceptsRequest.ts b/src/app/semantic-enrichment/ConceptsRequest.ts index 1e8d7c65a6dee49a82f3625391b4eeedcd442cc2..a7dfe0bb453ee84d4b6928ad6d693f558e23f58f 100644 --- a/src/app/semantic-enrichment/ConceptsRequest.ts +++ b/src/app/semantic-enrichment/ConceptsRequest.ts @@ -7,7 +7,7 @@ export class ConceptsRequest { } export class DataConcept { - iris: string[]; + iris: { iri: string, label: string, originalKeyword: string }[]; id: string; url: string; } diff --git a/src/app/semantic-enrichment/semantic-enrichment.component.ts b/src/app/semantic-enrichment/semantic-enrichment.component.ts index d5882e749d3cddf3aeed5508b3de1fe214dd18b4..5db9079938bf1f3b7e637b28a28d6a5d97b067cd 100644 --- a/src/app/semantic-enrichment/semantic-enrichment.component.ts +++ b/src/app/semantic-enrichment/semantic-enrichment.component.ts @@ -129,17 +129,21 @@ export class SemanticEnrichmentComponent implements OnInit { const concepts = new DataConcept(); concepts.id = data.id; concepts.iris = []; - Object.values(data.keywords).forEach((value: ESModel) => { + data.keywords.forEach((value: ESModel, key: string) => { if (value && value.results) { value.results.forEach((result: Result) => { if (result.checked) { - concepts.iris.push(result.source.document.iri); + concepts.iris.push({iri: result.source.document.iri, label: result.source.document.label, originalKeyword: key}); } }); } if (this.autocompleteMap.get(data.id) && this.autocompleteMap.get(data.id).length > 0) { - this.autocompleteMap.get(data.id).forEach((result: Result) => concepts.iris.push(result.source.document.iri)); + this.autocompleteMap.get(data.id).forEach( + (result: Result) => concepts.iris.push( + {iri: result.source.document.iri, label: result.source.document.label, originalKeyword: null} + ) + ); } mappingData.dataConcepts.push(concepts); });