From 5a5899dc9047ccced53654365f8e1096cc1a669e Mon Sep 17 00:00:00 2001 From: Kevin Schaper Date: Fri, 27 Oct 2023 16:07:02 -0700 Subject: [PATCH] Add closurizer expansion slots for qualifiers field --- backend/src/monarch_py/datamodels/model.py | 26 ++++++++++++++++++++ backend/src/monarch_py/datamodels/model.yaml | 18 ++++++++++++++ frontend/src/api/model.ts | 22 ++++++++++++++++- 3 files changed, 65 insertions(+), 1 deletion(-) diff --git a/backend/src/monarch_py/datamodels/model.py b/backend/src/monarch_py/datamodels/model.py index 92e3f332e..d06276a7f 100644 --- a/backend/src/monarch_py/datamodels/model.py +++ b/backend/src/monarch_py/datamodels/model.py @@ -105,6 +105,19 @@ class Association(ConfiguredBaseModel): onset_qualifier: Optional[str] = Field(None) sex_qualifier: Optional[str] = Field(None) stage_qualifier: Optional[str] = Field(None) + qualifiers_label: Optional[str] = Field(None, description="""The name of the frequency_qualifier entity""") + qualifiers_namespace: Optional[str] = Field( + None, description="""The namespace/prefix of the frequency_qualifier entity""" + ) + qualifiers_category: Optional[str] = Field(None, description="""The category of the frequency_qualifier entity""") + qualifiers_closure: Optional[List[str]] = Field( + default_factory=list, + description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""", + ) + qualifiers_closure_label: Optional[List[str]] = Field( + default_factory=list, + description="""Field containing frequency_qualifier name and the names of all of it's ancestors""", + ) frequency_qualifier_label: Optional[str] = Field(None, description="""The name of the frequency_qualifier entity""") frequency_qualifier_namespace: Optional[str] = Field( None, description="""The namespace/prefix of the frequency_qualifier entity""" @@ -265,6 +278,19 @@ class DirectionalAssociation(Association): onset_qualifier: Optional[str] = Field(None) sex_qualifier: Optional[str] = Field(None) stage_qualifier: Optional[str] = Field(None) + qualifiers_label: Optional[str] = Field(None, description="""The name of the frequency_qualifier entity""") + qualifiers_namespace: Optional[str] = Field( + None, description="""The namespace/prefix of the frequency_qualifier entity""" + ) + qualifiers_category: Optional[str] = Field(None, description="""The category of the frequency_qualifier entity""") + qualifiers_closure: Optional[List[str]] = Field( + default_factory=list, + description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""", + ) + qualifiers_closure_label: Optional[List[str]] = Field( + default_factory=list, + description="""Field containing frequency_qualifier name and the names of all of it's ancestors""", + ) frequency_qualifier_label: Optional[str] = Field(None, description="""The name of the frequency_qualifier entity""") frequency_qualifier_namespace: Optional[str] = Field( None, description="""The namespace/prefix of the frequency_qualifier entity""" diff --git a/backend/src/monarch_py/datamodels/model.yaml b/backend/src/monarch_py/datamodels/model.yaml index 60902c9f9..612f34b8e 100644 --- a/backend/src/monarch_py/datamodels/model.yaml +++ b/backend/src/monarch_py/datamodels/model.yaml @@ -496,6 +496,24 @@ slots: is_a: in_taxon object_taxon_label: is_a: in_taxon_label + + # this whole block will be renamed to qualifer_ after we bring in the next biolink model release + qualifiers_label: + is_a: name + description: The name of the frequency_qualifier entity + qualifiers_namespace: + range: string + description: The namespace/prefix of the frequency_qualifier entity + qualifiers_category: + is_a: category + description: The category of the frequency_qualifier entity + qualifiers_closure: + multivalued: true + description: Field containing frequency_qualifier id and the ids of all of it's ancestors + qualifiers_closure_label: + multivalued: true + description: Field containing frequency_qualifier name and the names of all of it's ancestors + frequency_qualifier_label: is_a: name description: The name of the frequency_qualifier entity diff --git a/frontend/src/api/model.ts b/frontend/src/api/model.ts index 8a861812a..738d1f782 100644 --- a/frontend/src/api/model.ts +++ b/frontend/src/api/model.ts @@ -75,6 +75,16 @@ export interface Association { sex_qualifier?: string, stage_qualifier?: string, /** The name of the frequency_qualifier entity */ + qualifiers_label?: string, + /** The namespace/prefix of the frequency_qualifier entity */ + qualifiers_namespace?: string, + /** The category of the frequency_qualifier entity */ + qualifiers_category?: string, + /** Field containing frequency_qualifier id and the ids of all of it's ancestors */ + qualifiers_closure?: string[], + /** Field containing frequency_qualifier name and the names of all of it's ancestors */ + qualifiers_closure_label?: string[], + /** The name of the frequency_qualifier entity */ frequency_qualifier_label?: string, /** The namespace/prefix of the frequency_qualifier entity */ frequency_qualifier_namespace?: string, @@ -235,6 +245,16 @@ export interface DirectionalAssociation extends Association { sex_qualifier?: string, stage_qualifier?: string, /** The name of the frequency_qualifier entity */ + qualifiers_label?: string, + /** The namespace/prefix of the frequency_qualifier entity */ + qualifiers_namespace?: string, + /** The category of the frequency_qualifier entity */ + qualifiers_category?: string, + /** Field containing frequency_qualifier id and the ids of all of it's ancestors */ + qualifiers_closure?: string[], + /** Field containing frequency_qualifier name and the names of all of it's ancestors */ + qualifiers_closure_label?: string[], + /** The name of the frequency_qualifier entity */ frequency_qualifier_label?: string, /** The namespace/prefix of the frequency_qualifier entity */ frequency_qualifier_namespace?: string, @@ -481,7 +501,7 @@ export interface TermPairwiseSimilarity extends PairwiseSimilarity { cosine_similarity?: number, dice_similarity?: string, /** the geometric mean of the jaccard similarity and the information content */ - phenodigm_score?: string, + phenodigm_score?: number, }; /** * A simple pairwise similarity between two sets of concepts/terms