Updated all the files to give more control to the user#12
Updated all the files to give more control to the user#12ThHanke merged 1 commit intomaterialdigital:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR establishes a comprehensive ODK (Ontology Development Kit) infrastructure for PMD Core application ontology development. It introduces configuration files and automated GitHub workflows to give users fine-grained control over ontology setup, including ID range allocation, component management, and external ontology imports.
Key changes:
- Added ODK configuration system with customizable ID ranges, components, and import management
- Implemented automated workflow chain: setup → refresh-imports → QC/build → documentation
- Provided example configuration files (imports, components, creators, terms) for ontology initialization
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| project-odk.yaml | Main ODK configuration defining ontology structure, URIs, imports, components, and release settings |
| pmdco_terms.txt | List of PMD Core ontology term IRIs to import via SLME extraction |
| imports.txt | Configuration for external ontology imports (LOGO, TTO, HTO) with URLs |
| creators.txt | List of creators for ID range allocation (appears to contain placeholder names) |
| components.txt | Component module names for modular ontology organization |
| component_seeds.txt | Seed data for initializing component templates with class hierarchies |
| .github/workflows/update-repo.yml | Workflow for synchronizing repository structure with ODK configuration changes |
| .github/workflows/setup-repo.yml | Comprehensive initial setup workflow handling metadata, imports, components, and ID ranges |
| .github/workflows/refresh-imports.yml | Workflow for updating external ontology import modules using SLME |
| .github/workflows/qc.yml | Build and quality control workflow generating release artifacts |
| .github/workflows/docs.yml | Documentation generation workflow using Widoco for GitHub Pages deployment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| namespaces: [] |
There was a problem hiding this comment.
Duplicate namespaces key at the end of the file. The namespaces configuration is already defined at line 76-77. This duplicate empty array at line 174 will override the earlier configuration, potentially breaking namespace resolution for entity IDs.
| namespaces: [] |
| # Result: https://w3id.org/pmd/co/tryce/TRYCE_0000001 | ||
| # | ||
| # This section will be populated by the setup workflow | ||
|
|
There was a problem hiding this comment.
[nitpick] The idranges configuration at line 172 is set to an empty array, but the comment above (lines 157-170) suggests this section should be populated during setup. However, the empty array is appropriate as a default placeholder since setup-repo.yml workflow (lines 166-195) populates this dynamically. Consider adding a comment clarifying that this is intentionally empty and populated by the setup workflow.
| # NOTE: This is intentionally left empty as a placeholder. | |
| # The setup workflow (.github/workflows/setup-repo.yml) will populate this section automatically. |
| git commit -m "chore: Setup ${LOWER_ID^^} ontology (end-to-end complete) | ||
| Auto-generated via Setup New Ontology workflow: | ||
| - Configured project-odk.yaml (URIs: https://w3id.org/pmd/${LOWER_ID}/) | ||
| - Initialized components, imports (SLME), ID ranges | ||
| - Generated ${LOWER_ID}-edit.owl and ${LOWER_ID}-idranges.owl | ||
| - Customized README.md with development guides" || echo "No changes to commit" |
There was a problem hiding this comment.
[nitpick] The commit message formatting on lines 648-653 uses a multi-line string that includes an uppercase conversion ${LOWER_ID^^}. However, the commit message structure could be cleaner. The indentation and line continuation may not format as expected in git log. Consider using a simpler format or testing the output to ensure it displays correctly.
| git commit -m "chore: Setup ${LOWER_ID^^} ontology (end-to-end complete) | |
| Auto-generated via Setup New Ontology workflow: | |
| - Configured project-odk.yaml (URIs: https://w3id.org/pmd/${LOWER_ID}/) | |
| - Initialized components, imports (SLME), ID ranges | |
| - Generated ${LOWER_ID}-edit.owl and ${LOWER_ID}-idranges.owl | |
| - Customized README.md with development guides" || echo "No changes to commit" | |
| git commit \ | |
| -m "chore: Setup ${LOWER_ID^^} ontology (end-to-end complete)" \ | |
| -m "Auto-generated via Setup New Ontology workflow:" \ | |
| -m "- Configured project-odk.yaml (URIs: https://w3id.org/pmd/${LOWER_ID}/)" \ | |
| -m "- Initialized components, imports (SLME), ID ranges" \ | |
| -m "- Generated ${LOWER_ID}-edit.owl and ${LOWER_ID}-idranges.owl" \ | |
| -m "- Customized README.md with development guides" || echo "No changes to commit" |
| # push: | ||
| # branches: ["main"] # Production deployments from main only | ||
| # paths: | ||
| # - 'src/ontology/**' | ||
|
|
||
| # ============================================================================ | ||
| # TRIGGER 3: Pull Request Events (for preview/validation) | ||
| # ============================================================================ | ||
| # Triggers documentation build during PR review | ||
| # Note: Deploy step is skipped for PRs (see deploy job condition) | ||
| # | ||
| # Purpose: | ||
| # - Validates that documentation can be generated successfully | ||
| # - Allows preview of documentation changes before merge | ||
| # - Catches Widoco errors early in development cycle | ||
| # # ============================================================================ | ||
| # pull_request: | ||
| # branches: ["*"] | ||
| # paths: | ||
| # - 'src/ontology/**' |
There was a problem hiding this comment.
Similar to qc.yml, the push and pull_request triggers are completely commented out (lines 75-94), making this workflow only trigger via repository_dispatch or manual dispatch. The extensive documentation describes automatic triggering on ontology file changes, which won't happen with these triggers disabled. Update the documentation to match the actual configuration or enable the triggers as documented.
| # if: | | ||
| # github.event_name != 'push' || | ||
| # github.event.head_commit.author.name != 'github-actions[bot]' |
There was a problem hiding this comment.
The bot-commit skip check is commented out (lines 187-189) despite being marked as "CRITICAL" in the comments (lines 184-186). This is the same issue as in qc.yml. Without this check active, if push triggers were enabled, bot commits would cause duplicate workflow runs, defeating the purpose of the repository_dispatch chain.
| # if: | | |
| # github.event_name != 'push' || | |
| # github.event.head_commit.author.name != 'github-actions[bot]' | |
| if: | | |
| github.event_name != 'push' || | |
| github.event.head_commit.author.name != 'github-actions[bot]' |
| # Function: Process terms for one import (custom → standard → placeholder) | ||
| process_terms_file() { | ||
| local onto_id=$1 # e.g., "pmd" (lowercase) | ||
| local custom_source="${onto_id^^}-terms.txt" # e.g., PMD-terms.txt |
There was a problem hiding this comment.
The comment on line 456 states "custom source" refers to "${onto_id^^}-terms.txt" (e.g., PMD-terms.txt), but the bash parameter expansion ^^ converts to uppercase, which would make it look for files like "PMDCO-terms.txt" when onto_id is "pmdco". This may not match the intended file naming convention shown in the example. Consider using the actual filename pattern or clarifying the expected case.
| local custom_source="${onto_id^^}-terms.txt" # e.g., PMD-terms.txt | |
| local prefix="${onto_id:0:3}" # e.g., "pmd" from "pmdco" | |
| local custom_source="${prefix^^}-terms.txt" # e.g., PMD-terms.txt |
|
|
||
| # Grep for this component's specific rows | ||
| grep "^$comp" component_seeds.txt | while IFS='|' read -r _ id label parent || [ -n "$id" ]; do | ||
| echo -e "$(echo $id|xargs)\t$(echo $label|xargs)\t$(echo $parent|xargs)" >> "$TSV_FILE" |
There was a problem hiding this comment.
Missing space after echo command operator. Line 557 has inconsistent formatting: echo -e "$(echo $id|xargs)... includes unquoted command substitution with pipe. The variables $id, $label, and $parent should be quoted to prevent word splitting and glob expansion. This could cause issues if these values contain spaces or special characters.
| echo -e "$(echo $id|xargs)\t$(echo $label|xargs)\t$(echo $parent|xargs)" >> "$TSV_FILE" | |
| echo -e "$(echo "$id" | xargs)\t$(echo "$label" | xargs)\t$(echo "$parent" | xargs)" >> "$TSV_FILE" |
| # - 'src/ontology/imports/**' | ||
| # - 'src/ontology/*-edit.owl' | ||
| - 'src/ontology/**' |
There was a problem hiding this comment.
[nitpick] Commented-out path filters on lines 68-70 with a broader src/ontology/** pattern active. The comment suggests the intention was to monitor specific paths (imports/** and *-edit.owl), but the actual configuration monitors all files under src/ontology/. This could trigger the workflow unnecessarily for changes to unrelated files like documentation or component files. Consider uncommenting and using the more specific path filters or updating the comments to reflect the current intentional behavior.
| # - 'src/ontology/imports/**' | ||
| # - 'src/ontology/*-edit.owl' |
There was a problem hiding this comment.
[nitpick] Duplicate commented-out path filters. Lines 83-85 repeat the same pattern as lines 68-70. This redundancy in the pull_request trigger suggests copy-paste without cleanup. Either use consistent path filtering across both triggers or document why the broader pattern is preferred.
| # - 'src/ontology/imports/**' | |
| # - 'src/ontology/*-edit.owl' |
| # push: | ||
| # branches: ["*"] # Triggers on any branch | ||
| # paths: | ||
| # - 'src/ontology/**' | ||
|
|
||
| # ============================================================================ | ||
| # TRIGGER 3: Pull Request Events (for PR validation) | ||
| # ============================================================================ | ||
| # Same as push trigger, but for pull requests | ||
| # Runs QC checks on PR branches to validate changes before merge | ||
| # Note: Commits are skipped for PRs (see commit step conditions) | ||
| # ============================================================================ | ||
| # pull_request: | ||
| # branches: ["*"] | ||
| # paths: | ||
| # - 'src/ontology/**' |
There was a problem hiding this comment.
The entire push and pull_request triggers are commented out (lines 68-83), meaning this workflow will only run via repository_dispatch or manual trigger. This contradicts the extensive documentation describing automatic triggering on file changes. If this is intentional, the comments should be updated to reflect that these triggers are disabled by design. If not, these triggers should be enabled to match the documented behavior.
Added more functionalities like idrange, components, etc, to give more control to the users in developing the application ontologies