{"id":32991397,"url":"https://github.com/RDFLib/pySHACL","last_synced_at":"2025-11-16T03:01:06.936Z","repository":{"id":32993155,"uuid":"147505799","full_name":"RDFLib/pySHACL","owner":"RDFLib","description":"A Python validator for SHACL","archived":false,"fork":false,"pushed_at":"2025-08-23T09:30:52.000Z","size":4517,"stargazers_count":294,"open_issues_count":43,"forks_count":67,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-11-15T22:21:25.787Z","etag":null,"topics":["constraints","owl","rdf","shacl","validator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RDFLib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-05T11:13:51.000Z","updated_at":"2025-11-13T01:24:02.000Z","dependencies_parsed_at":"2023-01-14T22:57:46.606Z","dependency_job_id":"ee8187ec-6e20-4c9e-ac2f-baa3dbab1434","html_url":"https://github.com/RDFLib/pySHACL","commit_stats":{"total_commits":333,"total_committers":29,"mean_commits":"11.482758620689655","dds":0.3993993993993994,"last_synced_commit":"c18e8b97abcb42fbe3bb5715214c5eaf27ae5ea0"},"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"purl":"pkg:github/RDFLib/pySHACL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RDFLib%2FpySHACL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RDFLib%2FpySHACL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RDFLib%2FpySHACL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RDFLib%2FpySHACL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RDFLib","download_url":"https://codeload.github.com/RDFLib/pySHACL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RDFLib%2FpySHACL/sbom","scorecard":{"id":116527,"data":{"date":"2025-08-11","repo":{"name":"github.com/RDFLib/pySHACL","commit":"9f886a7418984f7310a4136a1aa60aa19e2250bb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 2/16 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.30.1 not signed: https://api.github.com/repos/RDFLib/pySHACL/releases/205966414","Warn: release artifact v0.30.0 not signed: https://api.github.com/repos/RDFLib/pySHACL/releases/196581556","Warn: release artifact v0.29.0 not signed: https://api.github.com/repos/RDFLib/pySHACL/releases/183060832","Warn: release artifact v0.28.1 not signed: https://api.github.com/repos/RDFLib/pySHACL/releases/181921385","Warn: release artifact v0.30.1 does not have provenance: https://api.github.com/repos/RDFLib/pySHACL/releases/205966414","Warn: release artifact v0.30.0 does not have provenance: https://api.github.com/repos/RDFLib/pySHACL/releases/196581556","Warn: release artifact v0.29.0 does not have provenance: https://api.github.com/repos/RDFLib/pySHACL/releases/183060832","Warn: release artifact v0.28.1 does not have provenance: https://api.github.com/repos/RDFLib/pySHACL/releases/181921385"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/RDFLib/pySHACL/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/RDFLib/pySHACL/ci.yml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating docker.io/library/python:3.11-alpine to docker.io/library/python:3.11-alpine@sha256:9ce54d7ed458f71129c977478dd106cf6165a49b73fa38c217cc54de8f3e2bd0","Warn: pipCommand not pinned by hash: Dockerfile:10","Warn: pipCommand not pinned by hash: Dockerfile:19","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:49","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   3 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T01:25:55.146Z","repository_id":32993155,"created_at":"2025-08-16T01:25:55.146Z","updated_at":"2025-08-16T01:25:55.146Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284654194,"owners_count":27041729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constraints","owl","rdf","shacl","validator"],"created_at":"2025-11-13T09:00:33.301Z","updated_at":"2025-11-16T03:01:06.923Z","avatar_url":"https://github.com/RDFLib.png","language":"Python","funding_links":[],"categories":["SHACL Implementations","Data Validation"],"sub_categories":["BBedit","OpenRefine Reconciliation services"],"readme":"![](pySHACL-250.png)\n\n# pySHACL\nA Python validator for SHACL.\n\n[![Build Status](https://drone.rdflib.ashs.dev/api/badges/RDFLib/pySHACL/status.svg)](https://drone.rdflib.ashs.dev/RDFLib/pySHACL)\n\n[![DOI](https://zenodo.org/badge/147505799.svg)](https://zenodo.org/badge/latestdoi/147505799) [![Downloads](https://pepy.tech/badge/pyshacl)](https://pepy.tech/project/pyshacl) [![Downloads](https://pepy.tech/badge/pyshacl/month)](https://pepy.tech/project/pyshacl/month) [![Downloads](https://pepy.tech/badge/pyshacl/week)](https://pepy.tech/project/pyshacl/week)\n\nThis is a pure Python module which allows for the validation of [RDF](https://www.w3.org/2001/sw/wiki/RDF) graphs against Shapes Constraint Language ([SHACL](https://www.w3.org/TR/shacl/)) graphs. This module uses the [rdflib](https://github.com/RDFLib/rdflib) Python library for working with RDF and is dependent on the [OWL-RL](https://github.com/RDFLib/OWL-RL) Python module for [OWL2 RL Profile](https://www.w3.org/TR/owl2-overview/#ref-owl-2-profiles) based expansion of data graphs.\n\nThis module is developed to adhere to the SHACL Recommendation:\n\u003e Holger Knublauch; Dimitris Kontokostas. *Shapes Constraint Language (SHACL)*. 20 July 2017. W3C Recommendation. URL: \u003chttps://www.w3.org/TR/shacl/\u003e ED: \u003chttps://w3c.github.io/data-shapes/shacl/\u003e\n\n# Community for Help and Support\nThe SHACL community has a discord server for discussion of topics around SHACL and the SHACL specification.\n\n[Use this invitation link: https://discord.gg/RTbGfJqdKB to join the server](https://discord.gg/RTbGfJqdKB)\n\nThere is a \\#pyshacl channel for discussion of this python library, and you can ask for general SHACL help too.\n\n## Installation\nInstall with PIP (Using the Python3 pip installer `pip3`)\n```bash\n$ pip3 install pyshacl\n```\n\nOr in a python virtualenv _(these example commandline instructions are for a Linux/Unix based OS)_\n```bash\n$ python3 -m virtualenv --python=python3 --no-site-packages .venv\n$ source ./.venv/bin/activate\n$ pip3 install pyshacl\n```\n\nTo exit the virtual enviornment:\n```bash\n$ deactivate\n```\n\n## Command Line Use\nFor command line use:\n_(these example commandline instructions are for a Linux/Unix based OS)_\n```bash\n$ pyshacl -s /path/to/shapesGraph.ttl -m -i rdfs -a -j -f human /path/to/dataGraph.ttl\n```\nWhere\n - `-s` is an (optional) path to the shapes graph to use\n - `-e` is an (optional) path to an extra ontology graph to import\n - `-i` is the pre-inferencing option\n - `-f` is the ValidationReport output format (`human` = human-readable validation report)\n - `-m` enable the meta-shacl feature\n - `-a` enable SHACL Advanced Features\n - `-j` enable SHACL-JS Features (if `pyshacl[js]` is installed)\n\nSystem exit codes are:\n`0` = DataGraph is Conformant\n`1` = DataGraph is Non-Conformant\n`2` = The validator encountered a RuntimeError (check stderr output for details)\n`3` = Not-Implemented; The validator encountered a SHACL feature that is not yet implemented.\n\nFull CLI Usage options:\n```bash\n$ pyshacl -h\n$ python3 -m pyshacl -h\nusage: pyshacl [-h] [-s [SHACL]] [-e [ONT]] [-i {none,rdfs,owlrl,both}] [-m]\n               [-im] [-a] [-j] [-it] [--abort] [--allow-info] [-w]\n               [--max-depth [MAX_DEPTH]] [-d]\n               [-f {human,table,turtle,xml,json-ld,nt,n3}]\n               [-df {auto,turtle,xml,json-ld,nt,n3}]\n               [-sf {auto,turtle,xml,json-ld,nt,n3}]\n               [-ef {auto,turtle,xml,json-ld,nt,n3}] [-V] [-o [OUTPUT]]\n               [--server]\n               DataGraph\n\nPySHACL 0.27.0 command line tool.\n\npositional arguments:\n  DataGraph             The file containing the Target Data Graph.\n\noptional arguments:\n  --server              Ignore all the rest of the options, start the HTTP Server.\n  -h, --help            show this help message and exit\n  -s [SHACL], --shacl [SHACL]\n                        A file containing the SHACL Shapes Graph.\n  -e [ONT], --ont-graph [ONT]\n                        A file path or URL to a document containing extra\n                        ontological information. RDFS and OWL definitions from this \n                        are used to inoculate the DataGraph.\n  -i {none,rdfs,owlrl,both}, --inference {none,rdfs,owlrl,both}\n                        Choose a type of inferencing to run against the Data\n                        Graph before validating.\n  -m, --metashacl       Validate the SHACL Shapes graph against the shacl-\n                        shacl Shapes Graph before validating the Data Graph.\n  -im, --imports        Allow import of sub-graphs defined in statements with\n                        owl:imports.\n  -a, --advanced        Enable features from the SHACL Advanced Features\n                        specification.\n  -j, --js              Enable features from the SHACL-JS Specification.\n  -it, --iterate-rules  Run Shape's SHACL Rules iteratively until the\n                        data_graph reaches a steady state.\n  --abort               Abort on first invalid data.\n  --allow-info, --allow-infos\n                        Shapes marked with severity of Info will not cause\n                        result to be invalid.\n  -w, --allow-warning, --allow-warnings\n                        Shapes marked with severity of Warning or Info will\n                        not cause result to be invalid.\n  --max-depth [MAX_DEPTH]\n                        The maximum number of SHACL shapes \"deep\" that the\n                        validator can go before reaching an \"endpoint\"\n                        constraint.\n  -d, --debug           Output additional verbose runtime messages.\n  --focus [FOCUS]       Optional IRIs of focus nodes from the DataGraph, the shapes will\n                        validate only these node. Comma-separated list.\n  --shape [SHAPE]       Optional IRIs of a NodeShape or PropertyShape from the SHACL\n                        ShapesGraph, only these shapes will be used to validate the\n                        DataGraph. Comma-separated list.\n  -f {human,table,turtle,xml,json-ld,nt,n3}, --format {human,table,turtle,xml,json-ld,nt,n3}\n                        Choose an output format. Default is \"human\".\n  -df {auto,turtle,xml,json-ld,nt,n3}, --data-file-format {auto,turtle,xml,json-ld,nt,n3}\n                        Explicitly state the RDF File format of the input\n                        DataGraph file. Default=\"auto\".\n  -sf {auto,turtle,xml,json-ld,nt,n3}, --shacl-file-format {auto,turtle,xml,json-ld,nt,n3}\n                        Explicitly state the RDF File format of the input\n                        SHACL file. Default=\"auto\".\n  -ef {auto,turtle,xml,json-ld,nt,n3}, --ont-file-format {auto,turtle,xml,json-ld,nt,n3}\n                        Explicitly state the RDF File format of the extra\n                        ontology file. Default=\"auto\".\n  -V, --version         Show PySHACL version and exit.\n  -o [OUTPUT], --output [OUTPUT]\n                        Send output to a file (defaults to stdout).\n  --server              Ignore all the rest of the options, start the HTTP\n                        Server. Same as `pyshacl_server`.\n```\n\n## Python Module Use\nFor basic use of this module, you can just call the `validate` function of the `pyshacl` module like this:\n\n```python\nfrom pyshacl import validate\n\ndata_graph = \"some-data.ttl\"\nshacl_graph = \"some-shacl.ttl\"\nont_graph = \"some-ontology.ttl\"\n\nr = validate(data_graph,\n      shacl_graph=shacl_graph,\n      ont_graph=ont_graph,\n      inference='rdfs',\n      abort_on_first=False,\n      allow_infos=False,\n      allow_warnings=False,\n      meta_shacl=False,\n      advanced=False,\n      js=False,\n      debug=False)\nconforms, results_graph, results_text = r\n```\n\nWhere:\n* `data_graph` is an rdflib `Graph` object or file path of the graph to be validated\n* `shacl_graph` is an rdflib `Graph` object or file path or Web URL of the graph containing the SHACL shapes to validate with, or None if the SHACL shapes are included in the data_graph.\n* `ont_graph` is an rdflib `Graph` object or file path or Web URL a graph containing extra ontological information, or None if not required. RDFS and OWL definitions from this are used to inoculate the DataGraph.\n* `inference` is a Python string value to indicate whether or not to perform OWL inferencing expansion of the `data_graph` before validation.\nOptions are 'rdfs', 'owlrl', 'both', or 'none'. The default is 'none'.\n* `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.\n* `allow_infos` (optional) `bool` value, Shapes marked with severity of Info will not cause result to be invalid.\n* `allow_warnings` (optional) `bool` value, Shapes marked with severity of Warning or Info will not cause result to be invalid.\n* `meta_shacl` (optional) `bool` value to indicate whether or not the program should enable the Meta-SHACL feature. Default is False.\n* `advanced`: (optional) `bool` value to enable SHACL Advanced Features\n* `js`: (optional) `bool` value to enable SHACL-JS Features (if `pyshacl[js]` is installed)\n* `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.\n\nSome other optional keyword variables available on the `validate` function:\n* `data_graph_format`: Override the format detection for the given data graph source file.\n* `shacl_graph_format`: Override the format detection for the given shacl graph source file.\n* `ont_graph_format`: Override the format detection for the given extra ontology graph source file.\n* `iterate_rules`: Iterate SHACL Rules until steady state is found (only works with advanced mode).\n* `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.\n* `serialize_report_graph`: Convert the report results_graph into a serialised representation (for example, 'turtle')\n* `check_dash_result`: Check the validation result against the given expected DASH test suite result.\n\nReturn value:\n* a three-component `tuple` containing:\n  * `conforms`: a `bool`, indicating whether the `data_graph` conforms to the `shacl_graph`\n  * `results_graph`: a `Graph` object built according to the SHACL specification's [Validation Report](https://www.w3.org/TR/shacl/#validation-report) scheme\n  * `results_text`: python string representing a verbose textual representation of the [Validation Report](https://www.w3.org/TR/shacl/#validation-report)\n\n## Python Module Call\n\nYou can get an equivalent of the Command Line Tool using the Python3 executable by doing:\n\n```bash\n$ python3 -m pyshacl\n```\n\n## Errors\nUnder certain circumstances pySHACL can produce a [`Validation Failure`](https://www.w3.org/TR/shacl/#failures). This is a formal error [defined by the SHACL specification](https://www.w3.org/TR/shacl/#failures) and is required to be produced as a result of specific conditions within the SHACL graph that leads to the inability to complete the validation.\nIf the validator produces a [`Validation Failure`](https://www.w3.org/TR/shacl/#failures), the `results_graph` variable returned by the `validate()` function will be an instance of `ValidationFailure`.\nSee the `message` attribute on that instance to get more information about the validation failure.\n\nOther errors the validator can generate:\n- `ShapeLoadError`: This error is thrown when a SHACL Shape in the SHACL graph is in an invalid state and cannot be loaded into the validation engine.\n- `ConstraintLoadError`: This error is thrown when a SHACL Constraint Component is in an invalid state and cannot be loaded into the validation engine.\n- `ReportableRuntimeError`: An error occurred for a different reason, and the reason should be communicated back to the user of the validator.\n- `RuntimeError`: The validator encountered a situation that caused it to throw an error, but the reason does not concern the user.\n\nUnlike `ValidationFailure`, these errors are not passed back as a result by the `validate()` function, but thrown as exceptions by the validation engine and must be\ncaught in a `try ... except` block.\nIn the case of `ShapeLoadError` and `ConstraintLoadError`, see the `str()` string representation of the exception instance for the error message along with a link to the relevant section in the SHACL spec document.\n\n## Focus Node Filtering, and Shape Selection\nPySHACL v0.27.0 and above has two powerful new features:\n- Focus Node Filtering\n  - You can pass in a list of focus nodes to the validator, and it will only validate those focus nodes.\n  - _Note_, you still need to use a SHACL ShapesGraph, and the Shapes _still need to target_ the focus nodes.\n  - This feature will filter the Shapes' targeted focus nodes to include only those that are in the list of specified focus nodes.\n- SHACL Shape selection\n  - You can pass in a list of SHACL Shapes to the validator, and it will use only those Shapes for validation.\n  - This is useful for testing new shapes in your shapes graph, or for many other procedure-driven use cases.\n- Combined Shape Selection with Focus Node filtering\n  - The combination of the above two new features is especially powerful.\n  - If you give the validator a list of Shapes to use, and a list of focus nodes, the validator will operate in\n    a highly-targeted mode, it feeds those focus nodes directly into those given Shapes for validation.\n  - In this mode, the selected SHACL Shape does not need to specify any focus-targeting mechanisms of its own.\n\n## SPARQL Remote Graph Mode\n\n_**PySHACL now has a built-in SPARQL Remote Graph Mode, which allows you to validate a data graph that is stored on a remote server.**_\n\n- In this mode, PySHAL operates strictly in read-only mode, and does not modify the remote data graph.\n- Some features are disabled when using the SPARQL Remote Graph Mode:\n    - \"rdfs\" and \"owl\" inferencing is not allowed (because the remote graph is read-only, it cannot be expanded)\n    - Extra Ontology file (Inoculation or Mix-In mode) is disabled (because the remote graph is read-only)\n    - SHACL Rules (Advanced mode SPARQL-Rules) are not allowed (because the remote graph is read-only)\n    - All SHACL-JS features are disabled (this is not safe when operating on a remote graph)\n    - \"inplace\" mode is disabled (actually all operations on the remote data graph are inherently performed in-place)\n\n## Inference and Rules\nPySHACL can perform inference - creation of new data using rules - according to the [SHACL Advanced Features - Rules specification](https://www.w3.org/TR/shacl-af/#rules).\n\nThe `shacl_rules` function can be used like this:\n\n```python\nfrom pyshacl import shacl_rules\n\ndata_graph = \"some-data.ttl\"\nshacl_graph = \"some-shacl.ttl\"\n\noutput_graph = shacl_rules(data_graph, shacl_graph=shacl_graph, advanced=True)\n```\n\nIn the code above, the `output_graph` will contain the original RDF triples in the `data_graph` as well as new triples generated by the `shacl_graph`.\n\nSee the example file `examples/rules_inference.py` for a working example of PySHACL performing two kinds of SHACL inference.\n\n## Integrated OpenAPI-3.0-compatible HTTP REST Service\n\nPySHACL now has a built-in validation service, exposed via an OpenAPI3.0-compatible REST API.\n\nDue to the additional dependencies required to run, this feature is an optional extra.\n\nYou must first install PySHACL with the `http` extra option enabled:\n\n```bash\n$ pip3 install -U pyshacl[http]\n```\n\nWhen that is installed, you can start the service using the by executing the CLI entrypoint:\n\n```bash\n$ pyshacl --server\n# or\n$ pyshacl_server\n# or\n$ python3 -m pyshacl server\n# or\n$ docker run --rm -e PYSHACL_SERVER=TRUE -i -t docker.io/ashleysommer/pyshacl:latest\n```\n\nBy default, this will run the service on localhost address `127.0.0.1` on port `8099`.\n\nTo view the SwaggerUI documentation for the service, navigate to `http://127.0.0.1:8099/docs/swagger` and for the ReDoc version, go to `http://127.0.0.1:8099/docs/redoc`.\n\nTo view the OpenAPI3 schema see `http://127.0.0.1:8099/docs/openapi.json`\n\n### Configuring the HTTP REST Service\n\n- You can force PySHACL CLI to start up in HTTP Server mode by passing environment variable `PYSHACL_SERVER=TRUE`. This is useful in a containerised service, where you will _only_ be running PySHACL in this mode.\n- `PYSHACL_SERVER_LISTEN=1.2.3.4` listen on a different IP Address or hostname\n- `PYSHACL_SERVER_PORT=8080` listen on given different TCP PORT\n- `PYSHACL_SERVER_HOSTNAME=example.org` when you are hosting the server behind a reverse-proxy or in a containerised environment, use this so PySHACL server knows what your externally facing hostname is\n\n\n## Windows CLI\n\n[Pyinstaller](https://www.pyinstaller.org/) can be\n[used](https://pyinstaller.readthedocs.io/en/stable/usage.html) to create an\nexecutable for Windows that has the same characteristics as the Linux/Mac\nCLI program.\nThe necessary ``.spec`` file is already included in ``pyshacl/pyshacl-cli.spec``.\nThe ``pyshacl-cli.spec`` PyInstaller spec file creates a ``.exe`` for the\npySHACL Command Line utility. See above for the pySHACL command line util usage instructions.\n\nSee [the PyInstaller installation guide](https://pyinstaller.readthedocs.io/en/stable/installation.html#installing-in-windows) for info on how to install PyInstaller for Windows.\n\nOnce you have pyinstaller, use pyinstaller to generate the ``pyshacl.exe`` CLI file like so:\n```bash powershell\n$ cd src/pyshacl\n$ pyinstaller pyshacl-cli.spec\n```\nThis will output ``pyshacl.exe`` in the ``dist`` directory in ``src/pyshacl``.\n\nYou can now run the pySHACL Command Line utility via ``pyshacl.exe``.\nSee above for the pySHACL command line util usage instructions.\n\n## Docker\nPull the official docker image from Dockerhub:\n`docker pull docker.io/ashleysommer/pyshacl:latest`\n\nOr build the image yourself, from the PySHACL repository with `docker build . -t pyshacl`.\n\nYou can now run PySHACL inside a container; but you need to mount the data you want to validate.\nFor example, to validate `graph.ttl` against `shacl.ttl`, run :\n```bash\ndocker run --rm -i -t --mount type=bind,src=`pwd`,dst=/data pyshacl -s /data/shacl.ttl /data/graph.ttl\n```\n\n## Compatibility\nPySHACL is a Python3 library. For best compatibility use Python v3.8 or greater. Python3 v3.7 or below is _**not supported**_ and this library _**does not work**_ on Python v2.7.x or below.\n\nPySHACL is a PEP518 \u0026 PEP517 project, it uses `pyproject.toml` and `poetry` to manage dependencies, build and install.\n\nFor best compatibility when installing from PyPI with `pip`, upgrade to pip v20.0.2 or above.\n  - If you're on Ubuntu 18.04 or older, you will need to run `sudo pip3 install --upgrade pip` to get the newer version.\n\n## Features\nA features matrix is kept in the [FEATURES file](https://github.com/RDFLib/pySHACL/blob/master/FEATURES.md).\n\n## Changelog\nA comprehensive changelog is kept in the [CHANGELOG file](https://github.com/RDFLib/pySHACL/blob/master/CHANGELOG.md).\n\n## Benchmarks\nThis project includes a script to measure the difference in performance of validating the same source graph that has been inferenced using each of the four different inferencing options. Run it on your computer to see how fast the validator operates for you.\n\n## License\nThis repository is licensed under Apache License, Version 2.0. See the [LICENSE deed](https://github.com/RDFLib/pySHACL/blob/master/LICENSE.txt) for details.\n\n## Contributors\nSee the [CONTRIBUTORS file](https://github.com/RDFLib/pySHACL/blob/master/CONTRIBUTORS.md).\n\n## Citation\nDOI: [10.5281/zenodo.4750840](https://doi.org/10.5281/zenodo.4750840) (For all versions/latest version)\n\n## Contacts\n\n### Lead Developer\n\n**Ashley Sommer**  \n*Software Engineer*  \n[Department of Climate Change, Energy, the Environment and Water](https://www.dcceew.gov.au)  \nBrisbane, Qld, Australia  \n\u003cAshley.Sommer@dcceew.gov.au\u003e  \n\u003chttps://orcid.org/0000-0003-0590-0131\u003e\n\n### Support developer\n\n**Nicholas Car**  \n*Data Architect*  \n[KurrawongAI](https://kurrawong.ai)  \nBrisbane, Qld, Australia  \n\u003cnick@kurrawong.ai\u003e  \n\u003chttp://orcid.org/0000-0002-8742-7730\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRDFLib%2FpySHACL","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRDFLib%2FpySHACL","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRDFLib%2FpySHACL/lists"}