Skip to content

6.1 Introduction

Data explains what information the systems of the Moonitoring Platform keep and how it stays trustworthy. This section describes the data model: the farm, animal and sensor data we hold, where each value comes from, how sources that disagree are reconciled, and how the data as it was at any past moment can be reproduced.

Source of truth

The data model is designed in GDrive\[11] Engineering\[0] Projects\[0] moonitoring-farm\[0] Design\1.requisiti-raffinati.txt. The entity pages are generated from that file with uv run docs-data, so change the model there first. See the repository README for details.

The model is also drawn in the draw.io diagram, which opens only for Google accounts with access to the file.

6.1.1 Domains

Each domain has an introduction with its model notes, a diagram and its list of entities.

  • 6.2 Organizations & Access

    Users, Organizations (farms, cooperatives, insurers and professionals), roles, memberships and delegations, and the separate access structure for Moonitoring staff.

  • 6.3 Animals & Identity

    The animal registry: animals, species and breeds, groups, identifiers and ownership.

  • 6.4 Provenance & Ingestion

    Who produced each value and how it reached us: origins, channels, devices, feeds, raw files and parsing.

  • 6.5 Observations

    Measured and computed values, their types, methods and contexts, sessions, samples and derivations.

  • 6.6 Events & Periods

    Calvings, services, treatments, exits and other events, and the periods derived from them.

  • 6.7 Reconciliation

    Resolved facts built from evidence, animal links, data issues and the versioned rules behind them.

  • 6.8 Synchronisation & Submissions

    Sync runs, schedules and digests of the farm client, and submissions to official bodies.

  • 6.9 Versioning & Reproducibility

    The write number, model runs that can be rebuilt exactly, and erasure requests.

  • 6.10 Client Distribution

    Builds, depots and chunks, channels and releases, signing keys and installations of our clients.

  • 6.11 Agent Platform

    Agents, their model profiles and tools, and their conversations with users and staff.

  • 6.12 Content

    The articles of MooNitoring News, a translation per language, and their images.

  • 6.13 Shared Types

    Value types and enumerations reused across the model: times, periods, codes, values and revisions.

6.1.2 Reading the Entity Pages

An entity is one kind of record a system keeps, such as an animal or a calving. Every entity page has the same layout: what the entity is for and the questions it answers, then its fields, its subtypes, its relationships with other entities, and its rules.

  • Cardinality (min..max) says how many values a field holds: 1..1 exactly one (required), 0..1 at most one (optional), 0..* any number, 1..* at least one.
  • Key marks the field that identifies each record; Unique marks a field, or a combination of fields listed in the rules, whose value cannot appear twice.
  • Subtypes are kinds of an entity, such as a farm, a cooperative, an insurer or a professional for an Organization. They are sections of their entity's page, not separate pages. The discriminator, the field that tells the kinds apart, says whether every record must be one of them (complete) or may be none.
  • References link to other entities, down to the exact field or subtype. Referenced by lists every field in the model that points to this entity.
  • Marks appear at the top of a page or subtype.
    • Future work: part of the model, but built only when a real case needs it.
    • Immutable, Append-only and Optional describe how records change.
  • Open questions collect what the design has not decided yet.