diff --git a/src/app/mapping/mapping.component.html b/src/app/mapping/mapping.component.html index b631d2f17a5bcc54dd3be2aec6df86a6535049c9..8eaf9a7451908ea60c4f07a52c47b07125c18bc0 100644 --- a/src/app/mapping/mapping.component.html +++ b/src/app/mapping/mapping.component.html @@ -1,4 +1,13 @@ -<form #form="ngForm"> +<nb-card> + <nb-card-body> + <nb-select placeholder="Select ontology" [(ngModel)]="ontology" (ngModelChange)="selectOntology()" name="ontology"> + <nb-option value="dcat">Dcat</nb-option> + <nb-option value="geodcat">GeoDcat</nb-option> + </nb-select> + </nb-card-body> +</nb-card> + +<form #form="ngForm" *ngIf="ontology"> <div class="card-row"> <div class="card-col"> <nb-card size="giant"> diff --git a/src/app/mapping/mapping.component.ts b/src/app/mapping/mapping.component.ts index 1b2f279a4cb608725bab1fca9ac1bc07b6265482..cc601eb52f1476e34ec017490f7ddd594031aa9e 100644 --- a/src/app/mapping/mapping.component.ts +++ b/src/app/mapping/mapping.component.ts @@ -22,6 +22,7 @@ import { FeedbackDialogComponent } from './dialog/feedback-dialog/feedback-dialo }) export class MappingComponent implements OnInit { + ontology: string; itemsdataset: Object[] = [] dcatVocabulary: Dataset[]; vocabularies: Dataset[]; @@ -45,17 +46,6 @@ export class MappingComponent implements OnInit { constructor(private dataSetService: DatasetCrudService, private dialog: MatDialog, private route: Router, private fileSaverService: FileSaverService) { } ngOnInit() { - this.dataSetService.getLocally('./assets/dcat.json').subscribe( - dataset => { - this.dcatVocabulary = dataset; - this.vocabularies = dataset; - this.obsDcatVocabulary = of(this.dcatVocabulary) - this.selectedPaths = []; - }, - error => { - console.error(error); - }, - ); this.itemsdataset = this.dataSetService.itemsDataset; this.ids = this.dataSetService.ids; this.ids @@ -64,6 +54,22 @@ export class MappingComponent implements OnInit { this.filteredOptions = of(this.keys); } + selectOntology(): void { + + this.dataSetService.getLocally('./assets/'+ this.ontology + '.json').subscribe( + dataset => { + this.dcatVocabulary = dataset; + this.vocabularies = dataset; + this.obsDcatVocabulary = of(this.dcatVocabulary); + this.selectedPaths = []; + + }, + error => { + console.error(error); + }, + ); + } + createDataset(item: Object): Map<number, string> { console.log("rerereer" + this.selectedPaths)