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
//TO check
120
    let c_pubs_per_datasource = new Indicator("Which are the top repositories containing "+stakeholder.index_shortName+" research outputs?",null, "chart","small",false,
121
      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)]);
122
    pubDefSub.charts.push(c_pubs_per_datasource);
123

    
124
    let c_pubs_per_doc_type = new Indicator("In what type of documents do your researchers used to publish?",null, "chart","small",true, true,
125
      [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)]);
126
    pubDefSub.charts.push(c_pubs_per_doc_type);
127

    
128
    let c_pubs_funding_scheme = new Indicator("What is the percentage publications by funding scheme / programme?",null, "chart","small",true,
129
      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)]);
130
    pubDefSub.charts.push(c_pubs_funding_scheme);
131

    
132
/*    //TODO check why doesn't load
133
      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,
134
      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)]);
135
    //pubDefSub.charts.push(c_pubs_gg_funding_scheme);
136
*/
137

    
138
    let c_pubs_open = new Indicator("Open Access publications timeline",null, "chart","small",true, true,
139
      [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)]);
140
    pubDefSub.charts.push(c_pubs_open);
141

    
142
    let c_pubs_access_modes = new Indicator("How your Open Access publications are shaped over the years?",null, "chart","medium",true, true,
143
      [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)]);
144
    pubDefSub.charts.push(c_pubs_access_modes);
145

    
146
    // 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)]);
147
    // pubDefSub.charts.push(c_pubs_av_embargo);
148

    
149
    let c_pubs_OA_journals = new Indicator("Publications in OA Journals over time",null, "chart","medium",true, true,
150
      [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)]);
151
    pubDefSub.charts.push(c_pubs_OA_journals);
152

    
153
    //from monitor
154
    let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
155
      [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)]);
156
    pubDefSub.charts.push(c_pubs_repo);
157
    //
158
    // let c_pubs_repo = new Indicator("OA publications in repositories by year",null, "chart","medium",true, true,
159
    //   [new IndicatorPath("column", "stats-tool", "chart?json="+encodeURIComponent('), null)]);
160
    // pubDefSub.charts.push(c_pubs_repo);
161

    
162
    // 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)]);
163
    // pubDefSub.charts.push(c_pubs_green_year);
164

    
165
    let c_pubs_datasource_country = new Indicator("What is the percentage of OA pubs by repositories over the years?",null, "chart","medium",true, true,
166
      [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)]);
167
    pubDefSub.charts.push(c_pubs_datasource_country);
168

    
169
    let c_pubs_funding_country = new Indicator("What is the percentage of OA pubs by projects over the years?",null, "chart","medium",true, true,
170
      [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)]);
171
    pubDefSub.charts.push(c_pubs_funding_country);
172

    
173
    let c_data_year = new Indicator("How your Open research data are shaped over the years?",null, "chart","medium",true, true,
174
      [new IndicatorPath("column", "stats-tool",'/chart?json='+
175
        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)]);
176
    dataDefSub.charts.push(c_data_year);
177

    
178
    // 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)]);
179
    // otherDefSub.charts.push(c_other_year);
180
    //
181
    // 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)]);
182
    // pubDefSub.charts.push(c_datasources_access_modes);
183
    //
184
    // 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)]);
185
    // pubDefSub.charts.push(c_pub_nometa_year);
186
    //
187
    // 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)]);
188
    // pubDefSub.charts.push(c_pub_meta_linked_year);
189
    //
190
    // 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)]);
191
    // pubDefSub.charts.push(c_pub_colocated_year);
192

    
193
    // 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)]);
194
    // pubDefSub.charts.push(c_pub_pids);
195
    //
196
    // 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)]);
197
    // pubDefSub.charts.push(c_oai_pmh_datasources);
198

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

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

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

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

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

    
224

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

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

    
233

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

    
237

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

    
241

    
242

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

    
248
    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)]);
249
    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)]);
250
    subCat1.charts.push(chart1);
251
    subCat2.charts.push(chart2);
252

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

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

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

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

    
332
}
333

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

    
346
}
    (1-1/1)