From 3453fed05b3222fab7a153ba378e833f79f02924 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 17 Jul 2023 23:03:39 +0300 Subject: Dump dataset metadata with documentation Signed-off-by: Munyoki Kilyungi --- examples/dump-dataset-metadata.scm | 50 ++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'examples') diff --git a/examples/dump-dataset-metadata.scm b/examples/dump-dataset-metadata.scm index 789e298..53c381c 100755 --- a/examples/dump-dataset-metadata.scm +++ b/examples/dump-dataset-metadata.scm @@ -16,9 +16,6 @@ (call-with-input-file (list-ref (command-line) 1) read)) -(define %dump-directory - (list-ref (command-line) 2)) - ;; One email ID in the Investigators table has spaces in it. This @@ -150,8 +147,7 @@ (field Investigators Email))) (set gn:datasetOfOrganization (field ("CAST(CONVERT(BINARY CONVERT(Organizations.OrganizationName USING latin1) USING utf8) AS VARCHAR(1500))" Organizations))) - (set gn:accessionId (string-append "GN" (number->string - (field InfoFiles GN_AccesionId)))) + (set gn:accessionId (format #f "GN~a" (field InfoFiles GN_AccesionId))) (set gn:datasetStatusName (string-downcase (field DatasetStatus DatasetStatusName))) (set gn:datasetOfInbredSet @@ -234,27 +230,23 @@ -(call-with-target-database - %connection-settings - (lambda (db) - (with-output-to-file (string-append %dump-directory "dump-info-pages.ttl") - (lambda () - (prefix "dct:" "") - (prefix "foaf:" "") - (prefix "generif:" "") - (prefix "geoSeries:" "") - (prefix "gn:" "") - (prefix "owl:" "") - (prefix "phenotype:" "") - (prefix "pubmed:" "") - (prefix "rdf:" "") - (prefix "rdfs:" "") - (prefix "uniprot:" "") - (prefix "up:" "") - (prefix "xsd:" "") - (prefix "probeset:" "") - (prefix "dataset:" "") - (newline) - (dump-info-files db) - (dump-investigators db)) - #:encoding "utf8"))) +(dump-with-documentation + (name "Info files / Investigators Metadata") + (connection %connection-settings) + (table-metadata? #f) + (prefixes + (("dct:" "") + ("geoSeries:" "") + ("rdf:" "") + ("rdfs:" "") + ("gn:" "") + ("foaf:" "") + ("taxon:" "") + ("dataset:" ""))) + (inputs + (dump-info-files + dump-investigators)) + (outputs + (#:documentation "./docs/dump-info-pages.md" + #:rdf "./verified-data/dump-info-pages.ttl"))) + -- cgit v1.2.3