Repository navigation
Version 1.3 of the RDFGraphGen generator.
The generated data now conforms to the shapes for many more SHACL features, and the generator can check this itself.
Highlights
-
Conformance checking:
--validatechecks the graph while it is generated, andrdfgen validate SHAPES DATAchecks an existing graph. This requires the optionalvalidateextra:pip install "rdf-graph-gen[validate]". -
Reproducible graphs: with
--seed, every run generates the same graph, for any number of worker processes (--processes). The output file starts with a comment that records the version, the shapes file with its SHA-256 hash, and the options of the run. -
Broader SHACL support:
- newly supported: all XSD datatypes, language-tagged strings, sequence and inverse paths,
sh:qualifiedValueShape,sh:nodeKindandsh:not; - fixed:
sh:class,sh:node,sh:and/sh:or/sh:xone, the property pair constraints, closed shapes and recursive shapes.
The README lists the supported SHACL features and the known limitations.
- newly supported: all XSD datatypes, language-tagged strings, sequence and inverse paths,
-
New options:
--base-iri,--format ntriples,--no-provenanceand--version. The new Python functiongenerate_graphreturns the generated graph as an rdflibGraph. -
Exit status:
0for success, or a conforming graph when validating;1when the graph does not conform;2for an error;3when nothing was checked. -
Lower memory use: large graphs need less memory, since batches are written in order and only a few are held in memory at a time.
-
New example: conferences with their talks, speakers, venues and tickets, which uses most of the supported features in one shapes file. All example outputs were regenerated with a seed, and they all conform.
-
Tests: a test suite now runs on Python 3.9 to 3.14 for every push and pull request.
Upgrading from 1.2
- The same shapes generate different values than before. For example, dates and decimal numbers are drawn differently, and the output uses the prefixes of the shapes file.
generate_rdfoverwrites the output file instead of appending to it.- Generated e-mail addresses use the domain
example.com. - Entities of closed shapes (
sh:closed true) are no longer linked to their shape withsh:description. - The scale factor,
--batch_sizeand--processesmust be positive integers. python-dateutilandsetuptoolsare no longer needed.
The full list of changes is in the changelog.
Install or upgrade with pip install --upgrade rdf-graph-gen.