diff options
author | Pjotr Prins | 2023-08-04 11:39:04 +0200 |
---|---|---|
committer | Pjotr Prins | 2023-08-04 11:39:04 +0200 |
commit | 8148c6ec58dbec464f3ac731ccc539d1e371944f (patch) | |
tree | 13177fcdbc5f4a5c00a1f8a22ac90ed706433252 /gn3-guile/web/webserver.scm | |
parent | f843826aaa3b7275783f4e7bfe2fcf2a98ed0da6 (diff) | |
download | genenetwork3-8148c6ec58dbec464f3ac731ccc539d1e371944f.tar.gz |
Get species links
Diffstat (limited to 'gn3-guile/web/webserver.scm')
-rwxr-xr-x | gn3-guile/web/webserver.scm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm index 5dc0038..3772d51 100755 --- a/gn3-guile/web/webserver.scm +++ b/gn3-guile/web/webserver.scm @@ -219,8 +219,6 @@ SELECT ?species ?p ?o WHERE { ?species ?p ?o . }}}")) - - (define (get-values names row) "Get values by name from a resultset row" (map (lambda (n) (unpack "value" (unpack n row))) (array->list names))) @@ -323,21 +321,23 @@ SELECT ?species ?p ?o WHERE { (scm->json-string #("https://genenetwork.org/api/v2/mouse/" "https://genenetwork.org/api/v2/rat/"))) -(define (get-species-links) - '(("description" . "URI")) +(define (get-species-links recs) + "Return a list of short names and expand them to URIs" + (map (lambda r + (let ([shortname (assoc-ref (car r) "shortName")]) + (cons shortname (mk-url shortname)))) recs) ) (define (get-species-rec) (list->vector (get-expanded-species))) (define (get-species-meta) - `( - ("comment" . "Get information on species") + (let ([recs (get-expanded-species)]) + `(("comment" . "Get information on species") ("doc" . ,(mk-doc "species")) ("meta" . ,(mk-meta "species")) ("rec" . ,(mk-rec "species")) - ("links" . ,(get-species-links) - ))) + ("links" . ,(get-species-links recs))))) ;; ---- REST API web server handler |