Get source(e) in an ontology

get_source(..., regex = FALSE, ontology = NULL)

Arguments

...

combination of column name and value to filter that column by. The value to filter by can be provided as regular expression, if regex = TRUE.

regex

logical(1)
whether or not the value in ... shall be matched in full, or whether any partial match should be returned.

ontology

ontology(1)
either a path where the ontology is stored, or an already loaded ontology.

Value

A table of the source(s) in the ontology according to the values in ...

Examples

ontoDir <- system.file("extdata", "crops.rds", package = "ontologics")
onto <- load_ontology(path = ontoDir)

# exact sources from a loaded ontology ...
get_source(label = "harmonised", ontology = onto)
#> # A tibble: 1 × 9
#>   id    label   version date       description homepage uri_prefix license notes
#>   <chr> <chr>   <chr>   <date>     <chr>       <chr>    <chr>      <chr>   <chr>
#> 1 1     harmon… 0.0.1   2022-09-13 NA          NA       NA         NA      impo…

# ... or one stored on the harddisc
get_source(version = "0.0.1", ontology = ontoDir)
#> # A tibble: 1 × 9
#>   id    label   version date       description homepage uri_prefix license notes
#>   <chr> <chr>   <chr>   <date>     <chr>       <chr>    <chr>      <chr>   <chr>
#> 1 1     harmon… 0.0.1   2022-09-13 NA          NA       NA         NA      impo…

# get all sources
get_source(ontology = onto)
#> # A tibble: 1 × 9
#>   id    label   version date       description homepage uri_prefix license notes
#>   <chr> <chr>   <chr>   <date>     <chr>       <chr>    <chr>      <chr>   <chr>
#> 1 1     harmon… 0.0.1   2022-09-13 NA          NA       NA         NA      impo…