SunsetProv.Scorecards<-function(recipe,data){
  graph<-data$graph.prov
  parentnodename_fcst<-graph$parentnodename$parentnodename_fcst
  parentnodename_hcst<-graph$parentnodename$parentnodename_hcst
  parentnodename_obs<-graph$parentnodename$parentnodename_obs
  measure <- unlist(strsplit(recipe$Analysis$Workflow$Scorecards$metric, " "))

  graph<-graph$graph
  chart.nodename<-"Scorecards_chart"
  graph <- add_vertices(graph,
                         nv = 1,
                         name = chart.nodename,
                         label="Scorecards",
                         className = "go:Chart"
                         )

  if(!is.null(parentnodename_fcst)){                      
    for(type in list("fcst","hcst")){
      for(names in measure){
          names<-tolower(names)
          metric.nodename<- paste0("Metrics_", type,"_",names) 
          graph <- add_edges(graph, 
                          c(getNodeIndexbyName(graph, metric.nodename),
                              getNodeIndexbyName(graph, chart.nodename)),
                          label = "go:hadGraphicalRepresentation")  
      }
    }
  } else{ 
    type="hcst"
          for(names in measure){
          names<-tolower(names)
          metric.nodename<- paste0("Metrics_",type,"_",names) 
          graph <- add_edges(graph, 
                          c(getNodeIndexbyName(graph, metric.nodename),
                              getNodeIndexbyName(graph, chart.nodename)),
                          label = "go:hadGraphicalRepresentation")
  }
  }

    if(!is.null(data$fcst)){

    graph<-SunsetProv.Command(graph, package="Scorecards", version="2.0.0", fun="modules/Scorecards/Scorecards.R", arg.list=list("recipe"="Recipe","Data"="Data"), 
                                origin.node.name=chart.nodename)
    graph<-list("graph"=graph, "parentnodename"=list("parentnodename_fcst"=parentnodename_fcst, "parentnodename_hcst"=parentnodename_hcst
                                                        ))
                                                        
    } else{

        graph<-SunsetProv.Command(graph, package="Scorecards", version="2.0.0", fun="modules/Scorecards/Scorecards.R", arg.list=list("recipe"="Recipe","Data"="Data"), 
                                 origin.node.name=chart.nodename)
        graph<-list("graph"=graph, "parentnodename"=list("parentnodename_fcst"=parentnodename_fcst, "parentnodename_hcst"=parentnodename_hcst, 
                                                        "parentnodename_obs"=parentnodename_obs))   
    }
    
  print(paste0("Scorecards provenance computed"))
  data$graph.prov<-graph
  return(data)
}