Skip to content

Commit d67c9b2

Browse files
committed
Removed unverified omn: columns from tsv format
1 parent b607fb4 commit d67c9b2

3 files changed

Lines changed: 2 additions & 37 deletions

File tree

hed/schema/schema_io/df2schema.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ def _read_attributes(self):
215215
self._read_attribute_section(self.input_data[constants.DATA_KEY])
216216

217217
def _read_attribute_section(self, df, annotation_property=False, section_key=HedSectionKey.Attributes):
218-
# todo: this needs to ALSO check range/domain(and verify they match)
219218
for row_number, row in df.iterrows():
220219
new_entry = self._create_entry(row_number, row, section_key)
221220
if annotation_property:

hed/schema/schema_io/df_constants.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,13 @@
8080
source = "source" # for the sources section, this is the column name in the sources dataframe
8181
link = "link"
8282
type = "Type"
83-
domain = "omn:Domain"
84-
range = "omn:Range"
8583
properties = "Properties" # for the schema properties, this is the column name in the properties dataframe
8684
description = "description"
8785

8886
struct_columns = [hed_id, name, attributes, subclass_of, dcdescription]
8987
tag_columns = [hed_id, name, level, subclass_of, attributes, dcdescription]
9088
unit_columns = [hed_id, name, subclass_of, has_unit_class, attributes, dcdescription]
91-
attribute_columns = [hed_id, name, type, domain, range, properties, dcdescription] # For the annotation property
89+
attribute_columns = [hed_id, name, type, properties, dcdescription] # For the annotation property
9290
property_columns = [hed_id, name, type, dcdescription]
9391
prefix_columns = [prefix, namespace, description]
9492
external_annotation_columns = [prefix, id, iri, description]
@@ -105,8 +103,6 @@
105103

106104
# for schema attributes
107105
property_type = "Type"
108-
property_domain = "omn:Domain"
109-
property_range = "omn:Range"
110106
properties = "Properties"
111107

112108

hed/schema/schema_io/schema2df.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def _write_attribute_entry(self, entry, include_props):
202202
df_key = constants.DATA_KEY
203203
property_type = "DataProperty"
204204

205-
hed_id_mapping = {
205+
{
206206
"HedTag": self._get_object_id("HedTag", include_prefix=True),
207207
"HedUnit": self._get_object_id("HedUnit", include_prefix=True),
208208
"HedUnitClass": self._get_object_id("HedUnitClass", include_prefix=True),
@@ -214,41 +214,11 @@ def _write_attribute_entry(self, entry, include_props):
214214
"float": "xsd:float",
215215
}
216216

217-
domain_attributes = {
218-
HedKey.TagDomain: "HedTag",
219-
HedKey.UnitDomain: "HedUnit",
220-
HedKey.UnitClassDomain: "HedUnitClass",
221-
HedKey.UnitModifierDomain: "HedUnitModifier",
222-
HedKey.ValueClassDomain: "HedValueClass",
223-
HedKey.ElementDomain: "HedElement",
224-
}
225-
range_attributes = {
226-
HedKey.StringRange: "string",
227-
HedKey.TagRange: "HedTag",
228-
HedKey.NumericRange: "float",
229-
HedKey.BoolRange: "boolean",
230-
HedKey.UnitRange: "HedUnit",
231-
HedKey.UnitClassRange: "HedUnitClass",
232-
HedKey.ValueClassRange: "HedValueClass",
233-
}
234-
235-
domain_keys = [key for key in entry.attributes if key in domain_attributes]
236-
range_keys = [key for key in entry.attributes if key in range_attributes]
237-
238-
if self._get_as_ids:
239-
domain_string = " or ".join(hed_id_mapping[domain_attributes[key]] for key in domain_keys)
240-
range_string = " or ".join(hed_id_mapping[range_attributes[key]] for key in range_keys)
241-
else:
242-
domain_string = " or ".join(domain_attributes[key] for key in domain_keys)
243-
range_string = " or ".join(range_attributes[key] for key in range_keys)
244-
245217
tag_id = entry.attributes.get(HedKey.HedID, "")
246218
new_row = {
247219
constants.hed_id: f"{tag_id}",
248220
constants.name: entry.name,
249221
constants.property_type: property_type,
250-
constants.property_domain: domain_string,
251-
constants.property_range: range_string,
252222
constants.properties: self._format_tag_attributes(entry.attributes) if include_props else "",
253223
constants.dcdescription: entry.description,
254224
}

0 commit comments

Comments
 (0)