From 4849c2dd68d373eab43e93206781321fd2dd34ff Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 9 Jul 2024 12:52:57 -0500 Subject: Document running actual transformation scripts Document an example command to invoke to enable the actual transformation of the data to be done. This will need to be cleaned up, and the commands will also need to check for the appropriate arguments before attempting to run in the first place. Reviewed-by: Munyoki Kilyungi --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 92d5e31..214f165 100644 --- a/README.md +++ b/README.md @@ -74,16 +74,35 @@ Here's a sample *conn.scm*. ## Transform the database -Then, to transform the database to into ttl files, \~/data/dump, run inside the shell: +Example: Transform the phenotype from SQL to Terse RDF Triple Language (TTL) ```sh -./pre-inst-env ./examples/dump-species-metadata.scm ../conn.scm ~/tmp +guile -s examples/phenotype.scm \ + --settings=conn.scm \ + --output=tmp/phenotype.ttl \ + --documentation=tmp/phenotype.ttl.md ``` -``` shell -$ guix shell -m manifest.scm -- ./pre-inst-env ./examples/dump-dataset-metadata.scm ../conn.scm ~/tmp +the `-s` option to *guile* runs the `examples/phenotype.scm` file as a script. Everything else on the command line is passed onto the script as command-line arguments. + +This should create the files: +- `tmp/phenotype.ttl`: will contain the data in the database in TTL format +- `tmp/phenotype.ttl.md`: will contain a short documentation on the data in the file above. + +**Note to Devs**: The current `pre-inst-env` script will not work within containers since it assumes the existence of `/usr/bin/env`. We need to fix that if we intend to keep using that. + + +There is a shorter form of the command above: + +```sh +guile -s examples/phenotype.scm \ + -s conn.scm \ + -o tmp/phenotype.ttl \ + -d tmp/phenotype.ttl.md ``` +which does the same thing, but has the potential to be confusing due to the two `-s` options: the first `-s` option is to guile while the second is to the script itself. + ## Validate and load dump Then, validate the dumped RDF using `rapper` and load it into -- cgit v1.2.3