aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-07-17 23:03:07 +0300
committerMunyoki Kilyungi2023-07-21 14:36:39 +0300
commit252aa900fcdc28546cd21741b982a00a55acf606 (patch)
tree187cefca7212bd5ee20f6a99f78a054fcc5c4dd7 /examples
parent35d268f70020a4eb0696b894135ec298e2f6305c (diff)
downloadgn-transform-databases-252aa900fcdc28546cd21741b982a00a55acf606.tar.gz
Dump tissue metadata with documentation
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dump-tissue.scm57
1 files changed, 19 insertions, 38 deletions
diff --git a/examples/dump-tissue.scm b/examples/dump-tissue.scm
index b1104ab..4998cff 100755
--- a/examples/dump-tissue.scm
+++ b/examples/dump-tissue.scm
@@ -13,53 +13,34 @@
(define %connection-settings
- (call-with-input-file (list-ref (command-line) 1)
- read))
-
-(define %dump-directory
- (list-ref (command-line) 2))
+ (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))
+ ;; The Name and TissueName fields seem to be identical. BIRN_lex_ID
+ ;; and BIRN_lex_Name are mostly NULL.
+ (tables (Tissue))
(schema-triples
(gn: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:tissue)
- (set gn:name (field Tissue Name))))
+ (set rdf:type 'gn:tissue)
+ (set gn:name (field Tissue Name))))
-(call-with-target-database
- %connection-settings
- (lambda (db)
- (with-output-to-file (string-append %dump-directory "dump-tissue.ttl")
- (lambda ()
- (prefix "chebi:" "<http://purl.obolibrary.org/obo/CHEBI_>")
- (prefix "dct:" "<http://purl.org/dc/terms/>")
- (prefix "foaf:" "<http://xmlns.com/foaf/0.1/>")
- (prefix "generif:" "<http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids=>")
- (prefix "gn:" "<http://genenetwork.org/>")
- (prefix "hgnc:" "<http://bio2rdf.org/hgnc:>")
- (prefix "homologene:" "<https://bio2rdf.org/homologene:>")
- (prefix "kegg:" "<http://bio2rdf.org/ns/kegg#>")
- (prefix "molecularTrait:" "<http://genenetwork.org/molecular-trait/>")
- (prefix "nuccore:" "<https://www.ncbi.nlm.nih.gov/nuccore/>")
- (prefix "omim:" "<https://www.omim.org/entry/>")
- (prefix "owl:" "<http://www.w3.org/2002/07/owl#>")
- (prefix "phenotype:" "<http://genenetwork.org/phenotype/>")
- (prefix "pubchem:" "<https://pubchem.ncbi.nlm.nih.gov/>")
- (prefix "pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>")
- (prefix "rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
- (prefix "rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
- (prefix "uniprot:" "<http://purl.uniprot.org/uniprot/>")
- (prefix "up:" "<http://purl.uniprot.org/core/>")
- (prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>")
- (newline)
- (dump-tissue db))
- #:encoding "utf8")))
+(dump-with-documentation
+ (name "Tissue Metadata")
+ (connection %connection-settings)
+ (table-metadata? #f)
+ (prefixes
+ (("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>")
+ ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>")
+ ("gn:" "<http://genenetwork.org/terms/>")))
+ (inputs
+ (dump-tissue))
+ (outputs
+ (#:documentation "./docs/dump-tissue.md" #:rdf "./verified-data/dump-tissue.ttl")))