aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-07-17 21:27:09 +0300
committerBonfaceKilz2023-07-30 12:29:56 +0300
commitbcfd39682bdf3a0a8ea5c1efaf0c33a9367991ad (patch)
treef771aaf0441e57b886e40c3ae80343f00ee382e2 /examples
parent86c10b7c591b621b4a9922541f79b3e958c57645 (diff)
downloadgn-transform-databases-bcfd39682bdf3a0a8ea5c1efaf0c33a9367991ad.tar.gz
Dump species metadata with documentation
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dump-species-metadata.scm57
1 files changed, 19 insertions, 38 deletions
diff --git a/examples/dump-species-metadata.scm b/examples/dump-species-metadata.scm
index 2937c80..4ea9ce7 100755
--- a/examples/dump-species-metadata.scm
+++ b/examples/dump-species-metadata.scm
@@ -16,9 +16,6 @@
(call-with-input-file (list-ref (command-line) 1)
read))
-(define %dump-directory
- (list-ref (command-line) 2))
-
(define-dump dump-species
@@ -34,11 +31,11 @@
(set gn:displayName (field Species MenuName))
(set gn:binomialName (field Species FullName))
(set gn:family (field Species Family))
- (set gn:organism (ontology 'ncbiTaxon: (field Species TaxonomyId)))))
+ (set gn:organism (ontology 'taxon: (field Species TaxonomyId)))))
(define-dump dump-strain
(tables (Strain
- (join Species "ON Strain.SpeciesId = Species.SpeciesId")))
+ (left-join Species "ON Strain.SpeciesId = Species.SpeciesId")))
(schema-triples
(gn:strainOfSpecies rdfs:domain gn:strain)
(gn:strainOfSpecies rdfs:range gn:species)
@@ -106,36 +103,20 @@
-(call-with-target-database
- %connection-settings
- (lambda (db)
- (with-output-to-file (string-append %dump-directory "dump-species-metadata.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 "ncbiTaxon:" "<https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?mode=Info&id=>")
- (prefix "uniprot:" "<http://purl.uniprot.org/uniprot/>")
- (prefix "up:" "<http://purl.uniprot.org/core/>")
- (prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>")
- (newline)
- (dump-species db)
- (dump-strain db)
- (dump-mapping-method db)
- (dump-inbred-set db)
- (dump-avg-method db))
- #:encoding "utf8")))
+(dump-with-documentation
+ (name "Species 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/>")
+ ("taxon:" "<http://purl.uniprot.org/taxonomy/>")))
+ (inputs
+ (dump-species
+ dump-strain
+ dump-mapping-method
+ dump-avg-method))
+ (outputs
+ (#:documentation "docs/dump-species-metadata.md"
+ #:rdf "./verified-data/dump-species-metadata.ttl")))