aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-24Import functions from (ccwl graphviz).Arun Isaac
* visualize-schema.scm (graph->dot, graph, graph-node, graph-edge, graph-port, html-string): New functions. (sxml->graphviz-html): Use html-string. (foreign-key-graphviz-edges): Use graph-port.
2021-12-24Color code dumped tables and columns.Arun Isaac
* visualize-schema.scm (sxml->graphviz-html): Color code dumped tables and columns.
2021-12-24Fetch entire table schema in single SPARQL query.Arun Isaac
* visualize-schema.scm (tables): Fetch entire table schema in single SPARQL query.
2021-12-24Add TODO note to prefer JSON query results to CSV.Arun Isaac
* visualize-schema.scm (sparql-query-records): Add TODO note to prefer JSON query results to CSV.
2021-12-24Document define-dump.Arun Isaac
* dump.scm (define-dump): Add docstring.
2021-12-24Introduce syntax-let abstraction.Arun Isaac
* dump.scm (syntax-let): New macro. (define-dump): Use syntax-let. * .dir-locals.el (scheme-mode): Indent syntax-let correctly.
2021-12-23Automatically create domain triples for predicates.Arun Isaac
* dump.scm (define-dump): Automatically create domain triples for predicates.
2021-12-23Dump metadata about the dump itself.Arun Isaac
* dump.scm (remove-namespace, dump-id): New functions. (define-dump): Dump metadata about the dump itself.
2021-12-23Disambiguate user and User tables in RDF identifier.Arun Isaac
* dump.scm (dump-schema, column-id): Disambiguate user and User tables in RDF identifier.
2021-12-23Abstract column id generation to separate function.Arun Isaac
* dump.scm (column-id): New function. (dump-schema): Use column-id.
2021-12-23Do not register dumped tables and columns to %dumped.Arun Isaac
* dump.scm (%dumped): Delete variable. (define-dump): Do not register dumped tables and columns to %dumped. (dumped-table?): Delete function.
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-23Specify range of gn:inbredSetOfSpecies.Arun Isaac
* dump.scm (dump-inbred-set): Set range of gn:inbredSetOfSpecies to gn:species.
2021-12-23Use foaf:Person instead of gn:investigator.Arun Isaac
* dump.scm (dump-info-files): Set range of gn:datasetOfInvestigator to foaf:Person instead of gn:investigator.
2021-12-23Add Literal range triples.Arun Isaac
* dump.scm (dump-species, dump-strain, dump-inbred-set, dump-phenotype, dump-publication, dump-tissue, dump-investigator, dump-avg-method, dump-gene-chip, dump-info-files): Add Literal range triples.
2021-12-23Remove duplicate predicates for gn:phenotype.Arun Isaac
* dump.scm (dump-phenotype): Remove duplicate predicates gn:prePublicationDescription and gn:postPublicationDescription.
2021-12-23Rename gn:authors predicate to gn:author.Arun Isaac
gn:authors is a typo. * dump.scm (dump-publication): Rename gn:authors predicate to gn:author.
2021-12-23Add runtime type checking for triple.Arun Isaac
* dump.scm (triple): Add runtime type checking.
2021-12-20Move schema visualization to separate script.Arun Isaac
* dump.scm: Do not import (sxml simple) and (dump string-similarity). (string-remove-suffix-ci, floor-log1024, human-units, human-units-color, sxml->xml-string, sxml->graphviz-html, table-label, table->graphviz-node, column->foreign-table, tables->graphviz-edges): Move to ... (dump-schema): Dump schema to RDF. (main): Call dump-schema without setting schema.dot as the output file. * visualize-schema.scm: ... here.
2021-12-20Add guile-sparql to Guix manifest.Arun Isaac
* guix.scm: Add guile-sparql to manifest.
2021-12-20Upgrade ccwl to latest commit.Arun Isaac
* guix.scm (ccwl): Upgrade to commit 51c12b7e58685b70e7cfd9612dac403cf9ee845c.
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-17Indent define-dump better.Arun Isaac
* dump.scm (define-dump): Indent better.
2021-12-17Document RDF schema during dumping.Arun Isaac
* dump.scm (define-dump): Support schema-triples clause. (dump-strain, dump-publish-xref, dump-info-files): Add schema-triples clause. (main): Output rdfs: prefix.
2021-12-17Make order of clauses in define-dump unspecified.Arun Isaac
* dump.scm (find-clause): New function. (define-dump): Make order of clauses unspecified.
2021-12-16Make define-dump syntax more concise.Arun Isaac
* dump.scm (field->key, field->assoc-ref, collect-fields): New functions. (define-dump): Redefine with more concise syntax. * dump.scm (dump-species, dump-strain, dump-mapping-method, dump-inbred-set, dump-phenotype, dump-publication, dump-publish-xref, dump-tissue, dump-investigators, dump-avg-method, dump-gene-chip, dump-info-files): Use new define-dump syntax. (default-metadata-proc): Delete function. * .dir-locals.el (scheme-mode): Indent triples form correctly.
2021-12-16Add tests.Arun Isaac
* tests.scm: New file.
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-14Camel case gn:binomialName.Arun Isaac
* dump.scm (dump-species): Change gn:binomialname to gn:binomialName.
2021-12-14Use node ports to indicate foreign key relations precisely.Arun Isaac
* dump.scm (table-label): Set port attributes on <td> tag. (tables->graphviz-edges): Specify ports on edges.
2021-12-14Specify appearance using HTML table.Arun Isaac
* dump.scm (table-label): Unset border attribute of <table> tag. Set cellborder and bgcolor attributes of <table> tag. (table->graphviz-node): Unset style and fillcolor node attributes. Set shape node attribute to none.
2021-12-14Take advantage of bug fixes in bleeding edge (ccwl graphviz).Arun Isaac
* dump.scm (graph->dot): Delete function. (sxml->graphviz-html): Return a <html-string> object. (dump-schema): Use graph->dot from (ccwl graphviz).
2021-12-13Upgrade to bleeding edge (ccwl graphviz).Arun Isaac
This fixes a few bugs and brings in new features from (ccwl graphviz). * guix.scm: Import (gnu packages autotools), (guix git-download) and (guix packages). Prefix (gnu packages bioinformatics) imports with guix:. (ccwl): New variable.
2021-12-13Abstract out table to graphviz edge conversion.Arun Isaac
* dump.scm (column->foreign-table, tables->graphviz-edges): New functions. (dump-schema): Use tables->graphviz-edges.
2021-12-13Abstract out table to graphviz node conversion.Arun Isaac
* dump.scm (dumped-table?, table-label, table->graphviz-node): New functions. (dump-schema): Use table->graphviz-node.
2021-12-13Color table headers by size.Arun Isaac
* dump.scm (human-units-color): New function. (dump-schema): Use human-units-color.
2021-12-13Implement human units conversion in terms of log1024.Arun Isaac
This generalizes better and is mathematically cleaner. * dump.scm (floor-log1024): New function. (human-units): Use floor-log1024.
2021-12-13Use sxml to construct graphviz HTML strings.Arun Isaac
Using sxml allows us to stay in the world of S-expressions. * dump.scm (sxml->xml-string, sxml->graphviz-html): New function. (dump-schema): Construct graphviz HTML string using sxml.
2021-12-11Highlight dumped tables and columns.Arun Isaac
* dump.scm (dump-schema): Highlight tables and columns.
2021-12-11Fix HTML string handling in dot output.Arun Isaac
* dump.scm (replace-substrings): New function. (graph->dot): Fix HTML string handling.
2021-12-11Log dumped tables and columns.Arun Isaac
* dump.scm (%dumped): New variable. (define-dump): Append to %dumped when a new table dumping function is defined.
2021-12-11Abstract out definition of table dumping functions.Arun Isaac
* dump.scm (define-dump): New macro. (dump-species, dump-strain, dump-mapping-method, dump-inbred-set, dump-phenotype, dump-publication, dump-publish-xref, dump-tissue, dump-investigators, dump-avg-method, dump-gene-chip, dump-info-files): Redefine using define-dump.
2021-12-11Use string similarity and check if foreign key is an integer.Arun Isaac
* dump.scm (<column>): New type. (tables): Use <column> objects to represent columns. (trigrams, jaccard-index, jaccard-string-similarity): New functions. (dump-schema): Use string similarity and check if foreign key is an integer.
2021-12-11Remove rdflib python code.Arun Isaac
* rdf.py: Delete file.
2021-12-11Visualize schema.Arun Isaac
* .dir-locals.el (scheme-mode): Indent set-table-columns correctly. * dump.scm: Import (srfi srfi-9 gnu). (%database-name): New variable. (<table>): New type. (tables, string-remove-suffix-ci, human-units, graph->dot, dump-schema): New functions. Invoke dump-schema. * guix.scm: Import (gnu packages bioinformatics). Add ccwl, graphviz and guile-libyaml to the manifest.
2021-12-11Use select-query.Arun Isaac
* dump.scm (get-tables-from-comments, dump-table-fields, dump-species, dump-strain, dump-mapping-method, dump-inbred-set, dump-phenotype, dump-publication, dump-publish-xref, dump-tissue, dump-investigators, dump-avg-method, dump-gene-chip, dump-info-files): Use select-query.