Repository navigation
Importing an ontology queues alignment behind the index refresh, as the editor does - #1286
Merged
WaylandYang merged 2 commits intoOct 16, 2026
Merged
Conversation
…he editor does Signed-off-by: dada-yan <BinjunYann@gmail.com>
WaylandYang
approved these changes
Oct 16, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thank you. Calling reindex_then_align after the reconcile commit gives import the same order the editor and adoption already have: the index refresh that apply queued is reused, and align_types waits for it and queues align_phrases when it settles. Leaving it out of owl_import::apply keeps pack installs into new bases from queuing alignment with nothing to align. The test goes through the real import route and fails on dev. Merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Importing an ontology now queues alignment behind the index refresh, so kind words and phrases decided earlier can bind to what it adds.
Problem
apply_importrunsowl_import::apply, which queues onlyembed_ontology. The editor's create and update handlers (#956) and adoption (#1257) queue the refresh, then the alignment, asdocs/design/ontology.mdasks of every path adding elements. The new-base form says more can be imported later.On dev, a document gives Acme the kind word
company, decidednonewith no classes yet. After importingex:Company a owl:Classand runningembed_ontology,companystaysnoneand Acme has no class until another document or a class edit queues alignment. Phrase signatures with no fitting property staynonetoo.Change
apply_importcallsreindex_then_align(&state, kb_id, "align_types"), which finds the refresh already queued and addsalign_types; that job waits for the refresh and queuesalign_phraseswhen it settles. Not inowl_import::apply, which also installs packs into new bases that have nothing to align.Verification
api::token_setup_tests::importing_an_ontology_queues_alignment_behind_the_index_refreshimports a one-class Turtle file through the router and expects["embed_ontology", "align_types"]queued. On dev 040a533 with only the test file added, it fails with["embed_ontology"]. Cleanup now deletes the base's jobs.companybound to the imported class, and stayednonewithout the change. It is left out: past the queue it tests the unchanged aligner.Linux x86_64 container, Rust 1.98.1, PostgreSQL 16 + pgvector, Poppler, DB required, commit 96d37a5 on dev 040a533: fmt and clippy clean;
cargo test --locked --workspace1,576 passed, 0 failed, 6 ignored.Limits
applymay have committed some classes; a successful re-import queues it.update_type_from_importalways bumpsupdated_at, as an editor save does; before, the next document did.align_typesqueues it only once a class exists.