Skip to content

ad-freiburg/dicom2rdf

Repository files navigation

dicom2rdf

dicom2rdf is a data pipeline that converts millions of DICOM SR documents to RDF Turtle, makes its metadata searchable with SPARQL, and is powered by QLever, a high performance graph database.

Unlike other approaches that only translate the bare hierarchical structure of a DICOM SR document to RDF triples, dicom2rdf applies a second processing step to transform this raw structure via a set of SPARQL CONSTRUCT queries. The resulting schema yields simpler SPARQL queries that are both highly explorable and run faster.

Example: Chronological SSDE by Acquisition Protocol

image

Prerequisites

  • Docker with Docker Compose V2, or
  • Podman with podman-compose

Usage

We use docker in the following examples, but podman works just as well.

  1. Clone this repository and cd into it:

    git clone https://github.com/ad-freiburg/dicom2rdf.git ~/dicom2rdf && cd ~/dicom2rdf
  2. Create empty bind mounts:

    mkdir -p data/{ttl-raw,ttl-semantic,index-raw,index-semantic}
  3. Create an .env file from the example and adjust as needed:

    cp .env.example .env
  4. Start the pipeline:

    docker compose up --build
    1. In the future, you may also start QLever and QLever UI without a full pipeline run:
      docker compose -f compose.yml -f compose.isolated.yml up qlever qlever-ui
  5. Wait for the "ready" message that displays the URLs of the QLever and QLever UI instances.

  6. Open the QLever UI, start typing a subject, and explore the available predicates:

    Screenshot 2026-01-04 at 14 32 12

About

Convert millions of DICOM SR documents to RDF Turtle using the embedded coded concepts.

Topics

Resources

License

Stars

Watchers

Forks