Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion hed/schema/schema_io/df2schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 1 addition & 5 deletions hed/schema/schema_io/df_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Comment on lines 86 to 90
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes the omn:Domain/omn:Range columns from the TSV schema format, but there doesn't appear to be any test asserting the updated column set (e.g., ensuring generated dataframes/TSVs no longer include these columns). Adding a regression test would help prevent these columns from being reintroduced or required again unintentionally.

Copilot uses AI. Check for mistakes.
prefix_columns = [prefix, namespace, description]
external_annotation_columns = [prefix, id, iri, description]
Expand All @@ -105,8 +103,6 @@

# for schema attributes
property_type = "Type"
property_domain = "omn:Domain"
property_range = "omn:Range"
properties = "Properties"


Expand Down
42 changes: 0 additions & 42 deletions hed/schema/schema_io/schema2df.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down