aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-07-31 16:12:55 +0300
committerMunyoki Kilyungi2023-07-31 16:12:55 +0300
commit2837094f7d9240a837a867bed253cf333d44ee13 (patch)
tree12bc796dbec457f5b9e410176c714c8766de9e90 /examples
parent88f89358559abd7383781e9f16d0fc125f3dc188 (diff)
downloadgn-transform-databases-2837094f7d9240a837a867bed253cf333d44ee13.tar.gz
Update how strains are modelled
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/dump-species-metadata.scm23
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/dump-species-metadata.scm b/examples/dump-species-metadata.scm
index 292c0cf..bebd329 100755
--- a/examples/dump-species-metadata.scm
+++ b/examples/dump-species-metadata.scm
@@ -51,11 +51,10 @@
(tables (Strain
(left-join Species "ON Strain.SpeciesId = Species.SpeciesId")))
(schema-triples
- (gnt:strainOfSpecies rdfs:domain gnt:strain)
- (gnt:strainOfSpecies rdfs:range gn-term:species)
- (gn-term:name rdfs:range rdfs:Literal)
- (gn-term:alias rdfs:range rdfs:Literal)
- (gn-term:symbol rdfs:range rdfs:Literal))
+ (gnc:strain rdf:subClassOf gnc:species)
+ (gnt:species rdfs:domain gnc:strain)
+ (gnt:alias rdfs:range gnc:strain)
+ (gnt:symbol rdfs:range gnc:strain))
(triples (string->identifier
""
(regexp-substitute/global
@@ -65,13 +64,15 @@
#:separator ""
#:proc string-capitalize-first)
(set rdf:type 'gnc:strain)
- (set gn-term:strainOfSpecies
- (string->binomial-name (field Species FullName)))
+ (set gnt:species
+ (string->identifier "" (remap-species-identifiers (field Species Fullname))
+ #:separator ""
+ #:proc string-capitalize-first))
;; Name, and maybe a second name
- (set gn-term:name (sanitize-rdf-string (field Strain Name)))
- (set gn-term:name2 (sanitize-rdf-string (field Strain Name2)))
- (set gn-term:alias (sanitize-rdf-string (field Strain Alias)))
- (set gn-term:symbol (field Strain Symbol))))
+ (set rdfs:label (sanitize-rdf-string (field Strain Name)))
+ (set rdfs:label (sanitize-rdf-string (field ("IF ((Strain.Name2 != Strain.Name), Strain.Name2, '')" Name2))))
+ (set gnt:alias (sanitize-rdf-string (field Strain Alias)))
+ (set gnt:symbol (field Strain Symbol))))
(define-dump dump-mapping-method
(tables (MappingMethod))