Synthetic herd traceability: events, stock and review gaps

Four fictional animal/group records, 13 events and eight stock movements. Practice exact joins, preserve two review gaps and reconcile voided output without mixing units.

License: cc-by-4.0

livestock, synthetic, traceability, csv, data-quality

Overview

Synthetic herd traceability: events, stock and review gaps

Purpose and scope

This original fixture contains four fictional registry rows, 13 event rows and eight inventory movements. Eleven events are marked ok; SYN-E009 intentionally has no measured quantity and SYN-E013 intentionally refers to an unknown animal. Both require review. Two stock events are voided and retain their compensating movements. No real animals, farms, medicine records, prices or personal data are included.

Use in AgriDigi

In the Hub data workbench, open herd-events.csv as the primary table and animal-registry.csv as the secondary table; join animal_id to animal_id. Expect 12 matched rows and one retained unmatched row. Then join inventory-movements.csv to herd-events.csv on event_id: all eight movements match. Keep identifiers as exact strings and the registry/event secondary keys unique. JSON null and empty CSV measurements remain missing, never zero.

Expected output

Download the CSV/JSON tables, expected-checks.json and validate.txt into one folder and run python3 validate.txt. The validator uses only the Python standard library. It checks format equivalence, IDs, quality gaps, head counts and stock reversals. Final fictional heads are 1, 1, 13 and 19; stock is 85 kg of feed, 9 l of milk and 12 pieces of eggs. These are separate item balances, not one summed quantity.

Purpose and scope

The table names are a teaching schema, not a direct farm import contract. The two deliberate invalid rows demonstrate review queues; the application would reject their corresponding invalid mutations. No task, diagnosis, restriction clearance or stock/finance write is created by opening these files. Original stock rows use civil_date; correction receipts preserve their actual transaction instant and leave civil_date empty.

animal-registry.csv / .json

herd-events.csv / .json

inventory-movements.csv / .json

data-dictionary.json · expected-checks.json · validate.txt · license.txt

python3 validate.txt

Related capsules

Pair these workflows with the synthetic herd traceability dataset. Its tables can be joined in the Hub data workbench without importing them into your real herd. Keep farm identifiers and clinical notes private when sharing your own examples.

License and attribution

Original AgriDigi instructions and synthetic fixtures, version 1. CC BY 4.0; credit AgriDigi and retain the source capsule and version when adapting. External reference materials retain their own terms.

WOAH · Identification and traceability

https://creativecommons.org/licenses/by/4.0/

Dataset

Rows: 13

Columns: event_id, animal_id, event_kind, occurred_on, quantity, unit, disposition, inventory_item_id, voided, quality_flag, review_required, is_synthetic

  • animal-registry.csv · text/csv · 320 bytes
  • animal-registry.json · application/json · 812 bytes
  • herd-events.csv · text/csv · 1068 bytes
  • herd-events.json · application/json · 4297 bytes
  • inventory-movements.csv · text/csv · 903 bytes
  • inventory-movements.json · application/json · 2972 bytes
  • expected-checks.json · application/json · 725 bytes
  • validate.txt · text/plain · 3837 bytes
  • license.txt · text/plain · 287 bytes
  • data-dictionary.json · application/json · 14585 bytes
  • readme-en.txt · text/plain · 3213 bytes
  • readme-tr.txt · text/plain · 3404 bytes
  • readme-de.txt · text/plain · 3033 bytes
  • readme-es.txt · text/plain · 3019 bytes
  • readme-fr.txt · text/plain · 3063 bytes
  • readme-it.txt · text/plain · 2864 bytes
  • readme-az.txt · text/plain · 3089 bytes
  • readme-ru.txt · text/plain · 4345 bytes
  • readme-sr.txt · text/plain · 2782 bytes
  • readme-ar.txt · text/plain · 3783 bytes
  • readme.txt · text/plain · 3213 bytes

View publisher @agridigi

Explore AgriDigi Hub