From b17fe6adf6de0a1a405ad71c83816ad646d33eda Mon Sep 17 00:00:00 2001 From: David Glymph Date: Fri, 17 May 2024 17:10:41 -0400 Subject: [PATCH] hardcode treats predicate --- src/stores/useBiolinkModel.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/stores/useBiolinkModel.js b/src/stores/useBiolinkModel.js index 33fde7a8..9cc3286e 100644 --- a/src/stores/useBiolinkModel.js +++ b/src/stores/useBiolinkModel.js @@ -28,15 +28,15 @@ export default function useBiolinkModel() { * @returns {object[]} list of predicate objects */ function getEdgePredicates() { - const newPredicates = - Object.entries(biolinkModel.slots) - .filter(checkIfDescendantOfRelatedTo) - .map(([identifier, predicate]) => ({ - predicate: strings.edgeFromBiolink(identifier), - domain: strings.nodeFromBiolink(predicate.domain), - range: strings.nodeFromBiolink(predicate.range), - })); - return newPredicates; + const newPredicates = Object.entries(biolinkModel.slots).filter(checkIfDescendantOfRelatedTo); + // hard code in treats, it's techincally not a descendant of `related to` + // TODO: we'll want the more correct parsing using mixins at some point + newPredicates.push(['treats', biolinkModel.slots.treats]); + return newPredicates.map(([identifier, predicate]) => ({ + predicate: strings.edgeFromBiolink(identifier), + domain: strings.nodeFromBiolink(predicate.domain), + range: strings.nodeFromBiolink(predicate.range), + })); } /**