Read-only mirror of https://github.com/blw-ofag-ufag/eCH-0309 — Bundesamt für Landwirtschaft. Issues & pull requests at the source.
  • Python 42.6%
  • Turtle 34.5%
  • RMarkdown 11.6%
  • Makefile 4.7%
  • YAML 3.7%
  • Other 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Lea Stauber 3fe52f23d9
Merge pull request #75 from blw-ofag-ufag/32-system-map
Show the TVD system map in the introduction
2026-11-05 16:22:58 +01:00
.github Update ci.yml with latest version (no more R, publish graph) 2026-11-04 15:49:53 +01:00
docs Show the TVD system map in the introduction 2026-11-05 16:05:41 +01:00
src Work on #72 2026-11-04 16:27:29 +01:00
tests Work on #72 2026-11-04 16:27:29 +01:00
.gitattributes Add markdown/yml to .gitattributes 2026-06-13 14:17:49 +02:00
.gitignore Add Annex D on the mapping to the TVD interface 2026-10-27 12:47:49 +01:00
LICENSE.md Update license header format 2026-08-12 11:36:40 +02:00
Makefile Add Annex D on the mapping to the TVD interface 2026-10-27 12:47:49 +01:00
README.md Add Annex D on the mapping to the TVD interface 2026-10-27 12:47:49 +01:00

eCH-0309 – Animal movement data

The Hilfsmittel "eCH-0309 – Tierverkehrsdaten" describes the data of the Swiss animal movement database (TVD) at a semantic level. Births, changes of location, deaths and slaughters of defined livestock species have to be reported, among other reasons for the traceability of animal diseases and for calculating animal populations.

This repository maintains the data model as SHACL and the code lists in schema.org, and generates the Datenmodell and Wertebereiche chapters of the document from them, in German, French and English.

Quick start

make setup    # virtualenv, Python dependencies, ROBOT
make test     # syntax, prefixes, translations, one test per shape and property
make docs     # renders docs/ into build/docs/ as HTML, PDF, Word and Markdown

On its first run make docs additionally downloads SHACL Play, PlantUML and a portable Java 17 into venv/. The rendered document then sits at build/docs/de/index.pdf.

Where things are

Path Contents
src/rdf/shapes/model.shacl.ttl The data model: classes, attributes, relationships, cardinalities, and every label in de/en/fr/it
src/rdf/ontology/model.owl.ttl Declarations only — classes, properties, taxonomy. All constraints live in the shapes
src/rdf/data/codelists.ttl The Wertebereiche as schema.org code lists, maintained by hand
src/rdf/data/glossary.skos.ttl The glossary for Anhang C
src/rdf/mappings/animaltracing.ttl The counterparts in the TVD interface of the values of the four code lists taken from the Hilfsmittel, for Anhang D
src/rdf/prefixes.ttl The binding prefix list; tests/test_prefixes.py enforces it everywhere
docs/de, docs/fr, docs/en One index.qmd each with the hand-written text; the other .md files are generated
src/python/utils/ The generators, see below
tests/ Pytest. fixtures/example_model.ttl is a non-normative example graph, so the shapes are validated against something rather than nothing

How the document is produced

make docs generates the derived chapters and then renders with Quarto:

Generator Produces
generate_shacl_docs.py docs/*/entities.md — the entity tables, from the shapes; docs/*/codelists.md — one table per code list, from the graph
generate_glossary_docs.py docs/*/glossary.md
generate_animaltracing_docs.py docs/*/animaltracing.md — the tables of Anhang D, from the shapes and animaltracing.ttl
SHACL Play → PlantUML → patch_uml_diagram.py docs/assets/img/uml.png — the class diagram

Contributing

See CONTRIBUTING.md for the naming conventions and for the files synchronised from the semantic-web-template.

Contact

Do you have questions? Please do not hesitate to contact us at agridata.ch@blw.admin.ch, open an issue in this repository, or directly submit a Request for Change (RFC) via the official eCH feedback form.