Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

OMERO Virtualization

OMERO (Open Microscopy Environment Remote Objects) is a widely used platform for managing bioimaging data. Its PostgreSQL database stores rich metadata about images, experiments, and annotations — making it an ideal candidate for virtualization with Ontop.

This chapter applies the same OBDA mapping approach from the solar system exercise to a real-world OMERO installation.


Overview

The OMERO data model includes tables such as:

The full OMERO data model is documented at: OME Model Overview


Prerequisites


Step 1 — Clone the OMERO mappings repository

The omero-ontop-mappings repository contains starter OBDA mappings for OMERO:

git clone https://github.com/German-BioImaging/omero-ontop-mappings -b swat4hcls2026
cd omero-ontop-mappings

Install Ontop CLI (if not already installed)

The repo includes a convenience script:

bash utils/install_ontop.sh

Verify the installation:

ontop-cli/ontop help

Step 2 — Explore the OMERO database

Useful SQL queries for understanding the database while writing mappings:

List all tables

SELECT table_name
FROM information_schema.tables
WHERE NOT starts_with(table_name, 'pg_');

List columns in a table

SELECT column_name
FROM information_schema.columns
WHERE table_name = 'image';

The image table contains columns such as:

column_name
id
acquisitiondate
description
name
owner_id
group_id
instrument
fileset
...

Step 3 — Launch the Ontop endpoint

The repository contains pre-configured artifacts in the omeswat/ directory:

cd omeswat
./omeswat-ontop-endpoint.sh --dev

The log should end with:

-INFO  in i.u.i.o.e.OntopEndpointApplication - Started OntopEndpointApplication

Navigate to http://localhost:8080 to access the Ontop SPARQL query interface.


Step 4 — Explore the existing mappings

The mappings in omeswat/omeswat.obda provide a minimal starting point. The Ontop query UI includes several tabs with pre-written queries:

Run the test queries to verify the endpoint is working. All ASK queries should return true.


Assignments

The provided mappings are intentionally minimal. Extend them with the following tasks:

Assignment 1: Add entity mappings

Create mappings (similar to the image-id mapping) for:

Each mapping should:

  1. Define a class for the entity (e.g. :Experimenter a owl:Class)

  2. Map the id and name columns (where available)

  3. Add the class and property declarations to the ontology

Assignment 2: Map annotations

Create a mapping that exposes image map annotations. OMERO stores key-value annotations in the annotation_mapvalue table. Your mapping should:

Assignment 3: Write your own mapping

Choose an aspect of the OMERO data model that interests you and create a new mapping from scratch. Consider:


Connection to the solar system exercise

Notice how the same three Ontop artifacts appear in both use cases:

FileSolar systemOMERO
.propertiessolar_system.propertiesomeswat.properties
.obdasolar_system.obdaomeswat.obda
.ttlsolar_system.ttlomeswat.ttl

The pattern is always the same:

SQL database  →  .properties (connection)
              →  .obda (mappings)
              →  .ttl (ontology)
              →  Ontop endpoint  →  SPARQL

Whether you are mapping 8 planets or thousands of microscopy images, the workflow is identical. Only the SQL queries and RDF templates change.