diff --git a/Model/Import Model/examples/bsdd-minimum-import-file.json b/Model/Import Model/examples/bsdd-minimum-import-file.json new file mode 100644 index 00000000..5da3005a --- /dev/null +++ b/Model/Import Model/examples/bsdd-minimum-import-file.json @@ -0,0 +1,56 @@ +{ + "OrganizationCode": "text", + "DomainCode": "text", + "DomainVersion": "text", + "DomainName": "text", + "LanguageIsoCode": "text", + "LanguageOnly": false, + "UseOwnUri": false, + "Classifications": [ + { + "Code": "text", + "Name": "text", + "ClassificationType": "text", + "ClassificationRelations": [ + { + "RelationType": "text", + "RelatedClassificationUri": "text" + } + ], + "ClassificationProperties": [ + { + "Code": "text", + "PropertyCode": "text", + "PropertyNamespaceUri": "text", + "AllowedValues": [ + { + "Code": "text", + "Value": "text" + } + ] + } + ] + } + ], + "Properties": [ + { + "Code": "text", + "Description": "text", + "Name": "text", + + "AllowedValues": [ + { + "Code": "text", + "Value": "text" + } + ], + + "PropertyRelations": [ + { + "RelationType": "text", + "RelatedPropertyUri": "text" + } + ] + } + ], + } \ No newline at end of file diff --git a/Model/Import Model/spreadsheet-import/Python converter/Excel2bSDD_converter.py b/Model/Import Model/spreadsheet-import/Python converter/Excel2bSDD_converter.py index 55d5dfd6..79d98abb 100644 --- a/Model/Import Model/spreadsheet-import/Python converter/Excel2bSDD_converter.py +++ b/Model/Import Model/spreadsheet-import/Python converter/Excel2bSDD_converter.py @@ -44,7 +44,7 @@ def load_excel(EXCEL_PATH): excel['property'] = pd.read_excel(excel_df, 'Property', skiprows=5, usecols="C:AU", true_values="TRUE") excel['classificationproperty'] = pd.read_excel(excel_df, 'ClassificationProperty', usecols="C:T", skiprows=5, true_values="TRUE") excel['classificationrelation'] = pd.read_excel(excel_df, 'ClassificationRelation', usecols="C:G", skiprows=5, true_values="TRUE") - excel['propertyvalue'] = pd.read_excel(excel_df, 'PropertyValue', skiprows=5, usecols="C:I", true_values="TRUE") + excel['allowedvalue'] = pd.read_excel(excel_df, 'AllowedValue', skiprows=5, usecols="C:I", true_values="TRUE") excel['propertyrelation'] = pd.read_excel(excel_df, 'PropertyRelation', skiprows=5, usecols="C:F", true_values="TRUE") return excel @@ -120,8 +120,8 @@ def excel2bsdd(excel): related = cls_rel['(Origin Classification Code)'] cls_rel.pop("(Origin Classification Code)") next(item for item in bsdd_data['Classifications'] if item["Code"] == related)['ClassificationRelations'].append(cls_rel) - # process PropertyValue - prop_vals = jsonify(excel['propertyvalue'], AllowedValue) + # process AllowedValue + prop_vals = jsonify(excel['allowedvalue'], AllowedValue) for prop_val in prop_vals: # only one of the two Code columns is possible: if prop_val['(Origin Property Code)']: @@ -136,7 +136,7 @@ def excel2bsdd(excel): # iterate all properties and add AllowedValue if present in spreadsheet next(item for item in bsdd_data['Properties'] if item["Code"] == related)['AllowedValues'].append(prop_val) else: - # iterate all classifications to find the one referenced by property value + # iterate all classifications to find the one referenced by the property value for classification in bsdd_data['Classifications']: next(item for item in classification['ClassificationProperties'] if item["PropertyCode"] == related)['AllowedValues'].append(prop_val) # process PropertyRelation diff --git a/Model/Import Model/spreadsheet-import/Python converter/__pycache__/JSON_templates.cpython-310.pyc b/Model/Import Model/spreadsheet-import/Python converter/__pycache__/JSON_templates.cpython-310.pyc new file mode 100644 index 00000000..400a590b Binary files /dev/null and b/Model/Import Model/spreadsheet-import/Python converter/__pycache__/JSON_templates.cpython-310.pyc differ diff --git a/Model/Import Model/spreadsheet-import/Python converter/README.md b/Model/Import Model/spreadsheet-import/README.md similarity index 100% rename from Model/Import Model/spreadsheet-import/Python converter/README.md rename to Model/Import Model/spreadsheet-import/README.md diff --git a/Model/Import Model/spreadsheet-import/bSDD_Excel_template.xlsx b/Model/Import Model/spreadsheet-import/bSDD_Excel_template.xlsx index dcaecb58..efa2ce8d 100644 Binary files a/Model/Import Model/spreadsheet-import/bSDD_Excel_template.xlsx and b/Model/Import Model/spreadsheet-import/bSDD_Excel_template.xlsx differ