Project

General

Profile

1
export class Stakeholder {
2
  id: string;
3
  type: string;
4
  index_id;
5
  index_name: string;
6
  index_shortName:string;
7
  alias: string;
8
  isDefaultProfile: boolean;
9
  isActive: boolean;
10
  isPublic: boolean;
11
  creationDate: string;
12
  updateDate: string;
13
  managers: string[];
14
  topics:Topic[];
15
  constructor( id: string, type: string, index_id, index_name: string, index_shortName:string , isDefaultProfile: boolean, alias:string , isActive: boolean, isPublic: boolean){
16
    this.id = id;
17
    this.type = type;
18
    this.index_id = index_id;
19
    this.index_name = index_name;
20
    this.index_shortName = index_shortName;
21
    this.isDefaultProfile = isDefaultProfile;
22
    this.alias = alias;
23
    this.isActive = isActive;
24
    this.isPublic = isPublic;
25
    this.topics =[];
26
    this.managers =[];
27
  }
28
  static createECStakeholder():Stakeholder{
29
    let ec:Stakeholder = new Stakeholder("ec","funder","ec__________::EC","European Commission","EC",false,"ec",true,true);
30
    //  new Stakeholder('wt','funder','wt__________::WT','Wellcome Trust','WT',false, 'wt',true,true);
31
    ec.topics.push(ec.createOSTopic(ec));
32
    ec.topics.push(ec.createImpactTopic());
33
    ec.topics.push(ec.createCollaborationTopic());
34
    return ec;
35
  }
36
  createOSTopic(stakeholder:Stakeholder):Topic{
37
    let topic = new Topic("OpenScience","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...","open-science",true,true);
38

    
39
/*    let overview:Category =  new Category("Overview","","overview",true,true);
40
    topic.categories.push(overview);
41
    let overviewDefSub = new SubCategory(null, null,null,true, true);
42
    overview.subCategories.push(overviewDefSub);*/
43

    
44

    
45

    
46
    let pubCategory:Category =  new Category("Publications","","publications",true,true);
47
    topic.categories.push(pubCategory);
48
    let pubDefSub = new SubCategory(null, null,null,true, true);
49
    pubCategory.subCategories.push(pubDefSub);
50
/*    let pubOpenSub = new SubCategory("Openess","","openness",true,true);
51
    pubCategory.subCategories.push(pubOpenSub);
52
    let pubFundingSub = new SubCategory("Funding","","funding",true,true);
53
    pubCategory.subCategories.push(pubFundingSub);
54
    let pubDatasourceSub = new SubCategory("Content Providers","","content-providers",true,true);
55
    pubCategory.subCategories.push(pubDatasourceSub);
56
    let pubDocTypeSub = new SubCategory("Document Type","","doc-type",true,true);
57
    pubCategory.subCategories.push(pubDocTypeSub);
58
    let pubFindSub = new SubCategory("Findability","","dindability",true,true);
59
    pubCategory.subCategories.push(pubFindSub);*/
60

    
61

    
62
    let dataCategory:Category =  new Category("Research data","","data",true,true);
63
    topic.categories.push(dataCategory);
64
    let dataDefSub = new SubCategory(null, null,null,true, true);
65
    dataCategory.subCategories.push(dataDefSub);
66

    
67
    let softwareCategory:Category =  new Category("Software","","software",true,true);
68
    topic.categories.push(softwareCategory);
69
    let softDefSub = new SubCategory(null, null,null,true, true);
70
    softwareCategory.subCategories.push(softDefSub);
71

    
72
    let otherCategory:Category =  new Category("Other research products","","other",true,true);
73
    topic.categories.push(otherCategory);
74
    let otherDefSub = new SubCategory(null, null,null,true, true);
75
    otherCategory.subCategories.push(otherDefSub);
76

    
77
/*    let datasourceCategory:Category =  new Category("Content Providers","","content-providers",true,true);
78
    topic.categories.push(datasourceCategory);
79
    let datasourceDefSub = new SubCategory(null, null,null,true, true);
80
    datasourceCategory.subCategories.push(datasourceDefSub);*/
81

    
82
    let projectCategory:Category =  new Category("Projects","","projects",true,true);
83
    topic.categories.push(projectCategory);
84
    let projectDefSub = new SubCategory(null, null,null,true, true);
85
    projectCategory.subCategories.push(projectDefSub);
86

    
87
    //Numbers
88

    
89
    let n_total_pubs = new Indicator("Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, ["statistics","publications"])]);
90
    let n_open_pubs = new Indicator("OA Publications",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, ["statistics","open_access"])]);
91
    let n_total_projects = new Indicator("Projects",null, "number","small",true, true, [new IndicatorPath(null, "statistics","/funders/"+stakeholder.id, ["statistics","total_projects"])]);
92
    let n_total_data = new Indicator("Reserach data",null, "number","small",true, true, [new IndicatorPath(null, "search",
93
      "/datasets/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", ["total"])]);
94
    let n_total_soft = new Indicator("Software",null, "number","small",true, true, [new IndicatorPath(null, "search",
95
      "/software/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", ["total"])]);
96
    let n_total_other = new Indicator("Other research products",null, "number","small",true, true, [new IndicatorPath(null, "search",
97
      "/other/count?fq="+(encodeURIComponent("relfunderid exact "+stakeholder.index_id))+"&format=json", ["total"])]);
98

    
99
    /*overviewDefSub.numbers.push(n_total_pubs);
100
    overviewDefSub.numbers.push(n_open_pubs);
101
    overviewDefSub.numbers.push(n_total_projects);
102
    overviewDefSub.numbers.push(n_total_data);
103
    overviewDefSub.numbers.push(n_total_soft);
104
    overviewDefSub.numbers.push(n_total_other);*/
105

    
106
    pubDefSub.numbers.push(n_total_pubs);
107
    pubDefSub.numbers.push(n_open_pubs);
108
    softDefSub.numbers.push(n_total_soft);
109
    dataDefSub.numbers.push(n_total_data);
110
    otherDefSub.numbers.push(n_total_other);
111

    
112
    projectDefSub.numbers.push(n_total_projects);
113

    
114
    //Charts
115

    
116
    let c_pubs_per_project = new Indicator("Which are the top "+stakeholder.index_shortName+" projects?",null, "chart","large",true, true, [
117
      new IndicatorPath("bar", "old","chart.php?com=query&data="+encodeURIComponent('{"table":"result","fields":[{"fld":"number","agg":"count","type":"bar","yaxis":1,"c":false}],"xaxis":{"name":"result_projects-project-acronym","agg":"avg"},"group":"","color":"","type":"chart","size":30,"sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"result_projects-project-funder","values":["'+stakeholder.index_name+'"],"to":"-1"},{"name":"type","values":["publication"],"to":"-1"}],"having":[],"xStyle":{"r":"-","s":"-","l":"-","ft":"-","wt":"-"},"title":"Publications per project (top 30)","subtitle":"","xaxistitle":"project","order":"d"}'), null)]);
118
    pubDefSub.charts.push(c_pubs_per_project);
119

    
120
//TO check
121
     let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
122
       true, [new IndicatorPath("column", "old", "chart.php?com=query&data="+encodeURIComponent('{"table":"result","fields":[{"fld":"number","agg":"count","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"result_datasources-datasource-name","agg":"avg"},"group":"","color":"","type":"chart","size":"20","sort":"count-number","yaxisheaders":[""],"fieldsheaders":["publications"],"in":[],"filters":[{"name":"type","values":["publication"],"to":"-1"},{"name":"result_projects-project-funder","values":["'+stakeholder.index_name+'"],"to":"-1"},{"name":"result_datasources-datasource-type","exvalues":["Publication Catalogue"]}],"having":[],"xStyle":{"r":-90,"s":"-","l":"-","ft":10,"wt":"-"},"title":"Publications by content provider (top 20)","subtitle":"","xaxistitle":"content providers","order":"d"}'), null)]);
123
     pubDefSub.charts.push(c_pubs_per_datasource);
124

    
125
     let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
126
       [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.classification","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"publications"},"subtitle":{"text":"per document type"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Document Type"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
127
     pubDefSub.charts.push(c_pubs_per_doc_type);
128

    
129
     let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
130
       true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Open Access","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Total","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},{"field":"result.type","type":"=","values":["publication"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
131
     pubDefSub.charts.push(c_pubs_funding_scheme);
132

    
133
 /*    //TODO check why doesn't load
134
       let c_pubs_gg_funding_scheme = new Indicator("What is the percentage of green and gold publications by funding scheme / programme?",null, "chart","medium",true,
135
       true, [new IndicatorPath("bar", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Gold","color":"#f8b500","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},,{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Journal"]},{"field":"result.datasource.type","type":"=","values":["Journal Aggregator/Publisher"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}},{"name":"Green","color":"#239d60","type":"bar","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},{"field":"result.project.funding level 0","type":"=","values":["H2020"]},{"field":"result.type","type":"=","values":["publication"]},{"field":"result.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"result.datasource.type","type":"=","values":["Institutional Repository"]},{"field":"result.datasource.type","type":"=","values":["Thematic Repository"]}],"op":"OR"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"H2020 green and gold publications"},"subtitle":{"text":"by funding scheme"},"yAxis":{"title":{"text":"Publications"}},"xAxis":{"title":{"text":"Funding scheme"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
136
     //pubDefSub.charts.push(c_pubs_gg_funding_scheme);
137
 */
138

    
139
    /* let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
140
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Open Access Publications"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
141
     pubDefSub.charts.push(c_pubs_open);
142

    
143
     let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
144
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null},{"field":"publication.access mode","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by Access Mode"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
145
     pubDefSub.charts.push(c_pubs_access_modes);
146

    
147
     // let c_pubs_av_embargo = new Indicator("Average period of embargoed publications",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
148
     // pubDefSub.charts.push(c_pubs_av_embargo);
149

    
150
     let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
151
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">=","values":["2000"]},{"field":"publication.year","type":"<=","values":["2019"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
152
     pubDefSub.charts.push(c_pubs_OA_journals);
153

    
154
     //from monitor
155
     let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
156
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"OA publications","type":"column","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"contains","values":["repo"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"2000"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Publications by OA Journals"},"subtitle":{},"yAxis":{"title":{"text":"publications"}},"xAxis":{"title":{"text":"year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
157
     pubDefSub.charts.push(c_pubs_repo);
158
     //
159
     // let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
160
     //   [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
161
     // pubDefSub.charts.push(c_pubs_repo);
162

    
163
     // let c_pubs_green_year = new Indicator("How many OA publications have been submitted to repos per year?",null, "chart","medium",true, true,[new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png",  null)]);
164
     // pubDefSub.charts.push(c_pubs_green_year);
165

    
166
     let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
167
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
168
     pubDefSub.charts.push(c_pubs_datasource_country);
169

    
170
     let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
171
       [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Gold OA","type":"column","color":"#b8c91fff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.datasource.id","type":"starts_with","values":["doaj"]}],"op":"AND"},{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}},{"name":"Green OA","type":"column","color":"#0d9637ff","query":{"select":[{"field":"publication","aggregate":"count"},{"field":"publication.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"publication.year","type":">","values":["2010"]},{"field":"publication.year","type":"<","values":["2020"]}],"op":"AND"},{"groupFilters":[{"field":"publication.access mode","type":"=","values":["Open Access"]}],"op":"AND"},{"groupFilters":[{"field":"publication.datasource.type","type":"starts_with","values":["Institu"]}],"op":"AND"},{"groupFilters":[{"field":"publication.project.funder","type":"=","values":["'+stakeholder.index_name+'"]}],"op":"AND"}],"entity":"publication","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false},"stacking":"percent"}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
172
     pubDefSub.charts.push(c_pubs_funding_country);
173

    
174
     let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
175
       [new IndicatorPath("column", "stats-tool",'/chart?json='+
176
         encodeURIComponent('{"library":"HighCharts","chartDescription":{"colors":["#42a5f5","#26a69a","#90ed7d","#607d8b","#00838f","#689f38","#e4d354","#2b908f","#546e7a","#01579"],"queries":[{"name":"Data","type":"column","query":{"select":[{"field":"result","aggregate":"count"},{"field":"result.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"result.project.funder","type":"=","values":["'+stakeholder.index_name+'"]},{"field":"result.type","type":"=","values":["dataset"]},{"field":"result.year","type":">=","values":["2014"]},{"field":"result.year","type":"<=","values":["2019"]}],"op":"AND"}],"entity":"result","profile":"OpenAIRE original","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+stakeholder.index_shortName+' research data over time"},"subtitle":{},"yAxis":{"title":{"text":"Research data"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":true},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}'), null)]);
177
     dataDefSub.charts.push(c_data_year);*/
178

    
179
    // let c_other_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
180
    // otherDefSub.charts.push(c_other_year);
181
    //
182
    // let c_datasources_access_modes = new Indicator("What is the number of research data repositories by access mode?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
183
    // pubDefSub.charts.push(c_datasources_access_modes);
184
    //
185
    // let c_pub_nometa_year = new Indicator("How many publications lack of abstract per year?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
186
    // pubDefSub.charts.push(c_pub_nometa_year);
187
    //
188
    // let c_pub_meta_linked_year = new Indicator("??",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
189
    // pubDefSub.charts.push(c_pub_meta_linked_year);
190
    //
191
    // let c_pub_colocated_year = new Indicator("How many publications are submitted to more than one repos per year?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
192
    // pubDefSub.charts.push(c_pub_colocated_year);
193

    
194
    // let c_pub_pids = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
195
    // pubDefSub.charts.push(c_pub_pids);
196
    //
197
    // let c_oai_pmh_datasources = new Indicator("What is the most common PIDs by year?",null, "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
198
    // pubDefSub.charts.push(c_oai_pmh_datasources);
199

    
200
    return topic;
201
  }
202
  createImpactTopic():Topic{
203
    let topic = new Topic("Impact/Correlation","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...","impact",true,true);
204

    
205
    let pubCategory:Category =  new Category("Publications","","publications",true,true);
206
    topic.categories.push(pubCategory);
207
    let pubDefSub = new SubCategory(null, null,null,true, true);
208
    pubCategory.subCategories.push(pubDefSub);
209

    
210
    let dataCategory:Category =  new Category("Research data","","data",true,true);
211
    topic.categories.push(dataCategory);
212
    let dataDefSub = new SubCategory(null, null,null,true, true);
213
    dataCategory.subCategories.push(dataDefSub);
214

    
215
    let softwareCategory:Category =  new Category("Software","","software",true,true);
216
    topic.categories.push(softwareCategory);
217
    let softDefSub = new SubCategory(null, null,null,true, true);
218
    softwareCategory.subCategories.push(softDefSub);
219

    
220
  /*  let otherCategory:Category =  new Category("Other research products","","other",true,true);
221
    topic.categories.push(otherCategory);
222
    let otherDefSub = new SubCategory(null, null,null,true, true);
223
    otherCategory.subCategories.push(otherDefSub);*/
224

    
225

    
226
    return topic;
227
  }
228
  createCollaborationTopic():Topic{
229
    let topic = new Topic("Demo Topic","This is a demo topic","demo-topic",true,true);
230

    
231
    let category1:Category =  new Category("Category 1","This is ","cat-1",true,true);
232
    topic.categories.push(category1);
233

    
234

    
235
    let subCat1 = new SubCategory("Sub-category 1","","sub-cat-1",true,true);
236
    category1.subCategories.push(subCat1);
237

    
238

    
239
    let subCat2 = new SubCategory("Sub-category 2","","sub-cat-2",true,true);
240
    category1.subCategories.push(subCat2);
241

    
242

    
243

    
244
    let category2:Category =  new Category("Category 2 - no subcategories","","cat-2",true,true);
245
    topic.categories.push(category2);
246
    let defSub = new SubCategory(null, null,null,true, true);
247
    category2.subCategories.push(defSub);
248

    
249
    let chart1 = new Indicator("Chart title goes here","Chart description goes here", "chart","medium",true, true, [new IndicatorPath("?", "fake","https://visme.co/blog/wp-content/uploads/2017/03/Dogs-vs-Cats-How-much-they-miss-you-relative-to-the-time-you-are-gone.png", null)]);
250
    let chart2 = new Indicator("Chart title goes here","Chart description goes here", "chart","medium",true, true, [new IndicatorPath("?", "fake","https://static.boredpanda.com/blog/wp-content/uuuploads/funny-graphs-2/funny-graphs-legs.jpg", null)]);
251
    subCat1.charts.push(chart1);
252
    subCat2.charts.push(chart2);
253

    
254
    defSub.charts.push(chart1);
255
    defSub.charts.push(chart2);
256
    return topic;
257
  }
258
}
259

    
260
export class Topic {
261
  name: string;
262
  alias: string;
263
  description: string;
264
  isActive: boolean;
265
  isPublic: boolean;
266
  categories: Category[];
267
  constructor(name: string, description: string, alias:string , isActive: boolean, isPublic: boolean){
268
    this.name =  name;
269
    this.description = description;
270
    this.alias = alias;
271
    this.isActive = isActive;
272
    this.isPublic = isPublic;
273
    this.categories = [];
274
  }
275
}
276
export class Category {
277
  name: string;
278
  alias: string;
279
  description: string;
280
  isActive: boolean;
281
  isPublic: boolean;
282
  isOverview: boolean;
283
  subCategories: SubCategory[];
284
  constructor(name: string, description: string, alias:string , isActive: boolean, isPublic: boolean){
285
    this.name =  name;
286
    this.description = description;
287
    this.alias = alias;
288
    this.isActive = isActive;
289
    this.isPublic = isPublic;
290
    this.subCategories = [];
291
  }
292
}
293

    
294
export class SubCategory {
295
  name: string;
296
  alias: string;
297
  description: string;
298
  isActive: boolean;
299
  isPublic: boolean;
300
  charts: Indicator[];
301
  numbers: Indicator[];
302
  constructor(name: string, description: string, alias:string , isActive: boolean, isPublic: boolean){
303
    this.name =  name;
304
    this.description = description;
305
    this.alias = alias;
306
    this.isActive = isActive;
307
    this.isPublic = isPublic;
308
    this.charts = [];
309
    this.numbers = [];
310
  }
311

    
312
}
313
export class Indicator {
314
  id:string;
315
  name: string;
316
  description: string;
317
  type:string; //number,chart
318
  width:string; //small,medium,large
319
  tags:string[];
320
  isActive: boolean;
321
  isPublic: boolean;
322
  indicatorPaths:IndicatorPath[];
323
  constructor(name: string, description: string, type:string , width:string,  isActive: boolean, isPublic: boolean, indicatorPaths:IndicatorPath[]){
324
    this.name =  name;
325
    this.description = description;
326
    this.type =  type;
327
    this.width = width;
328
    this.isActive = isActive;
329
    this.isPublic = isPublic;
330
    this.indicatorPaths = indicatorPaths;
331
  }
332

    
333
}
334

    
335
export class IndicatorPath {
336
  type: string;  // for charts is type of chart {table, bar, column, etc}
337
  source:string;// for numbers is the service {statistics, search, metrics} for charts is the tool {stats-tool,old,metrics, fake}
338
  url: string;
339
  jsonPath:string[];
340
  constructor(type: string,  source:string, url: string, jsonPath:string[]){
341
    this.type =  type;
342
    this.url = url;
343
    this.source = source;
344
    this.jsonPath = jsonPath;
345
  }
346

    
347
}
    (1-1/1)