diff options
| author | Munyoki Kilyungi | 2026-01-27 16:42:43 +0300 |
|---|---|---|
| committer | Munyoki Kilyungi | 2026-01-27 16:42:43 +0300 |
| commit | 63c1af8d4e855979bec53e716dd046df44c956bc (patch) | |
| tree | f1d48a08d19909b5d21afd70f76d1deb67994422 /examples/molecular-traits.scm | |
| parent | 509485bf2db7ffd9367626f11617ae7d443cde04 (diff) | |
| download | gn-transform-databases-63c1af8d4e855979bec53e716dd046df44c956bc.tar.gz | |
Rename tissue.scm -> molecular-traits.scm.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples/molecular-traits.scm')
| -rwxr-xr-x | examples/molecular-traits.scm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/examples/molecular-traits.scm b/examples/molecular-traits.scm new file mode 100755 index 0000000..737c0b0 --- /dev/null +++ b/examples/molecular-traits.scm @@ -0,0 +1,63 @@ +#! /usr/bin/env guile +!# + +(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-transformer 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 owl:Class) + (gnc:tissue rdfs:subClassOf obo:UBERON_0000479) ; Anatomical Entity + (gnc:tissue rdfs:label "Tissue (GN)") + (gnt:has_tissue rdf:type owl:ObjectProperty) + (gnt:has_tissue rdfs:domain gnc:molecular_traits) + (gnt:has_tissue rdfs:range gnc:tissue) + (gnt:has_tissue rdfs:label "has tissue")) + (triples (string->identifier "tissue" (field Tissue Short_Name) + #:separator "_") + (set rdf:type 'gnc:tissue) + (set rdfs:label (field Tissue Name)))) + + + +(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://rdf.genenetwork.org/v1/id/>") + ("obo:" "<http://purl.obolibrary.org/obo/>") + ("owl:" "<http://www.w3.org/2002/07/owl#>") + ("gnt:" "<http://rdf.genenetwork.org/v1/term/>") + ("skos:" "<http://www.w3.org/2004/02/skos/core#>") + ("gnc:" "<http://rdf.genenetwork.org/v1/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)))) +;; http://purl.obolibrary.org/obo/UBERON_0000479 |
