Read-only mirror of https://github.com/StatistikStadtZuerich/ld-pipeline — Stadt Zürich. Issues & pull requests at the source.
  • Python 53.5%
  • TSQL 17%
  • Jinja 16.5%
  • Shell 7.7%
  • Jupyter Notebook 5.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jakob Frank (jakob.frank@redlink.at) 2c60ff1af1 Merge branch 'backport-log-cleanup' into 'main'
Backport: Cleanup der Log-Files

See merge request OE-7035/ssz-lod/ld-pipeline!80
2026-08-05 13:14:10 +02:00
database fix: standardize SQL table references and improve test consistency 2026-04-13 15:23:16 +02:00
notebooks ruff format 2026-04-28 14:45:11 +02:00
pipeline Merge branch 'fix-room-zone' into 'develop' 2026-06-09 05:52:47 +00:00
scripts feat: enhance pipeline script with improved error handling and Teams notifications 2026-05-07 12:44:12 +02:00
sql view leeren 2026-06-05 08:13:54 +02:00
static updated_homepage 2026-04-17 08:43:07 +02:00
tests ruff 2026-06-08 16:26:46 +02:00
.gitignore ausnahme für dimension RAUM 2026-05-18 11:38:50 +02:00
.gitlab-ci.yml fix: update GitLab CI to add ruff-check and ruff-format as dependencies for sync-to-github 2026-06-03 13:30:59 +02:00
cleanup.sh feat(#447): extend cleanup for cronjob-logs files in cleanup.sh 2026-08-05 12:55:27 +02:00
compose.yaml fixed tests 2024-05-29 10:34:14 +02:00
config.ini fix: align jupyter to new APIs and configure logging 2025-10-14 12:45:39 +02:00
create_fuseki_index.sh refactor(#447): standardize environment variable handling and directory paths across scripts 2026-08-05 12:55:27 +02:00
Dockerfile
LICENSE chore: add Apache 2.0 license and update README with license information 2026-02-23 11:10:29 +01:00
main.py fix: correct view reference and update descriptions in time termset relation steps 2026-05-07 08:28:03 +02:00
pytest.ini
README.md stardog und legalfoundation entfernen 2026-03-02 13:14:37 +01:00
requirements.txt HOTFIX reenable local testing 2024-06-26 13:02:10 +02:00
run_fuseki_index.sh fix: correct LOGS_DIR initialization and enhance error handling in scripts 2026-08-05 12:55:27 +02:00
run_pipeline.py Merge branch 'issue411-optimieren-triples' into 'develop' 2026-05-05 05:39:00 +00:00
run_pipeline.sh refactor(#447): standardize environment variable handling and directory paths across scripts 2026-08-05 12:55:27 +02:00
sample.env new pipeline-script for all environments 2025-09-29 20:30:25 +02:00

LD Pipeline

"LD Pipeline" (fka "LD Pipeline 2024") is a redevelopment of the existing pipeline, focusing on improving flexibility, efficiency and scalability. This project involves extracting data from the Harmonized Database (HDB), converting it into triples, and then transferring it into an RDF database.

The pipeline code is developed on GitLab and mirrored on GitHub.

Getting Started

These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Before you begin, ensure you have the following installed and configured:

  • Python 3.6 or higher, development is done with python 3.10

Installation

Follow these steps to set up your development environment:

  1. Clone the repository:

    1. git clone https://cmp-sdlc.stzh.ch/OE-7035/ssz-lod/ld-pipeline.git
    2. cd ld-pipeline
  2. It is recommended to use a virtual environment.

    1. python -m venv .venv
    2. source .venv/bin/activate
  3. Install the required Python dependencies:

    • pip install -r requirements.txt
  4. Execute the pipeline:

    • Get help: python main.py --help
    • Run pipeline: python main.py run
    • Run pipeline in env:test: python main.py run --env test
    • List all supported step names: python main.py list-step-names
    • Run single step in env:test: python main.py step --env test --name copyStatic

Pipeline Steps

Copy Step

  • "copyStatic": Copies static.n3 files from /static to defined output folder.

Templating Step

  • "codeTemplating": Creates a .ttl RDF file out of the given data, requested by an sql statement.

    ...

Compressing Step

  • "compressing": Compresses all .ttl files with the gzip algorithm to a new directory.

UploadToFuseki Step

  • "uploadToFuseki": Uploads all compressed .gz files to a configured fuseki server.

Run with docker

  1. Build docker image: docker build -t ssz/ld-pipeline .
  2. Run dockerized application (e.g. help command): docker run ssz/ld-pipeline --help
  3. Mount an output directory, e.g.: docker run --mount type=bind,source="$(pwd)"/tmp,target=/out ssz/ld-pipeline step --env local --name copyStatic.

HINT: be sure to use only local, int or prod as environment within docker.

Development

  1. Unit Tests
    • Unit tests can be found under tests/unit
    • Run: SSZ_DB_TYPE=mock python -m pytest tests/unit
  2. Integration Tests
    • Integration tests can be found under tests/integration
    • The tests create the environment using docker (tests/integration/compose.yaml)
    • Be sure docker is up and running
    • Run: python -m pytest --container-scope=session tests/integration
  3. Local Pipeline execution
  4. Linter
    • Run ruff check to lint all files in the current directory
    • Run ruff format to format all files in the current directory

License

This project is licensed under the Apache License 2.0 (Apache-2.0). See the LICENSE file for details.