
Create a Registry Object
Registry.RdAn S7 class that defines rules for validating data against a Schema.
Value
An S7 Registry object with the following properties:
rule_namesAll rule names, in order of evaluation. Derived from
control/transform/validaterules withapply_lastadded to the end.- 'control_rules
Rules that influence the control flow. These will be applied in the first pass when validating data.
- 'transform_rules'
Rules that transform data. These will be applied in the second pass when validating data.
- 'validate_rules'
Rules that validate data. These will be applied in the penultimate pass when validating (the last pass is the special
apply_lastpass - see details).str_to_fn_rulesSchema rules that are allowed to have string or function values, with string values being converted to functions automatically during schema validation.
str_to_fn_converterA function that converts string values to functions for the
str_to_fn_rules.type_namesA character vector of allowed type names, derived from the keys of the
type_mapenvironment.type_mapAn environment mapping type names to type definition functions.
coerce_namesA character vector of allowed coercion rule names, derived from the keys of the
coerce_mapenvironment.coerce_mapAn environment mapping type names to coercion functions.
rule_namesA character vector of all (non-cross) rule names.
schema_rulesAn environment containing the schema rule functions.
cross_rule_namesA character vector of allowed schema cross rule names, derived from the keys of the
cross_rulesenvironment.cross_rulesAn environment containing the schema cross rule functions (rules that check relationships between multiple schema rule values).
validator_rulesAn environment containing the validator rule functions.
Details
The Registry class serves as a central repository for all the rules used in
schema and data validation for RV based workflows. It includes builtin
rules for common validation tasks and allows for the addition of custom
rules.
Registry objects are automatically created in Schema objects
(which are passed to Validator objects), and rules can be added to the
registry directly within those objects by using the rule-adding generic
functions. It is therefore not necessary to create a Registry object
separately if one does not wish.
However, Schema and Validator objects are automatically re-validated
when rules are added, so for the addition of many new rules, it is
beneficial to create a Registry object, add all the rules to it, and
then pass it to the other classes.
For full details see the helper function show_RV_builtins() or the
rules vignette.