From 5159ed5430c5d8f15dc865aa32561e6b5bd6b7aa Mon Sep 17 00:00:00 2001 From: Jose Emilio Labra Gayo Date: Sun, 9 Jun 2024 09:46:59 +0200 Subject: [PATCH] Updated README --- .github/workflows/artifacts.yml | 7 ++-- README.md | 63 +++++++++++++++++++++++++-------- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index cb6be457..82ff1af5 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -14,7 +14,7 @@ concurrency: jobs: binary_linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Allow the workflow to access the files of the repository uses: actions/checkout@v3 @@ -26,6 +26,9 @@ jobs: run: | sudo apt update && sudo apt install -y g++-aarch64-linux-gnu echo -e "\n\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml + - name: Install libssl + run: | + sudo apt install libssl-dev - name: Use an intelligent Rust cache for building the project uses: Swatinem/rust-cache@v2 - name: Build the release version of `shapes-rs` for the x86 architecture @@ -131,7 +134,7 @@ jobs: if: github.event_name == 'release' deb: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Allow the workflow to access the files of the repository uses: actions/checkout@v3 diff --git a/README.md b/README.md index 145a0699..59776279 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ # SHAPES-rs -This repo contains an RDF data shapes library implemented in Rust. -The implementation supports both [ShEx](http://shex.io/) and [SHACL](https://www.w3.org/TR/shacl/). +This repo contains an RDF data shapes library implemented in Rust. +The implementation supports both [ShEx](http://shex.io/) and [SHACL](https://www.w3.org/TR/shacl/). We provide binaries for Linux, Windows, Mac and Docker (see [releases](https://github.com/weso/shapes-rs/releases)). @@ -15,27 +15,60 @@ We provide binaries for Linux, Windows, Mac and Docker (see [releases](https://g ### Installation -
-Instructions - #### Official releases -You can download a binary from the [latest release](https://github.com/weso/shapes-rs/releases/latest) page. There you will also find the compiled packages for the installation on -your system using a package manager. +You can download a binary from the [latest release](https://github.com/weso/shapes-rs/releases/latest) page. There you will also find the compiled packages for the installation on your system using a package manager. ##### Ubuntu -Note that the example below is for version 0.0.2. For any other version, please change the X.X.X values accordingly: +Download the binary from [https://github.com/weso/shapes-rs/releases] and install the `.deb` package running the following commands after replacing X.X.X by the latest version: ``` -wget https://github.com/weso/shapes-rs/releases/download/0.0.2/sx_0.0.2_amd64.deb -sudo dpkg -i sx_0.0.2_amd64.deb +wget https://github.com/weso/shapes-rs/releases/download/X.X.X/sx_vX.X.X_amd64.deb +sudo dpkg -i sx_vX.X.X_amd64.deb ``` +##### Windows + +The binary can be downloaded from [https://github.com/weso/shapes-rs/releases] + +##### Mac + +The binary is available at: [https://github.com/weso/shapes-rs/releases] + +
+Compiling from source + #### Compiling from source `shapes-rs` has been implemented in Rust and is compiled using [cargo](https://doc.rust-lang.org/cargo/). The command `cargo run` can be used to compile and run locally the code. +For example: + +``` +cargo run -- validate --data examples/user.ttl --schema examples/user.shex --shapemap examples/user.sm +``` + +#### Compiling from source and installing the binary (Debian) + +Install `cargo deb` (only the first time) + +``` +cargo install cargo-deb +``` + +Create the `.deb` package by: + +``` +cargo deb +``` + +And run: + +``` +sudo dpkg -i target/debian/shapes-rs_0.0.11-1_amd64.deb +``` + #### Docker TBD @@ -44,16 +77,18 @@ TBD ### Usage -#### Validate an example +#### Some examples The folder `examples` contains several example files with ShEx schemas and RDF data. -Validate a specific node with a shape: +##### Validate a simple RDF file with a ShEx schema using a ShapeMap ``` -sx validate --data examples/user.ttl --schema examples/user.jsonld --node :a --shape http://example.org/User +sx validate --data examples/user.ttl --schema examples/user.shex --shapemap examples/user.sm ``` +We maintain a Wiki page with some common [Usage scenarios and How-to guides](https://github.com/weso/shapes-rs/wiki/Howto-guides). + #### Debugging information It is possible to change the debug level information with: @@ -107,7 +142,7 @@ Options: ### Obtaining information about a node in RDF data -This command can be useful to obtain the neighbourhood of a node. +This command can be useful to obtain the neighbourhood of a node. ``` Usage: sx node [OPTIONS] --node