Skip to content

Commit

Permalink
add original predicate to model
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinschaper committed Jan 13, 2025
1 parent 8a046f2 commit 07d9acb
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/src/monarch_py/datamodels/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,11 @@ class Association(ConfiguredBaseModel):
...,
json_schema_extra={"linkml_meta": {"alias": "predicate", "domain_of": ["Association", "CompactAssociation"]}},
)
original_predicate: Optional[str] = Field(
None,
description="""used to hold the original relation/predicate that an external knowledge source uses before transformation to match the biolink-model specification.""",
json_schema_extra={"linkml_meta": {"alias": "original_predicate", "domain_of": ["Association"]}},
)
object: str = Field(
..., json_schema_extra={"linkml_meta": {"alias": "object", "domain_of": ["Association", "CompactAssociation"]}}
)
Expand Down Expand Up @@ -1243,6 +1248,11 @@ class DirectionalAssociation(Association):
...,
json_schema_extra={"linkml_meta": {"alias": "predicate", "domain_of": ["Association", "CompactAssociation"]}},
)
original_predicate: Optional[str] = Field(
None,
description="""used to hold the original relation/predicate that an external knowledge source uses before transformation to match the biolink-model specification.""",
json_schema_extra={"linkml_meta": {"alias": "original_predicate", "domain_of": ["Association"]}},
)
object: str = Field(
..., json_schema_extra={"linkml_meta": {"alias": "object", "domain_of": ["Association", "CompactAssociation"]}}
)
Expand Down
6 changes: 6 additions & 0 deletions backend/src/monarch_py/datamodels/model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ classes:
- subject_taxon
- subject_taxon_label
- predicate
- original_predicate
- object
- original_object
- object_namespace
Expand Down Expand Up @@ -562,6 +563,11 @@ slots:
range: string
original_object:
range: string
original_predicate:
range: string
description: >-
used to hold the original relation/predicate that an external knowledge
source uses before transformation to match the biolink-model specification.
original_subject:
range: string
pathway:
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/api/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export interface Association {
subject_taxon?: string,
subject_taxon_label?: string,
predicate: string,
/** used to hold the original relation/predicate that an external knowledge source uses before transformation to match the biolink-model specification. */
original_predicate?: string,
object: string,
original_object?: string,
/** The namespace/prefix of the object entity */
Expand Down
18 changes: 18 additions & 0 deletions frontend/src/pages/node/AssociationsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
/>
</template>

<template #extension="{ row }">
<AppNodeBadge
v-if="row.subject_specialization_qualifier_label"
:node="{
id: row.subject_specialization_qualifier,
name: row.subject_specialization_qualifier_label,
category: row.subject_specialization_qualifier_category,
}"
:breadcrumbs="getBreadcrumbs(node, row, 'subject')"
/>
<span v-else>{{ row.subject_specialization_qualifier }}</span>
</template>

<template #disease="{ row }">
<AppNodeBadge
v-if="row.disease_context_qualifier"
Expand Down Expand Up @@ -269,6 +282,11 @@ const medicalActionColumns = computed<Cols<Datum>>(() => {
key: "subject_label",
heading: "Medical Action",
},
{
slot: "extension",
key: "subject_specialization_qualifier",
heading: "Extension",
},
{
slot: "predicate",
key: "predicate",
Expand Down

0 comments on commit 07d9acb

Please sign in to comment.