aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2023-07-18 15:39:04 +0200
committerPjotr Prins2023-07-18 15:39:04 +0200
commit4da2ae5d4c259bfeb82de5d7b4e1d98d3aa3ceca (patch)
tree4a24dbb59ac848c38e1561e81c2caaa7924c32da
parent052957100e85e24dea2d8a1a49fc0abf94aae991 (diff)
downloadgenenetwork3-4da2ae5d4c259bfeb82de5d7b4e1d98d3aa3ceca.tar.gz
Now we hang
-rwxr-xr-xgn3-guile/web/webserver.scm20
1 files changed, 15 insertions, 5 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm
index af13275..d2cabf6 100755
--- a/gn3-guile/web/webserver.scm
+++ b/gn3-guile/web/webserver.scm
@@ -123,10 +123,22 @@ SELECT ?species ?p ?o WHERE {
;; from the triples first harvest the species URIs, followed by creating records of information
-(define (compile-species rows)
+(define (compile-species recs rows)
"Compile a matrix of species triples into records"
- (define s '())
- )
+ (for-each (lambda (r)
+ (let* ([s (car r)]
+ [v (cdr (cdr r))]
+ [p (car (cdr r))]
+ [nrec (assoc s recs)]) ; track records
+ (if nrec
+ (begin
+ (display nrec)
+ (set! nrec (assoc-set! nrec p v))
+ (set! recs (assoc-set! recs s nrec)))
+ (set! recs (assoc-set! recs s '()))
+ )))
+ rows)
+ recs)
(define (get-species-api-str)
(scm->json-string #("https://genenetwork.org/api/v2/mouse/"
@@ -158,8 +170,6 @@ SELECT ?species ?p ?o WHERE {
(render-json get-version))
(('GET "species")
(render-json (get-species)))
- (('GET "species-all")
- (render-json (triples)))
(_ (not-found (request-uri request)))
))