diff options
Diffstat (limited to 'transform')
| -rw-r--r-- | transform/strings.scm | 13 | ||||
| -rw-r--r-- | transform/triples.scm | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/transform/strings.scm b/transform/strings.scm index 8b4ee45..c0f02e5 100644 --- a/transform/strings.scm +++ b/transform/strings.scm @@ -1,6 +1,11 @@ (define-module (transform strings) #:use-module (srfi srfi-1) #:use-module (srfi srfi-19) + #:use-module (rnrs bytevectors) + #:use-module (uuid generate) + #:use-module (uuid utils) + #:use-module (uuid well-known) + #:use-module (ice-9 iconv) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) #:use-module (ice-9 string-fun) @@ -20,7 +25,13 @@ fix-email-id blank-p investigator-attributes->id - path-without-extension)) + path-without-extension + gn-uuid)) + +(define (gn-uuid string) + (generate-string-uuid + 'uuidv5 + (string->bytevector string "UTF-8"))) (define (blank-p str) (if (string-blank? str) #f str)) diff --git a/transform/triples.scm b/transform/triples.scm index 13758e5..7f96eea 100644 --- a/transform/triples.scm +++ b/transform/triples.scm @@ -39,6 +39,7 @@ #:optional #:key (ontology "gn:") (separator "") + (url-char #\_) (proc (lambda (x) x))) "Convert STR to a turtle identifier after replacing illegal characters with an underscore and prefixing with gn:PREFIX." @@ -55,7 +56,7 @@ characters with an underscore and prefixing with gn:PREFIX." (char-numeric? c) (char=? c #\_)) c - #\_)) + url-char)) (proc str))))))) |
