From 76da7359cf0bf9c45673853c78a20ce616dce248 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 23 Dec 2025 20:08:22 +0300 Subject: Strictly follow PN_LOCAL rules when constructing qnames. Signed-off-by: Munyoki Kilyungi --- transform/triples.scm | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'transform/triples.scm') diff --git a/transform/triples.scm b/transform/triples.scm index e24e68e..13758e5 100644 --- a/transform/triples.scm +++ b/transform/triples.scm @@ -47,19 +47,16 @@ characters with an underscore and prefixing with gn:PREFIX." "" (string->symbol (string-append ontology prefix separator - (string-delete - (lambda (c) - (eq? c #\))) - (string-map (lambda (c) - (case c - ((#\/ #\< #\> #\+ #\( #\space #\@) #\-) - (else c))) - (proc - (string-trim-right - (regexp-substitute/global - #f "_" - str - 'pre "-" 'post) #\.)))))))) + (string-delete + (lambda (c) + (eq? c #\))) + (string-map (lambda (c) + (if (or (char-alphabetic? c) + (char-numeric? c) + (char=? c #\_)) + c + #\_)) + (proc str))))))) (define* (prefix prefix iri #:optional (ttl? #t)) -- cgit 1.4.1