pyshacl

A Python validator for SHACL

https://github.com/rdflib/pyshacl

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    9 of 30 committers (30.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.3%) to scientific vocabulary

Keywords

constraints owl rdf shacl validator

Keywords from Contributors

mesh sequences interactive hacking network-simulation
Last synced: 6 months ago · JSON representation ·

Repository

A Python validator for SHACL

Basic Info
  • Host: GitHub
  • Owner: RDFLib
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 4.31 MB
Statistics
  • Stars: 284
  • Watchers: 23
  • Forks: 66
  • Open Issues: 43
  • Releases: 52
Topics
constraints owl rdf shacl validator
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

pySHACL

A Python validator for SHACL.

Build Status

DOI Downloads Downloads Downloads

This is a pure Python module which allows for the validation of RDF graphs against Shapes Constraint Language (SHACL) graphs. This module uses the rdflib Python library for working with RDF and is dependent on the OWL-RL Python module for OWL2 RL Profile based expansion of data graphs.

This module is developed to adhere to the SHACL Recommendation:

Holger Knublauch; Dimitris Kontokostas. Shapes Constraint Language (SHACL). 20 July 2017. W3C Recommendation. URL: https://www.w3.org/TR/shacl/ ED: https://w3c.github.io/data-shapes/shacl/

Community for Help and Support

The SHACL community has a discord server for discussion of topics around SHACL and the SHACL specification.

Use this invitation link: https://discord.gg/RTbGfJqdKB to join the server

There is a #pyshacl channel for discussion of this python library, and you can ask for general SHACL help too.

Installation

Install with PIP (Using the Python3 pip installer pip3) bash $ pip3 install pyshacl

Or in a python virtualenv (these example commandline instructions are for a Linux/Unix based OS) bash $ python3 -m virtualenv --python=python3 --no-site-packages .venv $ source ./.venv/bin/activate $ pip3 install pyshacl

To exit the virtual enviornment: bash $ deactivate

Command Line Use

For command line use: (these example commandline instructions are for a Linux/Unix based OS) bash $ pyshacl -s /path/to/shapesGraph.ttl -m -i rdfs -a -j -f human /path/to/dataGraph.ttl Where - -s is an (optional) path to the shapes graph to use - -e is an (optional) path to an extra ontology graph to import - -i is the pre-inferencing option - -f is the ValidationReport output format (human = human-readable validation report) - -m enable the meta-shacl feature - -a enable SHACL Advanced Features - -j enable SHACL-JS Features (if pyshacl[js] is installed)

System exit codes are: 0 = DataGraph is Conformant 1 = DataGraph is Non-Conformant 2 = The validator encountered a RuntimeError (check stderr output for details) 3 = Not-Implemented; The validator encountered a SHACL feature that is not yet implemented.

Full CLI Usage options: ```bash $ pyshacl -h $ python3 -m pyshacl -h usage: pyshacl [-h] [-s [SHACL]] [-e [ONT]] [-i {none,rdfs,owlrl,both}] [-m] [-im] [-a] [-j] [-it] [--abort] [--allow-info] [-w] [--max-depth [MAX_DEPTH]] [-d] [-f {human,table,turtle,xml,json-ld,nt,n3}] [-df {auto,turtle,xml,json-ld,nt,n3}] [-sf {auto,turtle,xml,json-ld,nt,n3}] [-ef {auto,turtle,xml,json-ld,nt,n3}] [-V] [-o [OUTPUT]] [--server] DataGraph

PySHACL 0.27.0 command line tool.

positional arguments: DataGraph The file containing the Target Data Graph.

optional arguments: --server Ignore all the rest of the options, start the HTTP Server. -h, --help show this help message and exit -s [SHACL], --shacl [SHACL] A file containing the SHACL Shapes Graph. -e [ONT], --ont-graph [ONT] A file path or URL to a document containing extra ontological information. RDFS and OWL definitions from this are used to inoculate the DataGraph. -i {none,rdfs,owlrl,both}, --inference {none,rdfs,owlrl,both} Choose a type of inferencing to run against the Data Graph before validating. -m, --metashacl Validate the SHACL Shapes graph against the shacl- shacl Shapes Graph before validating the Data Graph. -im, --imports Allow import of sub-graphs defined in statements with owl:imports. -a, --advanced Enable features from the SHACL Advanced Features specification. -j, --js Enable features from the SHACL-JS Specification. -it, --iterate-rules Run Shape's SHACL Rules iteratively until the datagraph reaches a steady state. --abort Abort on first invalid data. --allow-info, --allow-infos Shapes marked with severity of Info will not cause result to be invalid. -w, --allow-warning, --allow-warnings Shapes marked with severity of Warning or Info will not cause result to be invalid. --max-depth [MAXDEPTH] The maximum number of SHACL shapes "deep" that the validator can go before reaching an "endpoint" constraint. -d, --debug Output additional verbose runtime messages. --focus [FOCUS] Optional IRIs of focus nodes from the DataGraph, the shapes will validate only these node. Comma-separated list. --shape [SHAPE] Optional IRIs of a NodeShape or PropertyShape from the SHACL ShapesGraph, only these shapes will be used to validate the DataGraph. Comma-separated list. -f {human,table,turtle,xml,json-ld,nt,n3}, --format {human,table,turtle,xml,json-ld,nt,n3} Choose an output format. Default is "human". -df {auto,turtle,xml,json-ld,nt,n3}, --data-file-format {auto,turtle,xml,json-ld,nt,n3} Explicitly state the RDF File format of the input DataGraph file. Default="auto". -sf {auto,turtle,xml,json-ld,nt,n3}, --shacl-file-format {auto,turtle,xml,json-ld,nt,n3} Explicitly state the RDF File format of the input SHACL file. Default="auto". -ef {auto,turtle,xml,json-ld,nt,n3}, --ont-file-format {auto,turtle,xml,json-ld,nt,n3} Explicitly state the RDF File format of the extra ontology file. Default="auto". -V, --version Show PySHACL version and exit. -o [OUTPUT], --output [OUTPUT] Send output to a file (defaults to stdout). --server Ignore all the rest of the options, start the HTTP Server. Same as pyshacl_server. ```

Python Module Use

For basic use of this module, you can just call the validate function of the pyshacl module like this:

```python from pyshacl import validate

datagraph = "some-data.ttl" shaclgraph = "some-shacl.ttl" ont_graph = "some-ontology.ttl"

r = validate(datagraph, shaclgraph=shaclgraph, ontgraph=ontgraph, inference='rdfs', abortonfirst=False, allowinfos=False, allowwarnings=False, metashacl=False, advanced=False, js=False, debug=False) conforms, resultsgraph, resultstext = r ```

Where: * data_graph is an rdflib Graph object or file path of the graph to be validated * 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 datagraph. * `ontgraphis an rdflibGraphobject 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. *inferenceis a Python string value to indicate whether or not to perform OWL inferencing expansion of thedatagraphbefore validation. Options are 'rdfs', 'owlrl', 'both', or 'none'. The default is 'none'. *abortonfirst(optional)boolvalue to indicate whether or not the program should abort after encountering the first validation failure or to continue. Default is to continue. *allowinfos(optional)boolvalue, Shapes marked with severity of Info will not cause result to be invalid. *allowwarnings(optional)boolvalue, Shapes marked with severity of Warning or Info will not cause result to be invalid. *metashacl(optional)boolvalue to indicate whether or not the program should enable the Meta-SHACL feature. Default is False. *advanced: (optional)boolvalue to enable SHACL Advanced Features *js: (optional)boolvalue to enable SHACL-JS Features (ifpyshacl[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. * iterate_rules: Iterate 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 resultsgraph into a serialised representation (for example, 'turtle') * `checkdash_result`: Check the validation result against the given expected DASH test suite result.

Return value: * a three-component tuple containing: * conforms: a bool, indicating whether the data_graph conforms to the shacl_graph * results_graph: a Graph object built according to the SHACL specification's Validation Report scheme * results_text: python string representing a verbose textual representation of the Validation Report

Python Module Call

You can get an equivalent of the Command Line Tool using the Python3 executable by doing:

bash $ python3 -m pyshacl

Errors

Under certain circumstances pySHACL can produce a Validation Failure. This is a formal error defined by the SHACL specification 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. If the validator produces a Validation Failure, the results_graph variable returned by the validate() function will be an instance of ValidationFailure. See the message attribute on that instance to get more information about the validation failure.

Other errors the validator can generate: - 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. - ConstraintLoadError: This error is thrown when a SHACL Constraint Component is in an invalid state and cannot be loaded into the validation engine. - ReportableRuntimeError: An error occurred for a different reason, and the reason should be communicated back to the user of the validator. - RuntimeError: The validator encountered a situation that caused it to throw an error, but the reason does not concern the user.

Unlike 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 caught in a try ... except block. In 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.

Focus Node Filtering, and Shape Selection

PySHACL v0.27.0 and above has two powerful new features: - Focus Node Filtering - You can pass in a list of focus nodes to the validator, and it will only validate those focus nodes. - Note, you still need to use a SHACL ShapesGraph, and the Shapes still need to target the focus nodes. - This feature will filter the Shapes' targeted focus nodes to include only those that are in the list of specified focus nodes. - SHACL Shape selection - You can pass in a list of SHACL Shapes to the validator, and it will use only those Shapes for validation. - This is useful for testing new shapes in your shapes graph, or for many other procedure-driven use cases. - Combined Shape Selection with Focus Node filtering - The combination of the above two new features is especially powerful. - If you give the validator a list of Shapes to use, and a list of focus nodes, the validator will operate in a highly-targeted mode, it feeds those focus nodes directly into those given Shapes for validation. - In this mode, the selected SHACL Shape does not need to specify any focus-targeting mechanisms of its own.

SPARQL Remote Graph Mode

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.

  • In this mode, PySHAL operates strictly in read-only mode, and does not modify the remote data graph.
  • Some features are disabled when using the SPARQL Remote Graph Mode:
    • "rdfs" and "owl" inferencing is not allowed (because the remote graph is read-only, it cannot be expanded)
    • Extra Ontology file (Inoculation or Mix-In mode) is disabled (because the remote graph is read-only)
    • SHACL Rules (Advanced mode SPARQL-Rules) are not allowed (because the remote graph is read-only)
    • All SHACL-JS features are disabled (this is not safe when operating on a remote graph)
    • "inplace" mode is disabled (actually all operations on the remote data graph are inherently performed in-place)

Inference and Rules

PySHACL can perform inference - creation of new data using rules - according to the SHACL Advanced Features - Rules specification.

The shacl_rules function can be used like this:

```python from pyshacl import shacl_rules

datagraph = "some-data.ttl" shaclgraph = "some-shacl.ttl"

outputgraph = shaclrules(datagraph, shaclgraph=shacl_graph, advanced=True) ```

In 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.

See the example file examples/rules_inference.py for a working example of PySHACL performing two kinds of SHACL inference.

Integrated OpenAPI-3.0-compatible HTTP REST Service

PySHACL now has a built-in validation service, exposed via an OpenAPI3.0-compatible REST API.

Due to the additional dependencies required to run, this feature is an optional extra.

You must first install PySHACL with the http extra option enabled:

bash $ pip3 install -U pyshacl[http]

When that is installed, you can start the service using the by executing the CLI entrypoint:

```bash $ pyshacl --server

or

$ pyshacl_server

or

$ python3 -m pyshacl server

or

$ docker run --rm -e PYSHACL_SERVER=TRUE -i -t docker.io/ashleysommer/pyshacl:latest ```

By default, this will run the service on localhost address 127.0.0.1 on port 8099.

To 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.

To view the OpenAPI3 schema see http://127.0.0.1:8099/docs/openapi.json

Configuring the HTTP REST Service

  • 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.
  • PYSHACL_SERVER_LISTEN=1.2.3.4 listen on a different IP Address or hostname
  • PYSHACL_SERVER_PORT=8080 listen on given different TCP PORT
  • 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

Windows CLI

Pyinstaller can be used to create an executable for Windows that has the same characteristics as the Linux/Mac CLI program. The necessary .spec file is already included in pyshacl/pyshacl-cli.spec. The pyshacl-cli.spec PyInstaller spec file creates a .exe for the pySHACL Command Line utility. See above for the pySHACL command line util usage instructions.

See the PyInstaller installation guide for info on how to install PyInstaller for Windows.

Once you have pyinstaller, use pyinstaller to generate the pyshacl.exe CLI file like so: bash powershell $ cd src/pyshacl $ pyinstaller pyshacl-cli.spec This will output pyshacl.exe in the dist directory in src/pyshacl.

You can now run the pySHACL Command Line utility via pyshacl.exe. See above for the pySHACL command line util usage instructions.

Docker

Pull the official docker image from Dockerhub: docker pull docker.io/ashleysommer/pyshacl:latest

Or build the image yourself, from the PySHACL repository with docker build . -t pyshacl.

You can now run PySHACL inside a container; but you need to mount the data you want to validate. For example, to validate graph.ttl against shacl.ttl, run : bash docker run --rm -i -t --mount type=bind,src=`pwd`,dst=/data pyshacl -s /data/shacl.ttl /data/graph.ttl

Compatibility

PySHACL 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.

PySHACL is a PEP518 & PEP517 project, it uses pyproject.toml and poetry to manage dependencies, build and install.

For best compatibility when installing from PyPI with pip, upgrade to pip v20.0.2 or above. - If you're on Ubuntu 18.04 or older, you will need to run sudo pip3 install --upgrade pip to get the newer version.

Features

A features matrix is kept in the FEATURES file.

Changelog

A comprehensive changelog is kept in the CHANGELOG file.

Benchmarks

This 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.

License

This repository is licensed under Apache License, Version 2.0. See the LICENSE deed for details.

Contributors

See the CONTRIBUTORS file.

Citation

DOI: 10.5281/zenodo.4750840 (For all versions/latest version)

Contacts

Lead Developer

Ashley Sommer
Software Engineer
Department of Climate Change, Energy, the Environment and Water
Brisbane, Qld, Australia
Ashley.Sommer@dcceew.gov.au
https://orcid.org/0000-0003-0590-0131

Support developer

Nicholas Car
Data Architect
KurrawongAI
Brisbane, Qld, Australia
nick@kurrawong.ai
http://orcid.org/0000-0002-8742-7730

Owner

  • Name: RDFlib
  • Login: RDFLib
  • Kind: organization

RDFlib, the GitHub organization, is a volunteer-maintained collection of Python tools for working with RDF data.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use PySHACL in a publication, please cite it as below."
authors:
- family-names: "Sommer"
  given-names: "Ashley"
  orcid: "https://orcid.org/0000-0003-0590-0131"
- family-names: "Car"
  given-names: "Nicholas"
  orcid: "http://orcid.org/0000-0002-8742-7730"
title: "pySHACL"
version: 0.30.1
doi: 10.5281/zenodo.4750840
license: Apache-2.0
date-released: 2025-03-15
url: "https://github.com/RDFLib/pySHACL"

GitHub Events

Total
  • Create event: 14
  • Issues event: 22
  • Release event: 6
  • Watch event: 36
  • Issue comment event: 60
  • Push event: 43
  • Pull request review comment event: 4
  • Pull request review event: 4
  • Pull request event: 18
  • Fork event: 5
Last Year
  • Create event: 14
  • Issues event: 22
  • Release event: 6
  • Watch event: 36
  • Issue comment event: 60
  • Push event: 43
  • Pull request review comment event: 4
  • Pull request review event: 4
  • Pull request event: 18
  • Fork event: 5

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 470
  • Total Committers: 30
  • Avg Commits per committer: 15.667
  • Development Distribution Score (DDS): 0.287
Past Year
  • Commits: 133
  • Committers: 6
  • Avg Commits per committer: 22.167
  • Development Distribution Score (DDS): 0.293
Top Committers
Name Email Commits
Ashley Sommer a****r@g****m 335
Alex Nelson a****n@n****v 62
Nicholas Car n****r@c****u 11
Nicholas Car n****r@s****m 10
Gabe Fierro g****o@c****u 8
Piyush Gupta p****6@i****n 5
Nolan Nichols n****s@m****m 3
wcrd 1****d 3
Nicholas Bollweg n****g@g****m 3
Matt Goldberg g****3@c****m 3
Iwan Aucamp a****a@g****m 2
MPolitze m@p****t 2
Nolan Nichols n****s@g****m 2
Tom Mitchell t****l 2
jamiefeiss j****s@g****m 2
connorjcantrell c****l@g****m 2
atomobianco a****o 2
dependabot[bot] 4****] 1
martijn m****n@y****l 1
Wes Turner 5****r 1
Stephane_Branly 5****y 1
Rinke Hoekstra R****a 1
Ralf Grubenmann r****n@s****h 1
Mohameth François SY m****y@g****m 1
Konrad Höffner k****r@u****e 1
Jonathan Yu j****u@c****u 1
Car, Nicholas (L&W, Dutton Park) N****r@c****u 1
Daniel Dunbar d****1@s****u 1
Johannes Lötzsch g****t@j****e 1
James Howison j****s@h****e 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 130
  • Total pull requests: 88
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 13 days
  • Total issue authors: 75
  • Total pull request authors: 19
  • Average comments per issue: 3.8
  • Average comments per pull request: 1.6
  • Merged pull requests: 76
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 19
  • Pull requests: 38
  • Average time to close issues: 5 days
  • Average time to close pull requests: 2 days
  • Issue authors: 12
  • Pull request authors: 6
  • Average comments per issue: 1.32
  • Average comments per pull request: 0.79
  • Merged pull requests: 34
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ajnelson-nist (19)
  • KonradHoeffner (9)
  • santiagorr (6)
  • tobiasschweizer (4)
  • tduval-unifylogic (4)
  • volkerjaenisch (4)
  • ashleysommer (3)
  • gtfierro (3)
  • edmondchuc (3)
  • AJAY31797 (3)
  • jdsika (2)
  • sa-bpelakh (2)
  • henrieglesorotos (2)
  • nicholascar (2)
  • aucampia (2)
Pull Request Authors
  • ajnelson-nist (62)
  • ashleysommer (33)
  • nicholascar (5)
  • gtfierro (4)
  • dependabot[bot] (4)
  • kirchner (2)
  • atomobianco (2)
  • aucampia (2)
  • mgberg (2)
  • StephaneBranly (2)
  • connorjcantrell (2)
  • KonradHoeffner (1)
  • tcmitchell (1)
  • wcrd (1)
  • cclauss (1)
Top Labels
Issue Labels
bug (3) enhancement (1) help wanted (1) discussion (1)
Pull Request Labels
dependencies (4)

Packages

  • Total packages: 5
  • Total downloads:
    • pypi 99,493 last-month
  • Total docker downloads: 112
  • Total dependent packages: 36
    (may contain duplicates)
  • Total dependent repositories: 89
    (may contain duplicates)
  • Total versions: 248
  • Total maintainers: 3
pypi.org: pyshacl

Python SHACL Validator

  • Homepage: https://github.com/RDFLib/pySHACL
  • Documentation: https://pyshacl.readthedocs.io/
  • License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  • Latest release: 0.30.1
    published 11 months ago
  • Versions: 77
  • Dependent Packages: 33
  • Dependent Repositories: 87
  • Downloads: 99,493 Last month
  • Docker Downloads: 112
Rankings
Dependent packages count: 0.5%
Dependent repos count: 1.6%
Downloads: 1.6%
Average: 2.9%
Docker downloads count: 3.8%
Stargazers count: 4.6%
Forks count: 5.4%
Maintainers (2)
Last synced: 6 months ago
proxy.golang.org: github.com/RDFLib/pySHACL
  • Versions: 65
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
proxy.golang.org: github.com/rdflib/pyshacl
  • Versions: 65
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 6 months ago
spack.io: py-pyshacl

A Python validator for SHACL.

  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent repos count: 0.0%
Average: 14.5%
Forks count: 14.7%
Stargazers count: 15.1%
Dependent packages count: 28.1%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: pyshacl

This is a pure Python module which allows for the validation of RDF graphs against Shapes Constraint Language (SHACL) graphs. This module uses the rdflib Python library for working with RDF and is dependent on the OWL-RL Python module for OWL2 RL Profile-based expansion of data graphs.

  • Versions: 38
  • Dependent Packages: 2
  • Dependent Repositories: 2
Rankings
Dependent packages count: 19.6%
Dependent repos count: 20.2%
Average: 22.7%
Forks count: 24.3%
Stargazers count: 26.5%
Last synced: 6 months ago

Dependencies

poetry.lock pypi
  • atomicwrites 1.4.0 develop
  • attrs 21.4.0 develop
  • coverage 6.4.1 develop
  • iniconfig 1.1.1 develop
  • pluggy 1.0.0 develop
  • py 1.11.0 develop
  • pytest 6.2.5 develop
  • pytest-cov 2.12.1 develop
  • toml 0.10.2 develop
  • black 22.6.0
  • click 8.1.3
  • colorama 0.4.5
  • cython 0.29.30
  • flake8 3.9.2
  • importlib-metadata 4.12.0
  • isodate 0.6.1
  • isort 5.10.1
  • mccabe 0.6.1
  • mypy 0.800
  • mypy-extensions 0.4.3
  • owlrl 6.0.2
  • packaging 21.3
  • pathspec 0.9.0
  • platformdirs 2.5.2
  • prettytable 2.5.0
  • pycodestyle 2.7.0
  • pyduktape2 0.4.2
  • pyflakes 2.3.1
  • pyparsing 3.0.9
  • rdflib 6.1.1
  • rdflib-jsonld 0.5.0
  • six 1.16.0
  • tomli 2.0.1
  • typed-ast 1.4.3
  • types-setuptools 57.4.18
  • typing-extensions 4.2.0
  • wcwidth 0.2.5
  • zipp 3.8.0
pyproject.toml pypi
  • black 22.6.0 develop
  • coverage >6,<7,!=6.0.*,!=6.1,!=6.1.1 develop
  • flake8 ^3.8.0 develop
  • isort ^5.7.0 develop
  • mypy ^0.800 develop
  • pytest ^6.0 develop
  • pytest-cov ^2.8.1 develop
  • types-setuptools * develop
  • black 22.6.0
  • flake8 ^3.8.0
  • isort ^5.7.0
  • mypy ^0.800
  • owlrl >=6.0.2,<7
  • packaging >=21.3
  • prettytable ^2.2.1
  • pyduktape2 ^0.4.1
  • python ^3.7.0
  • rdflib >=6.1.1,<8
  • rdflib-jsonld >=0.4.0,<0.6
  • types-setuptools *
Dockerfile docker
  • docker.io/library/python 3.10-alpine build