From 78ba12cf154fa7cba5b80b530029356bf458c013 Mon Sep 17 00:00:00 2001 From: Mialy DeFelice Date: Mon, 11 Dec 2023 14:29:01 -0800 Subject: [PATCH 1/2] change parentOf to subclassOf to reference relationship properly and fix bug where attribute name is recorded twice --- schematic/schemas/data_model_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schematic/schemas/data_model_parser.py b/schematic/schemas/data_model_parser.py index f1684da1c..b15454513 100644 --- a/schematic/schemas/data_model_parser.py +++ b/schematic/schemas/data_model_parser.py @@ -327,6 +327,7 @@ def gather_jsonld_attributes_relationships(self, model_jsonld: List[dict]) -> Di # If not we wil use the get the label. attr_key = entry[label_jsonld_key] + # If the entry has not already been added to the dictionary, add it. if attr_key not in attr_rel_dictionary.keys(): attr_rel_dictionary.update(attr_dict_template(attr_key)) @@ -348,7 +349,7 @@ def gather_jsonld_attributes_relationships(self, model_jsonld: List[dict]) -> Di rel_entry=rel_entry, id_jsonld_key=id_jsonld_key ) rel_csv_header = self.rel_dict[rel_key]["csv_header"] - if rel_key == 'domainIncludes' or rel_key == 'parentOf': + if rel_key == 'domainIncludes' or rel_key == 'subClassOf': # In the JSONLD the domain includes field contains the ids of attributes that the current attribute is the property/parent of. # Because of this we need to handle these values differently. # We will get the values in the field (parsed_val), then add the current attribute as to the property key in the attr_rel_dictionary[p_attr_key]. From 93274faff2e01eb0769fadde1e802fe18ea1d1da Mon Sep 17 00:00:00 2001 From: Mialy DeFelice Date: Mon, 11 Dec 2023 14:31:43 -0800 Subject: [PATCH 2/2] Revert "change parentOf to subclassOf to reference relationship properly and fix bug where attribute name is recorded twice" This reverts commit 78ba12cf154fa7cba5b80b530029356bf458c013. --- schematic/schemas/data_model_parser.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/schematic/schemas/data_model_parser.py b/schematic/schemas/data_model_parser.py index b15454513..f1684da1c 100644 --- a/schematic/schemas/data_model_parser.py +++ b/schematic/schemas/data_model_parser.py @@ -327,7 +327,6 @@ def gather_jsonld_attributes_relationships(self, model_jsonld: List[dict]) -> Di # If not we wil use the get the label. attr_key = entry[label_jsonld_key] - # If the entry has not already been added to the dictionary, add it. if attr_key not in attr_rel_dictionary.keys(): attr_rel_dictionary.update(attr_dict_template(attr_key)) @@ -349,7 +348,7 @@ def gather_jsonld_attributes_relationships(self, model_jsonld: List[dict]) -> Di rel_entry=rel_entry, id_jsonld_key=id_jsonld_key ) rel_csv_header = self.rel_dict[rel_key]["csv_header"] - if rel_key == 'domainIncludes' or rel_key == 'subClassOf': + if rel_key == 'domainIncludes' or rel_key == 'parentOf': # In the JSONLD the domain includes field contains the ids of attributes that the current attribute is the property/parent of. # Because of this we need to handle these values differently. # We will get the values in the field (parsed_val), then add the current attribute as to the property key in the attr_rel_dictionary[p_attr_key].