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. getSearchAPIURLLast()+'datasets/'+id+"?format=json";
22
        let key = url;
23
        if (this._cache.has(key)) {
24
          return Observable.of(this._cache.get(key)).map(res => this.parseDatasetInfo(res));
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
                    ]).do(res => {
42
                      this._cache.set(key, res);
43
                    })
44
                    .map(res => this.parseDatasetInfo(res));
45
    }
46

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

    
54
    parseDatasetInfo (data: any):any {
55
        this.datasetInfo = new DatasetInfo();
56

    
57
        if(data[0] != null) {
58
            this.datasetInfo.date = data[0].dateofacceptance.substring(0,4);
59
            this.datasetInfo.publisher = data[0].publisher;
60
            if(!Array.isArray(data[0].description)) {
61
                this.datasetInfo.description = data[0].description;
62
            } else {
63
                this.datasetInfo.description = data[0].description[0];
64
            }
65
            this.datasetInfo.embargoEndDate = data[0].embargoenddate;
66
        }
67
        this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""};
68
        if(data[0]['bestlicense'].hasOwnProperty("classid")) {
69
            this.datasetInfo.title.accessMode = data[0]['bestlicense'].classid;
70
        }
71
        if(data[1] != null) {
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 = data[2].length!=undefined ? 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
            if(this.datasetInfo.authors != undefined) {
205
                this.datasetInfo.authors = this.datasetInfo.authors.filter(function (item) {
206
                    return (item != undefined);
207
                });
208
            }
209
        }
210

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

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

    
218
                let counter = 0;
219
                let counter1 = 0;
220
                let counter2 = 0;
221
                let mydata;
222
                for(let i=0; i<length; i++) {
223
                    mydata = data[3]['instance'].length!=undefined ? data[3]['instance'][i] : data[3]['instance'];
224

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
367
            for(let i=0; i<length; i++) {
368
                mydata = data[7].length!=undefined ? data[5][i] : data[5];
369

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
491

    
492
        //this.printdatasetInfo();
493
        return this.datasetInfo;
494

    
495
    }
496

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

    
502
        console.info("TITLE: "+this.datasetInfo.title);
503

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

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

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

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

    
567
        console.info("BEST LICENSE: "+this.datasetInfo.bestlicense);
568

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

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