about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2024-08-16 11:55:29 +0300
committerMunyoki Kilyungi2024-08-16 12:57:09 +0300
commit59c576cf30b435a6c90e09d4e50feaf21ba28970 (patch)
treedaaa48ccadf317a6b1595f52683337849fb1f3de
parentc81e764186a73b67538a3a4bd227475b546a699e (diff)
downloadgn-transform-databases-59c576cf30b435a6c90e09d4e50feaf21ba28970.tar.gz
Transform VersionIds in geneWiki transform correctly.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rwxr-xr-xexamples/generif.scm23
1 files changed, 8 insertions, 15 deletions
diff --git a/examples/generif.scm b/examples/generif.scm
index d214cd1..d4d483e 100755
--- a/examples/generif.scm
+++ b/examples/generif.scm
@@ -49,7 +49,7 @@
            (left-join Species "ON Species.SpeciesId = GeneRIF.SpeciesId")
            (left-join GeneRIFXRef "ON GeneRIFXRef.GeneRIFId = GeneRIF.Id")
            (left-join GeneCategory "ON GeneRIFXRef.GeneCategoryId = GeneCategory.Id"))
-          "WHERE GeneRIF.display > 0 AND GeneRIF.VersionId = 0 AND GeneRIF.comment IS NOT NULL GROUP BY GeneRIF.comment, BINARY GeneRIF.symbol")
+          "WHERE GeneRIF.display > 0 AND GeneRIF.comment IS NOT NULL GROUP BY GeneRIF.Id, GeneRIF.versionId, GeneRIF.symbol, GeneRIF.SpeciesId, GeneRIF.createtime, GeneRIF.reason")
   (schema-triples
    (gnc:GeneWikiEntry a rdfs:Class)
    (gnc:GNWikiEntry rdfs:subClassOf gnc:GeneWikiEntry)
@@ -84,16 +84,9 @@
                 (initial (sanitize-rdf-string (field GeneRIF initial)))
                 (reason (field GeneRIF reason))
                 (email (sanitize-rdf-string (field GeneRIF email)))
-                (categories
-                 (remove (lambda (x)
-                           (or (eq? x #f)
-                               (and (string? x)
-                                    (string-null? x))))
-                         (remove-duplicates
-                          (string-split-substring
-                           (field ("GROUP_CONCAT(DISTINCT GeneCategory.Name SEPARATOR '$$')"
-                                   GeneCategory))
-                           "$$")))))
+                (category
+                 (field ("GROUP_CONCAT(DISTINCT GeneCategory.Name SEPARATOR '; ')"
+                         GeneCategory))))
            (string->symbol
             (string-append
              "[ "
@@ -123,11 +116,11 @@
                  ""
                  (format #f "gnt:reason ~s ; " reason))
              (if (string-blank? initial) "" (format #f "gnt:initial ~s ; " initial))
-             (if (not (null? categories))
+             (if (string-blank? category)
+                 ""
                  (format #f
-                         "~{gnt:belongsToCategory ~s ; ~}"
-                         categories)
-                 "")
+                         "gnt:belongsToCategory ~s ; "
+                         category))
              (if (and (string? web-url) (not (string-null? web-url)))
                  (format #f "foaf:homepage ~s ; "
                          web-url)