-
Notifications
You must be signed in to change notification settings - Fork 28
Allow using similarity_measure at the set level.
#412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
matentzn
reviewed
Feb 24, 2025
Propagatable slots must be declared as instantiating the sssom:Propagatable interface to be properly marked as propagatable.
matentzn
approved these changes
Feb 24, 2025
Collaborator
matentzn
left a comment
There was a problem hiding this 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.
ehartley
approved these changes
Mar 1, 2025
Contributor
ehartley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
2 tasks
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves [#411]
docs/have been added/updated if necessarymake testhas been run locally[ ] tests have been added/updated (if applicable)If you are proposing a change to the SSSOM metadata model, you must
[ ] provide a full, working and valid example inexamples/[ ] provide a link to the related GitHub issue in thesee_alsofield of the linkml model[ ] provide a link to a valid example in thesee_alsofield of the linkml modelThis PR adds the
similarity_measureslot to theMappingSetclass, as a propagatable slot. It should be quite common that allsimilarity_scorefor 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.