diff options
author | Munyoki Kilyungi | 2023-07-11 10:26:21 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-07-30 12:29:56 +0300 |
commit | d9955860338facec2d36a80ef8959254ac4ef928 (patch) | |
tree | c8eabbc9510525245d7d597be7b7aa648a58ab52 /dump/triples.scm | |
parent | 9fd4ef6dc5512aacdc60c1bf0dc378d72a8a3dfe (diff) | |
download | gn-transform-databases-d9955860338facec2d36a80ef8959254ac4ef928.tar.gz |
Pass port to scm->triples
* dump/triples.scm (scm->triples): Make define have an optional arg fn
that defaults to "triple".
Diffstat (limited to 'dump/triples.scm')
-rw-r--r-- | dump/triples.scm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/dump/triples.scm b/dump/triples.scm index 19817bd..710e00f 100644 --- a/dump/triples.scm +++ b/dump/triples.scm @@ -68,12 +68,14 @@ characters with an underscore and prefixing with gn:PREFIX." (format port pattern subject predicate (if (symbol? object) (symbol->string object) object)))) -(define (scm->triples alist id) +(define* (scm->triples alist id + #:optional + (fn triple)) (for-each (match-lambda ((predicate . object) (when (cond ((string? object) (not (string-blank? object))) (else object)) - (triple id predicate object)))) + (fn id predicate object)))) alist)) |