Skip to content

RDFGraphGen v1.3.0

Latest

Choose a tag to compare

@mjovanovik mjovanovik released this 19 Nov 10:59

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: --validate checks the graph while it is generated, and rdfgen validate SHAPES DATA checks an existing graph. This requires the optional validate extra: 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:nodeKind and sh: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.

  • New options: --base-iri, --format ntriples, --no-provenance and --version. The new Python function generate_graph returns the generated graph as an rdflib Graph.

  • Exit status: 0 for success, or a conforming graph when validating; 1 when the graph does not conform; 2 for an error; 3 when 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_rdf overwrites 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 with sh:description.
  • The scale factor, --batch_size and --processes must be positive integers.
  • python-dateutil and setuptools are no longer needed.

The full list of changes is in the changelog.

Install or upgrade with pip install --upgrade rdf-graph-gen.