Python wrapper around TopQuadrant SHACL processor
Project description
Py(thon)T(op)Q(uadrant)SHA(pe)C(onstraint)L(anguage)
Python wrapper around TopQuadrant's SHACL implementation in Java.
Why?
Motivation: This was developed as part of BIM2RDF where TopQuadrant was used to execute SHACL. Python's PySHACL was too slow. Nonetheless, it's useful to be able to integrate it with Python.
Optional Features
can be installed as pytqshacl[java,cli].
- Java: is installed on first use. Note this changes your system. The installation location will be printed.
- CLI: will just wrap the topquadrant invocation with managed configuraion.
Usage
Install pytqshacl with your Python package manager.
The features are optional pytqshacl[cli,java].
CLI
Get help with pytqshacl --help.
Example usage:
pytqshacl\test on master [!⇡] via v3.11.9
❯ pytqshacl validate -d data.ttl -s shapes.ttl -o None
ERRORS: process did not exit with 0
@prefix dash: <http://datashapes.org/dash#> .
@prefix graphql: <http://datashapes.org/graphql#> .
@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 schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix swa: <http://topbraid.org/swa#> .
@prefix tosh: <http://topbraid.org/tosh#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
[ rdf:type sh:ValidationReport ;
sh:conforms false ;
sh:result [ rdf:type sh:ValidationResult ;
sh:focusNode <https://example.com/John-Doe> ;
sh:resultMessage "Property may only have 1 value, but found 2" ;
sh:resultPath schema:name ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
sh:sourceShape []
]
] .
Lib
Check the arguments from validate and infer
from the imports from pytqshacl import validate, infer.
Configuration
The environment variable, PYTQSHACL_PREFER_SYSJAVA, can be set to 'false'
if the package is installed with the 'java' feature
to prefer finding a java executable in the system PATH environment variable.
Dev Philosphy
This point of this code is just to provide access to use TopQuadrant's SHACL from Python. Therefore,
- No features: It should just wrap the TopQuadrant SHACL executable.
- No dependencies
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytqshacl-139.tar.gz.
File metadata
- Download URL: pytqshacl-139.tar.gz
- Upload date:
- Size: 21.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27f1f9f8234ea9585a114de653c516a1b1ac34c214219f7e4c25e1913f3a0b5
|
|
| MD5 |
0d272401fc5cc5d5e2190f04f1004bb3
|
|
| BLAKE2b-256 |
c99e836924f032a7d6d7e2f016b885e3f4bd387e0b8187c2e3f75d5383fe405c
|
Provenance
The following attestation bundles were made for pytqshacl-139.tar.gz:
Publisher:
python-publish.yml on pnnl/pytqshacl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytqshacl-139.tar.gz -
Subject digest:
d27f1f9f8234ea9585a114de653c516a1b1ac34c214219f7e4c25e1913f3a0b5 - Sigstore transparency entry: 253753438
- Sigstore integration time:
-
Permalink:
pnnl/pytqshacl@56233ce4e8611c5087303cb2e8378bcb42b73b1d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/pnnl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@56233ce4e8611c5087303cb2e8378bcb42b73b1d -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytqshacl-139-py2.py3-none-any.whl.
File metadata
- Download URL: pytqshacl-139-py2.py3-none-any.whl
- Upload date:
- Size: 21.3 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e31c256ee517c9ff4eaa1fc66dc87c57b77a25ca303968c86b8502465230aac9
|
|
| MD5 |
ec4648e7cf9c26edbb1518bd9b7281ed
|
|
| BLAKE2b-256 |
eda22a6a485d0df990ff1bf8d69d0a00ec69d29ad406d4924ebd91072285401a
|
Provenance
The following attestation bundles were made for pytqshacl-139-py2.py3-none-any.whl:
Publisher:
python-publish.yml on pnnl/pytqshacl
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytqshacl-139-py2.py3-none-any.whl -
Subject digest:
e31c256ee517c9ff4eaa1fc66dc87c57b77a25ca303968c86b8502465230aac9 - Sigstore transparency entry: 253753442
- Sigstore integration time:
-
Permalink:
pnnl/pytqshacl@56233ce4e8611c5087303cb2e8378bcb42b73b1d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/pnnl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@56233ce4e8611c5087303cb2e8378bcb42b73b1d -
Trigger Event:
push
-
Statement type: