ontoDir <- system.file("extdata", "crops.rds", package = "ontologics")
onto <- load_ontology(path = ontoDir)
mapping <- data.frame(old = c("BIOENERGY CROPS", "Bioenergy woody",
"Other bioenergy crops"),
new = c("bioenergy plants", "Wood plantation for fuel",
"Algae for bioenergy"),
type = c("close", "broader", "broader"))
onto <- new_source(name = "externalDataset",
version = "0.0.1",
description = "a vocabulary",
homepage = "https://www.something.net",
license = "CC-BY-0",
ontology = onto)
onto <- get_concept(label = mapping$old, ontology = onto) %>%
new_mapping(new = mapping$new,
target = .,
match = mapping$type,
source = "externalDataset",
certainty = 3,
ontology = onto)
Run the code above in your browser using DataLab