diff options
author | Pjotr Prins | 2023-07-12 07:24:56 -0500 |
---|---|---|
committer | Pjotr Prins | 2023-07-12 07:24:56 -0500 |
commit | 69acd15a9748a22f4cb14fe566226f39ac197c6a (patch) | |
tree | 0df6a406365a342384e377eab712041c1557f096 | |
parent | af02ec582494b52390f5c2d974f8700f39adcf2a (diff) | |
download | genenetwork3-69acd15a9748a22f4cb14fe566226f39ac197c6a.tar.gz |
SPARQL parsing
-rwxr-xr-x | gn3-guile/web/webserver.scm | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/gn3-guile/web/webserver.scm b/gn3-guile/web/webserver.scm index d7687a0..b6f3417 100755 --- a/gn3-guile/web/webserver.scm +++ b/gn3-guile/web/webserver.scm @@ -99,8 +99,8 @@ SELECT DISTINCT ?species WHERE { (map (lambda (m) (cdr (assoc "value"(cdr (car m))))) (array->list (sparql-species))) ) -(define (sparql-species-meta) - (sparql-results " +(define (sparql-species-meta2) + (sparql-exec " PREFIX gn: <http://genenetwork.org/> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @@ -109,13 +109,36 @@ SELECT DISTINCT ?species ?p ?o WHERE { ?species ?p ?o . }" )) +(define (sparql-species-meta) + (sparql-exec " +PREFIX gn: <http://genenetwork.org/> +PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> + +SELECT ?species ?p ?o WHERE { + MINUS { ?species rdf:type ?o . } +{ + SELECT DISTINCT ?species ?p ?o WHERE { + ?species rdf:type gn:species . + ?species ?p ?o . + }}}" + )) + (define (get-species-all) (sparql-species-meta)) (define (get-species) - (receive (names results) (sparql-species)) - results) + (receive (names results) (sparql-species-meta) + results)) + +(define (get-values name resultlist) + (map (lambda (m) (cdr (assoc "value" (cdr (assoc name m))))) resultlist) + ) + +(define (filter-results) + (get-values "o" (array->list (get-species))) + ) + (define (triples) (array->list (get-species-all))) |