diff options
author | Munyoki Kilyungi | 2023-08-21 15:37:37 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2023-08-21 17:52:07 +0300 |
commit | 99cef5dab86b93fb6f7d600297bd4fbb54622a64 (patch) | |
tree | e3d607fbb53e4ffdc0f94163a26010ab3aa3203f /examples | |
parent | 8e1e4cceab516afab46ccced63ca9edab663ca11 (diff) | |
download | gn-transform-databases-99cef5dab86b93fb6f7d600297bd4fbb54622a64.tar.gz |
Remove hard-coded paths
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/dataset-metadata.scm | 75 | ||||
-rwxr-xr-x | examples/generif.scm | 67 | ||||
-rwxr-xr-x | examples/genotype.scm | 56 | ||||
-rwxr-xr-x | examples/phenotype.scm | 61 | ||||
-rwxr-xr-x | examples/probeset.scm | 71 | ||||
-rwxr-xr-x | examples/publication.scm | 58 | ||||
-rwxr-xr-x | examples/species-metadata.scm | 63 | ||||
-rwxr-xr-x | examples/tissue.scm | 61 |
8 files changed, 278 insertions, 234 deletions
diff --git a/examples/dataset-metadata.scm b/examples/dataset-metadata.scm index 783b2b7..8bb9607 100755 --- a/examples/dataset-metadata.scm +++ b/examples/dataset-metadata.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)) - - - ;; One email ID in the Investigators table has spaces in it. This ;; function fixes that. (define (fix-email-id email) @@ -356,32 +351,44 @@ -(with-documentation - (name "Info files / Investigators Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("v:" "<http://www.w3.org/2006/vcard/ns#>") - ("foaf:" "<http://xmlns.com/foaf/0.1/>") - ("gdmt:" "<http://vocab.fairdatacollective.org/gdmt/>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>") - ("geoSeries:" "<http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=>") - ("gnt:" "<http://genenetwork.org/term/>") - ("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("taxon:" "<http://purl.uniprot.org/taxonomy/>") - ("dct:" "<http://purl.org/dc/terms/>"))) - (inputs - (list info-files - publishfreeze - genofreeze - probesetfreeze - investigators - gene-chip)) - (outputs - '(#:documentation "./docs/info-pages.md" - #:rdf "/export/data/genenetwork-virtuoso/info-pages.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 "Info files / Investigators Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("v:" "<http://www.w3.org/2006/vcard/ns#>") + ("foaf:" "<http://xmlns.com/foaf/0.1/>") + ("gdmt:" "<http://vocab.fairdatacollective.org/gdmt/>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("geoSeries:" "<http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=>") + ("gnt:" "<http://genenetwork.org/term/>") + ("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("taxon:" "<http://purl.uniprot.org/taxonomy/>") + ("dct:" "<http://purl.org/dc/terms/>"))) + (inputs + (list info-files + publishfreeze + genofreeze + probesetfreeze + investigators + gene-chip)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) + 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:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("gnt:" "<http://genenetwork.org/term/>") - ("dct:" "<http://purl.org/dc/terms/>") - ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>") - ("ncbiTaxon:" "<https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=>") - ("generif:" "<http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids=>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") - ("owl:" "<http://www.w3.org/2002/07/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:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("gnt:" "<http://genenetwork.org/term/>") + ("dct:" "<http://purl.org/dc/terms/>") + ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>") + ("ncbiTaxon:" "<https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=>") + ("generif:" "<http://www.ncbi.nlm.nih.gov/gene?cmd=Retrieve&dopt=Graphics&list_uids=>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") + ("owl:" "<http://www.w3.org/2002/07/owl#>"))) + (inputs + (list ;; genewiki-symbols + gn-genewiki-entries + ;; ncbi-genewiki-entries + )) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) diff --git a/examples/genotype.scm b/examples/genotype.scm index 6fe60c9..830da0a 100755 --- a/examples/genotype.scm +++ b/examples/genotype.scm @@ -5,6 +5,7 @@ (rnrs io ports) (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (ice-9 match) (ice-9 regex) (transform strings) @@ -14,12 +15,6 @@ -(define %connection-settings - (call-with-input-file (list-ref (command-line) 1) - read)) - - - (define (remap-species-identifiers str) "This procedure remaps identifiers to standard binominal. Obviously this should be sorted by correcting the database!" @@ -103,22 +98,33 @@ -(with-documentation - (name "Genotype Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("dct:" "<http://purl.org/dc/terms/>") - ("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("gnt:" "<http://genenetwork.org/term/>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>"))) - (inputs - (list genotypes)) - (outputs - '(#:documentation "./docs/genotype.md" - #:rdf "/export/data/genenetwork-virtuoso/genotype.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 "Genotype Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("dct:" "<http://purl.org/dc/terms/>") + ("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("gnt:" "<http://genenetwork.org/term/>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>"))) + (inputs + (list genotypes)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) diff --git a/examples/phenotype.scm b/examples/phenotype.scm index 31d7972..772c2bc 100755 --- a/examples/phenotype.scm +++ b/examples/phenotype.scm @@ -5,6 +5,7 @@ (rnrs io ports) (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (ice-9 match) (ice-9 regex) (transform strings) @@ -13,12 +14,6 @@ (transform special-forms)) - -(define %connection-settings - (call-with-input-file (list-ref (command-line) 1) - read)) - - (define-transformer phenotypes (tables (PublishXRef (left-join InbredSet "ON InbredSet.InbredSetId = PublishXRef.InbredSetId") @@ -102,24 +97,36 @@ -(with-documentation - (name "Phenotypes Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("dct:" "<http://purl.org/dc/terms/>") - ("gn:" "<http://genenetwork.org/id/>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("gnc:" "<http://genenetwork.org/category/>") - ("gnt:" "<http://genenetwork.org/terms/>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") - ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>"))) - (inputs - (list - phenotypes)) - (outputs - '(#:documentation "./docs/phenotype.md" - #:rdf "/export/data/genenetwork-virtuoso/phenotype.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 "Phenotypes Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("dct:" "<http://purl.org/dc/terms/>") + ("gn:" "<http://genenetwork.org/id/>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("gnc:" "<http://genenetwork.org/category/>") + ("gnt:" "<http://genenetwork.org/terms/>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") + ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>"))) + (inputs + (list + phenotypes)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) + diff --git a/examples/probeset.scm b/examples/probeset.scm index 2dfdbc2..fa2fff6 100755 --- a/examples/probeset.scm +++ b/examples/probeset.scm @@ -3,19 +3,13 @@ (use-modules (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (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 probeset (tables (ProbeSet @@ -156,29 +150,40 @@ -(with-documentation - (name "ProbeSet Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gn:" "<http://genenetwork.org/id/>") - ("probeset:" "<http://genenetwork.org/probeset/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("gnt:" "<http://genenetwork.org/term/>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("kegg:" "<http://bio2rdf.org/ns/kegg#>") - ("pubchem:" "<https://pubchem.ncbi.nlm.nih.gov/>") - ("omim:" "<https://www.omim.org/entry/>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("uniprot:" "<http://purl.uniprot.org/uniprot/>") - ("chebi:" "<http://purl.obolibrary.org/obo/CHEBI_>") - ("dct:" "<http://purl.org/dc/terms/>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("homologene:" "<https://bio2rdf.org/homologene:>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>"))) - (inputs - (list probeset)) - (outputs - '(#:documentation "./docs/probeset.md" - #:rdf "./verified-data/probeset.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 "ProbeSet Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("gn:" "<http://genenetwork.org/id/>") + ("probeset:" "<http://genenetwork.org/probeset/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("gnt:" "<http://genenetwork.org/term/>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("kegg:" "<http://bio2rdf.org/ns/kegg#>") + ("pubchem:" "<https://pubchem.ncbi.nlm.nih.gov/>") + ("omim:" "<https://www.omim.org/entry/>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("uniprot:" "<http://purl.uniprot.org/uniprot/>") + ("chebi:" "<http://purl.obolibrary.org/obo/CHEBI_>") + ("dct:" "<http://purl.org/dc/terms/>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("homologene:" "<https://bio2rdf.org/homologene:>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>"))) + (inputs + (list probeset)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) diff --git a/examples/publication.scm b/examples/publication.scm index d9e2aa5..81606b2 100755 --- a/examples/publication.scm +++ b/examples/publication.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 publication (tables (Publication)) (triples @@ -59,23 +54,34 @@ -(with-documentation - (name "Publications Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gnt:" "<http://genenetwork.org/terms/>") - ("fabio:" "<http://purl.org/spar/fabio/>") - ("dct:" "<http://purl.org/dc/terms/>") - ("prism:" "<http://prismstandard.org/namespaces/basic/2.0/>") - ("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"))) - (inputs - (list publication)) - (outputs - '(#:documentation "./docs/publication.md" - #:rdf "./verified-data/publication.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 "Publications Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("gnt:" "<http://genenetwork.org/terms/>") + ("fabio:" "<http://purl.org/spar/fabio/>") + ("dct:" "<http://purl.org/dc/terms/>") + ("prism:" "<http://prismstandard.org/namespaces/basic/2.0/>") + ("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("pubmed:" "<http://rdf.ncbi.nlm.nih.gov/pubmed/>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("xsd:" "<http://www.w3.org/2001/XMLSchema#>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>"))) + (inputs + (list publication)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) diff --git a/examples/species-metadata.scm b/examples/species-metadata.scm index b67c0bc..b330b12 100755 --- a/examples/species-metadata.scm +++ b/examples/species-metadata.scm @@ -3,21 +3,14 @@ (use-modules (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (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 (remap-species-identifiers str) "This procedure remaps identifiers to standard binominal. Obviously this should be sorted by correcting the database!" @@ -201,26 +194,34 @@ At this point it is not very clear how Name, Name2, Symbol and Alias are used. -(with-documentation - (name "Species Metadata") - (connection %connection-settings) - (table-metadata? #f) - (prefixes - '(("gn:" "<http://genenetwork.org/id/>") - ("gnc:" "<http://genenetwork.org/category/>") - ("owl:" "<http://www.w3.org/2002/07/owl#>") - ("gnt:" "<http://genenetwork.org/term/>") - ("skos:" "<http://www.w3.org/2004/02/skos/core#>") - ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") - ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") - ("taxon:" "<http://purl.uniprot.org/taxonomy/>"))) - (inputs - (list - inbred-set - species - strain - mapping-method - avg-method)) - (outputs - '(#:documentation "./docs/species-metadata.md" - #:rdf "/export/data/genenetwork-virtuoso/species-metadata.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 "Species Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + '(("gn:" "<http://genenetwork.org/id/>") + ("gnc:" "<http://genenetwork.org/category/>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("gnt:" "<http://genenetwork.org/term/>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("rdf:" "<http://www.w3.org/1999/02/22-rdf-syntax-ns#>") + ("rdfs:" "<http://www.w3.org/2000/01/rdf-schema#>") + ("taxon:" "<http://purl.uniprot.org/taxonomy/>"))) + (inputs + (list inbred-set species strain mapping-method avg-method)) + (outputs + `(#:documentation ,documentation + #:rdf ,output)))) + diff --git a/examples/tissue.scm b/examples/tissue.scm index 22b715e..ce9f345 100755 --- a/examples/tissue.scm +++ b/examples/tissue.scm @@ -3,48 +3,53 @@ (use-modules (srfi srfi-1) (srfi srfi-26) + (ice-9 getopt-long) (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)) + ;; 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)))) + (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"))) +(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 "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 ,documentation + #:rdf ,output)))) |