From 73bffc301abefe2b3cd52de1b8820cfe70bb30a9 Mon Sep 17 00:00:00 2001 From: Damien Goutte-Gattat Date: Fri, 19 Jul 2024 20:56:19 +0200 Subject: [PATCH] Add min/max value constraints to score and confidence slots. (#373) Resolves #372 - [ ] `docs/` have been added/updated if necessary (not applicable; the doc was already ahead of the model, this PR is about updating the model to align it with the doc) - [x] `make test` has been run locally - [ ] tests have been added/updated (not applicable) - [x] [CHANGELOG.md](https://github.com/mapping-commons/sssom/blob/master/CHANGELOG.md) has been updated. The description of the `confidence`, `semantic_similarity_score`, and `similarity_score` slots says that those slots expect a value between 0 and 1, but the model does not enforce that. LinkML provides a way to formalise this kind of value constraints (which could then be automatically enforced by a runtime that is aware of those constraints), so we do exactly that here: we add `minimum_value` and `maximum_value` constraints to the aforementioned slots. --- CHANGELOG.md | 1 + src/sssom_schema/schema/sssom_schema.yaml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91baafbb..2ab083c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ ## SSSOM version 0.15.1 - Add recommendation to sort the keys in the YAML metadata block. +- Double-typed slots explicitly constrained to the [0.0,1.0] range, as per their description. ## SSSOM version 0.15.0 diff --git a/src/sssom_schema/schema/sssom_schema.yaml b/src/sssom_schema/schema/sssom_schema.yaml index c659037f..877ae9e5 100644 --- a/src/sssom_schema/schema/sssom_schema.yaml +++ b/src/sssom_schema/schema/sssom_schema.yaml @@ -479,6 +479,8 @@ slots: description: A score between 0 and 1 to denote the confidence or probability that the match is correct, where 1 denotes total confidence. range: double + minimum_value: 0.0 + maximum_value: 1.0 subject_match_field: description: A list of properties (term annotations on the subject) that was used for the match. @@ -558,6 +560,8 @@ slots: description: A score between 0 and 1 to denote the semantic similarity, where 1 denotes equivalence. range: double + minimum_value: 0.0 + maximum_value: 1.0 semantic_similarity_measure: description: The measure used for computing the the semantic similarity score. To make processing this field as unambiguous as possible, we recommend using @@ -570,6 +574,8 @@ slots: description: A score between 0 and 1 to denote the similarity, where 1 denotes equivalence. range: double + minimum_value: 0.0 + maximum_value: 1.0 similarity_measure: description: The measure used for computing the the similarity score. To make processing this field as unambiguous as possible, we recommend using