Skip to main content

Synthetic RDF graph generator based on SHACL constraints.

Project description

Synthetic RDF graph generator based on SHACL constraints.

rdf_graph_gen 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-graph-gen/

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

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_graph_gen-1.1.0.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_graph_gen-1.1.0-py3-none-any.whl (732.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rdf_graph_gen-1.1.0.tar.gz
Algorithm Hash digest
SHA256 167b8ece4a2faf74987e0dfa67b2f4fade23c003d5c912fc8886ab5c035dd8de
MD5 48c9ea607b5285efde9d7e27f864348c
BLAKE2b-256 f17ab072a61a84d1f93381a92f680ba62737954f9184f264b29bb5eafa65247c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rdf_graph_gen-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 732.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.18

File hashes

Hashes for rdf_graph_gen-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f9e8feb76a13dfdef5b9e3527d2efd427ffc8ebd2f8ebe4dc6bf7e19bf25b47
MD5 aa6d574b35e056d1a1600a94b946b805
BLAKE2b-256 3c18adead1dfc2af5e461748a09aa6c070275ea01e62069ee7282eed7a8fdbbd

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