Skip to content

An ontology import does not reconcile violations after it changes a relation #1297

Closed as not planned

Description

@gedaiu

An ontology import that changes a relation's domain, range or temporal leaves the base's violations as they were.

On the ontology page, update_relation_type (and the class edits beside it) takes detection_keys before the write and calls reasoning::reconcile_ontology after it, so a violation the new criteria no longer support goes away and a new one shows up. The import path does neither: owl_import::apply rewrites domains and ranges through update_relation_from_import and set_domains_ranges, and from #1291 on it can change temporal too, but nothing reconciles afterwards. A base re-imported with a narrower range keeps showing the old picture until something else triggers a reconcile.

This is older than #1291; WaylandYang noted it in the review there. The fix would likely take the detection keys once before apply writes and reconcile once at the end, in the same transaction if the import has one.

Related: #1291

Activity

  1. WaylandYang commented on Oct 18, 2026

    @WaylandYang
    Contributor

    Thank you for following up, and sorry: my note on #1291 was wrong. I looked at owl_import::apply and missed the route. apply_import (ontology_routes.rs:659-714) captures detection_keys before apply and runs reconcile_ontology after it, including a best-effort reconciliation if apply fails partway, and ADR 0062 lists import among the covered mutations. A temporal change from #1291 goes through the same call, so it's reconciled too. The only path without it is install_packs at base creation, which has no facts yet.

    Your reading does point at a real gap one step over. update_relation_from_import changes a relation's label, description, domains and ranges without moving updated_at, and neither do set_domains_ranges or link_property_axioms_bulk. The page's update_relation_type always moves it, and 0053's staleness check (phrase_bindings::stale) depends on that, so a re-import that narrows a range leaves existing phrase bindings looking current. #1291 fixes this only for temporal changes.

    If you agree, I'll retitle this issue to that gap. A PR is welcome: bump updated_at when an imported label, description, domain, range, inverse or super-property actually differs, with a route test that a binding becomes stale after a range-narrowing re-import. If you've actually seen stale violations after an import, please share the steps and I'll look at that separately.

  2. gedaiu commented on Oct 18, 2026

    @gedaiu
    ContributorAuthor

    You're right, thanks for checking. apply_import in ontology_routes.rs takes the detection keys before the import and reconciles once afterwards; I only looked at owl_import::apply and the store functions. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions