diff options
author | Pjotr Prins | 2023-08-21 12:21:01 +0200 |
---|---|---|
committer | Pjotr Prins | 2023-08-21 12:21:01 +0200 |
commit | d06d732625fdc48677ea32b129da905ebd527c38 (patch) | |
tree | c744372e426a2c1ed2042192e8292cb3a0536e31 /gn/data/group.scm | |
parent | b151e98e3933d7e21f20554cc892f0bef0740cba (diff) | |
download | gn-guile-d06d732625fdc48677ea32b129da905ebd527c38.tar.gz |
Getting group info
Diffstat (limited to 'gn/data/group.scm')
-rw-r--r-- | gn/data/group.scm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gn/data/group.scm b/gn/data/group.scm new file mode 100644 index 0000000..003ac11 --- /dev/null +++ b/gn/data/group.scm @@ -0,0 +1,23 @@ +(define-module (gn data group) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (ice-9 iconv) + #:use-module (ice-9 receive) + #:use-module (ice-9 string-fun) + #:use-module (gn db sparql) + #:use-module (web gn-uri) + + #:export ( + get-group-links + )) + +(define (get-group-links gnid) + "Return all the URIs that link to group info, e.g. for Mus_musculus" + (let ([recs (car (cdr (compile-groups-meta)))] + [uri (mk-gnid gnid)]) + (filter-map + (lambda (r) (if (string=? (second r) uri) + (list ("ref" . (car r))) + #f)) recs) + )) |