RDFVR
RDFVR (RDF Validation Report) is a pure Python package to generate readable reports for the validation of RDF graphs against Shapes Constraint Language (SHACL) graphs.
Installation
Install with pip (Python 3 pip installer pip3):
$ pip3 install rdfvr
Command Line Use
$ rdfvr -f /path/to/rdf_graph -ff rdf_graph_format -s path/to/schema_of_rdf_graph -sf schema_of_rdf_graph_format -m path/to/mappings -o path/to/report -of report_format --no-datetime
Where
-fis the path of the RDF graph file to be validated (also supports multiple files)-ffis the format of the RDF graph file (also supports multiple file formats when we have multiple RDF graph files)-sis the path of the the RDF graph's schema-sfis the format of the RDF graph's schema-mis the path of mappings to shorten the report-ois the path of the validation report without extension (also supports multiple files when we have multiple RDF graph files)-ofis the format of the validation report (also supports multiple file formats when we have multiple RDF graph files)--no-datetimedisables the datetime line in the output
Full CLI Usage Options:
$ rdfvr -h
usage: rdfvr [-h] [--file FILE] [--schema SCHEMA] [--fileformat FILEFORMAT]
[--schemaformat {xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext}]
[--mappings MAPPINGS] [--output OUTPUT] [--outputformat OUTPUTFORMAT]
[--no-datetime]
optional arguments:
-h, --help show this help message and exit
--file FILE, -f FILE File(s) of the RDF graph(s) to be validated (list[str] | str ): please use comma (no space) to split multiple file paths (e.g.
file1,file2,file3).
--schema SCHEMA, -s SCHEMA
Schema of the RDF graph, i.e., Shapes Constraint Language (SHACL) graph (str): path of the file.
--fileformat FILEFORMAT, -ff FILEFORMAT
File format(s) of the RDF graph(s) to be validated (list[str] | str ). Orders should be consistent with the input of --file. Default format is
json-ld. If all input files have the same format, only need to write once.
--schemaformat {xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext}, -sf {xml,n3,turtle,nt,pretty-xml,trix,trig,nquads,json-ld,hext}
File format of the schema (str). Default format is ttl.
--mappings MAPPINGS, -m MAPPINGS
File of the mappings to shorten the report (str): path of the JSON file, where the key is the original text and the value is the shorter text.
--output OUTPUT, -o OUTPUT
Path(s) of the validation report without extension (list[str] | str ). If no value, then output will be a string. Please use comma (no space) to split
multiple file paths (e.g. file1,file2,file3).
--outputformat OUTPUTFORMAT, -of OUTPUTFORMAT
File format(s) of the output, validation report (list[str] | str ). Orders should be consistent with the input of --output. Default format is
txt. Each item can only be one of {txt,html}. Please use comma (no space) to split multiple formats (e.g. format1,format2,format3). If all
output files have the same format, only need to write once.
--no-datetime Disable the datetime line in the output.
Python Module Use
You can call the validation_report function of the rdfvr module as follows:
from rdfvr import validation_report
validation_report(file_path, file_format, schema, schema_format, output_path, output_format, mappings, no_datetime)
Where
file_pathis the file path (string) of a RDF graphfile_formatis the format (string) of the RDF graph fileschemais the file path (string) of the RDF graph's schemaschema_formatis the format (string) of the schema fileoutput_pathis the file path (string) of the validation report without extensionoutput_formatis the format (string) of the validation report, i.e.,txtorhtmlmappingsis the mappings (dictionary) to shorten the reportno_datetimeis a boolean (defaultFalse) to disable the datetime line in the output
The return value is None.
The output will be either a txt file, a html file, or a string print in Bash.
Metadata
Release files for rdfvr 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rdfvr-0.3.6.tar.gz | 6.6 kB | Without provenance | Details for rdfvr-0.3.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rdfvr-0.3.6-py3-none-any.whl | Python 3 | none | any | Details for rdfvr-0.3.6-py3-none-any.whl |
Total release size: 13.6 kB
Release files / rdfvr-0.3.6.tar.gz
| Download URL | rdfvr-0.3.6.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4e997be39bad04c1da098cb3c1eb7daf44e19af97c4b990751d8ca5ff81658af
|
|
BLAKE2b-256 checksum How to use checksums |
c79a387eff68d10d688a8f958229d6ee468b522d7585f7e7ceea90ef19278162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Release files / rdfvr-0.3.6-py3-none-any.whl
| Download URL | rdfvr-0.3.6-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4b9d70be70a8cb0ee753111446d986e84fa5a22c6317d1faae252f13f9ccbdd
|
|
BLAKE2b-256 checksum How to use checksums |
9fcfb7a91f9933ead5f0005ba6baf4776f51c2d4edbb1683ccba54abd45f5595
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.1
|
Security for rdfvr 0.3.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.