Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#2024 | CSV to JSON converter for mapping to…
Browse files Browse the repository at this point in the history
… work with extras
  • Loading branch information
snyaggarwal committed Nov 28, 2024
1 parent 206c07d commit 0d112b0
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions ocldev/oclcsvtojsonconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,15 @@ class OclStandardCsvToJsonConverter(OclCsvToJsonConverter):
{'resource_field': 'source', 'column_prefix': 'map_source', 'column': 'source'},
],
},
OclCsvToJsonConverter.DEF_AUTO_ATTRIBUTES: {
'standard_column_prefix': 'attr', # e.g. 'attr:Reporting Frequency'
'separator': ':',
'key_column_prefix': 'attr_key', # 2-digit number required, e.g. attr_key[01]
'value_column_prefix': 'attr_value', # 2-digit number required, e.g. attr_value[01]
'index_prefix': AUTO_INDEX_STANDARD_PREFIX,
'index_postfix': AUTO_INDEX_STANDARD_POSTFIX,
'index_regex': AUTO_INDEX_STANDARD_REGEX,
},
},
{
'definition_name': 'Generic Auto Concept External Mappings',
Expand Down Expand Up @@ -1095,6 +1104,15 @@ class OclStandardCsvToJsonConverter(OclCsvToJsonConverter):
'column': 'source'},
],
},
OclCsvToJsonConverter.DEF_AUTO_ATTRIBUTES: {
'standard_column_prefix': 'attr', # e.g. 'attr:Reporting Frequency'
'separator': ':',
'key_column_prefix': 'attr_key', # 2-digit number required, e.g. attr_key[01]
'value_column_prefix': 'attr_value', # 2-digit number required, e.g. attr_value[01]
'index_prefix': AUTO_INDEX_STANDARD_PREFIX,
'index_postfix': AUTO_INDEX_STANDARD_POSTFIX,
'index_regex': AUTO_INDEX_STANDARD_REGEX,
},
},
{
'definition_name': 'Generic Auto Concept Reference',
Expand Down Expand Up @@ -1177,7 +1195,16 @@ class OclStandardCsvToJsonConverter(OclCsvToJsonConverter):
{'resource_field': 'owner_type', 'column': ['map_owner_type', 'owner_type'],
'default': oclconstants.OclConstants.RESOURCE_TYPE_ORGANIZATION},
{'resource_field': 'source', 'column': ['map_source', 'source']},
]
],
OclCsvToJsonConverter.DEF_AUTO_ATTRIBUTES: {
'standard_column_prefix': 'attr', # e.g. 'attr:Reporting Frequency'
'separator': ':',
'key_column_prefix': 'attr_key', # 2-digit number required, e.g. attr_key[01]
'value_column_prefix': 'attr_value', # 2-digit number required, e.g. attr_value[01]
'index_prefix': AUTO_INDEX_STANDARD_PREFIX,
'index_postfix': AUTO_INDEX_STANDARD_POSTFIX,
'index_regex': AUTO_INDEX_STANDARD_REGEX,
}
},
{
'definition_name': 'Generic Standalone External Mapping',
Expand Down Expand Up @@ -1223,7 +1250,16 @@ class OclStandardCsvToJsonConverter(OclCsvToJsonConverter):
{'resource_field': 'owner_type', 'column': ['map_owner_type', 'owner_type'],
'default': oclconstants.OclConstants.RESOURCE_TYPE_ORGANIZATION},
{'resource_field': 'source', 'column': ['map_source', 'source']},
]
],
OclCsvToJsonConverter.DEF_AUTO_ATTRIBUTES: {
'standard_column_prefix': 'attr', # e.g. 'attr:Reporting Frequency'
'separator': ':',
'key_column_prefix': 'attr_key', # 2-digit number required, e.g. attr_key[01]
'value_column_prefix': 'attr_value', # 2-digit number required, e.g. attr_value[01]
'index_prefix': AUTO_INDEX_STANDARD_PREFIX,
'index_postfix': AUTO_INDEX_STANDARD_POSTFIX,
'index_regex': AUTO_INDEX_STANDARD_REGEX,
}
},
{
'definition_name': 'Generic Collection Reference',
Expand Down

0 comments on commit 0d112b0

Please sign in to comment.