Skip to content

Commit f72e627

Browse files
committed
update Excel template with AllowedValue instead of PropertyValue
1 parent cc8d7fe commit f72e627

5 files changed

Lines changed: 60 additions & 4 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"OrganizationCode": "text",
3+
"DomainCode": "text",
4+
"DomainVersion": "text",
5+
"DomainName": "text",
6+
"LanguageIsoCode": "text",
7+
"LanguageOnly": false,
8+
"UseOwnUri": false,
9+
"Classifications": [
10+
{
11+
"Code": "text",
12+
"Name": "text",
13+
"ClassificationType": "text",
14+
"ClassificationRelations": [
15+
{
16+
"RelationType": "text",
17+
"RelatedClassificationUri": "text"
18+
}
19+
],
20+
"ClassificationProperties": [
21+
{
22+
"Code": "text",
23+
"PropertyCode": "text",
24+
"PropertyNamespaceUri": "text",
25+
"AllowedValues": [
26+
{
27+
"Code": "text",
28+
"Value": "text"
29+
}
30+
]
31+
}
32+
]
33+
}
34+
],
35+
"Properties": [
36+
{
37+
"Code": "text",
38+
"Description": "text",
39+
"Name": "text",
40+
41+
"AllowedValues": [
42+
{
43+
"Code": "text",
44+
"Value": "text"
45+
}
46+
],
47+
48+
"PropertyRelations": [
49+
{
50+
"RelationType": "text",
51+
"RelatedPropertyUri": "text"
52+
}
53+
]
54+
}
55+
],
56+
}

Model/Import Model/spreadsheet-import/Python converter/Excel2bSDD_converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def load_excel(EXCEL_PATH):
4444
excel['property'] = pd.read_excel(excel_df, 'Property', skiprows=5, usecols="C:AU", true_values="TRUE")
4545
excel['classificationproperty'] = pd.read_excel(excel_df, 'ClassificationProperty', usecols="C:T", skiprows=5, true_values="TRUE")
4646
excel['classificationrelation'] = pd.read_excel(excel_df, 'ClassificationRelation', usecols="C:G", skiprows=5, true_values="TRUE")
47-
excel['propertyvalue'] = pd.read_excel(excel_df, 'PropertyValue', skiprows=5, usecols="C:I", true_values="TRUE")
47+
excel['allowedvalue'] = pd.read_excel(excel_df, 'AllowedValue', skiprows=5, usecols="C:I", true_values="TRUE")
4848
excel['propertyrelation'] = pd.read_excel(excel_df, 'PropertyRelation', skiprows=5, usecols="C:F", true_values="TRUE")
4949
return excel
5050

@@ -120,8 +120,8 @@ def excel2bsdd(excel):
120120
related = cls_rel['(Origin Classification Code)']
121121
cls_rel.pop("(Origin Classification Code)")
122122
next(item for item in bsdd_data['Classifications'] if item["Code"] == related)['ClassificationRelations'].append(cls_rel)
123-
# process PropertyValue
124-
prop_vals = jsonify(excel['propertyvalue'], AllowedValue)
123+
# process AllowedValue
124+
prop_vals = jsonify(excel['allowedvalue'], AllowedValue)
125125
for prop_val in prop_vals:
126126
# only one of the two Code columns is possible:
127127
if prop_val['(Origin Property Code)']:
@@ -136,7 +136,7 @@ def excel2bsdd(excel):
136136
# iterate all properties and add AllowedValue if present in spreadsheet
137137
next(item for item in bsdd_data['Properties'] if item["Code"] == related)['AllowedValues'].append(prop_val)
138138
else:
139-
# iterate all classifications to find the one referenced by property value
139+
# iterate all classifications to find the one referenced by the property value
140140
for classification in bsdd_data['Classifications']:
141141
next(item for item in classification['ClassificationProperties'] if item["PropertyCode"] == related)['AllowedValues'].append(prop_val)
142142
# process PropertyRelation
Binary file not shown.

Model/Import Model/spreadsheet-import/Python converter/README.md renamed to Model/Import Model/spreadsheet-import/README.md

File renamed without changes.
202 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)