From 99cef5dab86b93fb6f7d600297bd4fbb54622a64 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 21 Aug 2023 15:37:37 +0300 Subject: Remove hard-coded paths Signed-off-by: Munyoki Kilyungi --- examples/generif.scm | 67 +++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 30 deletions(-) (limited to 'examples/generif.scm') diff --git a/examples/generif.scm b/examples/generif.scm index 76f55ee..170cf0c 100755 --- a/examples/generif.scm +++ b/examples/generif.scm @@ -3,6 +3,7 @@ (use-modules (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (ice-9 match) (ice-9 regex) (transform strings) @@ -12,12 +13,6 @@ -(define %connection-settings - (call-with-input-file (list-ref (command-line) 1) - read)) - - - (define-transformer genewiki-symbols (tables (GeneRIF_BASIC (left-join Species "USING (SpeciesId)")) @@ -124,27 +119,39 @@ -(with-documentation - (name "GeneRIF Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("rdf:" "") - ("rdfs:" "") - ("gn:" "") - ("gnc:" "") - ("gnt:" "") - ("dct:" "") - ("pubmed:" "") - ("ncbiTaxon:" "") - ("generif:" "") - ("xsd:" "") - ("owl:" ""))) - (inputs - (list ;; genewiki-symbols - gn-genewiki-entries - ;; ncbi-genewiki-entries - )) - (outputs - '(#:documentation "./docs/generif.md" - #:rdf "./verified-data/generif.ttl"))) +(let* ((option-spec + '((settings (single-char #\s) (value #t)) + (output (single-char #\o) (value #t)) + (documentation (single-char #\d) (value #t)))) + (options (getopt-long (command-line) option-spec)) + (settings (option-ref options 'settings #f)) + (output (option-ref options 'output #f)) + (documentation (option-ref options 'documentation #f)) + (%connection-settings + (call-with-input-file settings + read))) + + (with-documentation + (name "GeneRIF Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("rdf:" "") + ("rdfs:" "") + ("gn:" "") + ("gnc:" "") + ("gnt:" "") + ("dct:" "") + ("pubmed:" "") + ("ncbiTaxon:" "") + ("generif:" "") + ("xsd:" "") + ("owl:" ""))) + (inputs + (list ;; genewiki-symbols + gn-genewiki-entries + ;; ncbi-genewiki-entries + )) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) -- cgit v1.2.3