aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPjotr Prins2023-07-30 10:31:34 +0200
committerPjotr Prins2023-07-30 10:31:34 +0200
commitbf09c92f4b84a5037c02a72f6d8d05901dc1a234 (patch)
tree4351189bb50514d68efd0ffdeee167c803159db7 /examples
parent9f332ce32738292c082b1cf41995457259be7625 (diff)
downloadgn-transform-databases-bf09c92f4b84a5037c02a72f6d8d05901dc1a234.tar.gz
Remap identifiers
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dump-species-metadata.scm15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/dump-species-metadata.scm b/examples/dump-species-metadata.scm
index 41d5847..3a6a6af 100755
--- a/examples/dump-species-metadata.scm
+++ b/examples/dump-species-metadata.scm
@@ -18,6 +18,15 @@
+(define (remap-species-identifiers str)
+ "This procedure remaps identifiers to standard binominal. Obviously this should
+ be sorted in a different way!"
+ (match str
+ ["Fly (Drosophila melanogaster, dm6)" "Drosophila melanogaster"]
+ ["Oryzias latipes (Japanese medaka)" "Oryzias latipes"]
+ ["Monkey (Macaca nemestrina)" "Macaca nemestrina"]
+ [str str]))
+
(define-dump dump-species
(tables (Species))
(schema-triples
@@ -26,9 +35,9 @@
(gn-term:binomialName rdfs:range rdfs:Literal)
(gn-term:family rdfs:range rdfs:Literal))
(triples
- (string->identifier "" (field Species FullName)
- #:separator ""
- #:proc string-capitalize-first)
+ (string->identifier "" (remap-species-identifiers (field Species Fullname))
+ #:separator ""
+ #:proc string-capitalize-first)
(set rdf:type 'gn:species)
(set gn-term:name (field Species SpeciesName))
(set gn-term:displayName (field Species MenuName))