sunset_prov_verification<- function(recipe, data, graph_calibration, graph){
graph_main<-graph$main_graph
parentnodenames<-graph$main_graph$parentnodename
graph_fcst<-graph_calibration$anom_fcst
graph_hcst<-graph_calibration$anom_hcst
graph_obs<-graph_calibration$anom_obs

#Forecast verification node
graph <- make_empty_graph(0)
measure <- recipe$Analysis$Workflow$Skill$metric

origin.node.name <- paste0("Verification.", randomName())
      
graph <- add_vertices(graph,
                        nv = 1,
                        name = origin.node.name,
                        label="Verification step",
                        className = "veri:ForecastVerification")

#Add Verification metrics
measure <- unlist(strsplit(measure, " "))



for (names in measure){
names<-tolower(names)
label.name<-getSkillScoreLabel(names)
definition<-getSkillScoreDefinition(names)
representation<-getSkillScoreRepresentation(names)
#Conf file
node.name<- paste0("SkillScore.", randomName()) #Rename? 
graph <- add_vertices(graph,
                        nv = 1,
                        name = node.name,
                        label=label.name,
                        className = representation,
                        attr=list("dc:title"=label.name, "dc:description"=definition))

graph <- add_edges(graph, 
                    c(getNodeIndexbyName(graph, node.name),
                       getNodeIndexbyName(graph, origin.node.name)),
                      label = "veri:withForecastRepresentation")

}

graph<-my_union_graph(graph_main$graph, graph)

# Linking the verification with the hindcast
if (!is.null(graph_fcst)){
graph <- add_edges(graph, 
                    c(getNodeIndexbyName(graph, graph_fcst$parentnodename),
                       getNodeIndexbyName(graph, origin.node.name)),
                    label = "veri:hadValidation")
}

 # Linking the verification with the hindcast
graph <- add_edges(graph, 
                    c(getNodeIndexbyName(graph, graph_hcst$parentnodename),
                       getNodeIndexbyName(graph, origin.node.name)),
                    label = "veri:hadValidation")

# Linking the verification with the observations
graph <- add_edges(graph, 
                    c(getNodeIndexbyName(graph, graph_obs$parentnodename),
                        getNodeIndexbyName(graph,origin.node.name)),
                     
                    label = "veri:withReference")

parentnodename<-list(origin.node.name)    

graph <- metaclip.graph.Command(graph, "Skill", "2.0.0", "/modules/Skill/Skill.R", arg.list=list("Recipe"=recipe$Run$output_dir, "Data"),parentnodename)

graph=list("graph"=graph, "parentnodename"=parentnodename)

if(!is.null(graph_fcst)){
return(list("main_graph"=graph, "graph_fcst"=graph_fcst, "graph_hcst"=graph_hcst, "graph_obs"=graph_obs))
}else {
return(list("main_graph"=graph, "graph_hcst"=graph_hcst, "graph_obs"=graph_obs))
}

#Should add as ouput all the Skills nodes computed in case they are plotted afterwards!
}