about summary refs log tree commit diff
path: root/gn/db/sparql.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gn/db/sparql.scm')
-rw-r--r--gn/db/sparql.scm14
1 files changed, 13 insertions, 1 deletions
diff --git a/gn/db/sparql.scm b/gn/db/sparql.scm
index 95b4e1d..0e8c938 100644
--- a/gn/db/sparql.scm
+++ b/gn/db/sparql.scm
@@ -5,9 +5,11 @@
   #:use-module (ice-9 iconv)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 string-fun)
-  #:use-module (gn cache memoize)
   #:use-module (web client)
+  #:use-module (web request)
   #:use-module (web uri)
+  #:use-module (gn cache memoize)
+  #:use-module (web gn-uri)
 
   #:export (memo-sparql-species
             memo-sparql-species-meta
@@ -15,9 +17,19 @@
             compile-species
             get-rows
             tsv->scm
+            strip-lang
             )
 )
 
+
+(define (strip-lang s)
+  "Strip quotes and language tag (@en) from RDF entries"
+  (list->string (match (string->list s)
+		  [(#\"rest ... #\") rest]
+		  [(#\"rest ... #\" #\@ #\e #\n) rest]
+		  [rest rest]))
+  )
+
 (define (gn-sparql-endpoint-url)
   "https://sparql.genenetwork.org/sparql")