GitHunt
BL

blw-ofag-ufag/data-catalog

An MVP data catalog for the FOAG and the FSVO

License: CC BY 4.0
Pages
GitHub last commit
GitHub issues

๐Ÿฎ Agri-Food Data Catalog

This data catalog was built in a joint effort by the Federal Office for Agriculture FOAG and the Federal Food Safety and Veterinary Office FSVO.
It aims to showcase the offices datasets in a user-friendly way and in one place while maintaining interoperability with broader metadata platforms.

This data catalog directly supports the principles of DigiAgriFoodCH, Switzerlandโ€™s digital strategy for the agri-food sector โ€” including Once Only, Open by Default, and Innovation First โ€” while ensuring seamless interoperability by aligning its metadata structure with both I14Y and opendata.swiss standards for frictionless data exchange.
Each dataset includes clear ownership and provenance information, empowering data owners and analysts to collaborate more effectively and streamline data governance.
Ultimately, everyone benefits: managers and decision-makers make strategic calls faster with trusted data; technical teams simplify system integrations and metadata maintenance; and external stakeholders can easily access public datasets for research or community-driven projects.

Important

While the code and metadata are publicly available, some dataset links point to internal services and require the right credentials to access.

โšก What are the key features?

  1. Intuitive frontend: A user-friendly interface for browsing, filtering, and sorting datasets, making it simple to discover the information you need.
  2. Schema-based validation: Each dataset is structured according to a robust JSON Schema, providing consistent quality and clarity throughout the catalog. Note that data and schema are held on a separate repository.
  3. Interoperability by design: Metadata follows recognized standards and is compatible with both I14Y and opendata.swiss, ensuring seamless data exchange across platforms.
  4. Open source collaboration: We welcome pull requests and community-driven improvements. Join our open source culture by sharing your ideas, reporting issues, or enhancing features for the benefit of all users.

๐Ÿ”— Useful links

๐Ÿš€ Quick start

(Github Actions are currently work in progress)
This project was generated using Angular CLI version 19.2.10.

Prerequisites to run locally: node.js and globally installed angular CLI

  1. Explore the data catalog online: Head over to our GitHub page to see the development version of the data catalog in action. Not that the main version is deployed on an Azure instance.
  2. Clone & run locally:
    git clone https://github.com/blw-ofag-ufag/data-catalog.git
    cd data-catalog
    npm install
    ng serve

Once the server is running, open your browser and navigate to http://localhost:4200/. The application will automatically reload whenever you modify any of the source files.

Code scaffolding

Angular CLI includes powerful code scaffolding tools. To generate a new component, run:

ng generate component component-name

For a complete list of available schematics (such as components, directives, or pipes), run:

ng generate --help

Building

To build the project run:

ng build

This will compile your project and store the build artifacts in the dist/ directory. By default, the production build optimizes your application for performance and speed.

Github actions / production build

There is a develop workflow which builds the angular application as a SPA, the resulting build is just an index.html with colocated js bundles. For environment backwards compatibility reasons, this build is located under docs.
The base url is fixed to data-catalog and is not configurable. A deployment should check out the code, point a web server document root to /docs and serve index.html under <domain>/data-catalog/.

Configuration (publishers)

The set of publishers is configurable, this can be declared in config/publishers.yaml. npm run prebuild applies the config (generates some code).
All publishers can provide a data repository adhering to the same structure as the BLW repo and JSON schema, for the index we query all and merge them, so an instance of the data catalog can serve multiple sources at once.

Docker

The Dockerfile in the project root builds the angular application and copies the (html, css, js)-files
to the default document root of an nginx web server.
The image doesn't contain any node.js runtime anymore.

๐Ÿš€ Build the Docker Image

docker build -t yourusername/data-catalog:latest .

Run the container

docker run -p yourusername/data-catalog:latest

๐Ÿ’ก Contribute to the data catalog

PAT Settings

To interact with this project's repositories (i.e., add or edit metadata) in the blw-ofag-ufag organization, you need to generate a Fine-grained Personal Access Token (PAT).

1. Navigate to Settings

  • Go to GitHub Settings > Developer settings.
  • Select Personal access tokens > Fine-grained tokens (see image).

2. Configuration

  • Resource owner: Select blw-ofag-ufag.
  • Token name: e.g., Metadata Repo.
  • Expiration: 90 days.

3. Access & Permissions

  • Repository access: Choose Only select repositories and pick your metadata repo.
  • Permissions: Set Contents to Read and write.

4. Save Securely

  • Click Generate token.
  • Copy immediately and store it in KeePass.