import {Stakeholder,Topic,Category,SubCategory,Indicator, IndicatorPath, ChartHelper} from "./stakeholder"; export class StakeholderCreator { static createFunderDefaultProfile():Stakeholder{ let funder:Stakeholder = new Stakeholder(null,"funder","_funder_id_","_funder_name_","_FSN_",true,"deafult_funder",true,true, null); funder.topics.push(StakeholderCreator.createResearchProductionTopic(funder)); funder.topics.push(StakeholderCreator.createOSTopic(funder)); let collaboration = new Topic("Collaboration","Indexes for collaboration","collaboration", true, true); collaboration.categories.push(this.createEmptyCategory("Academic Impact","","academic-impact")); collaboration.categories.push(this.createEmptyCategory("Economic Impact","","economic-impact")); collaboration.categories.push(this.createEmptyCategory("Societal Impact","","societal-impact")); funder.topics.push(collaboration); funder.topics.push(StakeholderCreator.createEmptyTopic("Diffusion","","diffusion")); let impact = new Topic("Impact", "", "impact", true, true); impact.categories.push(this.createEmptyCategory("Academic Impact","","academic-impact")); impact.categories.push(this.createEmptyCategory("Economic Impact","","economic-impact")); impact.categories.push(this.createEmptyCategory("Societal Impact","","societal-impact")); funder.topics.push(impact); return funder; } static createEmptyTopic(name: string, description: string, alias: string):Topic{ let topic = new Topic(name, description, alias, true, true); topic.categories.push(this.createEmptyCategory("Overview","","overview")); return topic; } static createEmptyCategory(name: string, description: string, alias: string):Category{ let cat:Category = new Category(name, description, alias,true,true); cat.subCategories.push(new SubCategory("Overview","","overview",true,true,true)); return cat; } static createResearchProductionTopic(stakeholder:Stakeholder):Topic { let topic = new Topic("Throughput / Output", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...", "research-production", true, true); let pubCategory:Category = new Category("Publications","","publications",true,true); topic.categories.push(pubCategory); // let pubDefSub = StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications"); pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",0)); pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",1)); pubCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Publications", "Publication","publication", "publications",2)); let dataCategory:Category = new Category("Research data","","data",true,true); topic.categories.push(dataCategory); dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",0)); dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",1)); dataCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Research data", "Research data","dataset", "datasets",2)); let softwareCategory:Category = new Category("Software","","software",true,true); topic.categories.push(softwareCategory); softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",0)); softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",1)); softwareCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Software", "Software","software", "datasets",2)); let otherCategory:Category = new Category("Other research products","","other",true,true); topic.categories.push(otherCategory); otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",0)); otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",1)); otherCategory.subCategories.push(StakeholderCreator.createResearchProductionPerType(stakeholder,"Other research products", "Other research product","other", "other",2)); return topic; } static createResearchProductionPerType(stakeholder:Stakeholder,typePlural, typeSingl, dbType, dbTypePlural, index:number):SubCategory{ let fundingFilter = ['',',{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["FP7"]}],"op":"AND"}', ',{"groupFilters":[{"field":"' + dbType + '.project.funding level 0","type":"=","values":["H2020"]}],"op":"AND"}']; let categoryTitle=["Overview","FP7","H2020"]; let chartTitle=["","FP7 ","H2020 "]; let pubDefSub = new SubCategory(categoryTitle[index], null,categoryTitle[index].toLowerCase(),true, true); if(index!=0){ pubDefSub.recommendedFor.push("ec"); } if(index==0) { let n_total = new Indicator("Total " + typePlural, null, "number", "small", true, true, [new IndicatorPath(null, "search", "/" + dbTypePlural + "/count?fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&format=json", null, ["total"])]); n_total.indicatorPaths[0].filters["fundingL0"] = "&fq=relfundinglevel0_name exact " + ChartHelper.prefix + 'fundingL0' + ChartHelper.suffix; pubDefSub.numbers.push(n_total); } if( dbType != "publication" && index == 0) { let n_linkedPubs = this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Publications","publication"); // new Indicator("Linked with Publications", null, "number", "small", true, true, [new IndicatorPath(null, "search", // "/resources?query="+encodeURIComponent(" ( (oaftype exact result) and (resulttypeid exact " + dbTypePlural + ") and (relresulttype=publication) )")+"&fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&page=0&size=0&format=json", null, ["meta","total"])]); pubDefSub.numbers.push(n_linkedPubs); } let res_timeline = new Indicator("",null, "chart","small",true, true,[new IndicatorPath("column", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+typePlural+'","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","query":{"select":[{"field":"'+dbType+'","aggregate":"count"},{"field":"'+dbType+'.year","aggregate":null}],"filters":[{"groupFilters":[{"field":"'+dbType+'.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"},{"groupFilters":[{"field":"'+dbType+'.year","type":">=","values":["'+ChartHelper.prefix+'start_year'+ChartHelper.suffix+'"]},{"field":"'+dbType+'.year","type":"<=","values":["'+ChartHelper.prefix+'end_year'+ChartHelper.suffix+'"]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"'+dbType+'","profile":"OpenAIRE All-inclusive","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'"},"subtitle":{},"yAxis":{"title":{"text":"'+typePlural+'"}},"xAxis":{"title":{"text":"Year"}},"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)]); res_timeline.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,chartTitle[index] + typePlural+" timeline","column"); res_timeline.indicatorPaths[0].parameters["start_year"] = (index == 1?"2014":"2008"); res_timeline.indicatorPaths[0].parameters["end_year"] = "2020"; res_timeline.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); pubDefSub.charts.push(res_timeline); if(dbType == "publication" || dbType == "dataset") { let res_types = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("column", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.classification","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Type"}},"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)]); res_types.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " types", "bar"); res_types.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); pubDefSub.charts.push(res_types); } let res_access_mode = new Indicator("",null, "chart","small",true, true,[new IndicatorPath("pie", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+typePlural+'","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","query":{"select":[{"field":"'+dbType+'","aggregate":"count"},{"field":"'+dbType+'.access mode","aggregate":null}],"filters":[{"groupFilters":[{"field":"'+dbType+'.project.funder","type":"=","values":["'+ChartHelper.prefix+'funder_name'+ChartHelper.suffix+'"]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"0"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'"},"subtitle":{},"yAxis":{"title":{"text":"'+typePlural+'"}},"xAxis":{"title":{"text":"Year"}},"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)]); res_access_mode.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,chartTitle[index] + typeSingl+" acccess mode","pie"); res_access_mode.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); pubDefSub.charts.push(res_access_mode); let res_sci_area = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Scientific area"}},"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)]); res_sci_area.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " scientific area", "bar"); res_sci_area.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); res_sci_area.recommendedFor = ["ec"]; pubDefSub.charts.push(res_sci_area); let res_programmes = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"select":[{"field":"' + dbType + '","aggregate":"count"},{"field":"' + dbType + '.project.funding level 2","aggregate":null}],"filters":[{"groupFilters":[{"field":"' + dbType + '.project.funder","type":"=","values":["' + ChartHelper.prefix + 'funder_name' + ChartHelper.suffix + '"]}],"op":"AND"},{"groupFilters":[{"field":"' + dbType + '.project.funding level 2","type":"!=","values":[" "]}],"op":"AND"}'+fundingFilter[index]+'],"entity":"' + dbType + '","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Programmes"}},"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)]); res_programmes.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " programmes", "bar"); res_programmes.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); res_programmes.recommendedFor = ["ec"]; pubDefSub.charts.push(res_programmes); //{"library":"HighCharts","chartDescription":{"queries":[{"name":"Research Data","type":"bar","query":{"select":[{"field":"dataset","aggregate":"count"},{"field":"dataset.project.funding level 1","aggregate":null}],"filters":[{"groupFilters":[{"field":"dataset.project.funder","type":"=","values":["European Commission"]}],"op":"AND"}],"entity":"dataset","profile":"OpenAIRE All-inclusive","limit":"30"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Scientific Area"},"subtitle":{},"yAxis":{"title":{}},"xAxis":{"title":{}},"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"}}} let datasource = new Indicator("",null, "chart","small",true, true,[new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+typePlural+'","type":"'+ChartHelper.prefix+'type'+ChartHelper.suffix+'","query":{"name":"monitor.'+ChartHelper.prefix+'id'+ChartHelper.suffix+(index==2?".h2020":(index==1?".fp7":""))+'.'+dbTypePlural+'.datasources"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"'+ChartHelper.prefix+'title'+ChartHelper.suffix+'"},"subtitle":{},"yAxis":{"title":{"text":"'+typePlural+'"}},"xAxis":{"title":{"text":"Content provider"}},"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)]); datasource.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name,chartTitle[index] + typeSingl+" content provider","bar"); datasource.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pubDefSub.charts.push(datasource); if(dbType == "publication") { let journal = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural + '.journals"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Journal"}},"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)]); journal.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " journal", "bar"); journal.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pubDefSub.charts.push(journal); let repo = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural + '.repositories"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Repositories"}},"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)]); repo.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " repositories", "bar"); repo.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pubDefSub.charts.push(repo); } if(dbType == "dataset") { let repo = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + (index==2?".h2020":(index==1?".fp7":""))+'.' + dbTypePlural + '.drepositories"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Data Repositories"}},"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)]); repo.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " repositories", "bar"); repo.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pubDefSub.charts.push(repo); let irepo = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("bar", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix +(index==2?".h2020":(index==1?".fp7":""))+ '.' + dbTypePlural + '.irepositories"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"yAxis":{"title":{"text":"' + typePlural + '"}},"xAxis":{"title":{"text":"Institutional repositories"}},"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)]); irepo.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, chartTitle[index] + typeSingl + " institutional repositories", "bar"); irepo.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pubDefSub.charts.push(irepo); } if(index ==0) { let pid = new Indicator("", null, "chart", "small", true, true, [new IndicatorPath("pie", "stats-tool", "chart?json=", '{"library":"HighCharts","chartDescription":{"queries":[{"name":"' + typePlural + '","type":"' + ChartHelper.prefix + 'type' + ChartHelper.suffix + '","query":{"name":"monitor.' + ChartHelper.prefix + 'id' + ChartHelper.suffix + '.' + dbTypePlural + '.pidtypes"}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"' + ChartHelper.prefix + 'title' + ChartHelper.suffix + '"},"subtitle":{},"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)]); pid.indicatorPaths[0].parameters = IndicatorPath.createParameters(stakeholder.index_name, typeSingl + " PIDs", "pie"); pid.indicatorPaths[0].parameters["id"] = stakeholder.index_shortName.toLowerCase(); pid.indicatorPaths[0].filters = IndicatorPath.createResultFilters(dbType); pubDefSub.charts.push(pid); } return pubDefSub; } /* static createOASub(){ let subCategories:SubCategory[] = []; let overviewSub = new SubCategory("Overview", null,"overview",true, true); subCategories.push(overviewSub); let byScientificAreaSub = new SubCategory("By Scientific Area", null,"scientific-area",true, true); subCategories.push(byScientificAreaSub); let byProgramSub = new SubCategory("By Programme", null,"programme",true, true); subCategories.push(byProgramSub); return subCategories; }*/ static createOpenAccessTopic(stakeholder:Stakeholder):Category { let category = new Category("Open Access", "", "open-access", true, true); category.subCategories.push(this.createOASub(stakeholder,"Publications","Publication","publication","publications")); category.subCategories.push(this.createOASub(stakeholder,"Research data","Research data","dataset","datasets")); category.subCategories.push(this.createOASub(stakeholder,"Software","Software","software","software")); category.subCategories.push(this.createOASub(stakeholder,"Other research products","Other research product","other","other")); return category; } static createOASub(stakeholder:Stakeholder,typePlural, typeSingl, dbType, dbTypePlural ):SubCategory { let sub:SubCategory = new SubCategory(typePlural, null, dbTypePlural, true, true); return sub; } static createOSTopic(stakeholder:Stakeholder):Topic{ let topic = new Topic("Open Science","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...","open-science",true,true); topic.categories.push(this.createOpenAccessTopic(stakeholder)); let linked:Category = new Category("Fair / Linked","","linked",true,true); topic.categories.push(linked); linked.subCategories.push(this.createOSOverviewPerType(stakeholder,"Publications","Publication","publication","publications")); linked.subCategories.push(this.createOSOverviewPerType(stakeholder,"Research data","Research data","dataset","datasets")); linked.subCategories.push(this.createOSOverviewPerType(stakeholder,"Software","Software","software","software")); linked.subCategories.push(this.createOSOverviewPerType(stakeholder,"Other research products","Other research product","other","other")); let openInfra:Category = new Category("Open Infrastructures","","open-infrastructures",true,true); openInfra.subCategories.push(new SubCategory("Overview","","overview",true,true,true)); topic.categories.push(openInfra); return topic; } static createOSOverviewPerType(stakeholder:Stakeholder,typePlural, typeSingl, dbType, dbTypePlural ):SubCategory { let pubDefSub = new SubCategory(typePlural, null, dbTypePlural, true, true); if( dbType != "publication") { pubDefSub.numbers.push(this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Publications","publication")); } if( dbType != "dataset") { pubDefSub.numbers.push(this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Research data","dataset")); } if( dbType != "software") { pubDefSub.numbers.push(this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Software","software")); } if( dbType != "other") { pubDefSub.numbers.push(this.createLinkToIndicator(stakeholder,typePlural,typeSingl, dbType,"Other Research products","other")); } return pubDefSub; } static createLinkToIndicator(stakeholder:Stakeholder,typePlural, typeSingl, dbType, linkedToName,linkedToType ):Indicator { let n_linkedPubs = new Indicator(typePlural+" linked to "+linkedToName, null, "number", "small", true, true, [new IndicatorPath(null, "search", "/resources?query=" + encodeURIComponent(" ( (oaftype exact result) and (resulttypeid exact " + dbType + ") and (relresulttype="+linkedToType+") )") + "&fq=" + (encodeURIComponent("relfunderid exact " + stakeholder.index_id)) + "&page=0&size=0&format=json", null, ["meta", "total"])]); n_linkedPubs.indicatorPaths[0].filters["fundingL0"] = "&fq=relfundinglevel0_name exact "+ChartHelper.prefix+'fundingL0'+ChartHelper.suffix; /* filters.set("start_year",'{"groupFilters":[{"field":"'+dbType+'.year","type":">=","values":["'+ChartHelper.prefix+'start_year'+ChartHelper.suffix+'"]}],"op":"AND"}'); filters.set("end_year",'{"groupFilters":[{"field":"'+dbType+'.year","type":"<=","values":["'+ChartHelper.prefix+'end_year'+ChartHelper.suffix+'"]}],"op":"AND"}'); */ return n_linkedPubs; } static createFundingImpactTopic():Topic{ let topic = new Topic("Impact/Correlation","Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do...","impact",true,true); let pubCategory:Category = new Category("Publications","","publications",true,true); topic.categories.push(pubCategory); let pubDefSub = new SubCategory(null, null,null,true, true); pubCategory.subCategories.push(pubDefSub); let dataCategory:Category = new Category("Research data","","data",true,true); topic.categories.push(dataCategory); let dataDefSub = new SubCategory(null, null,null,true, true); dataCategory.subCategories.push(dataDefSub); let softwareCategory:Category = new Category("Software","","software",true,true); topic.categories.push(softwareCategory); let softDefSub = new SubCategory(null, null,null,true, true); softwareCategory.subCategories.push(softDefSub); /* let otherCategory:Category = new Category("Other research products","","other",true,true); topic.categories.push(otherCategory); let otherDefSub = new SubCategory(null, null,null,true, true); otherCategory.subCategories.push(otherDefSub);*/ return topic; } createCollaborationTopic():Topic{ let topic = new Topic("Demo Topic","This is a demo topic","demo-topic",true,true); let category1:Category = new Category("Category 1","This is ","cat-1",true,true); topic.categories.push(category1); let subCat1 = new SubCategory("Sub-category 1","","sub-cat-1",true,true); category1.subCategories.push(subCat1); let subCat2 = new SubCategory("Sub-category 2","","sub-cat-2",true,true); category1.subCategories.push(subCat2); let category2:Category = new Category("Category 2 - no subcategories","","cat-2",true,true); topic.categories.push(category2); let defSub = new SubCategory(null, null,null,true, true); category2.subCategories.push(defSub); 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, null)]); 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, null)]); subCat1.charts.push(chart1); subCat2.charts.push(chart2); defSub.charts.push(chart1); defSub.charts.push(chart2); return topic; } }