diff --git a/hed/schema/schema_io/df2schema.py b/hed/schema/schema_io/df2schema.py index 1dbf0c31..42c81ddb 100644 --- a/hed/schema/schema_io/df2schema.py +++ b/hed/schema/schema_io/df2schema.py @@ -215,7 +215,6 @@ def _read_attributes(self): self._read_attribute_section(self.input_data[constants.DATA_KEY]) def _read_attribute_section(self, df, annotation_property=False, section_key=HedSectionKey.Attributes): - # todo: this needs to ALSO check range/domain(and verify they match) for row_number, row in df.iterrows(): new_entry = self._create_entry(row_number, row, section_key) if annotation_property: diff --git a/hed/schema/schema_io/df_constants.py b/hed/schema/schema_io/df_constants.py index 6cd8facd..9211d49c 100644 --- a/hed/schema/schema_io/df_constants.py +++ b/hed/schema/schema_io/df_constants.py @@ -80,15 +80,13 @@ source = "source" # for the sources section, this is the column name in the sources dataframe link = "link" type = "Type" -domain = "omn:Domain" -range = "omn:Range" properties = "Properties" # for the schema properties, this is the column name in the properties dataframe description = "description" struct_columns = [hed_id, name, attributes, subclass_of, dcdescription] tag_columns = [hed_id, name, level, subclass_of, attributes, dcdescription] unit_columns = [hed_id, name, subclass_of, has_unit_class, attributes, dcdescription] -attribute_columns = [hed_id, name, type, domain, range, properties, dcdescription] # For the annotation property +attribute_columns = [hed_id, name, type, properties, dcdescription] # For AnnotationProperty, DataProperty, and ObjectProperty property_columns = [hed_id, name, type, dcdescription] prefix_columns = [prefix, namespace, description] external_annotation_columns = [prefix, id, iri, description] @@ -105,8 +103,6 @@ # for schema attributes property_type = "Type" -property_domain = "omn:Domain" -property_range = "omn:Range" properties = "Properties" diff --git a/hed/schema/schema_io/schema2df.py b/hed/schema/schema_io/schema2df.py index a99e7cef..11168ed8 100644 --- a/hed/schema/schema_io/schema2df.py +++ b/hed/schema/schema_io/schema2df.py @@ -202,53 +202,11 @@ def _write_attribute_entry(self, entry, include_props): df_key = constants.DATA_KEY property_type = "DataProperty" - hed_id_mapping = { - "HedTag": self._get_object_id("HedTag", include_prefix=True), - "HedUnit": self._get_object_id("HedUnit", include_prefix=True), - "HedUnitClass": self._get_object_id("HedUnitClass", include_prefix=True), - "HedUnitModifier": self._get_object_id("HedUnitModifier", include_prefix=True), - "HedValueClass": self._get_object_id("HedValueClass", include_prefix=True), - "HedElement": self._get_object_id("HedElement", include_prefix=True), - "string": "xsd:string", - "boolean": "xsd:boolean", - "float": "xsd:float", - } - - domain_attributes = { - HedKey.TagDomain: "HedTag", - HedKey.UnitDomain: "HedUnit", - HedKey.UnitClassDomain: "HedUnitClass", - HedKey.UnitModifierDomain: "HedUnitModifier", - HedKey.ValueClassDomain: "HedValueClass", - HedKey.ElementDomain: "HedElement", - } - range_attributes = { - HedKey.StringRange: "string", - HedKey.TagRange: "HedTag", - HedKey.NumericRange: "float", - HedKey.BoolRange: "boolean", - HedKey.UnitRange: "HedUnit", - HedKey.UnitClassRange: "HedUnitClass", - HedKey.ValueClassRange: "HedValueClass", - } - - domain_keys = [key for key in entry.attributes if key in domain_attributes] - range_keys = [key for key in entry.attributes if key in range_attributes] - - if self._get_as_ids: - domain_string = " or ".join(hed_id_mapping[domain_attributes[key]] for key in domain_keys) - range_string = " or ".join(hed_id_mapping[range_attributes[key]] for key in range_keys) - else: - domain_string = " or ".join(domain_attributes[key] for key in domain_keys) - range_string = " or ".join(range_attributes[key] for key in range_keys) - tag_id = entry.attributes.get(HedKey.HedID, "") new_row = { constants.hed_id: f"{tag_id}", constants.name: entry.name, constants.property_type: property_type, - constants.property_domain: domain_string, - constants.property_range: range_string, constants.properties: self._format_tag_attributes(entry.attributes) if include_props else "", constants.dcdescription: entry.description, }