From a72572a78d7f4dbbf9dd0ef8268590366c9cb762 Mon Sep 17 00:00:00 2001 From: Ashley Caselli Date: Tue, 12 Mar 2024 18:53:27 +0100 Subject: [PATCH] docs(readme): add how-to-run section --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e574739 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# SHACL-X Examples + +This repository contains the examples shown in the SHACL-X docs, available at [https://shacl-x.github.io/docs/](https://shacl-x.github.io/docs/). + + +## Structure + +The repository is organized as follows +- `data/` contains the data and shapes definition +- `web/` contains the JavaScript/Py functions used in the shapes + +## Run the examples +The content of the `web` directory is packed into an `nginx` that is released as docker image through the GitHub Packages registry. + +1. Create the docker network + ``` + docker network create shacl-x + ``` +2. Run the `shacl-x/examples` (nginx) container + ``` + docker run --network="shacl-x" \ + --name shacl-x-web \ + -p 8080:80 \ + ghcr.io/shacl-x/examples:latest + ``` +3. Run the `shacl-x/shacl-x` container with the `validate` command + ``` + docker run --rm --network="shacl-x" --name shacl-x-engine \ + -v ${PWD}/data:/data \ + ghcr.io/shacl-x/shacl-x:latest validate \ + -datafile /data/data.ttl \ + -shapesfile /data/shapes.ttl + ```