Skip to content

Commit

Permalink
bump changelog, bump version, update README for new release
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysommer committed May 26, 2021
1 parent c8c65bb commit f22c16f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 5 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ 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.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 @@ -729,7 +736,9 @@ 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.2...HEAD
[Unreleased]: https://github.com/RDFLib/pySHACL/compare/v0.14.4...HEAD
[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
[0.14.1]: https://github.com/RDFLib/pySHACL/compare/v0.14.0...v0.14.1
[0.14.0]: https://github.com/RDFLib/pySHACL/compare/v0.13.3...v0.14.0
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ optional arguments:
owl:imports.
-a, --advanced Enable support for SHACL Advanced Features.
-j, --js Enable support for SHACL-JS Features.
-it, --iterate-rules Interate SHACL Rules until steady state is found (only available in Advanced Mode)
--abort Abort on first error.
-d, --debug Output additional runtime messages, including violations that didn\'t
lead to non-conformance.
Expand Down Expand Up @@ -138,6 +139,7 @@ Some other optional keyword variables available available on the `validate` func
* `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.
* `iterate_rules`: Interate SHACL Rules until steady state is found (only works with advanced mode).
* `do_owl_imports`: Enable the feature to allow the import of subgraphs using `owl:imports` for the shapes graph and the ontology graph. Note, you explicitly cannot use this on the target data graph.
* `serialize_report_graph`: Convert the report results_graph into a serialised representation (for example, 'turtle')
* `check_dash_result`: Check the validation result against the given expected DASH test suite result.
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.0.3"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "pyshacl"
version = "0.14.3"
version = "0.14.4"
# Don't forget to change the version number in __init__.py along with this one
description = "Python SHACL Validator"
license = "Apache-2.0"
Expand Down Expand Up @@ -129,7 +129,7 @@ envlist = py36, py37, py38, py39, lint, type-checking
[testenv]
deps =
poetry>=1.1.0
poetry>=1.1.6
py36: coveralls
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH TRAVIS_BUILD_DIR
skip_install = true
Expand Down
2 changes: 1 addition & 1 deletion pyshacl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# version compliant with https://www.python.org/dev/peps/pep-0440/
__version__ = '0.14.3'
__version__ = '0.14.4'
# Don't forget to change the version number in pyproject.toml along with this one

__all__ = ['validate', 'Validator', '__version__', 'Shape', 'ShapesGraph']
2 changes: 2 additions & 0 deletions pyshacl/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __call__(self, parser, namespace, values, option_string=None):
'Shapes Graph before before validating the Data Graph.',
)
parser.add_argument(
'-im',
'--imports',
dest='imports',
action='store_true',
Expand All @@ -77,6 +78,7 @@ def __call__(self, parser, namespace, values, option_string=None):
help='Enable features from the SHACL-JS Specification.',
)
parser.add_argument(
'-it',
'--iterate-rules',
dest='iterate_rules',
action='store_true',
Expand Down
46 changes: 46 additions & 0 deletions test/test_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,50 @@ def test_owl_imports_fail():
print(string)
assert not conforms

def test_sparql_message_subst():
df = '''@prefix ex: <http://datashapes.org/sh/tests/#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
ex:ValidResource1
rdf:type rdfs:Resource ;
.
ex:InvalidResource1
rdf:type rdfs:Resource ;
rdfs:label "Invalid resource 1" ;
.
ex:InvalidResource2
rdf:type rdfs:Resource ;
rdfs:label "Invalid label 1" ;
rdfs:label "Invalid label 2" ;
.
ex:TestShape
rdf:type sh:NodeShape ;
rdfs:label "Test shape" ;
sh:sparql ex:TestShape-sparql ;
sh:targetNode ex:InvalidResource1 ;
sh:targetNode ex:InvalidResource2 ;
sh:targetNode ex:ValidResource1 ;
.
ex:TestShape-sparql
sh:message "{$this} cannot have a {$path} of {$value}" ;
sh:prefixes <http://datashapes.org/sh/tests/sparql/node/sparql-001.test> ;
sh:select """
SELECT $this ?path ?value
WHERE {
$this ?path ?value .
FILTER (?path = <http://www.w3.org/2000/01/rdf-schema#label>) .
}""" ;
.'''
res = validate(df, data_graph_format='turtle', inference=None, debug=True,)
conforms, graph, s = res
assert "#InvalidResource1 cannot have a http://www.w3.org/2000/01/rdf-schema#label of Invalid resource 1" in s
assert "#InvalidResource2 cannot have a http://www.w3.org/2000/01/rdf-schema#label of Invalid label 1" in s
assert "#InvalidResource2 cannot have a http://www.w3.org/2000/01/rdf-schema#label of Invalid label 2" in s
assert not conforms

if __name__ == "__main__":
test_validate_with_ontology()
Expand All @@ -444,3 +488,5 @@ def test_owl_imports_fail():
test_serialize_report_graph()
test_owl_imports()
test_owl_imports_fail()
test_sparql_message_subst()

0 comments on commit f22c16f

Please sign in to comment.