taxonomy is an S4 class to create a taxonomy object for use with smart.data.R/s4_constructs.R
taxonomy-class.RdSmart Taxonomy Constructor
taxonomy is an S4 class to create a taxonomy object for use with smart.data.
An object of class "taxonomy"
termA symbol indicating the term to be accessed with smart.data method $use(): must be of class 'language'
descA text description of the term
fieldsOne or more strings indicating the fields in smart.data$data that map to the taxonomy term
lawPassively set: used by smart.data method $enforce.rules()
stateA string indicating whether the taxonomy term has been processed by smart.data method $enforce.rules()
library(smart.data)
new("taxonomy", term = "identifier", desc = "Identifies unique instances of a type of reference")
#> An object of class "taxonomy"
#> Slot "term":
#> [1] "identifier"
#>
#> Slot "desc":
#> [1] "Identifies unique instances of a type of reference"
#>
#> Slot "fields":
#> character(0)
#>
#> Slot "law":
#> {
#> cur_fields <- self$smart.rules$for_usage[["identifier"]]@fields
#> new_fields <- if (rlang::is_empty(cur_fields) || identical(cur_fields,
#> "")) {
#> NULL
#> }
#> else {
#> names(purrr::keep(attr(self$smart.rules$for_naming, "history"),
#> function(i) any(i %in% self$smart.rules$for_usage[["identifier"]]@fields)))
#> }
#> if (!rlang::is_empty(new_fields)) {
#> self$smart.rules$for_usage[["identifier"]]@fields <- new_fields
#> }
#> invisible(self)
#> }
#>
#> Slot "state":
#> [1] "pending"
#>