From e6a6e950ea9d066dd499e332cc12404a23d96d08 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 28 Jul 2023 14:01:53 +0200 Subject: Expanding data --- gn3-guile/web/webserver.scm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'gn3-guile/web/webserver.scm') diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm index fb0ed38..648ea6a 100755 --- a/gn3-guile/web/webserver.scm +++ b/gn3-guile/web/webserver.scm @@ -247,6 +247,13 @@ SELECT ?species ?p ?o WHERE { "unknown" )) +(define (strip-lang s) + (list->string (match (string->list s) + [(#\"rest ... #\") rest] + [(#\"rest ... #\" #\@ #\e #\n) rest] + [rest rest])) + ) + (define (get-expanded-species) "Here we add information related to each species" (map (lambda (rec) @@ -258,11 +265,14 @@ SELECT ?species ?p ?o WHERE { (match (pk (car row)) ((taxonomy-name ncbi descr) (cons `("wikidata" . ,wd-id) - (cons `("ncbi" . ,ncbi) - (cons `("taxonomy-name" . ,taxonomy-name) + (cons `("ncbi" . ,(strip-lang ncbi)) + (cons `("ncbi-url" . ,(string-append "https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=" (strip-lang ncbi))) + (cons `("uniprot-url" . ,(string-append "https://www.uniprot.org/taxonomy/" (strip-lang ncbi))) + + (cons `("taxonomy-name" . ,(strip-lang taxonomy-name)) ; (cons `("shortname" . ,shortname) - (cons `("description" . ,descr) - rec))))) + (cons `("description" . ,(strip-lang descr)) + rec))))))) ) ))) ) (get-species) -- cgit v1.2.3