Skip to content

Consolidate consistency checks into the lint rule system #99

Description

@JohnRDOrazio

Summary

The consistency check (consistency_service.py) and the lint system (linter.py) have significant overlap. The lint system is more mature (progressive levels, per-project config, persistence in PostgreSQL, entity-type-aware results), while the consistency check is a lightweight all-or-nothing runner with ephemeral Redis caching.

Prerequisite: This work should not begin until PR #94 (per-project lint config) is merged, as it builds on the lint infrastructure introduced there.

Related discussion: #87 — Consolidate duplicate detection across lint, consistency, and duplicates tab

Current State

Overlap (3 fully redundant checks)

Consistency Rule Equivalent Lint Rule Action
cycle-detect circular-hierarchy Remove from consistency
missing-label missing-label Remove from consistency
missing-comment missing-comment Remove from consistency

Partial overlap (3 checks with different behavior)

Consistency Rule Related Lint Rule Difference
orphan-class orphan-class Consistency also checks for zero instances (stricter)
duplicate-label duplicate-label Consistency is exact-match + same-type only; lint is case-insensitive + all types
dangling-ref undefined-parent Consistency checks subClassOf + domain + range; lint only checks subClassOf

Unique to consistency (6 rules to migrate)

Rule Description Suggested Lint Level
unused-property Property declared but never used as predicate Level 4 (Quality)
orphan-individual Individual's rdf:type not declared as owl:Class Level 2 (Consistency)
empty-domain ObjectProperty/DatatypeProperty has no rdfs:domain Level 4 (Quality)
empty-range ObjectProperty/DatatypeProperty has no rdfs:range Level 4 (Quality)
deprecated-parent Class subclasses an owl:deprecated class Level 2 (Consistency)
multi-root More than 5 root classes (design smell) Level 4 (Quality)

Proposed Plan

Phase 1: Migrate unique rules to lint

  • Add the 6 unique consistency rules as new lint rules
  • Assign appropriate levels and scopes
  • Include subject_type classification

Phase 2: Enhance partial-overlap rules

Phase 3: Deprecate consistency service

  • Remove the 3 fully redundant checks from consistency
  • Once all rules are migrated, deprecate consistency_service.py
  • Update the frontend Consistency tab to use lint results filtered by rule category
  • Eventually remove the separate consistency endpoint

Benefits

  • Single system for all ontology quality checks
  • Per-project configuration applies to all checks
  • Progressive levels include consistency checks
  • Persistent results (PostgreSQL vs ephemeral Redis)
  • Entity-type-aware navigation for all issues
  • Simpler codebase to maintain

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions