Skip to contents

Creates a new concept that inherits from a template, optionally customizing parameter values. The SQL expression is generated by substituting parameters in the template's base expression.

Usage

ont_inherit_concept(
  concept_id,
  template_id,
  scope,
  parameter_values = list(),
  inheritance_type = "extends",
  deviation_notes = NULL,
  description = NULL,
  owner_domain = NULL,
  status = "draft",
  rationale = NULL,
  created_by = NULL,
  con = NULL
)

Arguments

concept_id

Character. Unique identifier for the new concept.

template_id

Character. The template to inherit from.

scope

Character. Scope for the initial version.

parameter_values

Named list. Parameter values to override defaults.

inheritance_type

Character. Type of inheritance: "extends" (default), "implements", or "adapts".

deviation_notes

Character. Notes explaining how this variant differs from the base template.

description

Character. Description of this specific concept variant.

owner_domain

Character. Domain that owns this concept.

status

Character. Initial status for the version. Default "draft".

rationale

Character. Rationale for this version.

created_by

Character. Who created this.

con

A DBI connection. If NULL, uses the active connection.

Value

Invisibly returns the concept_id.

Details

The function:

  1. Loads the template and its parameter definitions

  2. Merges provided parameter_values with template defaults

  3. Substitutes parameters into the base SQL expression

  4. Creates the concept and initial version

  5. Records the inheritance relationship

Examples

if (FALSE) { # \dontrun{
# Create Ireland-specific unemployed concept from ILO template
ont_inherit_concept(
    concept_id = "unemployed_ireland",
    template_id = "ilo_unemployed",
    scope = "ireland",
    parameter_values = list(
        min_age = 16,
        max_age = 66
    ),
    deviation_notes = "Ireland uses 16-66 age range per CSO guidelines",
    description = "CSO Ireland unemployment definition based on ILO standards"
)
} # }