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.
Metadata
Release files for rdf-shacl-generator 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rdf_shacl_generator-1.0.8.tar.gz | 728.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rdf_shacl_generator-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.5 MB
Release files / rdf_shacl_generator-1.0.8.tar.gz
| Download URL | rdf_shacl_generator-1.0.8.tar.gz |
|---|---|
| Size | 728.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95fb0dc9dd834dc6cfb9c69683cb190a142088e7f7925d999605c8b5569e4cc6
|
|
BLAKE2b-256 checksum How to use checksums |
8578e4e8dea48ff7fb06529d3f23a3a224de4f0c515b963988c4dde82b69915e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.18
|
Release files / rdf_shacl_generator-1.0.8-py3-none-any.whl
| Download URL | rdf_shacl_generator-1.0.8-py3-none-any.whl |
|---|---|
| Size | 732.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f27d7a2819f4dcd9c21f109bffe3c22993b3c96c56cb17d46158e41814ba77be
|
|
BLAKE2b-256 checksum How to use checksums |
6626edff1302009fa49c8095f81706c702c35c0b82df325d91df057c14b5d7dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.18
|