Vocabulary Creation Guide
This guide explains how to create new ISBDM vocabularies using the automated Google Sheets creation workflow.
Overview
The vocabulary creation workflow automates the process of:
- Creating a Google Workbook for your repository and profile type
- Setting up DCTAP profile sheets
- Creating vocabulary sheets with multilingual support
- Maintaining an index of all vocabularies
Prerequisites
- Google Cloud service account with Sheets API access
GSHEETS_SA_KEY
environment variable (base64-encoded service account JSON)- GitHub repository with appropriate permissions
Usage Methods
Method 1: Command Line (Local Development)
Run the interactive script:
yarn vocabulary:create
You'll be prompted for:
- Profile type (values or elements)
- Vocabulary name (lowercase with hyphens)
- Title
- Description
- Languages
Method 2: GitHub Actions Workflow
Trigger manually from GitHub Actions:
- Go to Actions → Create Vocabulary Sheet
- Click "Run workflow"
- Fill in the required fields
- Click "Run workflow"
Method 3: Web Form
Use the HTML form to submit vocabulary creation requests:
- Open
create-vocabulary-form.html
in a browser - Fill out the form
- Submit to trigger the creation process
Method 4: API Endpoint
Send a POST request to your API endpoint:
curl -X POST https://your-site.com/api/create-vocabulary \
-H "Content-Type: application/json" \
-d '{
"profileType": "values",
"vocabularyName": "sensory-specification",
"title": "Sensory Specification Vocabulary",
"description": "Vocabulary for describing sensory characteristics",
"languages": ["en", "fr", "es"]
}'
Vocabulary Structure
Values Profile Columns
valueID
- Unique identifierlabel
- Human-readable label (multilingual)definition
- Description (multilingual)scopeNote
- Usage notes (multilingual)example
- Usage examplessource
- Source referencestatus
- Current status
Elements Profile Columns
elementID
- Unique identifierlabel
- Human-readable label (multilingual)definition
- Description (multilingual)comment
- Additional notes (multilingual)cardinality
- Usage constraintsdatatype
- Expected data typestatus
- Current status
Multilingual Support
For translatable fields (label, definition, scopeNote, comment), the system creates language-specific columns:
label
→label_en
,label_fr
,label_es
definition
→definition_en
,definition_fr
,definition_es
Spreadsheet Organization
ISBDM-values (Workbook)
├── Index (Sheet) - List of all vocabularies
├── DCTAP-values (Sheet) - Profile definition
├── sensory-specification (Sheet) - Vocabulary 1
└── color-vocabulary (Sheet) - Vocabulary 2
Environment Setup
- Create a Google Cloud service account
- Enable Google Sheets API
- Download service account JSON key
- Encode as base64:
base64 -i key.json
- Set environment variable:
export GSHEETS_SA_KEY="<base64-string>"
Troubleshooting
Authentication Errors
- Verify service account has Sheets API access
- Check GSHEETS_SA_KEY is properly set
- Ensure JSON is valid after base64 decoding
Permission Errors
- Service account needs edit access to sheets
- For shared folders, add service account email
Script Errors
- Install dependencies:
yarn add googleapis
- Check Node.js version (≥18 recommended)
Adding to README
To add a "Create New Vocabulary" button to your README:
[](https://github.com/YOUR_ORG/ISBDM/actions/workflows/create-vocabulary-sheet.yml)
Or use a form link:
[📊 Create New Vocabulary](https://your-site.com/create-vocabulary-form.html)