Pipeline for converting railML 3.2 infrastructure data to the ERA ontology (RINF-compatible RDF).
⚠️ Built around the advanced example v14 of railML® in preparation for a Workshop at ERA. Scripts are reusable but assumptions are hardcoded — use with caution for other inputs.
⚠️ Theadvanced-example.xmlsource file is not included due to railML® licensing. See 01-prep/README.md.
railML XML
↓ [01-prep] SPARQL Anything → one-eyed-graph.ttl
↓ [02-construct] SPARQL CONSTRUCT → era-graph.ttl
↓ [03-post-process] Geometry enrichment → era-graph-enriched.ttl
↓ [04-validate] SHACL validation → validation-report.ttl
↓ [upload-to-rinf] Upload to https://jena.matdata.eu/rinf
A separate standalone script in 06-create-topology builds ERA topology from Belgian open rail segment data (Infrabel).
| Step | Folder | Purpose | Output |
|---|---|---|---|
| 1 | 01-prep | Convert railML XML → raw RDF via SPARQL Anything | one-eyed-graph.ttl |
| 2 | 02-construct | SPARQL CONSTRUCT queries → ERA ontology | era-graph.ttl |
| 3 | 03-post-process | Geometry enrichment, data fixes | era-graph-enriched.ttl |
| 4 | 04-validate | SHACL validation against ERA shapes (requires maplib license) | validation-report.ttl |
| 5 | 05-shacl-shacl | Validate the SHACL shapes themselves | — |
| 6 | 06-create-topology | Build ERA topology from Infrabel open data | topology.ttl |
- Docker (for SPARQL Anything in step 1)
- Python 3.10+ with virtual environment
- Apache Jena Fuseki (optional, recommended)
pip install -r requirements.txtcd 01-prep ; .\run-prep.ps1
cd ..\02-construct; .\run-construct.ps1
cd ..\03-post-process; .\run-post-process.ps1
cd ..\04-validate ; python validate.pyTo upload to the remote Fuseki instance:
.\upload-to-rinf.ps1Steps 01–03 read/write named graphs in a local Fuseki instance and fall back to local files when unavailable.
| Step | Dataset |
|---|---|
| 01 | advanced-example-one-eyed/ |
| 02 | reads one-eyed/, writes advanced-example/ |
| 03 | updates advanced-example/ |