#! /usr/bin/env guile
!#
(use-modules (srfi srfi-1)
(srfi srfi-26)
(ice-9 match)
(ice-9 regex)
(dump strings)
(dump sql)
(dump triples)
(dump special-forms))
(define %connection-settings
(call-with-input-file (list-ref (command-line) 1)
read))
(define-dump dump-tissue
;; The Name and TissueName fields seem to be identical. BIRN_lex_ID
;; and BIRN_lex_Name are mostly NULL.
(tables (Tissue))
(schema-triples
(gn-term:name rdfs:range rdfs:Literal))
;; 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 'gn-id:tissue)
(set gn-term:name (field Tissue Name))))
(dump-with-documentation
(name "Tissue Metadata")
(connection %connection-settings)
(table-metadata? #f)
(prefixes
'(("gn-id:" "")
("gn-term:" "")
("rdf:" "")
("rdfs:" "")))
(inputs
(list dump-tissue))
(outputs
'(#:documentation "./docs/dump-tissue.md"
#:rdf "./verified-data/dump-tissue.ttl")))