From ac11e610511a224dd8fb5934a4587a3c8e879ecc Mon Sep 17 00:00:00 2001 From: Kaiwen He Date: Fri, 23 Aug 2024 13:48:58 -0500 Subject: [PATCH] use curie->properties to get curie name to avoid dict-get failed error --- contrib/medikanren2/neo/utils.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/medikanren2/neo/utils.rkt b/contrib/medikanren2/neo/utils.rkt index 40f96aa7..249bf0c7 100644 --- a/contrib/medikanren2/neo/utils.rkt +++ b/contrib/medikanren2/neo/utils.rkt @@ -45,7 +45,7 @@ (get-descendent-curies*-in-db (curies->synonyms-in-db curie-list))) -(define (concept->name curie) +#;(define (concept->name curie) (let ((id-name-val (remove-duplicates (filter (lambda (cl) (and (equal? (car cl) curie) @@ -55,6 +55,10 @@ curie (caddar id-name-val)))) +(define (concept->name curie) + (let ((name (assoc "name" (curie->properties curie)))) + (if name (cdr name) curie))) + (define (concept->category curie) (let ((category (assoc "category" (curie->properties curie)))) (if category (cdr category) '())))