aboutsummaryrefslogtreecommitdiff
path: root/dump
AgeCommit message (Collapse)Author
2023-07-21Add string-capitalize-firstMunyoki Kilyungi
* dump/strings.scm: Export string-capitalize-first (string-capitalize-first): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Make string->identifier take optional keyword argsMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Make dump-data? default to #f when dumping dataMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Rewrite dump-with-documentation to be order-agnosticMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Conditionally dump documentationMunyoki Kilyungi
2023-07-21Make prefix function have an optional ttl?Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Revert "Pass port as an optional argument"Munyoki Kilyungi
This reverts commit 195ca590be5533935cf708d49fcb3736b3c78643.
2023-07-21Add missing srfi-26 importMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Create a new procedure for shadowing a file portMunyoki Kilyungi
* dump/documentation.scm (dump): Export call-with-documentation. (call-with-documentation): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Rename auto-documentation-port -> pathMunyoki Kilyungi
We don't need to pass around ports as part of a configuration when we can instead pass in a path that can be used to open a port. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Move dump-configuration record type to (dump documentation)Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Construct example SQL query and expected resultsMunyoki Kilyungi
2023-07-21Pass port to scm->triplesMunyoki Kilyungi
* dump/triples.scm (scm->triples): Make define have an optional arg fn that defaults to "triple".
2023-07-21Pass port as an optional argumentMunyoki Kilyungi
* dump/triples.scm (triple): Add port as an optional argument. Defaults to #t. This enables us to use triple to print to other ports E.g in the case of dumping documentation to a different file. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Print out triples with the from Table.Name or Table.AliasMunyoki Kilyungi
* dump/special-forms.scm (field->datum): New function. (define-dump): Use the field->datum to convert triples into the form Table.Name or Table.Alias. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Add table metadata to triple dumpMunyoki Kilyungi
2023-07-21Add a section sub-heading for schema triplesMunyoki Kilyungi
2023-07-21Wrap the dump title in quotesMunyoki Kilyungi
2023-07-21Replace #` with #'when fetching the name of the defined dumpMunyoki Kilyungi
2023-07-21Use call-with-target-database when dumping schema annotationsMunyoki Kilyungi
* dump/schema-dump.scm (dump-schema-annotations): Replace call-with-genenetwork-database with call-with-target-database.
2023-07-21Conditionally autogenerate schema triples during dumpMunyoki Kilyungi
2023-07-21Rename dump-configuration slotsMunyoki Kilyungi
* dump/special-forms.scm: Export dump-configuration? Rename dump-configuration-table-metadata -> dump-configuration-triples?; dump-configuration-table-dump -> dump-configuration-table-metadata?; and dump-configuration-auto-document-path -> dump-configuration-auto-documentation-port (<dump-configuration>): Ditto renames. (dump-configuration): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Make dumping optional, defaulting to #tMunyoki Kilyungi
There may be a case where one just wants to dump metadata about the s-exps only.
2023-07-21Add table-dump? option to dump-configuration recordMunyoki Kilyungi
* dump/special-forms.scm: Export dump-configuration-table-dump?. (<dump-configuration>): Add dump-configuration-table-dump. (dump-configuration): Make table-dump? default to #t. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-07-21Optionally self-document while dumpingMunyoki Kilyungi
2023-07-21Add a configuration record-type for for the define macroMunyoki Kilyungi
* dump/special-forms.scm: Import (srfi srfi-9 gnu). (<dump-configuration>): New record-type. (define-dump): Use the above record-type.
2023-06-21Fix failing testsMunyoki Kilyungi
* dump/special-forms.scm: Export map-alist. * tests.scm: Import strings, and special-forms.
2023-05-26Replace broken char-sets with an empty stringMunyoki Kilyungi
* dump/strings.scm (sanitize-rdf-string): Add extra elements---broken chars---to replace with "". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-05-26Re-organize dumping macros and associated functionsMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-05-26Always use "~a" to output like "display"Munyoki Kilyungi
Replacing "~s" with "~a" will print utf-8 characters correctly. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-05-26Return an empty string if args passed to ontology is emptyMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-05-26Fix how a symbol is displayed in the final RDFMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Simplify pattern matching when checking for a nodeMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Use match syntax to print object correctly during dumpMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Allow running raw queries in field formMunyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Annotate fields with a custom scheme such as "^^xsd:datetime"Munyoki Kilyungi
* dump.scm (annotate-field): New function. * dump/triples.scm (triple): Print a string as they appear with DISPLAY should they contain "\"" thus enabling a triple that looks like: gn:species_mus_musculus gn:name "Mouse"^^xsd:string Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Add a method to transform epoch time to a human readable formatMunyoki Kilyungi
* dump/utils.scm: Import srfi-19. Export time-unix->string. (time-unix->string): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Create a method to define ontologies as symbolsMunyoki Kilyungi
* dump/triples.scm: Export ontology. (ontology): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2023-04-05Add ability to have operations such as GROUP_CONCAT in SELECT clauseMunyoki Kilyungi
This change enables having: "... GROUP_CONCAT(GeneRIF_BASIC.PubMedId) AS alias ..." as part of the query. * dump.scm (field->key, field->assoc-ref): Add new syntax-rule. * dump/sql.scm (select-query): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2022-10-30Move triple utilities to new module.Arun Isaac
* dump.scm (string->identifier, string-blank?, triple, prefix): Move to ... * dump/triples.scm: ... new file. * dump.scm: Import (dump triples).
2022-10-30Move string-blank? to (dump utils).Arun Isaac
* dump.scm (string-blank?): Move to ... * dump/utils.scm (string-blank?): ... here.
2022-03-10Rename the delete verb of map-alist to remove.Arun Isaac
The delete verb of map-alist somehow interacts with the delete function from (srfi srfi-1), and I'm not able to figure out how. It is simpler to just rename the delete verb to remove. * dump/utils.scm: Do not rename the delete function from (srfi srfi-1). (map-alist): Rename the delete verb to remove. * tests.scm ("map-alist docstring example"): Update test.
2021-12-23Add dumped? field to <column> type.Arun Isaac
* dump/table.scm (<column>): Add dumped? field. Rename constructor to column-constructor. (make-column): Implement as wrapper around column-constructor.
2021-12-20Capture full column type.Arun Isaac
Capture full column type instead of just whether it is an integer. * dump.scm (dump-data-table): Capture full column type in <column> object. * dump/table.scm (<column>)[int?]: Delete member. [type]: New member. Export column-type instead of column-int?.
2021-12-20Move <table> and <column> types to separate module.Arun Isaac
* dump.scm (<table>, <column>): Move to ... * dump/table.scm: ... here.
2021-12-16Specify map-alist behaviour for multiple set verbs.Arun Isaac
* dump/utils.scm (map-alist): Specify behaviour for multiple set verbs.
2021-12-16Generalize collect-keys and key->assoc-ref.Arun Isaac
The generalized versions---collect forms and translate-forms---will be required by other macros. * dump/utils.scm (collect-forms, translate forms): New public functions. (collect-keys): Rewrite in terms of collect-forms. (key->assoc-ref): Rewrite in terms of translate-forms.
2021-12-16Rename away delete from (srfi srfi-1).Arun Isaac
delete from (srfi srfi-1) somehow interferes with the delete verb of map-alist. It is not clear why. * dump/utils.scm (dump): Rename delete to srfi:delete while importing.
2021-12-15Move string similarity functions to separate module.Arun Isaac
* dump.scm: Use (dump string-similarity). (trigrams, jaccard-index, jaccard-string-similarity, jaccard-string-similar?): Move to ... * dump/string-similarity.scm: ... here.
2021-12-11Implement S-expression like SQL select query.Arun Isaac
* dump/sql.scm: Import (srfi srfi-1). Export select-query. (select-query): New macro.