From 1981d1e517b5f2b0d3a6caa4ffd8505833ae17c5 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 14 Mar 2023 11:18:04 +0300 Subject: Create a method to define ontologies as symbols * dump/triples.scm: Export ontology. (ontology): New function. Signed-off-by: Munyoki Kilyungi --- dump/triples.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dump') diff --git a/dump/triples.scm b/dump/triples.scm index bb2acdc..1509ded 100644 --- a/dump/triples.scm +++ b/dump/triples.scm @@ -1,7 +1,8 @@ (define-module (dump triples) #:use-module (ice-9 match) #:use-module (dump utils) - #:export (string->identifier + #:export (ontology + string->identifier prefix triple scm->triples)) @@ -21,6 +22,10 @@ characters with an underscore and prefixing with gn:PREFIX." (define (prefix prefix iri) (format #t "@prefix ~a ~a .~%" prefix iri)) +(define (ontology prefix value) + (string->symbol + `,(format #f "~a~a" prefix value))) + (define (triple subject predicate object) (unless (or (string? subject) (symbol? subject)) -- cgit v1.2.3