Skip to content
luna-garcia edited this page Jan 29, 2026 · 1 revision

Metadata-MMAPI


Overview of the metadata model

Diagrama del modelo de metadatos MMAPI

The diagram above represents the metadata model used in MMAPI and the main relationships between its entities.

The model covers different aspects of the system, including the instrumental description (sensors, variables, units), the spatial organization (stations and locations), and the operational context (resources, operations, and activities).

The purpose of the diagram is to provide a global overview of the model, not to describe each entity in detail.

From this point onwards, the section focuses exclusively on the elements that are relevant to the data ingestion workflow, in particular operations and activities.

Scope of this section

This section does not aim to describe the complete MMAPI metadata model in detail. It focuses exclusively on the use of MMAPI within the operational data ingestion workflow, specifically:

  • operations
  • activities
  • their relationship with data
  • the steps required before proceeding to data ingestion

MMAPI does not store observational data; it defines the structure, relationships, and context in which those data will later exist in SensorThings.

Operations and activities in MMAPI

In the model used, operations and activities are not equivalent and serve different purposes.

Operations

Operations represent a general framework within which actions related to data acquisition take place, for example:

  • campaigns
  • projects
  • specific working periods

It is not mandatory for an operation to have associated activities.

This allows registering incomplete campaigns, documenting historical operations, and maintaining temporal and organizational consistency even when complete information is not available.

Activities

Activities represent specific actions carried out within an operation, for example:

  • deployment of an instrument
  • recovery of a sensor

An operation may have:

  • no associated activities
  • one or multiple associated activities

Metadata file generation

Before loading metadata into MMAPI, it is necessary to generate the metadata files that describe the structure of the system (stations, sensors, operations, activities, etc.).

These files define, in a declarative way, which entities exist and how they are related to each other, and they constitute the basis for the subsequent loading of metadata and data.

The generation of these files follows the model and conventions defined in the project’s data infrastructure, as described in the following reference repository:

https://github.com/obsea-upc/open-data-infrastructure

Once these files have been generated, the next step is to load the metadata into MMAPI using the provided tools.

Metadata loading and transition to SensorThings

Once operations (and activities, if applicable) have been defined, metadata must be loaded into the system before proceeding with data ingestion.

Before executing any MMAPI-related command, it is mandatory that the system services are running.

In particular, must have been executed beforehand:

odi up

Without the services running, metadata loading and export commands will not work.

Loading all metadata

The following command is used to load or update all metadata defined in MMAPI:

./metadata_manager.py --put 

Exporting metadata to SensorThings

Once metadata have been loaded into MMAPI, they must be exported to SensorThings so that the data structure becomes available for observation ingestion.

This process creates or updates the required entities in SensorThings (Things, Sensors, Datastreams, etc.) based on the metadata defined in MMAPI.

To perform the export, the following command is used:

./metadata_to_sensorthings.py

This step is mandatory and must always be executed after running

./metadata_manager.py --put

and before proceeding with observational data ingestion.