From a62399ffa4de2cee5ae9042de071dd422dd70703 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 05:42:59 +0100 Subject: [PATCH 1/8] README: Use MD-ish direct URL links syntax --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7041056f..20be2b0e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ You can download a binary from the [latest release](https://github.com/rudof-pro #### Ubuntu -Download the binary from [https://github.com/rudof-project/rudof/releases] and install the `.deb` package running the following commands after replacing X.X.X by the latest version: +Download the binary from and install the `.deb` package running the following commands after replacing X.X.X by the latest version: ```sh wget https://github.com/rudof-project/rudof/releases/download/vX.X.X/rudof_vX.X.X_amd64.deb @@ -36,11 +36,11 @@ sudo dpkg -i rudof_vX.X.X_amd64.deb #### Windows -The binary can be downloaded from [https://github.com/rudof-project/rudof/releases] +The binary can be downloaded from . #### Mac -The binary is available at: [https://github.com/rudof-project/rudof/releases] so you can download the corresponding binary to your machine. +The binary is available at: so you can download the corresponding binary to your machine. The usual way to run/install a binary in Mac is to download it in a folder, add that folder to your PATH and activating the binary using: From 0490a13edf7ae8dc826d091b26444898dfbce839 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 05:52:35 +0100 Subject: [PATCH 2/8] README: Wraps long lines No content-changes. --- README.md | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 20be2b0e..458e93ef 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,19 @@ [![dependency status](https://deps.rs/repo/github/rudof-project/rudof/status.svg)](https://deps.rs/repo/github/rudof-project/rudof) This repo contains an RDF data shapes library implemented in Rust. -The implementation supports [ShEx](http://shex.io/), [SHACL](https://www.w3.org/TR/shacl/), [DCTap](https://www.dublincore.org/specifications/dctap/) and conversions between different RDF data modeling formalisms. +The implementation supports +[ShEx](http://shex.io/), +[SHACL](https://www.w3.org/TR/shacl/), +[DCTap](https://www.dublincore.org/specifications/dctap/) +and conversions between different RDF data modeling formalisms. -The code can be used as a Rust library but it also contains a binary called `rudof` which can be used as an RDF playground. +The code can be used as a Rust library +but it also contains a binary called `rudof` +which can be used as an RDF playground. -We provide binaries for Linux, Windows, Mac and Docker (see [releases](https://github.com/rudof-project/rudof/releases)), as well as Python bindings. +We provide binaries for Linux, Windows, Mac and Docker +(see [releases](https://github.com/rudof-project/rudof/releases)), +as well as Python bindings. - [Installation](https://github.com/rudof-project/rudof?tab=readme-ov-file#installation) - [List of issues](https://github.com/rudof-project/rudof) @@ -23,11 +31,14 @@ We provide binaries for Linux, Windows, Mac and Docker (see [releases](https://g ### Official releases -You can download a binary from the [latest release](https://github.com/rudof-project/rudof/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/rudof-project/rudof/releases/latest) page. +There you will also find the compiled packages +for the installation on your system using a package manager. #### Ubuntu -Download the binary from and install the `.deb` package running the following commands after replacing X.X.X by the latest version: +Download the binary from +and install the `.deb` package running the following commands after replacing X.X.X by the latest version: ```sh wget https://github.com/rudof-project/rudof/releases/download/vX.X.X/rudof_vX.X.X_amd64.deb @@ -40,22 +51,29 @@ The binary can be downloaded from so you can download the corresponding binary to your machine. +The binary is available at: + +so you can download the corresponding binary to your machine. -The usual way to run/install a binary in Mac is to download it in a folder, add that folder to your PATH and activating the binary using: +The usual way to run/install a binary in Mac is to download it in a folder, +add that folder to your PATH and activating the binary using: ```sh chmod +x ``` -After that, the processor may complain the first time about security and you have to agree to use it. Once you agree, it should work. +After that, the processor may complain the first time about security +and you have to agree to use it. +Once you agree, it should work.
Compiling from source ### Compiling from source -`rudof` 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. +`rudof` 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: @@ -417,6 +435,7 @@ at your option. ### Contribution Unless you explicitly state otherwise, -any contribution intentionally submitted -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any -additional terms or conditions. +any contribution intentionally submitted for inclusion in the work by you, +as defined in the Apache-2.0 license, +shall be dual licensed as above, +without any additional terms or conditions. From dc6b2dd84e520a3e85c3ba24061e023191073810 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 05:53:15 +0100 Subject: [PATCH 3/8] README: --data is not longer required [fix] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 458e93ef..06274248 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ The command `cargo run` can be used to compile and run locally the code. For example: ```sh -cargo run -- validate --data examples/user.ttl --schema examples/user.shex --shapemap examples/user.sm +cargo run -- validate examples/user.ttl --schema examples/user.shex --shapemap examples/user.sm ``` ### Compiling from source and installing the binary (Debian) @@ -116,7 +116,7 @@ The folder `examples` contains several example files with ShEx schemas and RDF d ### Validate a simple RDF file with a ShEx schema using a ShapeMap ```sh -rudof validate --data examples/user.ttl --schema examples/user.shex --shapemap examples/user.sm +rudof validate 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/rudof-project/rudof/wiki/Howto-guides). From 571c8199e1451f5eb7be0742b0dce587b30729d8 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 06:01:15 +0100 Subject: [PATCH 4/8] Minor long description fix --- rudof_cli/src/cli.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rudof_cli/src/cli.rs b/rudof_cli/src/cli.rs index c35e5ed1..84b3693e 100644 --- a/rudof_cli/src/cli.rs +++ b/rudof_cli/src/cli.rs @@ -13,8 +13,8 @@ use std::{fmt::Formatter, path::PathBuf}; // #[command(version = "0.1")] #[command( arg_required_else_help = true, - long_about = r#" - A tool to process and validate RDF data using shapes, and convert between different RDF data models"# + long_about = "\ +A tool to process and validate RDF data using shapes, and convert between different RDF data models" )] pub struct Cli { #[command(subcommand)] From a2eb87c183928e208d713250320817a23c0049d4 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 06:02:23 +0100 Subject: [PATCH 5/8] README: Updates all the `--help` outputs --- README.md | 196 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 134 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 06274248..61ea178f 100644 --- a/README.md +++ b/README.md @@ -134,50 +134,63 @@ where `value` can be `debug` to show more verbose information or `info` to show ## Command line usage ```sh -RDF Data shapes implementation in Rust +A tool to process and validate RDF data using shapes, and convert between different RDF data models Usage: rudof [OPTIONS] [COMMAND] Commands: - shapemap Information about ShEx shapemaps - shex Information about ShEx schemas - validate RDF Validation using ShEx or SHACL - shex-validate RDF Validation using ShEx schemas - shacl-validate RDF Validation using SHACL shapes - data Information about RDF data - node Information about RDF nodes which are part of RDF Graphs - shacl Information about SHACL shapes - dctap Information and processing of DCTAP files - convert Conversion between different Data modeling technologies + shapemap Show information about ShEx ShapeMaps + shex Show information about ShEx schemas + validate Validate RDF data using ShEx or SHACL + shex-validate Validate RDF using ShEx schemas + shacl-validate Validate RDF data using SHACL shapes + data Show information about RDF data + node Show information about a node in an RDF Graph + shacl Show information about SHACL shapes + dctap Show information and process DCTAP files + convert Convert between different Data modeling technologies + service Show information about SPARQL service + query Run SPARQL queries help Print this message or the help of the given subcommand(s) Options: - -d, --debug... - -h, --help Print help (see more with '--help') - -V, --version Print version + -d, --debug... + + + -h, --help + Print help (see a summary with '-h') + + -V, --version + Print version ``` ### Obtaining information about a ShEx schema ```sh $ rudof shex --help -Information about ShEx schemas +Show information about ShEx schemas Usage: rudof shex [OPTIONS] --schema Options: -s, --schema - + -f, --format - [default: shexc] [possible values: internal, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] + [default: shexc] [possible values: internal, simple, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] -r, --result-format - [default: shexj] [possible values: internal, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] - -t, --show elapsed time - - --statistics - + [default: shexj] [possible values: internal, simple, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] + -t, --show elapsed time + [possible values: true, false] + --statistics + [possible values: true, false] -o, --output-file - + + --reader-mode + [default: strict] [possible values: lax, strict] + --force-overwrite + + -c, --config-file + Config file path, if unset it assumes default config -h, --help Print help ``` @@ -186,17 +199,26 @@ Options: ```sh $ rudof data --help -Information about RDF data +Show information about RDF data + +Usage: rudof data [OPTIONS] [DATA]... -Usage: rudof data [OPTIONS] --data +Arguments: + [DATA]... Options: - -d, --data - -t, --data-format [default: turtle] [possible values: turtle, ntriples, rdfxml, trig, n3, nquads] + --reader-mode + RDF Reader mode [default: strict] [possible values: lax, strict] -o, --output-file - + + -r, --result-format + [default: turtle] [possible values: turtle, ntriples, rdfxml, trig, n3, nquads] + -c, --config-file + Config file path, if unset it assumes default config + --force-overwrite + -h, --help Print help ``` @@ -207,27 +229,34 @@ This command can be useful to obtain the neighbourhood of a node. ```sh $ rudof node --help -Information about RDF nodes which are part of RDF Graphs +Show information about a node in an RDF Graph + +Usage: rudof node [OPTIONS] --node [DATA]... -Usage: rudof node [OPTIONS] --node +Arguments: + [DATA]... Options: -n, --node - - -d, --data - + -t, --data-format [default: turtle] [possible values: turtle, ntriples, rdfxml, trig, n3, nquads] -e, --endpoint - + + --reader-mode + RDF Reader mode [default: strict] [possible values: lax, strict] -m, --show-node-mode [default: outgoing] [possible values: outgoing, incoming, both] --show hyperlinks - + -p, --predicates - + -o, --output-file - + + -c, --config + + --force-overwrite + -h, --help Print help ``` @@ -242,37 +271,74 @@ rudof node -e wikidata -n wd:Q80 ```sh $ rudof validate --help -RDF Validation using ShEx or SHACL +Validate RDF data using ShEx or SHACL + +Usage: rudof validate [OPTIONS] [DATA]... + +Arguments: + [DATA]... -Usage: rudof validate [OPTIONS] --schema Options: -M, --mode - [default: shex] [possible values: shex, shacl] + [default: shex] + [possible values: shex, shacl] + -s, --schema - + + -f, --schema-format - [default: shexc] [possible values: internal, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] - -m, --shapemap - + [possible values: internal, simple, shexc, shexj, turtle, ntriples, rdfxml, trig, n3, nquads] + + -m, --shapemap + + --shapemap-format - [default: compact] [possible values: compact, internal] + [default: compact] + [possible values: compact, internal] + -n, --node - + + -l, --shape-label - - -d, --data - + + -t, --data-format - [default: turtle] [possible values: turtle, ntriples, rdfxml, trig, n3, nquads] + [default: turtle] + [possible values: turtle, ntriples, rdfxml, trig, n3, nquads] + -e, --endpoint - + + --max-steps [default: 100] + + -S, --shacl-mode + Execution mode + + [default: native] + + Possible values: + - native: We use a Rust native engine in an imperative manner (performance) + - sparql: We use a SPARQL-based engine, which is declarative + + --reader-mode + RDF Reader mode + + [default: strict] + [possible values: lax, strict] + -o, --output-file - + + + --force-overwrite + + + -c, --config-file + Config file path, if unset it assumes default config + -h, --help - Print help + Print help (see a summary with '-h') ``` Example: Assuming there a ShEx file in `examples/user.shex` and an RDF turtle file in `examples/user.ttl` we can ask to validate node `:a` with shape label `:User` using: @@ -297,25 +363,31 @@ rudof shacl-validate --shapes examples/simple_shacl.ttl examples/simple.ttl ```sh $ rudof convert --help -Conversion between different Data modeling technologies +Convert between different Data modeling technologies Usage: rudof convert [OPTIONS] --input-mode --source-file --export-mode Options: + -c, --config + -m, --input-mode - [possible values: shex, dctap] + [possible values: shacl, shex, dctap] + --force-overwrite + -s, --source-file - + -f, --format - [default: shexc] [possible values: csv, shexc, shexj, turtle] + [default: shexc] [possible values: csv, shexc, shexj, turtle, xlsx] -r, --result-format [default: default] [possible values: default, internal, json, shexc, shexj, turtle, plantuml, html, svg, png] -o, --output-file - + -t, --target-folder - + -l, --shape-label - + + --reader-mode + RDF Reader mode [default: strict] [possible values: lax, strict] -x, --export-mode [possible values: sparql, shex, uml, html] -h, --help @@ -391,9 +463,9 @@ Options: -p, --print_result_mode [default: basic] [possible values: basic, failed, passed, not-implemented, all] -e, --entry - + -t, --trait - + -h, --help Print help -V, --version From 26672a4a98e9242278485c02527c4acbbf701246 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 06:02:47 +0100 Subject: [PATCH 6/8] README: White-space fixes [minor] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 61ea178f..3ffead33 100644 --- a/README.md +++ b/README.md @@ -414,7 +414,7 @@ The repo is divided in the following modules: ## Publishing the crates ```sh -cargo workspaces publish +cargo workspaces publish ``` ## Worskpaces @@ -475,7 +475,7 @@ Options: ### Validation conformance tests for ShEx ```sh -cargo run -p shex_testsuite -- -m shex_testsuite/shexTest/validation/manifest.jsonld validation +cargo run -p shex_testsuite -- -m shex_testsuite/shexTest/validation/manifest.jsonld validation ``` ### Schemas tests From ce69c06150defe69239c85acaa8bc14e3f3278c8 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 06:13:44 +0100 Subject: [PATCH 7/8] README: Fixes link to issues --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ffead33..4e721a13 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ We provide binaries for Linux, Windows, Mac and Docker as well as Python bindings. - [Installation](https://github.com/rudof-project/rudof?tab=readme-ov-file#installation) -- [List of issues](https://github.com/rudof-project/rudof) +- [List of issues](https://github.com/rudof-project/rudof/issues) - [Discussion](https://github.com/rudof-project/rudof/discussions) - [FAQ](https://github.com/rudof-project/rudof/wiki/FAQ) - [How to guides](https://github.com/rudof-project/rudof/wiki/How%E2%80%90to-guides) From c5cc039257310b349d1f5656a31805ab4cc32424 Mon Sep 17 00:00:00 2001 From: Robin Vobruba Date: Fri, 13 Dec 2024 06:14:05 +0100 Subject: [PATCH 8/8] README: Adds name of published docker-image --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e721a13..05e12609 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,8 @@ sudo dpkg -i target/debian/rudof_0.0.11-1_amd64.deb ## Docker -The library is also published as a Docker image. +The library is also published as a Docker image +(`angelip2303/rudof:latest`).