Skip to content

Conversation

@gouttegd
Copy link
Contributor

@gouttegd gouttegd commented Feb 22, 2025

Resolves [#411]

  • docs/ have been added/updated if necessary
  • make test has been run locally
  • [ ] tests have been added/updated (if applicable)
  • CHANGELOG.md has been updated.

If you are proposing a change to the SSSOM metadata model, you must

  • [ ] provide a full, working and valid example in examples/
  • [ ] provide a link to the related GitHub issue in the see_also field of the linkml model
  • [ ] provide a link to a valid example in the see_also field of the linkml model
  • run SSSOM-Py test suite against the updated model

This PR adds the similarity_measure slot to the MappingSet class, as a propagatable slot. It should be quite common that all similarity_score for all mappings in a set are determined using the same measure, so it makes sense to allow setting the measure once and for all at the set level, without having to repeat that information for all individual mappings.

We add the `similarity_measure` slot to the MappingSet class, as a
propagatable slot. It should be quite common that all `similarity_score`
for all mappings in a set are determined using the same measure, so it
makes sense to allow setting the measure once and for all at the set
level, without having to repeat that information for all individual
mappings.

closes #411
@gouttegd gouttegd self-assigned this Feb 22, 2025
@gouttegd gouttegd requested a review from matentzn February 22, 2025 22:23
Propagatable slots must be declared as instantiating the
sssom:Propagatable interface to be properly marked as propagatable.
Copy link
Collaborator

@matentzn matentzn left a comment

Choose a reason for hiding this comment

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

I tested a schema build, and it all works as intended.

@matentzn matentzn requested a review from ehartley February 25, 2025 08:43
Copy link
Contributor

@ehartley ehartley left a comment

Choose a reason for hiding this comment

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

Looks good!

@gouttegd gouttegd merged commit de228d8 into master Mar 1, 2025
3 checks passed
@gouttegd gouttegd deleted the add-similarity-measure-on-mapping-set branch March 1, 2025 12:08
gouttegd added a commit that referenced this pull request Aug 17, 2025
- [x] `docs/` have been added/updated if necessary
- [x] `make test` has been run locally
- ~~[ ] tests have been added/updated (if applicable)~~
- ~~[ ]
[CHANGELOG.md](https://github.com/mapping-commons/sssom/blob/master/CHANGELOG.md)
has been updated.~~ Already covered by previous changes

The `added_in` annotation is used to indicate that a slot has been
introduced in a specific version of the specification. For now, that
annotation is only used in the model-wide definition of slots, which
means it can only indicate when a brand new slot has been introduced –
it can not be used to indicate that a pre-existing slot has been added
to a class in which it was not used before.

For example, the `similarity_measure` slot has existed since before 1.0,
but has been only been added to the `MappingSet` class for version 1.1.
Currently that information is _not_ contained in the model, implementers
need to check the [Model changes across
versions](https://mapping-commons.github.io/sssom/spec-model/#model-changes-across-versions)
section of the spec to be aware of that.

Likewise for `curation_rule` and `curation_rule_text`, which have just
been added to the `MappingSet` class.

In this PR, we make use of LinkML's `slot_usage` mechanism to add the
`added_in` annotation not only to the general (model-wide) definition of
a slot, but also to the specific instance of a slot within a class.

This allows to encode, directly into the model, that the use of
`similarity_measure`, `curation_rule`, and `curation_rule_text` at the
level of the `MappingSet` class is only possible starting from version
1.1.

(This really should have been done directly in the PRs that added those
slots to the `MappingSet` class – #412 and #472 –, but at the time I had
not realized that it was possible to use `slot_usage` to add annotations
to a slot only within the context of a particular class.)
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.

4 participants