From 3494fa35f332e0da6e4d2c76eac0a286fa4f5646 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 17 Jul 2023 23:03:07 +0300 Subject: Dump tissue metadata with documentation Signed-off-by: Munyoki Kilyungi --- examples/dump-tissue.scm | 57 ++++++++++++++++-------------------------------- 1 file 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:" "") - (prefix "dct:" "") - (prefix "foaf:" "") - (prefix "generif:" "") - (prefix "gn:" "") - (prefix "hgnc:" "") - (prefix "homologene:" "") - (prefix "kegg:" "") - (prefix "molecularTrait:" "") - (prefix "nuccore:" "") - (prefix "omim:" "") - (prefix "owl:" "") - (prefix "phenotype:" "") - (prefix "pubchem:" "") - (prefix "pubmed:" "") - (prefix "rdf:" "") - (prefix "rdfs:" "") - (prefix "uniprot:" "") - (prefix "up:" "") - (prefix "xsd:" "") - (newline) - (dump-tissue db)) - #:encoding "utf8"))) +(dump-with-documentation + (name "Tissue Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + (("rdf:" "") + ("rdfs:" "") + ("gn:" ""))) + (inputs + (dump-tissue)) + (outputs + (#:documentation "./docs/dump-tissue.md" #:rdf "./verified-data/dump-tissue.ttl"))) -- cgit v1.2.3