aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-05-22 10:51:20 +0300
committerBonfaceKilz2023-05-26 08:40:22 +0300
commit2363e578a834d4017ef4e320fa7da553376c61cf (patch)
treeb31605a0548cc1134e91481f7a1e9ee9efed80ed
parentdbbbf859b187c80545d923c2f712f0c755843a8f (diff)
downloadgn-transform-databases-2363e578a834d4017ef4e320fa7da553376c61cf.tar.gz
Update a dataset's subject identifier to be a gn url
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rwxr-xr-xexamples/dump-dataset-metadata.scm7
-rwxr-xr-xexamples/dump-phenotype.scm7
2 files changed, 11 insertions, 3 deletions
diff --git a/examples/dump-dataset-metadata.scm b/examples/dump-dataset-metadata.scm
index aa7a5f2..e4f8334 100755
--- a/examples/dump-dataset-metadata.scm
+++ b/examples/dump-dataset-metadata.scm
@@ -130,8 +130,10 @@
(gn:contributors rdfs:range rdfs:Literal)
(gn:citation rdfs:range rdfs:Literal)
(gn:acknowledgment rdfs:range rdfs:Literal))
- (triples (string->identifier "dataset"
- (field InfoFiles InfoPageName))
+ (triples (ontology 'dataset:
+ (regexp-substitute/global #f "[^A-Za-z0-9:]"
+ (field InfoFiles InfoPageName)
+ 'pre "_" 'post))
;; Add GeneChipName and GeoPlatform:
;; GeneChip.GeneChipName AS gene_chip_name
;; GeneChip.GeoPlatform AS geo_platform
@@ -214,6 +216,7 @@
(prefix "uniprot:" "<http://purl.uniprot.org/uniprot/>")
(prefix "up:" "<http://purl.uniprot.org/core/>")
(prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>")
+ (prefix "dataset:" "<http://genenetwork.org/dataset/>")
(newline)
(dump-info-files db)
(dump-investigators db))
diff --git a/examples/dump-phenotype.scm b/examples/dump-phenotype.scm
index 242e835..08d5127 100755
--- a/examples/dump-phenotype.scm
+++ b/examples/dump-phenotype.scm
@@ -89,7 +89,11 @@
(set gn:LRS (annotate-field (field ("IFNULL(PublishXRef.LRS, '')" lrs)) '^^xsd:float))
(set gn:additive (annotate-field (field ("IFNULL(PublishXRef.additive, '')" additive)) '^^xsd:decimal))
(set gn:sequence (annotate-field (field PublishXRef Sequence) '^^xsd:int))
- (set gn:phenotypeOfDataset (string->identifier "dataset" (field PublishFreeze Name)))
+ (set gn:phenotypeOfDataset
+ (ontology 'dataset:
+ (regexp-substitute/global #f "[^A-Za-z0-9:]"
+ (field PublishFreeze Name)
+ 'pre "_" 'post)))
(set gn:phenotypeOfPublication
(let ((pmid (field
("IF(Publication.PubMed_ID IS NULL, '', CONVERT(Publication.PubMed_Id, INT))"
@@ -127,6 +131,7 @@
(prefix "uniprot:" "<http://purl.uniprot.org/uniprot/>")
(prefix "up:" "<http://purl.uniprot.org/core/>")
(prefix "xsd:" "<http://www.w3.org/2001/XMLSchema#>")
+ (prefix "dataset:" "<http://genenetwork.org/dataset/>")
(newline)
(dump-publishfreeze db)
(dump-phenotypes db))