Project

General

Profile

« Previous | Next » 

Revision 62830

View differences:

data-handler.service.ts
34 34

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

  
37
      if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('publication')) {
37
      if (series.series.query.name === 'new.oso.publications.peer_reviewed.affiliated') {
38 38
        overviewMapData.publications = this.rawResultToCountryMapData(series.series.result);
39 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);
......
57 57
    const joinedPublicationsMap = new Map();
58 58

  
59 59
    for (const series of rawData.datasets) {
60
      if (series.series.query.name === 'oso.results.affiliated' && series.series.query.parameters.includes('publication')) {
60
      if (series.series.query.name === 'new.oso.publications.peer_reviewed.affiliated') {
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 === 'oso.results.deposited' && series.series.query.parameters.includes('publication')) {
74
      } else if (series.series.query.name === 'new.oso.publications.peer_reviewed.deposited') {
75 75

  
76 76
        for (const rowResult of series.series.result) {
77 77
          if (joinedPublicationsMap.has(rowResult.row[1])) {
......
209 209

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

  
212
      if (series.series.query.name === 'oso.results.affiliated.country' && series.series.query.parameters.includes('publication')) {
212
      if (series.series.query.name === 'new.oso.publications.peer_reviewed.affiliated.country') {
213 213
        countryData.publicationsAffiliated = Number(series.series.result[0].row[0]);
214
      } else if (series.series.query.name === 'oso.results.deposited.country' && series.series.query.parameters.includes('publication')) {
214
      } else if (series.series.query.name === 'new.oso.publications.peer_reviewed.deposited.country') {
215 215
        countryData.publicationsDeposited = Number(series.series.result[0].row[0]);
216 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]);
......
235 235

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

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

  
240 240
        const publicationsIndicator: Indicator = new Indicator();
241 241
        publicationsIndicator.percentage = Number(series.series.result[0].row[0]);
......
613 613

  
614 614
          if (mapTableData.has(rowResult.row[3])) {
615 615
            const countryTableData = mapTableData.get(rowResult.row[3]);
616
            pidIndicator.total = Number(rowResult.row[2]);
617
            pidIndicator.oa = Number(rowResult.row[1]);
616 618
            if (rowResult.row[0] !== 'NaN') {
617
              pidIndicator.total = Number(rowResult.row[2]);
618
              pidIndicator.oa = Number(rowResult.row[1]);
619 619
              pidIndicator.percentage = Number(rowResult.row[0]);
620
              countryTableData.pid = pidIndicator;
621 620
            }
621
            countryTableData.pid = pidIndicator;
622 622
          } else {
623 623
            const countryTableData: CountryTableData = new CountryTableData();
624
            pidIndicator.total = Number(rowResult.row[2]);
625
            pidIndicator.oa = Number(rowResult.row[1]);
624 626
            if (rowResult.row[0] !== 'NaN') {
625
              pidIndicator.total = Number(rowResult.row[2]);
626
              pidIndicator.oa = Number(rowResult.row[1]);
627 627
              pidIndicator.percentage = Number(rowResult.row[0]);
628
              countryTableData.pid = pidIndicator;
629 628
            }
629
            countryTableData.pid = pidIndicator;
630 630
            countryTableData.name = rowResult.row[4];
631 631
            countryTableData.code = rowResult.row[3];
632 632
            mapTableData.set(rowResult.row[3], countryTableData);
......
646 646

  
647 647
          if (mapTableData.has(rowResult.row[3])) {
648 648
            const countryTableData = mapTableData.get(rowResult.row[3]);
649
            licenceIndicator.total = Number(rowResult.row[2]);
650
            licenceIndicator.oa = Number(rowResult.row[1]);
649 651
            if (rowResult.row[0] !== 'NaN') {
650
              licenceIndicator.total = Number(rowResult.row[2]);
651
              licenceIndicator.oa = Number(rowResult.row[1]);
652 652
              licenceIndicator.percentage = Number(rowResult.row[0]);
653
              countryTableData.licence = licenceIndicator;
654 653
            }
654
            countryTableData.licence = licenceIndicator;
655 655
          } else {
656 656
            const countryTableData: CountryTableData = new CountryTableData();
657
            licenceIndicator.total = Number(rowResult.row[2]);
658
            licenceIndicator.oa = Number(rowResult.row[1]);
657 659
            if (rowResult.row[0] !== 'NaN') {
658
              licenceIndicator.total = Number(rowResult.row[2]);
659
              licenceIndicator.oa = Number(rowResult.row[1]);
660 660
              licenceIndicator.percentage = Number(rowResult.row[0]);
661
              countryTableData.licence = licenceIndicator;
662 661
            }
662
            countryTableData.licence = licenceIndicator;
663 663
            countryTableData.name = rowResult.row[4];
664 664
            countryTableData.code = rowResult.row[3];
665 665
            mapTableData.set(rowResult.row[3], countryTableData);
......
678 678

  
679 679
          if (mapTableData.has(rowResult.row[3])) {
680 680
            const countryTableData = mapTableData.get(rowResult.row[3]);
681
            greenIndicator.total = Number(rowResult.row[2]);
682
            greenIndicator.oa = Number(rowResult.row[1]);
681 683
            if (rowResult.row[0] !== 'NaN') {
682
              greenIndicator.total = Number(rowResult.row[2]);
683
              greenIndicator.oa = Number(rowResult.row[1]);
684 684
              greenIndicator.percentage = Number(rowResult.row[0]);
685
              countryTableData.green = greenIndicator;
686 685
            }
686
            countryTableData.green = greenIndicator;
687 687
          } else {
688 688
            const countryTableData: CountryTableData = new CountryTableData();
689
            greenIndicator.total = Number(rowResult.row[2]);
690
            greenIndicator.oa = Number(rowResult.row[1]);
689 691
            if (rowResult.row[0] !== 'NaN') {
690
              greenIndicator.total = Number(rowResult.row[2]);
691
              greenIndicator.oa = Number(rowResult.row[1]);
692 692
              greenIndicator.percentage = Number(rowResult.row[0]);
693
              countryTableData.green = greenIndicator;
694 693
            }
694
            countryTableData.green = greenIndicator;
695 695
            countryTableData.name = rowResult.row[4];
696 696
            countryTableData.code = rowResult.row[3];
697 697
            mapTableData.set(rowResult.row[3], countryTableData);
......
710 710

  
711 711
          if (mapTableData.has(rowResult.row[3])) {
712 712
            const countryTableData = mapTableData.get(rowResult.row[3]);
713
            goldIndicator.total = Number(rowResult.row[2]);
714
            goldIndicator.oa = Number(rowResult.row[1]);
713 715
            if (rowResult.row[0] !== 'NaN') {
714
              goldIndicator.total = Number(rowResult.row[2]);
715
              goldIndicator.oa = Number(rowResult.row[1]);
716 716
              goldIndicator.percentage = Number(rowResult.row[0]);
717
              countryTableData.gold = goldIndicator;
718 717
            }
718
            countryTableData.gold = goldIndicator;
719 719
          } else {
720 720
            const countryTableData: CountryTableData = new CountryTableData();
721
            goldIndicator.total = Number(rowResult.row[2]);
722
            goldIndicator.oa = Number(rowResult.row[1]);
721 723
            if (rowResult.row[0] !== 'NaN') {
722
              goldIndicator.total = Number(rowResult.row[2]);
723
              goldIndicator.oa = Number(rowResult.row[1]);
724 724
              goldIndicator.percentage = Number(rowResult.row[0]);
725
              countryTableData.gold = goldIndicator;
726 725
            }
726
            countryTableData.gold = goldIndicator;
727 727
            countryTableData.name = rowResult.row[4];
728 728
            countryTableData.code = rowResult.row[3];
729 729
            mapTableData.set(rowResult.row[3], countryTableData);
730 730
          }
731 731
        }
732
      } else if (series.series.query.name.includes('oso.results.cc_licence_percentage')) {
733

  
734
        for (const rowResult of series.series.result) {
735

  
736
          const ccLicenceIndicator = new Indicator();
737

  
738
          // remove unwanted countries
739
          if (this.isCountryToBeRemoved(rowResult.row[3])) {
740
            continue;
741
          }
742

  
743
          if (mapTableData.has(rowResult.row[3])) {
744
            const countryTableData = mapTableData.get(rowResult.row[3]);
745
            ccLicenceIndicator.total = Number(rowResult.row[2]);
746
            ccLicenceIndicator.oa = Number(rowResult.row[1]);
747
            if (rowResult.row[0] !== 'NaN') {
748
              ccLicenceIndicator.percentage = Number(rowResult.row[0]);
749
            }
750
            countryTableData.cc_licence = ccLicenceIndicator;
751
          } else {
752
            const countryTableData: CountryTableData = new CountryTableData();
753
            ccLicenceIndicator.total = Number(rowResult.row[2]);
754
            ccLicenceIndicator.oa = Number(rowResult.row[1]);
755
            if (rowResult.row[0] !== 'NaN') {
756
              ccLicenceIndicator.percentage = Number(rowResult.row[0]);
757
            }
758
            countryTableData.cc_licence = ccLicenceIndicator;
759
            countryTableData.name = rowResult.row[4];
760
            countryTableData.code = rowResult.row[3];
761
            mapTableData.set(rowResult.row[3], countryTableData);
762
          }
763
        }
764
      } else if (series.series.query.name.includes('oso.results.abstract_percentage')) {
765

  
766
        for (const rowResult of series.series.result) {
767

  
768
          const abstractIndicator = new Indicator();
769

  
770
          // remove unwanted countries
771
          if (this.isCountryToBeRemoved(rowResult.row[3])) {
772
            continue;
773
          }
774

  
775
          if (mapTableData.has(rowResult.row[3])) {
776
            const countryTableData = mapTableData.get(rowResult.row[3]);
777
            abstractIndicator.total = Number(rowResult.row[2]);
778
            abstractIndicator.oa = Number(rowResult.row[1]);
779
            if (rowResult.row[0] !== 'NaN') {
780
              abstractIndicator.percentage = Number(rowResult.row[0]);
781
            }
782
            countryTableData.abstract = abstractIndicator;
783
          } else {
784
            const countryTableData: CountryTableData = new CountryTableData();
785
            abstractIndicator.total = Number(rowResult.row[2]);
786
            abstractIndicator.oa = Number(rowResult.row[1]);
787
            if (rowResult.row[0] !== 'NaN') {
788
              abstractIndicator.percentage = Number(rowResult.row[0]);
789
            }
790
            countryTableData.abstract = abstractIndicator;
791
            countryTableData.name = rowResult.row[4];
792
            countryTableData.code = rowResult.row[3];
793
            mapTableData.set(rowResult.row[3], countryTableData);
794
          }
795
        }
796
      } else if (series.series.query.name.includes('new.oso.results.funders_collab_percentage')) {
797

  
798
        for (const rowResult of series.series.result) {
799

  
800
          const fundersCollabIndicator = new Indicator();
801

  
802
          // remove unwanted countries
803
          if (this.isCountryToBeRemoved(rowResult.row[3])) {
804
            continue;
805
          }
806

  
807
          if (mapTableData.has(rowResult.row[3])) {
808
            const countryTableData = mapTableData.get(rowResult.row[3]);
809
            fundersCollabIndicator.total = Number(rowResult.row[2]);
810
            fundersCollabIndicator.oa = Number(rowResult.row[1]);
811
            if (rowResult.row[0] !== 'NaN') {
812
              fundersCollabIndicator.percentage = Number(rowResult.row[0]);
813
            }
814
            countryTableData.funders_collab = fundersCollabIndicator;
815
          } else {
816
            const countryTableData: CountryTableData = new CountryTableData();
817
            fundersCollabIndicator.total = Number(rowResult.row[2]);
818
            fundersCollabIndicator.oa = Number(rowResult.row[1]);
819
            if (rowResult.row[0] !== 'NaN') {
820
              fundersCollabIndicator.percentage = Number(rowResult.row[0]);
821
            }
822
            countryTableData.funders_collab = fundersCollabIndicator;
823
            countryTableData.name = rowResult.row[4];
824
            countryTableData.code = rowResult.row[3];
825
            mapTableData.set(rowResult.row[3], countryTableData);
826
          }
827
        }
828
      } else if (series.series.query.name.includes('new.oso.results.projects_collab_percentage')) {
829

  
830
        for (const rowResult of series.series.result) {
831

  
832
          const projectsCollabIndicator = new Indicator();
833

  
834
          // remove unwanted countries
835
          if (this.isCountryToBeRemoved(rowResult.row[3])) {
836
            continue;
837
          }
838

  
839
          if (mapTableData.has(rowResult.row[3])) {
840
            const countryTableData = mapTableData.get(rowResult.row[3]);
841
            projectsCollabIndicator.total = Number(rowResult.row[2]);
842
            projectsCollabIndicator.oa = Number(rowResult.row[1]);
843
            if (rowResult.row[0] !== 'NaN') {
844
              projectsCollabIndicator.percentage = Number(rowResult.row[0]);
845
            }
846
            countryTableData.projects_collab = projectsCollabIndicator;
847
          } else {
848
            const countryTableData: CountryTableData = new CountryTableData();
849
            projectsCollabIndicator.total = Number(rowResult.row[2]);
850
            projectsCollabIndicator.oa = Number(rowResult.row[1]);
851
            if (rowResult.row[0] !== 'NaN') {
852
              projectsCollabIndicator.percentage = Number(rowResult.row[0]);
853
            }
854
            countryTableData.projects_collab = projectsCollabIndicator;
855
            countryTableData.name = rowResult.row[4];
856
            countryTableData.code = rowResult.row[3];
857
            mapTableData.set(rowResult.row[3], countryTableData);
858
          }
859
        }
860
      } else if (series.series.query.name.includes('new.oso.results.authors_collab_percentage')) {
861

  
862
        for (const rowResult of series.series.result) {
863

  
864
          const authorsCollabIndicator = new Indicator();
865

  
866
          // remove unwanted countries
867
          if (this.isCountryToBeRemoved(rowResult.row[3])) {
868
            continue;
869
          }
870

  
871
          if (mapTableData.has(rowResult.row[3])) {
872
            const countryTableData = mapTableData.get(rowResult.row[3]);
873
            authorsCollabIndicator.total = Number(rowResult.row[2]);
874
            authorsCollabIndicator.oa = Number(rowResult.row[1]);
875
            if (rowResult.row[0] !== 'NaN') {
876
              authorsCollabIndicator.percentage = Number(rowResult.row[0]);
877
            }
878
            countryTableData.authors_collab = authorsCollabIndicator;
879
          } else {
880
            const countryTableData: CountryTableData = new CountryTableData();
881
            authorsCollabIndicator.total = Number(rowResult.row[2]);
882
            authorsCollabIndicator.oa = Number(rowResult.row[1]);
883
            if (rowResult.row[0] !== 'NaN') {
884
              authorsCollabIndicator.percentage = Number(rowResult.row[0]);
885
            }
886
            countryTableData.authors_collab = authorsCollabIndicator;
887
            countryTableData.name = rowResult.row[4];
888
            countryTableData.code = rowResult.row[3];
889
            mapTableData.set(rowResult.row[3], countryTableData);
890
          }
891
        }
732 892
      }
733 893
    }
734 894

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

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

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

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

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

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

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

  
790 948
        countryPageOverviewData.name = series.series.result[0].row[3];
......
873 1031
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
874 1032

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

  
1035
      } else if (series.series.query.name === 'new.oso.ec_funded_projects.country'
1036
        && series.series.result && series.series.result.length > 0 && series.series.result[0].row) {
1037

  
1038
        countryPageOverviewData.ec_fundedProjects = Number(series.series.result[0].row[0]);
876 1039
      }
877 1040
    }
878 1041

  
......
885 1048

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

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

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

Also available in: Unified diff