|
|
@@ -11,19 +11,37 @@ export class MetadataDialogService {
|
|
|
constructor(public adjusterPresetsService: AdjusterPresetsService) {
|
|
|
this.ontology = this.adjusterPresetsService.ontology;
|
|
|
}
|
|
|
-
|
|
|
- loadDatasetMetadata(datasetName: string): DatasetDescriptor {
|
|
|
- console.log(this.ontology);
|
|
|
- const ontoInfo = this.ontology.find((subject) => subject['http://www.w3.org/2000/01/rdf-schema#label']?.find((label) => label['@value']?.includes(datasetName)))
|
|
|
- console.log(ontoInfo);
|
|
|
+
|
|
|
+ loadDatasetMetadata(datasetId: string): DatasetDescriptor {
|
|
|
+ const ontoInfo = this.ontology.find(
|
|
|
+ (subject) => subject['@id'] === datasetId
|
|
|
+ );
|
|
|
//TODO: the returned values must reflect possibility of multi-values (e.g. coverage CZ + EU)
|
|
|
return {
|
|
|
- title: datasetName,
|
|
|
- coverage: ontoInfo['http://www.semanticweb.org/attractiveness/hasCoverage'][0]['@id'] ?? null,
|
|
|
- link: ontoInfo['http://www.semanticweb.org/attractiveness/link'][0]['@value'] ?? null,
|
|
|
- lod: ontoInfo['http://www.semanticweb.org/attractiveness/hasLoD'][0]['@id'] ?? null,
|
|
|
- source: ontoInfo['http://www.semanticweb.org/attractiveness/hasSource'][0]['@id'] ?? null,
|
|
|
- update: ontoInfo['http://www.semanticweb.org/attractiveness/update'][0]['@value'] ?? null
|
|
|
+ id: datasetId,
|
|
|
+ title: this.adjusterPresetsService.getLabelInCurrentLang(
|
|
|
+ ontoInfo['http://www.w3.org/2000/01/rdf-schema#label'] ?? null
|
|
|
+ ),
|
|
|
+ coverage:
|
|
|
+ ontoInfo['http://www.semanticweb.org/attractiveness/hasCoverage']?.[0][
|
|
|
+ '@id'
|
|
|
+ ] ?? null,
|
|
|
+ link:
|
|
|
+ ontoInfo['http://www.semanticweb.org/attractiveness/link']?.[0][
|
|
|
+ '@value'
|
|
|
+ ] ?? null,
|
|
|
+ lod:
|
|
|
+ ontoInfo['http://www.semanticweb.org/attractiveness/hasLoD']?.[0][
|
|
|
+ '@id'
|
|
|
+ ] ?? null,
|
|
|
+ source:
|
|
|
+ ontoInfo['http://www.semanticweb.org/attractiveness/hasSource']?.[0][
|
|
|
+ '@id'
|
|
|
+ ] ?? null,
|
|
|
+ update:
|
|
|
+ ontoInfo['http://www.semanticweb.org/attractiveness/update']?.[0][
|
|
|
+ '@value'
|
|
|
+ ] ?? null,
|
|
|
};
|
|
|
}
|
|
|
}
|