diff options
author | Munyoki Kilyungi | 2023-06-29 22:08:15 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2023-07-21 14:36:35 +0300 |
commit | 51b87b5300bbbd415d3a3d3285ba1f93fba53203 (patch) | |
tree | 8c8b9a7e80eac759b6056d81a3a80cbaf6c4cb16 /dump/special-forms.scm | |
parent | 31825be584da4108d0984a310e8c301516d9bb4f (diff) | |
download | gn-transform-databases-51b87b5300bbbd415d3a3d3285ba1f93fba53203.tar.gz |
Optionally self-document while dumping
Diffstat (limited to 'dump/special-forms.scm')
-rw-r--r-- | dump/special-forms.scm | 20 |
1 files changed, 20 insertions, 0 deletions
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 ...))) |