Skip to content

Change MeaningsTable.target from a link to an object-reference attribute - #97

Merged
rly merged 1 commit into
mainfrom
meaningstable-target-object-reference
Jul 7, 2026
Merged

Change MeaningsTable.target from a link to an object-reference attribute#97
rly merged 1 commit into
mainfrom
meaningstable-target-object-reference

Conversation

@rly

@rly rly commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes MeaningsTable.target (common/table.yaml) from a link to an object-reference attribute (dtype with reftype: object, target_type: VectorData), matching VectorIndex.target and DynamicTableRegion.table.

# before
links:
- name: target
  target_type: VectorData
  doc: Link to the VectorData object for which this table provides meanings.

# after
attributes:
- name: target
  dtype:
    target_type: VectorData
    reftype: object
  doc: Reference to the VectorData object for which this table provides meanings.

Rationale

hdmf-common and nwb-schema use a consistent heuristic for the two mechanisms:

  • Link points to a shared, standalone object owned elsewhere in the file, and possibly in another file since links can be external (e.g. Device, ImagingPlane, source TimeSeries).
  • Object-reference attribute/dtype points to a co-located dataset from within table/column machinery (e.g. VectorIndex.target, DynamicTableRegion.table, electrodes.group, ImageReferences).

MeaningsTable.target is the second case: it points to a VectorData column of the same DynamicTable that owns the meanings group. The API in hdmf#1376 already enforces that the target must be a column of that table, so the target is inherently co-located and the link's only unique advantage, cross-file reach, does not apply. VectorIndex.target is the exact precedent: same target type, same name, same role of annotating a column of the same table, defined as an object reference.

The link in #91 was an unexamined default. The hdmf#1376 / #91 discussions were entirely about the BaseDynamicTable inheritance question; link vs. reference was never raised.

Changes

  • common/table.yaml: MeaningsTable.target link -> object-reference attribute; reconcile docstrings ("linked" -> "referenced").
  • common/namespace.yaml: bump hdmf-common to 1.10.0.
  • docs/source/hdmf_common_release_notes.rst: add 1.10.0 entry.

Notes for reviewers

  • This is a breaking change to the 1.9.0 MeaningsTable definition. I bumped the version to 1.10.0; adjust if you prefer a different number or want to fold it into a larger release. The release-notes date is left as "Upcoming".
  • The corresponding API change in hdmf (hdmf/common/table.py) is not included here.

Verified the schema loads via HDMF 6.1.0 spec classes: target resolves to an attribute with dtype {'target_type': 'VectorData', 'reftype': 'object'} and MeaningsTable.links is empty.

PR checklist for schema changes

  • Add release notes for the PR to docs/source/hdmf_common_release_notes.rst

🤖 Generated with Claude Code

MeaningsTable.target points to a VectorData column of the same DynamicTable
that owns the meanings group. That co-located, within-table-machinery
relationship is the pattern hdmf-common and nwb-schema model with an
object-reference attribute (VectorIndex.target, DynamicTableRegion.table),
not a link. Links are used for shared, standalone objects owned elsewhere in
the file (and possibly in another file). The target here is always a column of
the same table, so the link's only unique capability, cross-file reach, does
not apply.

Reconcile the MeaningsTable docstrings ("linked" -> "referenced") and bump the
hdmf-common namespace to 1.10.0, since this is a breaking change to the 1.9.0
MeaningsTable definition.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rly
rly merged commit 4508b8f into main Jul 7, 2026
5 checks passed
@rly
rly deleted the meaningstable-target-object-reference branch July 7, 2026 00:12
rly added a commit to hdmf-dev/hdmf that referenced this pull request Jul 8, 2026
Point the submodule at 4508b8f on main, the squash-merge of
hdmf-dev/hdmf-common-schema#97, now that the schema PR is merged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rly rly mentioned this pull request Jul 20, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants