Skip to content
blw-ofag-ufagPublic

About

A repository for dataset metadata as JSON files (+ an extraction pipeline)

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

793 Commits

Folders and files

Repository files navigation

FOAG Metadata

Combine Datasets Python 3.9+ License: CC BY-ND 4.0 GitHub last commit GitHub issues

Welcome to the FOAG Metadata repository. This repository contains the canonical metadata definitions, JSON schema artifacts, the dataset validation/audit automation and a client-side Quality Dashboard used by data stewards to validate and monitor dataset metadata quality.

TL;DR

  • The audit pipeline in src/ reads raw metadata (data/raw), validates it against schemas (data/schemas or data/schema_strict depending on target), runs link-health checks and scoring, and writes a static snapshot consumed by the dashboard.
  • The dashboard in dashboard/ is a static stlite (Streamlit-in-the-browser) viewer that loads a JSON snapshot and renders an interactive QA UI entirely client-side.

Repository tree (high-level)

Trimmed repository layout

.
├── .github/                     # CI/workflows and GitHub actions
├── .gitignore
├── LICENSE
├── README.md                    # <-- this file
├── automation/                  # Automation scripts for building / publishing
├── dashboard/                   # Static Streamlit (stlite) dashboard (viewer)
│   ├── index.html
│   ├── app.py
│   ├── translations.py
│   └── style.css
├── data/
│   ├── raw/                     # Raw metadata exports (source)
│   ├── processed/               # Processed/normalized dataset files (generated)
│   ├── schemas/                 # Catalog & working JSON Schemas (more permissive)
│   │   ├── Readme.md
│   │   ├── catalog.json
│   │   ├── dataService.json
│   │   ├── dataset.json
│   │   ├── datasetSeries.json
│   │   ├── dimensions.json
│   │   ├── keywords.json
│   │   └── roles.json
│   └── schema_strict/           # Strict/portal-enforced JSON Schemas (stricter)
│       ├── strict-dataService.json
│       ├── strict-dataset.json
│       ├── strict-distribution.json
│       ├── strict-i14y-dataService.json
│       ├── strict-i14y-dataset.json
│       ├── strict-i14y-distribution.json
│       ├── strict-ods-dataset.json
│       └── strict-ods-distribution.json
├── requirements.txt
├── src/                         # Builder / audit scripts (validation & snapshot generation)
│   └── audit.py                 # pipeline to validate, check links and create dashboard snapshot
└── tests/

Short overview of the schemas

The schemas contain two related sets of JSON Schema artifacts used at different stages of the pipeline:

  • data/schemas/ — the working/authoring schema set. These schemas capture the expected metadata model for datasets, distributions and services, but are designed to be practical for contributors and transformations. They include dataset.json, dataService.json, datasetSeries.json, catalog.json and lookups such as keywords.json and roles.json.

  • data/schema_strict/ — the stricter schema set used to validate if a dataproduct meets the requirements for publishing to external portals (e.g., opendata.swiss, i14y). These are intended for final validation prior to submitting. They include strict-dataset.json, strict-distribution.json, strict-dataService.json and portal-specific specializations (e.g., strict-i14y-*, strict-ods-*).

Guidance:

  • Use data/schemas/ for local authoring, CI checks and transformations where some fields may be optional.
  • Use data/schema_strict/ for a pre-publication gate to ensure portal-level constraints are satisfied (license present, multilingual titles, access rights declared, distribution metadata complete, etc.).

Metadata Quality Dashboard

This repository includes a Quality Assurance Dashboard built with Streamlit and deployed statically via Stlite (Python in the browser). It allows data stewards to audit datasets against the metadata model, run link health checks and inspect suggestions for improvement.

👉 View the Live Dashboard

Architecture

The dashboard runs entirely in the client's browser (Serverless).

  1. Builder: GitHub Actions runs src/audit.py to validate links and calculate scores.
  2. Snapshot: The results are saved to dashboard/data_summary.json and dashboard/data_details.json.
  3. Viewer: The dashboard/ folder is published to GitHub Pages. index.html loads the Stlite engine, which executes app.py using the JSON snapshot.

1. Prerequisites & Installation locally

Ensure you have Python 3.9+ installed.

  1. Clone the repository:

    git clone https://github.com/blw-ofag-ufag/metadata.git
    cd metadata
  2. Install dependencies: It is highly recommended to use a virtual environment.

    # Create virtual env (optional but recommended)
    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
    
    # Install packages
    pip install -r requirements.txt

2. Generate Data Snapshot (The "Builder")

Before running the dashboard, you must generate the data. This script processes raw JSON, performs async URL health checks, and creates the static JSON snapshot.

# Run the audit pipeline from the project root
# Generates: dashboard/data_summary.json & dashboard/data_details.json 
python -m src.audit

3. Run the Dashboard

streamlit run dashboard/app.py

Schema description: data/schemas vs data/schema_strict

Aspect data/schemas/ (Regular) data/schema_strict/ (Strict)
Purpose Working/authoring schema; practical for contributors Pre-publication gate; portal compliance validation
dct:accessRights Recommended Required
Distribution model Embedded inline in dataset Referenced via $ref to strict-distribution.json
Distribution required fields dcat:accessURL, adms:status, dct:format dcat:accessURL, adms:status, dct:format, dct:title, dct:description, dct:license
Additional properties Allowed Restricted (additionalProperties: false)
Portal requirement annotations Not included Included in descriptions
Use case Local authoring, CI checks, transformations Final validation before publishing to opendata.swiss, i14y

Below are the main schema files and the notable differences between the regular (data/schemas) and strict (data/schema_strict) variants. These points reference the concrete files present in the repository.

Main schema files:

  • data/schemas/dataset.json — canonical dataset schema used for authoring / validation
  • data/schemas/dataService.json — service-level schema
  • data/schemas/datasetSeries.json — series collection schema
  • data/schemas/* (keywords.json, roles.json, catalog.json) — lookups and supporting assets

Strict schema variants:

  • data/schema_strict/strict-dataset.json
  • data/schema_strict/strict-distribution.json
  • data/schema_strict/strict-dataService.json
  • portal specializations: strict-i14y-, strict-ods- (tuned to target portals)

Main differences:

  1. dct:accessRights is required in strict mode but only recommended in regular mode.

  2. Distribution model divergence:

  • Regular schema embeds distribution properties inline in the dataset
  • Strict schema uses a $ref to strict-distribution.json
  1. Distribution requirements:
  • Regular: only requires dcat:accessURL, adms:status, dct:format
  • Strict: requires those plus dct:title, dct:description, dct:license
  1. additionalProperties: false in strict-distribution.json restricts extra properties.

  2. Portal requirement annotations in descriptions (e.g., "Portal Requirement:...") appear only in strict schemas.


Developer pointers

  • data/schemas/ — working schema set (authoring).
  • data/schema_strict/ — strict schema set (pre-publication / portal compliance).
  • src/audit.py — pipeline that validates metadata files, checks link health, and generates the dashboard snapshot.
  • dashboard/app.py and dashboard/index.html — the client-side viewer (stlite) that consumes the snapshot and shows scores / validation results.

About

A repository for dataset metadata as JSON files (+ an extraction pipeline)

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages