Skip to content

Commit

Permalink
Add allow_warnings, fix abort_on_first
Browse files Browse the repository at this point in the history
Allow-Warnings is finally available. (Closes #34)
  - Setting this option puts PySHACL into a non-standard operation mode, where Shapes marked with severity of sh:Warning or sh:Info will not cause result to be invalid.
  - Despite the name, it allows both sh:Info and sh:Warning.
  - Try it with `allow_warnings=True` on `validate()` or `-w` in the CLI tool.
Fixed Abort Mode. (Fixes #75)
  - This optional mode allows the validator to exit early, on the first time your data fails to validate against a Constraint.
  - Name changed from `abort_on_error` to `abort_on_first`
  - Try it out with `abort_on_first=True` on `validate()` or `--abort` in the CLI tool.
  • Loading branch information
ashleysommer committed Jul 7, 2021
1 parent c86543e commit 72027ed
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 192 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Python PEP 440 Versioning](https://www.python.org/dev/peps/pep-0440/).

## [0.14.5] - 2021-07-07

## Added
- Allow-Warnings is finally available. (Closes #34)
- Setting this option puts PySHACL into a non-standard operation mode, where Shapes marked with severity of sh:Warning or sh:Info will not cause result to be invalid.
- Despite the name, it allows both sh:Info and sh:Warning.
- Try it with `allow_warnings=True` on `validate()` or `-w` in the CLI tool.

## Fixed
- Fixed Abort Mode. (Fixes #75)
- This optional mode allows the validator to exit early, on the first time your data fails to validate against a Constraint.
- Name changed from `abort_on_error` to `abort_on_first`
- Try it out with `abort_on_first=True` on `validate()` or `--abort` in the CLI tool.


## [0.14.4] - 2021-05-26

## Added
- Added an iterate_rules option, that causes SHACL Rules to run repeatedly until reaching a steady state. (Closes #76)
- Works with SPARQLRules, TripleRules, and JSRules.
- Variables {$this}, {$path}, and {$value} will be populated in the sh:message of a SPARQL Constraint. (Closes #30)


## [0.14.3] - 2021-02-20

## Changed
Expand Down Expand Up @@ -736,7 +752,8 @@ just leaves the files open. Now it is up to the command-line client to close the

- Initial version, limited functionality

[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.14.4...HEAD
[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.14.5...HEAD
[0.14.5]: https://github.com/RDFLib/pySHACL/compare/v0.14.4...v0.14.5
[0.14.4]: https://github.com/RDFLib/pySHACL/compare/v0.14.3...v0.14.4
[0.14.3]: https://github.com/RDFLib/pySHACL/compare/v0.14.2...v0.14.3
[0.14.2]: https://github.com/RDFLib/pySHACL/compare/v0.14.1...v0.14.2
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ r = validate(data_graph,
shacl_graph=sg,
ont_graph=og,
inference='rdfs',
abort_on_error=False,
abort_on_first=False,
allow_warnings=False,
meta_shacl=False,
advanced=False,
js=False,
Expand All @@ -129,13 +130,14 @@ Where:
* `ont_graph` is an rdflib `Graph` object or file path or Web URL a graph containing extra ontological information, or None if not required.
* `inference` is a Python string value to indicate whether or not to perform OWL inferencing expansion of the `data_graph` before validation.
Options are 'rdfs', 'owlrl', 'both', or 'none'. The default is 'none'.
* `abort_on_error` (optional) a Python `bool` value to indicate whether or not the program should abort after encountering a validation error or to continue. Default is to continue.
* `meta_shacl` (optional) a Python `bool` value to indicate whether or not the program should enable the Meta-SHACL feature. Default is False.
* `advanced`: (optional) a Python `bool` value to enable SHACL Advanced Features
* `js`: (optional) a Python `bool` value to enable SHACL-JS Features (if `pyshacl[js]` is installed)
* `debug` (optional) a Python `bool` value to indicate whether or not the program should emit debugging output text, including violations that didn't lead to non-conformance overall. So when debug is True don't judge conformance by absense of violation messages. Default is False.
Some other optional keyword variables available available on the `validate` function:
* `abort_on_first` (optional) `bool` value to indicate whether or not the program should abort after encountering the first validation failure or to continue. Default is to continue.
* `allow_warnings` (optional) `bool` value, Shapes marked with severity of Warning or Info will not cause result to be invalid.
* `meta_shacl` (optional) `bool` value to indicate whether or not the program should enable the Meta-SHACL feature. Default is False.
* `advanced`: (optional) `bool` value to enable SHACL Advanced Features
* `js`: (optional) `bool` value to enable SHACL-JS Features (if `pyshacl[js]` is installed)
* `debug` (optional) `bool` value to indicate whether or not the program should emit debugging output text, including violations that didn't lead to non-conformance overall. So when debug is True don't judge conformance by absense of violation messages. Default is False.
Some other optional keyword variables available on the `validate` function:
* `data_graph_format`: Override the format detection for the given data graph source file.
* `shacl_graph_format`: Override the format detection for the given shacl graph source file.
* `ont_graph_format`: Override the format detection for the given extra ontology graph source file.
Expand Down
Loading

0 comments on commit 72027ed

Please sign in to comment.