From 6aebd73eeeef944e555fec225c529c7674d7336d Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 16 Mar 2023 18:40:19 +0300 Subject: Annotate fields with a custom scheme such as "^^xsd:datetime" * dump.scm (annotate-field): New function. * dump/triples.scm (triple): Print a string as they appear with DISPLAY should they contain "\"" thus enabling a triple that looks like: gn:species_mus_musculus gn:name "Mouse"^^xsd:string Signed-off-by: Munyoki Kilyungi --- dump.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dump.scm') diff --git a/dump.scm b/dump.scm index 9650de5..01376b2 100755 --- a/dump.scm +++ b/dump.scm @@ -89,6 +89,15 @@ ;;; Dump tables +(define (annotate-field field schema) + (let ([schema (cond ((symbol? schema) + (symbol->string schema)) + ((string? schema) schema) + (else + (error "Use a string/symbol")))]) + (string->symbol + (format #f "~s~a" field schema)))) + (define (delete-substrings str . substrings) "Delete SUBSTRINGS, a list of strings, from STR." (fold (lambda (substring result) -- cgit v1.2.3