Sign inSign up

semmtech/shacl-api

By semmtech

•Updated over 5 years ago

Docker image with SHACL API installed

Image
0

327

semmtech/shacl-api repository overview

⁠Using the API

Get the docker image by running the following command in a Powershell:

docker image pull semmtech/shacl-api
⁠SHACL Infer

In the Powershell, go to the folder containing your data and shape files. From here a shacl validation or inferencing can now be done by running the following command (fill in the names of your datafile and shapesfile):

docker container run --rm -v "$(pwd):/tmp/" semmtech/shacl-api shaclinfer -datafile /tmp/data_file_name.ttl -shapesfile /tmp/shape_file_name.ttl > output.ttl

--rm causes Docker to automatically remove the container when it exits

-v is a mechanism for persisting data used by Docker containers

  • The first field is the name of the volume, and is unique on a given host machine (the $(pwd) returns the current working directory)
  • The second field is the path where the file or directory are mounted in the container

Remark: Using the > will pipe the output of the shaclinfer to a file (output.ttl) on the host machine and not in the container!

⁠SHACL Validate

The SHACL API also offers the shaclvalidate functionality.

docker container run --rm -v "$(pwd):/tmp/" semmtech/shacl-api shaclvalidate -datafile tmp/data_input.ttl -shapesfile tmp/shape_input.ttl > output.ttl

In case your file name has a whitespace you should put your filename between quotation marks (").

Finally, if you are testing if your SHACL query is working you can leave out > output.ttl at the end, then the output will be directly printed in the shell.

⁠References

For more information about the SHACL API, see TopBraid SHACL API⁠.

Tag summary

Content type

Image

Digest

Size

205.9 MB

Last updated

over 5 years ago

docker pull semmtech/shacl-api