about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-09-11 14:00:36 +0300
committerMunyoki Kilyungi2023-09-11 14:00:36 +0300
commit3bb162de45b85a36a2a869df58c2f921153bab74 (patch)
tree2288adef212f3629dd89978becc23d9ba7651a26
parentb9252098ede330fb41b463530e93f182d4e929bf (diff)
downloadgn-transform-databases-3bb162de45b85a36a2a869df58c2f921153bab74.tar.gz
Update generif metadata dump.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rwxr-xr-xexamples/generif.scm34
1 files changed, 19 insertions, 15 deletions
diff --git a/examples/generif.scm b/examples/generif.scm
index 83f8632..b8f81a1 100755
--- a/examples/generif.scm
+++ b/examples/generif.scm
@@ -152,34 +152,38 @@
       (string->identifier
        "symbol"
        (regexp-substitute/global #f "[^A-Za-z0-9:]"
-                                 (field GeneRIF_BASIC symbol)
+                                 (field GeneRIF_BASIC symbol GeneRIFSymbol)
                                  'pre "_" 'post)
        #:proc (lambda (x) x))
     (set rdfs:comment
-         (let* ([ncbi-comment (field GeneRIF_BASIC comment)]
-                [species
-                 (string->identifier
-                  ""
-                  (remap-species-identifiers (field Species Fullname))
-                  #:separator ""
-                  #:proc string-capitalize-first)]
-                [taxonomic-id (field GeneRIF_BASIC TaxID)]
-                [create-time (field GeneRIF_BASIC createtime EntryCreateTime)]
-                [pmid (field GeneRIF_BASIC PubMed_ID PMID)])
+         (let ([ncbi-comment (sanitize-rdf-string (field GeneRIF_BASIC comment))]
+               [species-name
+                (string->identifier
+                 ""
+                 (remap-species-identifiers (field Species Fullname SpeciesFullName))
+                 #:separator ""
+                 #:proc string-capitalize-first)]
+               [taxonomic-id (field GeneRIF_BASIC TaxID TaxonomicId)]
+               [create-time (field GeneRIF_BASIC createtime EntryCreateTime)]
+               [pmid (field GeneRIF_BASIC PubMed_ID PMID)]
+               [gene-id (field GeneRIF_BASIC GeneId)]
+               [version-id (field GeneRIF_BASIC VersionId)])
            (string->symbol
             (string-append
              "[ "
              (format #f "rdf:type gnc:NCBIWikiEntry ; ")
+             (format #f "rdfs:comment ~s^^xsd:string ; "
+                     ncbi-comment)
              (format #f "xkos:classifiedUnder ~a ; "
-                     species)
+                     species-name)
              (if (eq? #f taxonomic-id)
                  ""
                  (format #f "skos:notation taxon:~a ; "
-                         (field GeneRIF_BASIC TaxID)))
+                         taxonomic-id))
              (format #f "gnt:hasGeneId generif:~a ; "
-                     (field GeneRIF_BASIC GeneId))
+                     gene-id)
              (format #f "gnt:hasVersionId '~a'^^xsd:integer ; "
-                     (field GeneRIF_BASIC VersionId))
+                     version-id)
              (if (and (string? pmid) (not (string-null? pmid)))
                  (format #f
                          "~{dct:references pubmed:~a ; ~}"