about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2026-01-30 00:06:09 +0300
committerMunyoki Kilyungi2026-01-30 00:09:43 +0300
commitc9e45e7f5243c92c0cb8ff859b46b575d553db9a (patch)
tree919ac3ef68615a950b872e9c7d123328cef8d35c
parent60cfff731469d7fd7e7ae521687129b650d6a738 (diff)
downloadgn-transform-databases-c9e45e7f5243c92c0cb8ff859b46b575d553db9a.tar.gz
Replace gn:genotype->metadata with gn:set->gn:dataset.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rwxr-xr-xexamples/genotype.scm30
1 files changed, 16 insertions, 14 deletions
diff --git a/examples/genotype.scm b/examples/genotype.scm
index 5261af7..cefa450 100755
--- a/examples/genotype.scm
+++ b/examples/genotype.scm
@@ -14,20 +14,22 @@
              (transform special-forms))
 
 
-(define-transformer gn:genotype->metadata
-  (tables (InbredSet
-           (inner-join GenoFreeze "ON GenoFreeze.InbredSetId = InbredSet.Id")
-           (inner-join InfoFiles "ON InfoFiles.InbredSetId = InbredSet.Id"))
-          "WHERE GenoFreeze.public > 0 GROUP BY GenoFreeze.Id")
+(define-transformer gn:set->gn:dataset
+  (tables (Datasets
+           (inner-join InfoFiles "ON InfoFiles.DatasetId = Datasets.DatasetId")
+           (inner-join InbredSet "ON InbredSet.Id = InfoFiles.InbredSetId")
+           (inner-join GenoFreeze "ON GenoFreeze.InbredSetId = InbredSet.Id"))
+          "WHERE GenoFreeze.public > 0 GROUP BY Datasets.DatasetId")
   (schema-triples
-   (gnc:genotype a owl:Class)
-   (gnc:genotype a skos:Concept)
-   (gnc:genotype rdfs:label "A genotype."))
-  (triples (string->identifier "genotype" (field GenoFreeze Name) #:separator "_")
-    (set rdf:type 'gnc:genotype)
-    (set skos:prefLabel (field GenoFreeze FullName))
-    (set skos:altLabel (field GenoFreeze ShortName))
-    (set dct:created (annotate-field (field GenoFreeze CreateTime) '^^xsd:datetime))))
+   (gnt:has_genotype_data rdf:type owl:ObjectProperty)
+   (gnt:has_genotype_data rdfs:label "this resources has genotype data.")
+   (gnt:has_genotype_data rdfs:comment "Associates a resource with its genotype data.")
+   (gnt:has_genotype_data rdfs:domain gnc:set)
+   (gnt:has_genotype_data rdfs:range dcat:Dataset)
+   (gnt:has_genotype_data rdfs:subPropertyOf dct:relation))
+  (triples (string->identifier "set" (field InbredSet Name InbredSetName) #:separator "_")
+    (set gnt:has_genotype_data (string->identifier "dataset" (field GenoFreeze Name) #:separator "_"))))
+
 
 
 (let* ((option-spec
@@ -57,7 +59,7 @@
       ("xkos:" "<http://rdf-vocabulary.ddialliance.org/xkos#>")
       ("xsd:" "<http://www.w3.org/2001/XMLSchema#>")))
    (inputs
-    (list gn:genotype->metadata))
+    (list gn:set->gn:dataset))
    (outputs
     `(#:documentation ,documentation
       #:rdf ,output))))