Project

General

Profile

« Previous | Next » 

Revision 61286

Added by Antonis Lempesis 4 months ago

merged gradient and then querie_names branches

View differences:

data-handler.service.ts
34 34

  
35 35
    for (const series of rawData.datasets) {
36 36

  
37
      if (series.series.query.name === 'new.oso.publications.affiliated') {
37
      if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('publication')) {
38 38
        overviewMapData.publications = this.rawResultToCountryMapData(series.series.result);
39
      } else if (series.series.query.name === 'new.oso.datasets.affiliated') {
39
      } else if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('dataset')) {
40 40
        overviewMapData.datasets = this.rawResultToCountryMapData(series.series.result);
41
      } else if (series.series.query.name === 'new.oso.repositories.doar_re3data') {
41
      } else if (series.series.query.name === 'oso.repositories.doar_re3data') {
42 42
        overviewMapData.repositories = this.rawResultToCountryMapData(series.series.result);
43
      } else if (series.series.query.name === 'new.oso.journals.doaj') {
43
      } else if (series.series.query.name === 'oso.journals.doaj') {
44 44
        overviewMapData.journals = this.rawResultToCountryMapData(series.series.result);
45
      } else if (series.series.query.name === 'new.oso.oa_policies') {
45
      } else if (series.series.query.name === 'oso.oa_policies') {
46 46
        overviewMapData.policies = this.rawResultToCountryMapData(series.series.result);
47 47
      }
48 48
    }
......
57 57
    const joinedPublicationsMap = new Map();
58 58

  
59 59
    for (const series of rawData.datasets) {
60
      if (series.series.query.name === 'new.oso.publications.affiliated') {
60
      if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('publication')) {
61 61

  
62 62
        for (const rowResult of series.series.result) {
63 63
          if (joinedPublicationsMap.has(rowResult.row[1])) {
......
71 71
          }
72 72
        }
73 73

  
74
      } else if (series.series.query.name === 'new.oso.publications.deposited') {
74
      } else if (series.series.query.name === 'oso.results.deposited' && series.series.query.parameters.includes('publication')) {
75 75

  
76 76
        for (const rowResult of series.series.result) {
77 77
          if (joinedPublicationsMap.has(rowResult.row[1])) {
......
94 94
    const joinedDatasetsMap = new Map();
95 95

  
96 96
    for (const series of rawData.datasets) {
97
      if (series.series.query.name === 'new.oso.datasets.affiliated') {
97
      if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('dataset')) {
98 98

  
99 99
        for (const rowResult of series.series.result) {
100 100
          if (joinedDatasetsMap.has(rowResult.row[1])) {
......
108 108
          }
109 109
        }
110 110

  
111
      } else if (series.series.query.name === 'new.oso.datasets.deposited') {
111
      } else if (series.series.query.name === 'oso.results.deposited' && series.series.query.parameters.includes('dataset')) {
112 112

  
113 113
        for (const rowResult of series.series.result) {
114 114
          if (joinedDatasetsMap.has(rowResult.row[1])) {
......
132 132
    const joinedRepositoriesMap = new Map();
133 133

  
134 134
    for (const series of rawData.datasets) {
135
      if (series.series.query.name === 'new.oso.repositories.doar_re3data') {
135
      if (series.series.query.name === 'oso.repositories.doar_re3data') {
136 136

  
137 137
        for (const rowResult of series.series.result) {
138 138
          if (joinedRepositoriesMap.has(rowResult.row[1])) {
......
146 146
          }
147 147
        }
148 148

  
149
      } else if (series.series.query.name === 'new.oso.repositories') {
149
      } else if (series.series.query.name === 'oso.repositories') {
150 150

  
151 151
        for (const rowResult of series.series.result) {
152 152
          if (joinedRepositoriesMap.has(rowResult.row[1])) {
......
170 170
    const joinedJournalsMap = new Map();
171 171

  
172 172
    for (const series of rawData.datasets) {
173
      if (series.series.query.name === 'new.oso.journals.doaj') {
173
      if (series.series.query.name === 'oso.journals.doaj') {
174 174

  
175 175
        for (const rowResult of series.series.result) {
176 176
          if (joinedJournalsMap.has(rowResult.row[1])) {
......
184 184
          }
185 185
        }
186 186

  
187
      } else if (series.series.query.name === 'new.oso.journals') {
187
      } else if (series.series.query.name === 'oso.journals') {
188 188

  
189 189
        for (const rowResult of series.series.result) {
190 190
          if (joinedJournalsMap.has(rowResult.row[1])) {
......
209 209

  
210 210
    for (const series of rawData.datasets) {
211 211

  
212
      if (series.series.query.name === 'new.oso.publications.affiliated.country') {
212
      if (series.series.query.name === 'oso.results.affiliated.country' && series.series.query.parameters.includes('publication')) {
213 213
        countryData.publicationsAffiliated = Number(series.series.result[0].row[0]);
214
      } else if (series.series.query.name === 'new.oso.publications.deposited.country') {
214
      } else if (series.series.query.name === 'oso.results.deposited.country' && series.series.query.parameters.includes('publication')) {
215 215
        countryData.publicationsDeposited = Number(series.series.result[0].row[0]);
216
      } else if (series.series.query.name === 'new.oso.datasets.affiliated.country') {
216
      } else if (series.series.query.name === 'oso.results.affiliated.country' && series.series.query.parameters.includes('dataset')) {
217 217
        countryData.datasetsAffiliated = Number(series.series.result[0].row[0]);
218
      } else if (series.series.query.name === 'new.oso.datasets.deposited.country') {
218
      } else if (series.series.query.name === 'oso.results.deposited.country' && series.series.query.parameters.includes('dataset')) {
219 219
        countryData.datasetsDeposited = Number(series.series.result[0].row[0]);
220
      } else if (series.series.query.name === 'new.oso.repositories.doar_re3data.country') {
220
      } else if (series.series.query.name === 'oso.repositories.doar_re3data.country') {
221 221
        countryData.repositories = Number(series.series.result[0].row[0]);
222
      } else if (series.series.query.name === 'new.oso.journals.doaj.country') {
222
      } else if (series.series.query.name === 'oso.journals.doaj.country') {
223 223
        countryData.journals = Number(series.series.result[0].row[0]);
224
      } else if (series.series.query.name === 'new.oso.oa_policies.country') {
224
      } else if (series.series.query.name === 'oso.oa_policies.country') {
225 225
        countryData.policies = Number(series.series.result[0].row[0]);
226 226
      }
227 227
    }
......
235 235

  
236 236
    for (const series of rawData.datasets) {
237 237

  
238
      if (series.series.query.name === 'new.oso.publications.oa_percentage') {
238
      if (series.series.query.name === 'oso.results.oa_percentage' && series.series.query.parameters.includes('publication')) {
239 239

  
240 240
        const publicationsIndicator: Indicator = new Indicator();
241 241
        publicationsIndicator.percentage = Number(series.series.result[0].row[0]);
......
243 243
        publicationsIndicator.total = Number(series.series.result[0].row[2]);
244 244
        europeData.publications = publicationsIndicator;
245 245

  
246
      } else if (series.series.query.name === 'new.oso.datasets.oa_percentage') {
246
      } else if (series.series.query.name === 'oso.results.oa_percentage' && series.series.query.parameters.includes('dataset')) {
247 247

  
248 248
        const datasetsIndicator: Indicator = new Indicator();
249 249
        datasetsIndicator.percentage = Number(series.series.result[0].row[0]);
......
251 251
        datasetsIndicator.total = Number(series.series.result[0].row[2]);
252 252
        europeData.datasets = datasetsIndicator;
253 253

  
254
      } else if (series.series.query.name === 'new.oso.software.oa_percentage') {
254
      } else if (series.series.query.name === 'oso.results.oa_percentage' && series.series.query.parameters.includes('software')) {
255 255

  
256 256
        const softwareIndicator: Indicator = new Indicator();
257 257
        softwareIndicator.percentage = Number(series.series.result[0].row[0]);
......
259 259
        softwareIndicator.total = Number(series.series.result[0].row[2]);
260 260
        europeData.software = softwareIndicator;
261 261

  
262
      } else if (series.series.query.name === 'new.oso.other.oa_percentage') {
262
      } else if (series.series.query.name === 'oso.results.oa_percentage' && series.series.query.parameters.includes('other')) {
263 263

  
264 264
        const otherIndicator: Indicator = new Indicator();
265 265
        otherIndicator.percentage = Number(series.series.result[0].row[0]);
......
267 267
        otherIndicator.total = Number(series.series.result[0].row[2]);
268 268
        europeData.other = otherIndicator;
269 269

  
270
      } else if (series.series.query.name === 'new.oso.repositories.doar_re3data.validated') {
270
      } else if (series.series.query.name === 'oso.repositories.doar_re3data.validated') {
271 271

  
272 272
        const repositoriesIndicator: Indicator = new Indicator();
273 273
        repositoriesIndicator.percentage = Number(series.series.result[0].row[0]);
......
275 275
        repositoriesIndicator.total = Number(series.series.result[0].row[2]);
276 276
        europeData.repositories = repositoriesIndicator;
277 277

  
278
      } else if (series.series.query.name === 'new.oso.journals.doaj.validated') {
278
      } else if (series.series.query.name === 'oso.journals.doaj.validated') {
279 279

  
280 280
        const journalsIndicator: Indicator = new Indicator();
281 281
        journalsIndicator.percentage = Number(series.series.result[0].row[0]);
......
283 283
        journalsIndicator.total = Number(series.series.result[0].row[2]);
284 284
        europeData.journals = journalsIndicator;
285 285

  
286
      } else if (series.series.query.name === 'new.oso.oa_policies.europe') {
286
      } else if (series.series.query.name === 'oso.oa_policies.europe') {
287 287

  
288 288
        const policiesIndicator: Indicator = new Indicator();
289 289
        policiesIndicator.percentage = Number(series.series.result[0].row[0]);
......
303 303

  
304 304
    for (const series of rawData.datasets) {
305 305

  
306
      if (series.series.query.name.includes('new.oso.publications')) {
306
      if (series.series.query.name.includes('oso.results') && series.series.query.parameters.includes('publication')) {
307 307
        for (const rowResult of series.series.result) {
308 308

  
309 309
          // remove unwanted countries
......
323 323
          }
324 324
        }
325 325

  
326
      } else if (series.series.query.name.includes('new.oso.datasets')) {
326
      } else if (series.series.query.name.includes('oso.results') && series.series.query.parameters.includes('dataset')) {
327 327

  
328 328
        for (const rowResult of series.series.result) {
329 329

  
......
343 343
            mapTableData.set(rowResult.row[2], countryTableData);
344 344
          }
345 345
        }
346
      } else if (series.series.query.name.includes('new.oso.software')) {
346
      } else if (series.series.query.name.includes('oso.results') && series.series.query.parameters.includes('software')) {
347 347

  
348 348
        for (const rowResult of series.series.result) {
349 349

  
......
363 363
            mapTableData.set(rowResult.row[2], countryTableData);
364 364
          }
365 365
        }
366
      } else if (series.series.query.name.includes('new.oso.other')) {
366
      } else if (series.series.query.name.includes('oso.results') && series.series.query.parameters.includes('other')) {
367 367

  
368 368
        for (const rowResult of series.series.result) {
369 369

  
......
383 383
            mapTableData.set(rowResult.row[2], countryTableData);
384 384
          }
385 385
        }
386
      } else if (series.series.query.name.includes('new.oso.repositories')) {
386
      } else if (series.series.query.name.includes('oso.repositories')) {
387 387

  
388 388
        for (const rowResult of series.series.result) {
389 389

  
......
403 403
            mapTableData.set(rowResult.row[2], countryTableData);
404 404
          }
405 405
        }
406
      } else if (series.series.query.name.includes('new.oso.journals')) {
406
      } else if (series.series.query.name.includes('oso.journals')) {
407 407

  
408 408
        for (const rowResult of series.series.result) {
409 409

  
......
442 442

  
443 443
    for (const series of rawData.datasets) {
444 444

  
445
      if (series.series.query.name.includes('new.oso.results')
445
      if (series.series.query.name.includes('oso.results')
446 446
        && series.series.query.parameters && series.series.query.parameters[0] === 'publication') {
447 447
        for (const rowResult of series.series.result) {
448 448

  
......
467 467
          }
468 468
        }
469 469

  
470
      } else if (series.series.query.name.includes('new.oso.results')
470
      } else if (series.series.query.name.includes('oso.results')
471 471
        && series.series.query.parameters && series.series.query.parameters[0] === 'dataset') {
472 472

  
473 473
        for (const rowResult of series.series.result) {
......
492 492
            mapTableData.set(rowResult.row[4], countryTableData);
493 493
          }
494 494
        }
495
      } else if (series.series.query.name.includes('new.oso.results')
495
      } else if (series.series.query.name.includes('oso.results')
496 496
        && series.series.query.parameters && series.series.query.parameters[0] === 'software') {
497 497

  
498 498
        for (const rowResult of series.series.result) {
......
517 517
            mapTableData.set(rowResult.row[4], countryTableData);
518 518
          }
519 519
        }
520
      } else if (series.series.query.name.includes('new.oso.results')
520
      } else if (series.series.query.name.includes('oso.results')
521 521
        && series.series.query.parameters && series.series.query.parameters[0] === 'other') {
522 522

  
523 523
        for (const rowResult of series.series.result) {
......
542 542
            mapTableData.set(rowResult.row[4], countryTableData);
543 543
          }
544 544
        }
545
      } else if (series.series.query.name.includes('new.oso.repositories')) {
545
      } else if (series.series.query.name.includes('oso.repositories')) {
546 546

  
547 547
        for (const rowResult of series.series.result) {
548 548

  
......
562 562
            mapTableData.set(rowResult.row[4], countryTableData);
563 563
          }
564 564
        }
565
      } else if (series.series.query.name.includes('new.oso.journals')) {
565
      } else if (series.series.query.name.includes('oso.journals')) {
566 566

  
567 567
        for (const rowResult of series.series.result) {
568 568

  
......
601 601

  
602 602
    for (const series of rawData.datasets) {
603 603

  
604
      if (series.series.query.name.includes('new.oso.results.pid_percentage')) {
604
      if (series.series.query.name.includes('oso.results.pid_percentage')) {
605 605
        for (const rowResult of series.series.result) {
606 606

  
607 607
          const pidIndicator = new Indicator();
......
633 633
          }
634 634
        }
635 635

  
636
      } else if (series.series.query.name.includes('new.oso.results.licence_percentage')) {
636
      } else if (series.series.query.name.includes('oso.results.licence_percentage')) {
637 637

  
638 638
        for (const rowResult of series.series.result) {
639 639

  
......
665 665
            mapTableData.set(rowResult.row[3], countryTableData);
666 666
          }
667 667
        }
668
      } else if (series.series.query.name.includes('new.oso.results.green_percentage')) {
668
      } else if (series.series.query.name.includes('oso.results.green_percentage')) {
669 669

  
670 670
        for (const rowResult of series.series.result) {
671 671

  
......
697 697
            mapTableData.set(rowResult.row[3], countryTableData);
698 698
          }
699 699
        }
700
      } else if (series.series.query.name.includes('new.oso.results.gold_percentage')) {
700
      } else if (series.series.query.name.includes('oso.results.gold_percentage')) {
701 701

  
702 702
        for (const rowResult of series.series.result) {
703 703

  
......
747 747
    const leadingOpenScienceData: CountryOverviewData[] = [];
748 748

  
749 749
    for (const series of rawData.datasets) {
750
      if (series.series.query.name === 'new.oso.mobile.overview') {
750
      if (series.series.query.name === 'oso.mobile.overview') {
751 751
        for (const rowResult of series.series.result) {
752 752

  
753 753
          const countryOverviewData: CountryOverviewData = new CountryOverviewData();
......
770 770

  
771 771
    for (const series of rawData.datasets) {
772 772

  
773
      if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
774
        && series.series.query.parameters && series.series.query.parameters[0] === 'publication'
773
      if ((series.series.query.name === 'oso.results.oa_percentage.country')
774
        && series.series.query.parameters && series.series.query.parameters[1] === 'publication'
775 775
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
776 776

  
777 777
        countryPageOverviewData.name = series.series.result[0].row[3];
......
783 783
        publicationsAffiliatedIndicator.total = Number(series.series.result[0].row[2]);
784 784
        countryPageOverviewData.publicationsAffiliated = publicationsAffiliatedIndicator;
785 785

  
786
      } else if ((series.series.query.name === 'new.oso.results.oa_percentage.deposited.country')
786
      } else if ((series.series.query.name === 'oso.results.oa_percentage.deposited.country')
787 787
        && series.series.query.parameters && series.series.query.parameters[0] === 'publication'
788 788
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
789 789

  
......
796 796
        publicationsDepositedIndicator.total = Number(series.series.result[0].row[2]);
797 797
        countryPageOverviewData.publicationsDeposited = publicationsDepositedIndicator;
798 798

  
799
      } else if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
800
        && series.series.query.parameters && series.series.query.parameters[0] === 'dataset'
799
      } else if ((series.series.query.name === 'oso.results.oa_percentage.country')
800
        && series.series.query.parameters && series.series.query.parameters[1] === 'dataset'
801 801
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
802 802

  
803 803
        countryPageOverviewData.name = series.series.result[0].row[3];
......
809 809
        datasetsAffiliatedIndicator.total = Number(series.series.result[0].row[2]);
810 810
        countryPageOverviewData.datasetsAffiliated = datasetsAffiliatedIndicator;
811 811

  
812
      } else if ((series.series.query.name === 'new.oso.results.oa_percentage.deposited.country')
812
      } else if ((series.series.query.name === 'oso.results.oa_percentage.deposited.country')
813 813
        && series.series.query.parameters && series.series.query.parameters[0] === 'dataset'
814 814
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
815 815

  
......
822 822
        datasetsDepositedIndicator.total = Number(series.series.result[0].row[2]);
823 823
        countryPageOverviewData.datasetsDeposited = datasetsDepositedIndicator;
824 824

  
825
      } else if (series.series.query.name === 'new.oso.repositories.doar_re3data.validated.country'
825
      } else if (series.series.query.name === 'oso.repositories.doar_re3data.validated.country'
826 826
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
827 827

  
828 828
        countryPageOverviewData.name = series.series.result[0].row[3];
......
834 834
        repositoriesIndicator.total = Number(series.series.result[0].row[2]);
835 835
        countryPageOverviewData.repositories = repositoriesIndicator;
836 836

  
837
      } else if (series.series.query.name === 'new.oso.journals.doaj.validated.country'
837
      } else if (series.series.query.name === 'oso.journals.doaj.validated.country'
838 838
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
839 839

  
840 840
        countryPageOverviewData.name = series.series.result[0].row[3];
......
846 846
        journalsIndicator.total = Number(series.series.result[0].row[2]);
847 847
        countryPageOverviewData.journals = journalsIndicator;
848 848

  
849
      } else if (series.series.query.name === 'new.oso.oa_policies.country'
849
      } else if (series.series.query.name === 'oso.oa_policies.country'
850 850
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
851 851

  
852 852
        countryPageOverviewData.policies = Number(series.series.result[0].row[0]);
853 853

  
854
      } else if (series.series.query.name === 'new.oso.rnd.country'
854
      } else if (series.series.query.name === 'oso.rnd.country'
855 855
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
856 856

  
857 857
        const rndExpenditure: RnDExpenditure = new RnDExpenditure();
......
859 859
        rndExpenditure.year = Number(series.series.result[0].row[1]);
860 860
        countryPageOverviewData.rndExpenditure = rndExpenditure;
861 861

  
862
      } else if (series.series.query.name === 'new.oso.funder.country'
862
      } else if (series.series.query.name === 'oso.funder.country'
863 863
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
864 864

  
865 865
        countryPageOverviewData.funders = Number(series.series.result[0].row[0]);
866 866

  
867
      } else if (series.series.query.name === 'new.oso.funding_organizations.country'
867
      } else if (series.series.query.name === 'oso.funding_organizations.country'
868 868
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
869 869

  
870 870
        countryPageOverviewData.fundingOrganizations = Number(series.series.result[0].row[0]);
871 871

  
872
      } else if (series.series.query.name === 'new.oso.ec_funded_organizations.country'
872
      } else if (series.series.query.name === 'oso.ec_funded_organizations.country'
873 873
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
874 874

  
875 875
        countryPageOverviewData.ec_fundedOrganizations = Number(series.series.result[0].row[0]);
......
885 885

  
886 886
    for (const series of rawData.datasets) {
887 887

  
888
      if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
889
        && series.series.query.parameters && series.series.query.parameters[0] === 'publication'
888
      if ((series.series.query.name === 'oso.results.oa_percentage.country')
889
        && series.series.query.parameters && series.series.query.parameters[1] === 'publication'
890 890
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
891 891

  
892 892
        countryPageOverviewData.name = series.series.result[0].row[3];
......
898 898
        publicationsAffiliatedIndicator.total = Number(series.series.result[0].row[2]);
899 899
        countryPageOverviewData.publicationsAffiliated = publicationsAffiliatedIndicator;
900 900

  
901
      } else  if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
902
        && series.series.query.parameters && series.series.query.parameters[0] === 'dataset'
901
      } else  if ((series.series.query.name === 'oso.results.oa_percentage.country')
902
        && series.series.query.parameters && series.series.query.parameters[1] === 'dataset'
903 903
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
904 904

  
905 905
        countryPageOverviewData.name = series.series.result[0].row[3];
......
911 911
        datasetsAffiliatedIndicator.total = Number(series.series.result[0].row[2]);
912 912
        countryPageOverviewData.datasetsAffiliated = datasetsAffiliatedIndicator;
913 913

  
914
      } else if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
915
        && series.series.query.parameters && series.series.query.parameters[0] === 'software'
914
      } else if ((series.series.query.name === 'oso.results.oa_percentage.country')
915
        && series.series.query.parameters && series.series.query.parameters[1] === 'software'
916 916
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
917 917

  
918 918
        countryPageOverviewData.name = series.series.result[0].row[3];
......
924 924
        softwareIndicator.total = Number(series.series.result[0].row[2]);
925 925
        countryPageOverviewData.software = softwareIndicator;
926 926

  
927
      } else if ((series.series.query.name === 'new.oso.results.oa_percentage.country')
928
        && series.series.query.parameters && series.series.query.parameters[0] === 'other'
927
      } else if ((series.series.query.name === 'oso.results.oa_percentage.country')
928
        && series.series.query.parameters && series.series.query.parameters[1] === 'other'
929 929
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
930 930

  
931 931
        countryPageOverviewData.name = series.series.result[0].row[3];

Also available in: Unified diff