From 1b775aaefc9e2eaf5bfda62ec94856d7c10fce45 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Thu, 29 Jun 2023 22:08:15 +0300 Subject: Optionally self-document while dumping --- dump/special-forms.scm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dump') diff --git a/dump/special-forms.scm b/dump/special-forms.scm index bd1760b..0099f73 100644 --- a/dump/special-forms.scm +++ b/dump/special-forms.scm @@ -439,6 +439,26 @@ must be remedied." (triple 'predicate 'rdfs:domain #,subject-type)))) (_ (error "Invalid predicate clause:" predicate-clause)))) #'(predicate-clauses ...)))) + (when (dump-configuration-auto-document-path configuration) + (for-each (match-lambda + ((predicate . object) + (format #f "Subject:~a Predicate:~a Object:~a.~%" + #,(car (collect-keys + (field->key #'subject))) + predicate object))) + (map-alist + '() + #,@(translate-forms 'field + (lambda (x) + (symbol->string + (syntax->datum + ((syntax-rules (field) + ((field (query alias)) alias) + ((field table column) column) + ((field table column alias) alias)) + x)))) + #'(predicate-clauses ...)) + ))) (sql-for-each (lambda (row) (scm->triples (map-alist row #,@(field->key #'(predicate-clauses ...))) -- cgit v1.2.3