aboutsummaryrefslogtreecommitdiff
path: root/gn3-guile/web/webserver.scm
diff options
context:
space:
mode:
authorPjotr Prins2023-07-21 12:28:47 +0200
committerPjotr Prins2023-07-21 12:28:47 +0200
commit3349ce0a5817e7c3cbc9caf5db8b0ca45d984214 (patch)
tree7db6305932fdd732bb223a3a8812d438d2d52a1d /gn3-guile/web/webserver.scm
parent4da2ae5d4c259bfeb82de5d7b4e1d98d3aa3ceca (diff)
downloadgenenetwork3-3349ce0a5817e7c3cbc9caf5db8b0ca45d984214.tar.gz
This does not work
Diffstat (limited to 'gn3-guile/web/webserver.scm')
-rwxr-xr-xgn3-guile/web/webserver.scm17
1 files changed, 13 insertions, 4 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm
index d2cabf6..6451dc5 100755
--- a/gn3-guile/web/webserver.scm
+++ b/gn3-guile/web/webserver.scm
@@ -12,6 +12,9 @@
(ice-9 format)
(ice-9 iconv)
(ice-9 receive)
+ ;; (ice-9 debugger)
+ ;; (ice-9 breakpoints)
+ ;; (ice-9 source)
(srfi srfi-1)
(srfi srfi-26)
(web http)
@@ -95,6 +98,13 @@ SELECT DISTINCT ?species WHERE {
;; (define (get-species-uris)
;; (map (lambda (m) (cdr (assoc "value"(cdr (car m))))) (array->list (sparql-species))))
+#!
+(define-values (names res) (sparql-species-meta))
+(define table (get-rows names res))
+(define recs '())
+(compile-species recs table)
+!#
+
(define (sparql-species-meta)
(sparql-scm "
PREFIX gn: <http://genenetwork.org/>
@@ -129,13 +139,12 @@ SELECT ?species ?p ?o WHERE {
(let* ([s (car r)]
[v (cdr (cdr r))]
[p (car (cdr r))]
- [nrec (assoc s recs)]) ; track records
- (if nrec
+ [nrec (sloppy-assoc s recs)]) ; find record to fill based on subject
+ (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 '()))
+ (set! nrec (assoc-set! nrec s '())) ;; start with empty list
)))
rows)
recs)