aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xexamples/genotype.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/genotype.scm b/examples/genotype.scm
index cefa450..c3da459 100755
--- a/examples/genotype.scm
+++ b/examples/genotype.scm
@@ -30,6 +30,14 @@
(triples (string->identifier "set" (field InbredSet Name InbredSetName) #:separator "_")
(set gnt:has_genotype_data (string->identifier "dataset" (field GenoFreeze Name) #:separator "_"))))
+(define-transformer gn:dataset->gn:set
+ (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")
+ (triples (string->identifier "dataset" (field GenoFreeze Name) #:separator "_")
+ (set gnt:has_strain (string->identifier "set" (field InbredSet Name InbredSetName) #:separator "_"))))
(let* ((option-spec
@@ -48,7 +56,8 @@
(connection %connection-settings)
(table-metadata? #f)
(prefixes
- '(("dct:" "<http://purl.org/dc/terms/>")
+ '(("dcat:" "<http://www.w3.org/ns/dcat#>")
+ ("dct:" "<http://purl.org/dc/terms/>")
("gn:" "<http://rdf.genenetwork.org/v1/id/>")
("gnc:" "<http://rdf.genenetwork.org/v1/category/>")
("gnt:" "<http://rdf.genenetwork.org/v1/term/>")
@@ -59,7 +68,7 @@
("xkos:" "<http://rdf-vocabulary.ddialliance.org/xkos#>")
("xsd:" "<http://www.w3.org/2001/XMLSchema#>")))
(inputs
- (list gn:set->gn:dataset))
+ (list gn:set->gn:dataset gn:dataset->gn:set))
(outputs
`(#:documentation ,documentation
#:rdf ,output))))