aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ; ~}"