This document provides detailed information about the utility scripts used in the RAID-AU project for data generation, model creation, and reference data management.
- generate-general-mapping.sh
- generate-models.sh
- generate-references-config.json
- generate-references.sh
- generate-subject-mapping.sh
Fetches and processes general mapping data from ARDC vocabularies for use in both the RAID agency app and static app.
cd scripts
./generate-general-mapping.sh- Verifies the script is run from the correct directory
- Downloads concept tree data from the ARDC vocabulary API
- Uses
jqto process the JSON data, extracting:- Access types
- Contributor positions
- Description types
- Organisation roles
- Related object categories and types
- Related RAID types
- Title types
- Saves the processed data to both the agency app and static app mapping directories
raid-agency-app/src/mapping/data/general-mapping.jsonraid-agency-app-static/src/mapping/data/general-mapping.json
- cURL
- jq (JSON processor)
Generates TypeScript model files from OpenAPI specifications for use in both the RAID agency app and static app.
cd scripts
./generate-models.sh- Verifies the script is run from the correct directory
- Creates a temporary directory with a unique key
- Copies OpenAPI definitions from the source API path
- Uses Docker to run the OpenAPI generator to create TypeScript interfaces
- Processes the generated TypeScript files to extract only imports and interfaces
- Cleans and creates destination directories
- Copies the processed files to both the RAID agency app and static app directories
- Creates an index.ts file for each destination to export all models
- All TypeScript model files in:
raid-agency-app/src/generated/raid/raid-agency-app-static/src/generated/raid/
- Docker
- OpenAPI generator
- bash utilities (find, sed, awk)
Configuration file for the generate-references.sh script that defines language codes, output directories, and tables/columns to ignore.
language_codes: List of ISO language codes to include in the language referencesfinal_dir: The destination directory for the reference filesignore_tables: Tables and columns to ignore during reference generation
Extracts reference data from the database and saves it as JSON files for use in the RAID agency app.
cd scripts
./generate-references.sh- Verifies the script is run from the correct directory
- Loads environment variables for database connection
- Reads configuration from generate-references-config.json
- Creates a temporary output directory
- Processes database tables based on schema_id and status columns
- Optionally performs post-processing on specific files (e.g., subject_type.json)
- Copies the generated reference files to the final destination
JSON files for each processed table in:
raid-agency-app/src/references/
- PostgreSQL client (psql)
- jq (JSON processor)
- Database connection details (via environment variables)
PG_USER: Database usernamePG_PASS: Database passwordPG_HOST: Database hostPG_PORT: Database port (defaults to 5432)PG_DB: Database name
Fetches and processes subject mapping data from ARDC vocabularies for use in both the RAID agency app and static app.
cd scripts
./generate-subject-mapping.sh- Verifies the script is run from the correct directory
- Downloads concept tree data for subjects from the ARDC vocabulary API
- Uses
jqto process the JSON data, extracting subject type information - Saves the processed data to both the agency app and static app mapping directories
raid-agency-app/src/mapping/data/subject-mapping.jsonraid-agency-app-static/src/mapping/data/subject-mapping.json
- cURL
- jq (JSON processor)