about summary refs log tree commit diff
path: root/examples/tissue.scm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tissue.scm')
-rwxr-xr-xexamples/tissue.scm50
1 files changed, 50 insertions, 0 deletions
diff --git a/examples/tissue.scm b/examples/tissue.scm
new file mode 100755
index 0000000..8ce96c8
--- /dev/null
+++ b/examples/tissue.scm
@@ -0,0 +1,50 @@
+#! /usr/bin/env guile
+!#
+
+(use-modules (srfi srfi-1)
+             (srfi srfi-26)
+             (ice-9 match)
+             (ice-9 regex)
+             (dump strings)
+             (dump sql)
+             (dump triples)
+             (dump 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))
+  (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))))
+
+
+
+(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")))