glam/.opencode/rules/capitalization-consistency-naming-rule.md
kempersc 6e63465196 Add ImageTilingServiceEndpoint class and archive ID class
- Introduced the ImageTilingServiceEndpoint class for tiled high-resolution image delivery, including deep-zoom and transformation capabilities, with multilingual descriptions and structured aliases.
- Archived the ID class as a backwards-compatible alias for Identifier, marking it as deprecated to enforce the use of the canonical Identifier model.
2026-02-15 21:40:13 +01:00

1.8 KiB

Rule: Capitalization Consistency for LinkML Names

Purpose

Ensure naming is consistent across LinkML classes, slots, enums, and their files, with special care for acronyms (for example: GLAM, GHC, GHCID, GLEIF).

Mandatory Requirements

  1. Class names

    • Use PascalCase.
    • Preserve canonical acronym casing.
    • Example: GHCIdentifier, not GhcidIdentifier.
  2. Slot names

    • Use project slot naming convention consistently.
    • If acronym appears in a slot, keep its canonical uppercase form.
    • Example: has_GHCID_history (if acronymed slot is required), not has_ghcid_history.
  3. Enum names

    • Use PascalCase with Enum suffix where applicable.
    • Preserve acronym casing in enum identifiers and permissible values.
    • Example: GLAMTypeEnum.
  4. File names must match primary term exactly

    • Class file name must match class name (case-sensitive) plus .yaml.
    • Enum file name must match enum name (case-sensitive) plus .yaml.
    • Slot file name must match slot name (case-sensitive) plus .yaml.
  5. No mixed acronym variants in same schema branch

    • Do not mix forms like Ghcid, GHCID, and ghcid for the same concept.
    • Pick canonical form once and use it everywhere.

Refactoring Rule

When normalizing capitalization:

  • Update term declaration (name, class/slot/enum key).
  • Update file name to match.
  • Update all imports and references transitively.
  • Do not leave aliases as operational identifiers; keep aliases only for lexical metadata.

Validation Checklist

  • Class, slot, enum declarations use canonical casing.
  • File names exactly match declaration names.
  • Acronyms are consistent across declarations and references.
  • Imports and references resolve after renaming.