new_concept | R Documentation |
This adds a new concept to an existing ontology to semantically integrate and thus harmonise it with the already existing ontology.
new_concept(
new,
broader = NULL,
description = NULL,
class = NULL,
ontology = NULL
)
new |
|
broader |
|
description |
|
class |
|
ontology |
|
returns invisibly a table of the new harmonised concepts that were added to the ontology, or a message that nothing new was added.
ontoDir <- system.file("extdata", "crops.rds", package = "ontologics")
onto <- load_ontology(path = ontoDir)
# add fully known concepts
concepts <- data.frame(
old = c("Bioenergy woody", "Bioenergy herbaceous"),
new = c("acacia", "miscanthus")
)
onto <- new_source(
version = "0.0.1",
name = "externalDataset",
description = "a vocabulary",
homepage = "https://www.something.net",
license = "CC-BY-0",
ontology = onto
)
onto <- new_concept(
new = concepts$new,
broader = get_concept(label = concepts$old, ontology = onto),
class = "crop",
ontology = onto
)
# add concepts where the nesting is clear, but not the new class
concepts <- data.frame(
old = c("Barley", "Barley"),
new = c("food", "bio-energy")
)
onto <- new_concept(
new = concepts$new,
broader = get_concept(label = concepts$old, ontology = onto),
ontology = onto
)
# define that class ...
onto <- new_class(
new = "use type", target = "class",
description = "the way a crop is used", ontology = onto
)
# ... and set the concepts again
onto <- new_concept(
new = concepts$new,
broader = get_concept(label = concepts$old, ontology = onto),
class = "use type",
ontology = onto
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.