Data source/PEPPOL/data model/businessEntity/entity/id/2/scheme/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 PEPPOL
Mapping source The source of a data model mapping. PEPPOL entity_id_2_scheme, entity_countrycodeIDENTIFIER_TYPE
Transformation type A type of a transformation applied to a data model mapping. CUSTOM
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):
    names = raw_data.split(";")
    if str.upper(names[0]) == 'VAT':
        return 'EU_VAT_ID_' + names[1].lstrip()
    elif str.upper(names[0]) == 'CBE':
        return names[1].lstrip() + '_ENT_NO'
    elif str.upper(names[0]) == 'KVK':
        return 'KVK_NL'
    elif str.upper(names[0]) == 'ORGNR':
        return 'CVR_DK'
    elif str.upper(names[0]) == 'GLN':
        return 'GS1_GLN'
    elif str.upper(names[0]) == 'CVR':
        return 'CVR_DK'
    elif str.upper(names[0]) == 'EN':
        return names[1].lstrip() + '_ENT_NO'
    elif str.upper(names[0]) == 'ORG':
        return names[1].lstrip() + '_ORG_ID'
    elif str.upper(names[0]) == 'SIRENE':
        return 'FR_SIREN'
    elif str.upper(names[0]) == 'SIRET':
        return 'FR_SIRET'
    else:
        return names[0]