aboutsummaryrefslogtreecommitdiff
path: root/examples/tissue.scm
blob: 22b715e2e10d30a1f486c3bb7db55c859e9cc716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /usr/bin/env guile
!#

(use-modules (srfi srfi-1)
             (srfi srfi-26)
             (ice-9 match)
             (ice-9 regex)
             (transform strings)
             (transform sql)
             (transform triples)
             (transform special-forms))



(define %connection-settings
    (call-with-input-file (list-ref (command-line) 1)
			  read))



(define-transformer tissue
    ;; The Name and TissueName fields seem to be identical. BIRN_lex_ID
    ;; and BIRN_lex_Name are mostly NULL.
    (tables (Tissue))
  (schema-triples
   (gnc:tissue a skos:Concept))
  ;; Hopefully the Short_Name field is distinct and can be used as an
  ;; identifier.
  (triples (string->identifier "tissue" (field Tissue Short_Name))
	   (set rdf:type 'gnc:tissue)
	   (set rdfs:label (field Tissue Name))))



(with-documentation
 (name "Tissue Metadata")
 (connection %connection-settings)
 (table-metadata? #f)
 (prefixes
  '(("gn:" "<http://genenetwork.org/id/>")
    ("gnt:" "<http://genenetwork.org/terms/>")
    ("skos:" "<http://www.w3.org/2004/02/skos/core#>")
    ("gnc:" "<http://genenetwork.org/category/>")
    ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
    ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")))
 (inputs
  (list tissue))
 (outputs
  '(#:documentation "./docs/tissue.md"
    #:rdf "./verified-data/tissue.ttl")))