aboutsummaryrefslogtreecommitdiff
path: root/gn3-guile/web/webserver.scm
diff options
context:
space:
mode:
authorPjotr Prins2023-07-10 10:58:02 -0500
committerPjotr Prins2023-07-10 10:58:02 -0500
commit188c3d7880fd6481af4758b3e94577e81031c3c5 (patch)
tree52d0a8d07ef6180bbbc113c7b6ddb72380a64b8b /gn3-guile/web/webserver.scm
parent8ddd7f80f15943f9a48ac760babff9da9f95c043 (diff)
downloadgenenetwork3-188c3d7880fd6481af4758b3e94577e81031c3c5.tar.gz
Execute SPARQL and get s-exp
Diffstat (limited to 'gn3-guile/web/webserver.scm')
-rwxr-xr-xgn3-guile/web/webserver.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm
index 7ce2a9a..e72eba9 100755
--- a/gn3-guile/web/webserver.scm
+++ b/gn3-guile/web/webserver.scm
@@ -10,6 +10,8 @@
(json)
(ice-9 match)
(ice-9 format)
+ (ice-9 iconv)
+ (ice-9 receive)
(srfi srfi-1)
(srfi srfi-26)
(web http)
@@ -91,8 +93,11 @@ CONSTRUCT {
;; curl "https://sparql.genenetwork.org/sparql?default-graph-uri=&query=prefix+gn%3A+%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E+%0D%0A%0D%0ASELECT+distinct+*+WHERE+%7B%3Fu++gn%3AbinomialName+%3Fo%7D&format=application%2Fsparql-results%2Bjson"|jq
(define (get-species)
- (http-get "http://sparql.genenetwork.org/sparql?default-graph-uri=&query=")
- )
+ (bytevector->string (receive (response-status response-body)
+ (http-request "https://sparql.genenetwork.org/sparql?default-graph-uri=&query=prefix+gn%3A+%3Chttp%3A%2F%2Fgenenetwork.org%2F%3E+%0D%0A%0D%0ASELECT+distinct+*+WHERE+%7B%3Fu++gn%3AbinomialName+%3Fo%7D&format=application%2Fsparql-results%2Bjson")
+
+ response-body) "UTF-8"
+ ))
(define (get-species-api-str)
(scm->json-string #("https://genenetwork.org/api/v2/mouse/"