Project

General

Profile

1
import {Injectable} from '@angular/core';
2
import {Http, Response} from '@angular/http';
3
import {Observable}     from 'rxjs/Observable';
4
import {DatasetInfo} from '../utils/entities/datasetInfo';
5
import {OpenaireProperties} from '../utils/properties/openaireProperties';
6
import 'rxjs/add/observable/of';
7
import 'rxjs/add/operator/do';
8
import 'rxjs/add/operator/share';
9
import { CacheService  } from '../shared/cache.service';
10

    
11
@Injectable()
12
export class DatasetService {
13

    
14
    constructor(private http: Http, public _cache: CacheService) {}
15

    
16
    datasetInfo: DatasetInfo;
17

    
18
    getDatasetInfo (id: string):any {
19
        console.info("getDatasetInfo in service");
20

    
21
        let url = OpenaireProperties.getSearchAPIURL()+'datasets/'+id;
22
        let key = url;
23
        if (this._cache.has(key)) {
24
          return Observable.of(this._cache.get(key));
25
        }
26

    
27
        return this.http.get(url)
28
                    .map(res => <any> res.json())
29
                    .do(res => console.info(res['result']['metadata']['oaf:entity']))
30
                    .map(res => res['result']['metadata']['oaf:entity']['oaf:result'])
31
                    .map(res => [res,
32
                                 res['title'],
33
                                 res['rels']['rel'],
34
                                 res['children'],
35
                                 res['pid'],
36
                                 res['subject'],
37
                                 res['bestlicense'],
38
                                 res['collectedfrom'],
39
                                 res['context'],
40
                                 res['resulttype']
41
                    ])
42
                    .map(res => this.parseDatasetInfo(res))
43
                    .do(res => {
44
                      this._cache.set(key, res);
45
                    });
46

    
47
    }
48

    
49
    private handleError (error: Response) {
50
    // in a real world app, we may send the error to some remote logging infrastructure
51
    // instead of just logging it to the console
52
        console.error(error);
53
        return Observable.throw(error  || 'Server error');
54
    }
55

    
56
    parseDatasetInfo (data: any):any {
57
        this.datasetInfo = new DatasetInfo();
58

    
59
        if(data[0] != null) {
60
            this.datasetInfo.date = data[0].dateofacceptance.substring(0,4);
61
            this.datasetInfo.publisher = data[0].publisher;
62
            if(!Array.isArray(data[0].description)) {
63
                this.datasetInfo.description = data[0].description;
64
            } else {
65
                this.datasetInfo.description = data[0].description[0];
66
            }
67
            this.datasetInfo.embargoEndDate = data[0].embargoenddate;
68
        }
69

    
70
        if(data[1] != null) {
71
            this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""};
72
            if(Array.isArray(data[1])) {
73
                this.datasetInfo.title['name'] = data[1][0].content;
74
            } else {
75
                this.datasetInfo.title['name'] = data[1].content;
76
            }
77
        }
78

    
79
        if(data[2] != null) {
80
            let mydata;
81
            let counter = 0;
82
            let length = data[2].length!=undefined ? data[2].length : 1;
83

    
84
            for(let i=0; i<length; i++) {
85
                mydata = length > 1 ? data[2][i] : data[2];
86
                if(mydata.hasOwnProperty("to")) {
87
                    if(mydata['to'].class == "hasAuthor") {
88
                        if(this.datasetInfo.authors == undefined) {
89
                            this.datasetInfo.authors = new Array<{"name": string, "url": string}>();
90
                        }
91

    
92
                        this.datasetInfo.authors[mydata.ranking-1] = {"name": "", "url": ""};
93
                        this.datasetInfo.authors[mydata.ranking-1]['name'] = mydata.fullname;
94
                        this.datasetInfo.authors[mydata.ranking-1]['url'] = OpenaireProperties.getsearchLinkToPerson()+mydata['to'].content;
95
                    } else if(mydata['to'].class == "isProducedBy") {
96
                        if(this.datasetInfo.fundedByProjects == undefined) {
97
                            this.datasetInfo.fundedByProjects = new Array<
98
                                { "url": string, "acronym": string, "title": string,
99
                                  "funderShortname": string, "funderName": string,
100
                                  "funding": string, "inline": boolean
101
                                }>();
102
                        }
103

    
104
                        counter = this.datasetInfo.fundedByProjects.length;
105

    
106
                        this.datasetInfo.fundedByProjects[counter] = {
107
                            "url": "", "acronym": "", "title": "",
108
                            "funderShortname": "", "funderName": "",
109
                            "funding": "", "inline": false
110
                        }
111

    
112
                        this.datasetInfo.fundedByProjects[counter]['url'] =
113
                            OpenaireProperties.getsearchLinkToProject()+mydata['to'].content;
114
                        this.datasetInfo.fundedByProjects[counter]['acronym'] = mydata.acronym;
115
                        this.datasetInfo.fundedByProjects[counter]['title'] = mydata.title;
116

    
117
                        if(mydata.hasOwnProperty("funding")) {
118
                            let length1 = Array.isArray(mydata['funding']) ? mydata['funding'].length : 1;
119

    
120
                            for(let j=0; j<length1; j++) {
121
                                let funding;
122
                                let mydata1 = Array.isArray(mydata['funding']) ? mydata['funding'][j] : mydata['funding'];
123

    
124
                                if(mydata1.hasOwnProperty("funder")) {
125
                                    this.datasetInfo.fundedByProjects[counter]['funderShortname'] = mydata1['funder'].shortname;
126
                                    this.datasetInfo.fundedByProjects[counter]['funderName'] = mydata1['funder'].name;
127
                                }
128

    
129
                                if(mydata1.hasOwnProperty("funding_level_2")) {
130
                                    funding = mydata1['funding_level_2'].content;
131
                                } else if(mydata1.hasOwnProperty("funding_level_1")) {
132
                                    funding = mydata1['funding_level_1'].content;
133
                                } else if(mydata1.hasOwnProperty("funding_level_0")) {
134
                                    funding = mydata1['funding_level_0'].content;
135
                                }
136

    
137
                                if(funding != undefined) {
138
                                    funding = funding.split("::");
139

    
140
                                    if(this.datasetInfo.fundedByProjects[counter]['funding'] != "") {
141
                                        this.datasetInfo.fundedByProjects[counter]['funding'] += ", "+funding[1];
142
                                    } else {
143
                                        this.datasetInfo.fundedByProjects[counter]['funding'] = funding[1];
144
                                    }
145
                                    for(let i=2; i<funding.length; i++) {
146
                                        this.datasetInfo.fundedByProjects[counter]['funding'] += " | " + funding[i];
147
                                    }
148
                                }
149
                            }
150
                        }
151
                    } else if(mydata['to'].class == "hasAmongTopNSimilarDocuments") {
152
                        if(this.datasetInfo.similarResearchResults == undefined) {
153
                            this.datasetInfo.similarResearchResults = new Array<{
154
                                "name": string, "url": string, "date": string,
155
                                "trust": string, "class": string}>();
156
                        }
157

    
158
                        counter = this.datasetInfo.similarResearchResults.length;
159
                        this.datasetInfo.similarResearchResults[counter] = {"name": "", "url": "", "date": "", "trust": "", "class": ""}
160

    
161
                        let url;
162
                        if(mydata['resulttype'].classname == "publication") {
163
                            url = OpenaireProperties.getsearchLinkToPublication()+mydata['to'].content;
164
                            this.datasetInfo.similarResearchResults[counter]['class'] = "publication";
165
                        } else {
166
                            url = OpenaireProperties.getsearchLinkToDataset()+mydata['to'].content;
167
                            this.datasetInfo.similarResearchResults[counter]['class'] = "dataset";
168
                        }
169

    
170
                        this.datasetInfo.similarResearchResults[counter]['url'] = url;
171
                        this.datasetInfo.similarResearchResults[counter]['name'] = mydata['title'].content;
172
                        this.datasetInfo.similarResearchResults[counter]['date'] = mydata.dateofacceptance.substring(0,4);;
173
                        this.datasetInfo.similarResearchResults[counter]['trust'] = Math.round(mydata.trust*100)+"%";
174

    
175

    
176
                    } else if(mydata['to'].class == "isRelatedTo") {
177
                        if(this.datasetInfo.relatedResearchResults == undefined) {
178
                            this.datasetInfo.relatedResearchResults = new Array<{
179
                                "name": string, "url": string, "date": string,
180
                                "trust": string, "class": string}>();
181
                        }
182

    
183
                        counter = this.datasetInfo.relatedResearchResults.length;
184
                        this.datasetInfo.relatedResearchResults[counter] = {"name": "", "url": "", "date": "", "trust": "", "class": ""}
185

    
186
                        let url;
187
                        if(mydata['resulttype'].classname == "publication") {
188
                            url = OpenaireProperties.getsearchLinkToPublication()+mydata['to'].content;
189
                            this.datasetInfo.relatedResearchResults[counter]['class'] = "publication";
190
                        } else {
191
                            url = OpenaireProperties.getsearchLinkToDataset()+mydata['to'].content;
192
                            this.datasetInfo.relatedResearchResults[counter]['class'] = "dataset";
193
                        }
194

    
195
                        this.datasetInfo.relatedResearchResults[counter]['url'] = url;
196
                        this.datasetInfo.relatedResearchResults[counter]['name'] = mydata['title'].content;
197
                        this.datasetInfo.relatedResearchResults[counter]['date'] = mydata.dateofacceptance.substring(0,4);;
198
                        this.datasetInfo.relatedResearchResults[counter]['trust'] = Math.round(mydata.trust*100)+"%";
199

    
200
                    }
201
                }
202
            }
203

    
204
            this.datasetInfo.authors = this.datasetInfo.authors.filter(function (item) {
205
                return (item != undefined);
206
            });
207
        }
208

    
209
        if(data[3] != null) {
210
            if(data[3].hasOwnProperty("instance")) {
211
                this.datasetInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[]}>();
212
                this.datasetInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[]}>()
213

    
214
                let length = data[3]['instance'].length!=undefined ? data[3]['instance'].length : 1;
215

    
216
                let counter = 0;
217
                let counter1 = 0;
218
                let counter2 = 0;
219
                let mydata;
220
                for(let i=0; i<length; i++) {
221
                    mydata = length > 1 ? data[3]['instance'][i] : data[3]['instance'];
222

    
223
                    if(this.datasetInfo.type == undefined) {
224
                        if(mydata.hasOwnProperty("instancetype")) {
225
                            if(mydata['instancetype'].classname != null
226
                                && mydata['instancetype'].classname != ""
227
                                && mydata['instancetype'].classname != "Unknown"){
228
                                this.datasetInfo.type = mydata['instancetype'].classname;
229
                            }
230
                        }
231
                    }
232

    
233
                    if(mydata.hasOwnProperty("webresource")) {
234
                        let url;
235
                        if(mydata['webresource'].length == undefined) {
236
                            url = mydata['webresource'].url;
237
                        } else{
238
                            url = mydata['webresource'][0].url;
239
                        }
240

    
241
                        if(!this.datasetInfo.downloadFrom.has(url) && mydata.hasOwnProperty("hostedby")) {
242
                            if(mydata['hostedby'].name != "other resources" && mydata['hostedby'].name != "Unknown Repository") {
243
                                if(!this.datasetInfo.downloadFrom.has(mydata['hostedby'].name)) {
244
                                    this.datasetInfo.downloadFrom.set(mydata['hostedby'].name, {"url": null, "accessMode": null});
245
                                }
246

    
247
                                if(this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['url'] == null) {
248
                                    this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['url'] = new Array<string>();
249
                                }
250

    
251
                                counter2 = this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['url'].length;
252
                                this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['url'][counter2] = url;
253

    
254
                                if(this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'] == null) {
255
                                    this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'] = new Array<string>();
256
                                }
257

    
258
                                if(mydata.hasOwnProperty("licence")) {
259
                                    this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'][counter2] = mydata['licence'].classid;
260
                                } else {
261
                                    this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'][counter2] = "";
262
                                }
263
                            } else {
264
                                if(data[0] != null && data[0].hasOwnProperty("source")) {
265
                                    let key: string;
266
                                    if(Array.isArray(data[0].source)) {
267
                                        if(!this.datasetInfo.publishedIn.has(data[0]['source'][counter1])) {
268
                                            key = data[0]['source'][counter1];
269
                                        }
270
                                    } else {
271
                                        if(!this.datasetInfo.publishedIn.has(data[0]['source'])) {
272
                                            key = data[0]['source'];
273
                                        }
274
                                    }
275

    
276
                                    this.datasetInfo.publishedIn.set(key, {"url": null, "accessMode": null});
277

    
278
                                    if(this.datasetInfo.publishedIn.get(key)['url'] == null) {
279
                                        this.datasetInfo.publishedIn.get(key)['url'] = new Array<string>();
280
                                    }
281

    
282
                                    counter2 = this.datasetInfo.publishedIn.get(key)['url'].length;
283
                                    this.datasetInfo.publishedIn.get(key)['url'][counter2] = url;
284

    
285
                                    if(this.datasetInfo.publishedIn.get(key)['accessMode'] == null) {
286
                                        this.datasetInfo.publishedIn.get(key)['accessMode'] = new Array<string>();
287
                                    }
288

    
289
                                    if(mydata.hasOwnProperty("licence")) {
290
                                        this.datasetInfo.publishedIn.get(key)['accessMode'][counter2] = mydata['licence'].classid;
291
                                    } else {
292
                                        this.datasetInfo.publishedIn.get(key)['accessMode'][counter2] = "";
293
                                    }
294
                                    counter1++;
295
                                }
296
                            }
297
                            if(this.datasetInfo.title != undefined) {
298
                                if(this.datasetInfo.title['url'] == undefined) {
299
                                    this.datasetInfo.title['url'] = url;
300
                                }
301

    
302
                                switch (this.datasetInfo.title['licence']) {
303
                                    case undefined:
304
                                        this.datasetInfo.title['licence'] = mydata['licence'].classid;
305
                                        this.datasetInfo.title['url'] = url;
306
                                        break;
307
                                    case "CLOSED":
308
                                        if(mydata['licence'].classid == "OPEN" ||
309
                                            mydata['licence'].classid == "EMBARGO" ||
310
                                            mydata['licence'].classid == "RESTRICTED") {
311
                                                this.datasetInfo.title['licence'] = mydata['licence'].classid;
312
                                                this.datasetInfo.title['url'] = url;
313
                                        }
314
                                        break;
315
                                    case "RESTRICTED":
316
                                        if(mydata['licence'].classid == "OPEN" ||
317
                                            mydata['licence'].classid == "EMBARGO") {
318
                                                this.datasetInfo.title['licence'] = mydata['licence'].classid;
319
                                                this.datasetInfo.title['url'] = url;
320
                                        }
321
                                        break;
322
                                    case "EMBARGO":
323
                                        if(mydata['licence'].classid == "OPEN") {
324
                                                this.datasetInfo.title['licence'] = mydata['licence'].classid;
325
                                                this.datasetInfo.title['url'] = url;
326
                                        }
327
                                        break;
328
                                }
329
                            }
330
                        }
331
                    }
332
                }
333
            }
334
        }
335

    
336
        if(data[4] != null) {
337
            let counter = 0;
338
            this.datasetInfo.identifiers = new Map<string, string[]>();
339

    
340
            if(data[4].hasOwnProperty("classname") && data[4]['classname'] != "") {
341
                if(data[4].classname == "doi" || data[4].classname == "pmc") {
342
                    if(!this.datasetInfo.identifiers.has(data[4].classname)) {
343
                        this.datasetInfo.identifiers.set(data[4].classname, new Array<string>());
344
                    }
345
                    counter = this.datasetInfo.identifiers.get(data[4].classname).length;
346
                    this.datasetInfo.identifiers.get(data[4].classname)[counter] = data[4].content;
347
                }
348
            } else {
349
                for(let i=0; i<data[4].length; i++) {
350
                    if(data[4][i].classname == "doi" || data[4][i].classname == "pmc") {
351
                        if(!this.datasetInfo.identifiers.has(data[4][i].classname)) {
352
                            this.datasetInfo.identifiers.set(data[4][i].classname, new Array<string>());
353
                        }
354
                        counter = this.datasetInfo.identifiers.get(data[4][i].classname).length;
355
                        this.datasetInfo.identifiers.get(data[4][i].classname)[counter] = data[4][i].content;
356
                    }
357
                }
358
            }
359
        }
360

    
361
        if(data[5] != null) {
362
            let mydata;
363
            let length = data[7].length!=undefined ? data[5].length : 1;
364

    
365
            for(let i=0; i<length; i++) {
366
                mydata = length > 1 ? data[5][i] : data[5];
367

    
368
                if(mydata.classid != "") {
369
                    if(mydata.inferred == true) {
370
                        if(this.datasetInfo.classifiedSubjects == undefined) {
371
                            this.datasetInfo.classifiedSubjects = new Map<string, string[]>();
372
                        }
373

    
374
                        if(!this.datasetInfo.classifiedSubjects.has(mydata.classname)) {
375
                            this.datasetInfo.classifiedSubjects.set(mydata.classname, new Array<string>());
376
                        }
377

    
378
                        this.datasetInfo.classifiedSubjects.get(mydata.classname).push(mydata.content);
379
                    } else {
380
                        if(mydata.classid == "keyword") {
381
                            if(this.datasetInfo.subjects == undefined) {
382
                                this.datasetInfo.subjects = new Array<string>();
383
                            }
384

    
385
                            this.datasetInfo.subjects.push(mydata.content);
386
                        } else {
387
                            if(this.datasetInfo.otherSubjects == undefined) {
388
                                this.datasetInfo.otherSubjects = new Map<string, string[]>();
389
                            }
390

    
391
                            if(!this.datasetInfo.otherSubjects.has(mydata.classname)) {
392
                                this.datasetInfo.otherSubjects.set(mydata.classname, new Array<string>());
393
                            }
394
                            this.datasetInfo.otherSubjects.get(mydata.classname).push(mydata.content);
395
                        }
396
                    }
397
                }
398
            }
399
        }
400

    
401
        if(data[6] != null) {
402
            this.datasetInfo.bestlicense = data[6].classid;
403
        }
404

    
405
        if(data[7] != null) {
406
            this.datasetInfo.collectedFrom = new Array<{"name": string, "url": string}>();
407

    
408
            let mydata;
409
            let length = data[7].length!=undefined ? data[7].length : 1;
410
            for(let i=0; i<length; i++) {
411
                mydata = length > 1 ? data[7][i] : data[7];
412
                let link = OpenaireProperties.getsearchLinkToDataProvider();
413
                this.datasetInfo.collectedFrom[i] = {"name": "", "url": ""};
414
                this.datasetInfo.collectedFrom[i]['name'] = mydata.name;
415
                this.datasetInfo.collectedFrom[i]['url'] = link+mydata.id;
416
            }
417
        }
418

    
419
        if(this.datasetInfo.publisher != null
420
            && this.datasetInfo.identifiers != null
421
            && this.datasetInfo.identifiers.has("doi")) {
422

    
423
            if( this.datasetInfo.downloadFrom == null) {
424
                this.datasetInfo.downloadFrom = new Map<string,{"url": string[], "accessMode": string[]}>();
425
            }
426

    
427
            this.datasetInfo.downloadFrom.set(this.datasetInfo.publisher, {"url": null, "accessMode": null});
428

    
429
            let url = OpenaireProperties.getDoiURL()+this.datasetInfo.identifiers.get("doi");
430
            this.datasetInfo.downloadFrom.get(this.datasetInfo.publisher)['url'] = new Array<string>();
431
            this.datasetInfo.downloadFrom.get(this.datasetInfo.publisher)['accessMode'] = new Array<string>();
432

    
433
            this.datasetInfo.downloadFrom.get(this.datasetInfo.publisher)['url'][0] = url;
434
            this.datasetInfo.downloadFrom.get(this.datasetInfo.publisher)['accessMode'][0] = "";
435

    
436
            if(this.datasetInfo.title != undefined && this.datasetInfo.title['url'] == "") {
437
                this.datasetInfo.title['url'] = url;
438
            }
439
        }
440

    
441
        if(data[8] != null) {
442
            this.datasetInfo.contexts = new Array<
443
                { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}>();
444

    
445
            let position = 0;
446
            let labels = "";
447
            let mydata;
448
            let length = data[8].length!=undefined ? data[8].length : 1;
449
            for(let i=0; i<length; i++) {
450
                mydata = length > 1 ? data[8][i] : data[8];
451

    
452
                if(mydata.hasOwnProperty("type") && mydata['type'] == "community") {
453
                    if(mydata.hasOwnProperty("category")) {
454
                        if(mydata['category'].hasOwnProperty("concept")) {
455
                            let mydata1;
456
                            let length1 = mydata['category']['concept'].length!=undefined ? mydata['category']['concept'].length : 1;
457
                            for(let j=0; j<length1; j++) {
458
                                mydata1 = length1 > 1 ? mydata['category']['concept'][j] : mydata['category']['concept'];
459

    
460
                                this.datasetInfo.contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
461
                                this.datasetInfo.contexts[position]['labelContext'] = mydata.label;
462
                                this.datasetInfo.contexts[position]['labelCategory'] = mydata['category'].label;;
463
                                this.datasetInfo.contexts[position]['labelConcept'] = mydata1.label;
464

    
465
                                position++;
466
                            }
467
                        } else {
468
                            this.datasetInfo.contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
469
                            this.datasetInfo.contexts[position]['labelContext'] = mydata.label;
470
                            this.datasetInfo.contexts[position]['labelCategory'] = mydata['category'].label;;
471
                            this.datasetInfo.contexts[position]['labelConcept'] = null;
472
                        }
473
                    } else {
474
                        this.datasetInfo.contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
475
                        this.datasetInfo.contexts[position]['labelContext'] = mydata.label;
476
                        this.datasetInfo.contexts[position]['labelCategory'] = null;
477
                        this.datasetInfo.contexts[position]['labelConcept'] = null;
478
                    }
479
                }
480
            }
481
        }
482

    
483
        if(data[9] != null && this.datasetInfo.type == undefined) {
484
            if(data[9].hasOwnProperty('classname')) {
485
                this.datasetInfo.type = data[9].classname;
486
            }
487
        }
488

    
489

    
490
        //this.printdatasetInfo();
491
        return this.datasetInfo;
492

    
493
    }
494

    
495
    printDatasetInfo() {
496
        console.info("DATE: "+this.datasetInfo.date);
497
        console.info("PUBLISHER: "+this.datasetInfo.publisher);
498
        console.info("DESCRIPTION: "+this.datasetInfo.description);
499

    
500
        console.info("TITLE: "+this.datasetInfo.title);
501

    
502
        console.info("AUTHORS: "+this.datasetInfo.authors);
503
        console.info("\nFUNDED BY PROJECTS:");
504
        if(this.datasetInfo.fundedByProjects != undefined) {
505
            this.datasetInfo.fundedByProjects.forEach(function (value, key, map) {
506
                console.info(key + " = " + value);
507
            });
508
        } else {
509
            console.info("undefined");
510
        }
511
        console.info("\n");
512
/*
513
        console.info("\nRELATED RESEARCH DATA:");
514
        if(this.datasetInfo.relatedResearchData != undefined) {
515
            this.datasetInfo.relatedResearchData.forEach(function (value, key, map) {
516
                console.info(key + " = " + value);
517
            });
518
        } else {
519
            console.info("undefined");
520
        }
521
        console.info("\n");
522

    
523
        console.info("\nSIMILAR datasetS:");
524
        if(this.datasetInfo.similarPublications != undefined) {
525
            this.datasetInfo.similarPublications.forEach(function (value, key, map) {
526
                console.info(key + " = " + value);
527
            });
528
        } else {
529
            console.info("undefined");
530
        }
531
        console.info("\n");
532
*/
533
        console.info("TYPE: "+this.datasetInfo.type);
534
        console.info("\nDOWNLOAD FROM:");
535
        if(this.datasetInfo.downloadFrom != undefined) {
536
            this.datasetInfo.downloadFrom.forEach(function (value, key, map) {
537
                console.info(key + " = " + value);
538
            });
539
        } else {
540
            console.info("undefined");
541
        }
542
        console.info("\n");
543

    
544
        console.info("\nIDENTIFIERS:");
545
        if(this.datasetInfo.identifiers != undefined) {
546
            this.datasetInfo.identifiers.forEach(function (value, key, map) {
547
                console.info(key + " = " + value);
548
            });
549
        } else {
550
            console.info("undefined");
551
        }
552
        console.info("\n");
553

    
554
        console.info("SUBJECTS: "+this.datasetInfo.subjects);
555
        console.info("\nCLASSIFIED OBJECTS:");
556
        if(this.datasetInfo.classifiedSubjects != undefined) {
557
            this.datasetInfo.classifiedSubjects.forEach(function (value, key, map) {
558
                console.info(key + " = " + value);
559
            });
560
        } else {
561
            console.info("undefined");
562
        }
563
        console.info("\n");
564

    
565
        console.info("BEST LICENSE: "+this.datasetInfo.bestlicense);
566

    
567
        console.info("\nCOLLECTED FROM:");
568
        if(this.datasetInfo.collectedFrom != undefined) {
569
            this.datasetInfo.collectedFrom.forEach(function (value, key, map) {
570
                console.info(key + " = " + value);
571
            });
572
        } else {
573
            console.info("undefined");
574
        }
575
        console.info("\n");
576

    
577
        console.info("\nDOWNLOAD FROM:");
578
        if(this.datasetInfo.downloadFrom != undefined) {
579
            this.datasetInfo.downloadFrom.forEach(function (value, key, map) {
580
                console.info(key + " = " + value);
581
            });
582
        } else {
583
            console.info("undefined");
584
        }
585
        console.info("\n");
586
    }
587
}
(5-5/22)