Skip to main content

Generates SHACL shapes from XML Schema files

Project description

XSD2SHACL

License DOI

A tool to generate SHACL shapes from XSD for RDF graphs validation.

  • The results of comparison and evaluation of supported XSD components are under comparison folder.

  • The results of validation on two usecases are under usecases folder.

Installation

  • From PyPi package
pip install xsd2shacl
  • From source code:
python -m pip install poetry
poetry update
poetry build

Usage

To translate XSD to SHACL shapes:

python -m xsd2shacl -x XSD_PATH [-s SHACL_PATH]

For example, if you execute the following:

python -m xsd2shacl -x comparison/pos.xsd

The generated shape file will then be located here: comparison/pos.xsd.shape.ttl.

Post-adjustment

To adjust the generated SHACL shapes with corresponding RML mapping files to the post-adjusted shapes on two use cases:

  • RINF:
python -m xsd2shacl -i usecases/RINF/RINF-metadata.xsd.shape.ttl -r usecases/RINF/mappings/RINF-contact-line-systems.yml.ttl -a usecases/RINF/RINF-metadata.xsd.shape.RINF-contact-line-systems.adjustment.ttl
  • TED:
python -m xsd2shacl -i usecases/TED/TED_EXPORT_merge.xsd.shape.ttl -r usecases/TED/mappings/F03 -a usecases/TED/TED_EXPORT_merge_F03.shape.adjustment.ttl

Run following get the validation results (C_T, R/T, R/T', C_P, R/P, R/P'):

python usecases/RINF/metrics.py
python usecases/TED/metrics.py

Cite

To cite our work:

@inproceedings{duan2023xsd,
    author = {Duan, Xuemin and Chaves-Fraga, David and Dimou, Anastasia},
    title = {{XSD2SHACL: Capturing RDF Constraints from XML Schema}},
    year = {2023},
    isbn = {9798400701412},
    publisher = {ACM},
    doi = {10.1145/3587259.3627565},
    booktitle = {Proceedings of the 12th Knowledge Capture Conference 2023},
    keywords = {Validation, XSD, SHACL, RDF shapes, XML Schema},
    series = {K-CAP '23}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xsd2shacl-1.1.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

xsd2shacl-1.1.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file xsd2shacl-1.1.0.tar.gz.

File metadata

  • Download URL: xsd2shacl-1.1.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xsd2shacl-1.1.0.tar.gz
Algorithm Hash digest
SHA256 386516c4011a7eb4afb73dd0d4c9036f5de4a72bd7785262bcb47f8d40105850
MD5 e54fbc70b728ed51921b23137614c64f
BLAKE2b-256 38b70395d66038a979ca0ed818dc0e0053d096ed8762e536c8caa18613080aac

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsd2shacl-1.1.0.tar.gz:

Publisher: publish.yml on dtai-kg/XSD2SHACL

Attestations:

File details

Details for the file xsd2shacl-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: xsd2shacl-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for xsd2shacl-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a63e974a252958fdd880aef8dad3b13022a7ffdd21bfc91cb8bb33b2f0c34b0
MD5 062f3afd6ff43ad92ec1ebdc0524b037
BLAKE2b-256 c88a2858eb2ee828c3d5e38174b10ab1f79244d00a108d29492edd5ce7536fa4

See more details on using hashes here.

Provenance

The following attestation bundles were made for xsd2shacl-1.1.0-py3-none-any.whl:

Publisher: publish.yml on dtai-kg/XSD2SHACL

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page