Skip to content

Updated all the files to give more control to the user#12

Merged
ThHanke merged 1 commit intomaterialdigital:mainfrom
POTUSAITEJA:main
Jan 7, 2026
Merged

Updated all the files to give more control to the user#12
ThHanke merged 1 commit intomaterialdigital:mainfrom
POTUSAITEJA:main

Conversation

@POTUSAITEJA
Copy link
Collaborator

Added more functionalities like idrange, components, etc, to give more control to the users in developing the application ontologies

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +173 to +174

namespaces: []
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
namespaces: []

Copilot uses AI. Check for mistakes.
# Result: https://w3id.org/pmd/co/tryce/TRYCE_0000001
#
# This section will be populated by the setup workflow

Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
# NOTE: This is intentionally left empty as a placeholder.
# The setup workflow (.github/workflows/setup-repo.yml) will populate this section automatically.

Copilot uses AI. Check for mistakes.
Comment on lines +648 to +653
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"
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
Comment on lines +75 to +94
# 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/**'
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +187 to +189
# if: |
# github.event_name != 'push' ||
# github.event.head_commit.author.name != 'github-actions[bot]'
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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]'

Copilot uses AI. Check for mistakes.
# 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
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.

# 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"
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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"

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +70
# - 'src/ontology/imports/**'
# - 'src/ontology/*-edit.owl'
- 'src/ontology/**'
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.
Comment on lines +83 to +84
# - 'src/ontology/imports/**'
# - 'src/ontology/*-edit.owl'
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Suggested change
# - 'src/ontology/imports/**'
# - 'src/ontology/*-edit.owl'

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +83
# 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/**'
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@materialdigital materialdigital deleted a comment from Copilot AI Dec 4, 2025
@ThHanke ThHanke merged commit 05f4ed1 into materialdigital:main Jan 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants