diff options
author | Frederick Muriuki Muriithi | 2024-07-09 12:52:57 -0500 |
---|---|---|
committer | Munyoki Kilyungi | 2024-07-10 12:03:11 +0300 |
commit | 4849c2dd68d373eab43e93206781321fd2dd34ff (patch) | |
tree | fbce75ac73c59bd0a00f224de9fd5d5aab907bc8 | |
parent | 3eb01f8b0611e18d293283f761259961752c3c5c (diff) | |
download | gn-transform-databases-4849c2dd68d373eab43e93206781321fd2dd34ff.tar.gz |
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 <me@bonfacemunyoki.com>
-rw-r--r-- | README.md | 27 |
1 files changed, 23 insertions, 4 deletions
@@ -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 |