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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: rdf_graph_gen-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 81cf22693f567297525aa9acbf115b847c776b40737dc2a417a4cbf618eb814a
MD5 47c1ce34fb674becab6438e8656ef56a
BLAKE2b-256 38afff5de503d9222b7e42b6e7a4622dc6cf1ca254efbf0f24892986da76eb60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rdf_graph_gen-1.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f5f5ea1b796ebcc3325b7eea7e7ca27484f7da2e4e3fdf736ac87851ac5aa72
MD5 68875686f65eaa0d8aa38894395ee199
BLAKE2b-256 3d65d6effdaf0eac0ea8078360dc2628937ff2cb8110b21935efcd87e22077ec

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