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.
- The audit pipeline in
src/reads raw metadata (data/raw), validates it against schemas (data/schemasordata/schema_strictdepending 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.
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/
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 includedataset.json,dataService.json,datasetSeries.json,catalog.jsonand lookups such askeywords.jsonandroles.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 includestrict-dataset.json,strict-distribution.json,strict-dataService.jsonand 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.).
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.
The dashboard runs entirely in the client's browser (Serverless).
- Builder: GitHub Actions runs
src/audit.pyto validate links and calculate scores. - Snapshot: The results are saved to
dashboard/data_summary.jsonanddashboard/data_details.json. - Viewer: The
dashboard/folder is published to GitHub Pages.index.htmlloads the Stlite engine, which executesapp.pyusing the JSON snapshot.
Ensure you have Python 3.9+ installed.
-
Clone the repository:
git clone https://github.com/blw-ofag-ufag/metadata.git cd metadata -
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
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.auditstreamlit run dashboard/app.py| 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.
- 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
- 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)
-
dct:accessRights is required in strict mode but only recommended in regular mode.
-
Distribution model divergence:
- Regular schema embeds distribution properties inline in the dataset
- Strict schema uses a $ref to strict-distribution.json
- Distribution requirements:
- Regular: only requires dcat:accessURL, adms:status, dct:format
- Strict: requires those plus dct:title, dct:description, dct:license
-
additionalProperties: falsein strict-distribution.json restricts extra properties. -
Portal requirement annotations in descriptions (e.g., "Portal Requirement:...") appear only in strict schemas.
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.pyanddashboard/index.html— the client-side viewer (stlite) that consumes the snapshot and shows scores / validation results.