# Clarifying alias-using foreign keys

**URL:** <https://odm.discourse.group/t/clarifying-alias-using-foreign-keys/194>\
**Category:** Bugs\
**Tags:** odm-v3\
**Created:** [June 10, 2026, 9:26pm UTC](https://odm.discourse.group/t/clarifying-alias-using-foreign-keys/194 "2026-06-10T21:26:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthomson](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matthomson](https://odm.discourse.group/u/matthomson)\
**Post date:** [June 10, 2026, 9:26pm UTC](https://odm.discourse.group/t/clarifying-alias-using-foreign-keys/194/1 "2026-06-10T21:26:44Z")

</div>

In a conversation with @martinwellman, who is developing out the LinkML schema (essentially a flattened YAML version) for the ODM, we realized we don’t make it very machine readable and actionable to see which primary keys are being referenced in certain “reformulations” of those IDs in other areas.

For example, and to illustrate the issue: in the relationships tables we have (with `samples`, for example) `sampleIDsubj`, `relationshipID`, and `sampleIDobj`. The two sampleID fields, for the object and the subject, take a regular `sampleID` from the `samples` table. But nowhere in the parts list (except in free text in the description or instructions) do we actually say that.

My suggestion as a possible way to address this is to add a new column to the `parts` table: `fKAliasID`. This would then have the value of the actual primary key being referenced in situations where the name is changed, like the above.

An example of the column in practice is found below:

 ![Screenshot 2026-06-10 at 3.23.09 PM](https://global.discourse-cdn.com/free1/uploads/odm/original/1X/42f2232bbdee95a745e360d5cfcee42c4458ebc7.png)

The pros:

- Succint
- No major structural changes
- makes the key linkages explicit
- simple to implement

The cons:

- new column
- new variable (attribute)
- A column for everything in the parts list but only 21 rows actually need a value in this column (overkill, reminiscent of the ‘short names’ column).

Happy to hear any feedback on this point, particularly interested in your thoughts, @dmanuel and @jeandavidt
