Skip to main content

Synthetic RDF graph generator based on SHACL constraints.

Project description

Synthetic RDF graph generator based on SHACL constraints.

rdf_shacl_generator is a Python package that can be used to generate RDF graphs based on SHACL constraints.

The following function can be used to generate RDF data:

generate_rdf(file1, file2, number_of_entities)

  • file1 is a turtle file that contains SHACL shapes.
  • file2 is a turtle file that will store the generated RDF entities
  • number_of_entities is the number of RDF entities to be generated.

Link on PyPi: https://pypi.org/project/rdf-shacl-generator/

Link on GitHub: https://github.com/mveco/RDF_generator

Installation:

pip install rdf-shacl-generator

After installation, this package can be used as a command line tool:

rdfgen file1 file2 number_of_entities

Examples

Examples of SHACL Shapes based on Schema.org types can be found in the generated_examples\shape_examples directory in the GitHub repo, along with generated RDF data samples for these Shapes (in the generated_examples\generated_rdf directory) .

Remarks:

  • A SHACL shape has to have a 'a sh:NodeShape' property and object in order to be recognized as a Node Shape.
  • sh:severity is ignored because it has no useful info.
  • SHACL Property Paths are not supported
  • sh:datatype can have many different values, not all are recognized.
  • sh:nodeKind is ignored
  • The triples generated based on properties with a sh:minCount constraint can sometimes have a smaller value than the defined minimum count. This is because sometimes the generator generates the same triple multiple times.

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

rdf_shacl_generator-1.0.8.tar.gz (728.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rdf_shacl_generator-1.0.8-py3-none-any.whl (732.7 kB view details)

Uploaded Python 3

File details

Details for the file rdf_shacl_generator-1.0.8.tar.gz.

File metadata

  • Download URL: rdf_shacl_generator-1.0.8.tar.gz
  • Upload date:
  • Size: 728.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.18

File hashes

Hashes for rdf_shacl_generator-1.0.8.tar.gz
Algorithm Hash digest
SHA256 95fb0dc9dd834dc6cfb9c69683cb190a142088e7f7925d999605c8b5569e4cc6
MD5 9dbadb60464af2fb89d371f37be0d8d1
BLAKE2b-256 8578e4e8dea48ff7fb06529d3f23a3a224de4f0c515b963988c4dde82b69915e

See more details on using hashes here.

File details

Details for the file rdf_shacl_generator-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for rdf_shacl_generator-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f27d7a2819f4dcd9c21f109bffe3c22993b3c96c56cb17d46158e41814ba77be
MD5 48339b42e9046e55ef3e29122ad7e149
BLAKE2b-256 6626edff1302009fa49c8095f81706c702c35c0b82df325d91df057c14b5d7dc

See more details on using hashes here.

Supported by

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