Data source/IN.CA/data model/record/class/mapping/CDQ/transformation

From CDQ
Jump to navigation Jump to search


Part of Hierarchical relation between two concepts of the CDQ Data Model. Data source IN.CA
Mapping source The source of a data model mapping. IN.CA llpin, classLEGAL_FORM
Transformation type A type of a transformation applied to a data model mapping. CUSTOM_TRANSFORMATION"CUSTOM_TRANSFORMATION" is not in the list (UPPER_CASE, LOWER_CASE, CUSTOM) of allowed values for the "Has transformation type" property.
Transformation parameter A transformation parameter is an action proccessed by a data model transformation. n/a
Description Informal and comprehensive human-readable definition of a concept. n/a

Transformation code Any code (in Python, JAVA or other) that will transform values for a given data source attributes.

def transform(raw_data):
    legalform = raw_data.strip()
    if legalform in ["OPC", "Private One Person Company", "One Person Company", "Private(One Person Company)"]:
        return "IN_9156" # One Person Company
    elif legalform in ["Private", "Private Company"]:
        return "IN_2084" # Private Limited Company
    elif legalform in ["Public", "Public Company"]:
        return "IN_2085" # Public Limited Company
    elif legalform[0] == "A":
        return "IN_0768" # Limited Liability Partnership
    else: return None