Skip to content

Commit

Permalink
Add species_context_qualifier, remove closure expansion on most quali…
Browse files Browse the repository at this point in the history
…fiers (#904)

Schema tidying that is tightly coupled with the 2024-11 KG build
  • Loading branch information
kevinschaper authored Nov 19, 2024
1 parent ce0851b commit 98cbf26
Show file tree
Hide file tree
Showing 38 changed files with 106,813 additions and 115,378 deletions.
4 changes: 1 addition & 3 deletions backend/src/monarch_py/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def schema():
"""
schema_name = "model"
import_path = f"monarch_py.datamodels.{schema_name}"
schema_module_spec = importlib.util.find_spec(
f"monarch_py.datamodels.{schema_name}"
)
schema_module_spec = importlib.util.find_spec(f"monarch_py.datamodels.{schema_name}")
if schema_module_spec is None or schema_module_spec.origin is None:
print(f"No python module found at {import_path}")
raise typer.Exit(code=1)
Expand Down
192 changes: 72 additions & 120 deletions backend/src/monarch_py/datamodels/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -662,16 +662,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "qualifiers_category", "domain_of": ["Association"], "is_a": "category"}
},
)
qualifiers_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifiers_closure", "domain_of": ["Association"]}},
)
qualifiers_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifiers_closure_label", "domain_of": ["Association"]}},
)
qualifier: Optional[List[str]] = Field(
None, json_schema_extra={"linkml_meta": {"alias": "qualifier", "domain_of": ["Association"]}}
)
Expand All @@ -692,16 +682,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifier_closure", "domain_of": ["Association"]}},
)
qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifier_closure_label", "domain_of": ["Association"]}},
)
frequency_qualifier_label: Optional[str] = Field(
None,
description="""The name of the frequency_qualifier entity""",
Expand All @@ -721,16 +701,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "frequency_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
frequency_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "frequency_qualifier_closure", "domain_of": ["Association"]}},
)
frequency_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "frequency_qualifier_closure_label", "domain_of": ["Association"]}},
)
onset_qualifier_label: Optional[str] = Field(
None,
description="""The name of the onset_qualifier entity""",
Expand All @@ -750,16 +720,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "onset_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
onset_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing onset_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "onset_qualifier_closure", "domain_of": ["Association"]}},
)
onset_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing onset_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "onset_qualifier_closure_label", "domain_of": ["Association"]}},
)
sex_qualifier_label: Optional[str] = Field(
None,
description="""The name of the sex_qualifier entity""",
Expand All @@ -779,16 +739,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "sex_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
sex_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing sex_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "sex_qualifier_closure", "domain_of": ["Association"]}},
)
sex_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing sex_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "sex_qualifier_closure_label", "domain_of": ["Association"]}},
)
stage_qualifier_label: Optional[str] = Field(
None,
description="""The name of the stage_qualifier entity""",
Expand All @@ -808,16 +758,6 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "stage_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
stage_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing stage_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "stage_qualifier_closure", "domain_of": ["Association"]}},
)
stage_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing stage_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "stage_qualifier_closure_label", "domain_of": ["Association"]}},
)
disease_context_qualifier: Optional[str] = Field(
None,
description="""A context qualifier representing a disease or condition in which a relationship expressed in an association took place.""",
Expand Down Expand Up @@ -866,6 +806,42 @@ class Association(ConfiguredBaseModel):
"linkml_meta": {"alias": "disease_context_qualifier_closure_label", "domain_of": ["Association"]}
},
)
species_context_qualifier: Optional[str] = Field(
None,
description="""A context qualifier representing a species in which a relationship expressed in an association took place.""",
json_schema_extra={
"linkml_meta": {
"alias": "species_context_qualifier",
"domain_of": ["Association"],
"examples": [{"value": "NCBITaxon:9606"}],
}
},
)
species_context_qualifier_label: Optional[str] = Field(
None,
description="""The name of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {"alias": "species_context_qualifier_label", "domain_of": ["Association"], "is_a": "name"}
},
)
species_context_qualifier_namespace: Optional[str] = Field(
None,
description="""The namespace/prefix of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {"alias": "species_context_qualifier_namespace", "domain_of": ["Association"]}
},
)
species_context_qualifier_category: Optional[str] = Field(
None,
description="""The category of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {
"alias": "species_context_qualifier_category",
"domain_of": ["Association"],
"is_a": "category",
}
},
)


class AssociationCountList(ConfiguredBaseModel):
Expand Down Expand Up @@ -1372,16 +1348,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "qualifiers_category", "domain_of": ["Association"], "is_a": "category"}
},
)
qualifiers_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifiers_closure", "domain_of": ["Association"]}},
)
qualifiers_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifiers_closure_label", "domain_of": ["Association"]}},
)
qualifier: Optional[List[str]] = Field(
None, json_schema_extra={"linkml_meta": {"alias": "qualifier", "domain_of": ["Association"]}}
)
Expand All @@ -1402,16 +1368,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifier_closure", "domain_of": ["Association"]}},
)
qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "qualifier_closure_label", "domain_of": ["Association"]}},
)
frequency_qualifier_label: Optional[str] = Field(
None,
description="""The name of the frequency_qualifier entity""",
Expand All @@ -1431,16 +1387,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "frequency_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
frequency_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "frequency_qualifier_closure", "domain_of": ["Association"]}},
)
frequency_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing frequency_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "frequency_qualifier_closure_label", "domain_of": ["Association"]}},
)
onset_qualifier_label: Optional[str] = Field(
None,
description="""The name of the onset_qualifier entity""",
Expand All @@ -1460,16 +1406,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "onset_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
onset_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing onset_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "onset_qualifier_closure", "domain_of": ["Association"]}},
)
onset_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing onset_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "onset_qualifier_closure_label", "domain_of": ["Association"]}},
)
sex_qualifier_label: Optional[str] = Field(
None,
description="""The name of the sex_qualifier entity""",
Expand All @@ -1489,16 +1425,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "sex_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
sex_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing sex_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "sex_qualifier_closure", "domain_of": ["Association"]}},
)
sex_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing sex_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "sex_qualifier_closure_label", "domain_of": ["Association"]}},
)
stage_qualifier_label: Optional[str] = Field(
None,
description="""The name of the stage_qualifier entity""",
Expand All @@ -1518,16 +1444,6 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "stage_qualifier_category", "domain_of": ["Association"], "is_a": "category"}
},
)
stage_qualifier_closure: Optional[List[str]] = Field(
None,
description="""Field containing stage_qualifier id and the ids of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "stage_qualifier_closure", "domain_of": ["Association"]}},
)
stage_qualifier_closure_label: Optional[List[str]] = Field(
None,
description="""Field containing stage_qualifier name and the names of all of it's ancestors""",
json_schema_extra={"linkml_meta": {"alias": "stage_qualifier_closure_label", "domain_of": ["Association"]}},
)
disease_context_qualifier: Optional[str] = Field(
None,
description="""A context qualifier representing a disease or condition in which a relationship expressed in an association took place.""",
Expand Down Expand Up @@ -1576,6 +1492,42 @@ class DirectionalAssociation(Association):
"linkml_meta": {"alias": "disease_context_qualifier_closure_label", "domain_of": ["Association"]}
},
)
species_context_qualifier: Optional[str] = Field(
None,
description="""A context qualifier representing a species in which a relationship expressed in an association took place.""",
json_schema_extra={
"linkml_meta": {
"alias": "species_context_qualifier",
"domain_of": ["Association"],
"examples": [{"value": "NCBITaxon:9606"}],
}
},
)
species_context_qualifier_label: Optional[str] = Field(
None,
description="""The name of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {"alias": "species_context_qualifier_label", "domain_of": ["Association"], "is_a": "name"}
},
)
species_context_qualifier_namespace: Optional[str] = Field(
None,
description="""The namespace/prefix of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {"alias": "species_context_qualifier_namespace", "domain_of": ["Association"]}
},
)
species_context_qualifier_category: Optional[str] = Field(
None,
description="""The category of the species_context_qualifier entity""",
json_schema_extra={
"linkml_meta": {
"alias": "species_context_qualifier_category",
"domain_of": ["Association"],
"is_a": "category",
}
},
)


class ExpandedCurie(ConfiguredBaseModel):
Expand Down
Loading

0 comments on commit 98cbf26

Please sign in to comment.