Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
pyrudof — Python bindings for Rudof
pyrudof provides Python bindings for rudof, a Rust library for working with RDF data validation and related Semantic Web technologies.
Key features:
- ShEx & SHACL validation — validate RDF graphs against Shape Expressions and SHACL shapes.
- DCTAP conversion — read Dublin Core Tabular Application Profiles and convert them to ShEx.
- SPARQL queries — run SELECT / CONSTRUCT queries against local data or remote endpoints.
- Schema comparison — compare two schemas for structural equivalence.
- UML visualization — generate PlantUML diagrams from schemas and data.
- Synthetic data generation — create RDF data from ShEx or SHACL schemas via
rudof_generate.
Links: PyPI · Documentation · Tutorials (Jupyter)
Building from source
pyrudof is built with PyO3 and maturin.
# Clone the repository
# (Optional) create a virtual environment
# .venv\Scripts\Activate.ps1 # Windows PowerShell
# Install maturin and build
For a release-optimised wheel:
Testing
Run the full test suite
Run only the example tests
Run a specific category or test
# All ShEx examples
# A single example
# SHACL API tests
# Data generation tests
Test architecture
Tests are auto-generated from examples/examples.toml. When test_examples.py is loaded, it reads the manifest and dynamically creates one unittest.TestCase class per category, with one test method per example. Each test:
- Launches the
.pyfile as a subprocess (exactly as a user would run it). - Asserts a zero exit code and non-empty stdout.
- Checks any
expected_outputsubstrings declared in the manifest.
Examples that require network access, a PlantUML JAR, or special runtimes are marked with skip_test = true in the TOML and are automatically skipped.
| Test file | What it covers |
|---|---|
test_examples.py |
All examples from the manifest |
test_shacl.py |
SHACL validation API |
test_generate.py |
GeneratorConfig / DataGenerator API |
Examples and documentation
Single source of truth
The example system is designed to eliminate duplication. Code lives in one place only:
- examples/*.py: the executable code (authoritative)
- examples/examples.toml: metadata: title, description, category, files, expected_output, skip_test
Both the test suite and the documentation generator read from these two sources. There is no inline code in the registry or in the RST file.
Adding a new example
-
Create a
.pyfile inpython/examples/(it must be a runnable script that prints output). -
Register it in
examples/examples.toml:[[]] = "my_example" = "my_example.py" = "My Example" = "What this example demonstrates" = "shex" # shex | shacl | rdf | dctap | sparql | endpoint | generate | uml | utility = { = "my_data.ttl"} # optional: referenced files = ["some expected string"] # optional: substrings to check # skip_test = true # uncomment if it needs network, PlantUML, etc. -
Run tests to verify:
-
Regenerate the documentation:
-
Verify the docs are in sync:
Available categories
| Category | Description |
|---|---|
shex |
ShEx validation |
shacl |
SHACL validation |
rdf |
RDF parsing and serialization |
dctap |
DCTAP profiles and conversion |
sparql |
SPARQL queries (local data) |
endpoint |
Remote endpoints (skipped in CI) |
generate |
Synthetic data generation |
uml |
PlantUML visualization (skipped in CI) |
utility |
Module introspection and testing |
Building the documentation locally
Then open _build/html/index.html in a browser.
Using rudof_generate
pyrudof includes bindings for synthetic RDF data generation.
Basic usage
=
=
Configuration options
=
# Generation
# or .Shacl
# Strategies: Minimum, Maximum, Random, Balanced
# Output
# or .NTriples
# Parallelism
Configuration files
# Load / save TOML
=
# Load / save JSON
=
See the advanced examples in examples/advanced_generate_example.py and examples/config_file_example.py for more patterns.