Repository navigation
Fixes #35988: Add abstract, source, and deprecation fields to native ontology classes - #35997
Conversation
First unit of #35983. The enum carries the Any or All reviewer rule that later commits put on the ontology, freeze into the review target, and turn into the review task's approval threshold.
Adds the fields to the concept and property schemas, the create requests, the release payload allowlist, and the RDF catalog vocabulary. Adds the DEPRECATED change type, the REPLACED_BY reference role, and the concept-grouped rows of the working diff. Regenerates the TypeScript types.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:
- A replacement must name another definition of the same kind in the
same ontology. It is indexed as a REPLACED_BY reference, so deleting
a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
enumerations stored before this rule stay editable until their values
change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
changes grouped by the concept they define, with parent labels and a
property count, paged by group under its own revision-bound cursor.
…sion IndependentOntologyClassModelIT covers the field round trips, the enumeration minimum and its legacy carve-out, replacedBy integrity, the DEPRECATED diff row, and grouped diff paging with the 412 cursor rule. NativeOntologyMemoryIT adds a class-create change set and its rollback. Existing ITs that stored one-value enumerations now use two values.
Adds the fields to the concept and property schemas, the create requests, the release payload allowlist, and the RDF catalog vocabulary. Adds the DEPRECATED change type, the REPLACED_BY reference role, and the concept-grouped rows of the working diff. Regenerates the TypeScript types.
Concepts and properties now carry deprecation and replacement, and
concepts carry abstract and a definition source:
- A replacement must name another definition of the same kind in the
same ontology. It is indexed as a REPLACED_BY reference, so deleting
a replacement target is refused like any other dangling reference.
- An enumeration needs at least two allowed values. One-value
enumerations stored before this rule stay editable until their values
change.
- Release projection writes om:abstract, dct:source, owl:deprecated,
and dct:isReplacedBy, and native import reads them back.
- Release and working diffs classify a member whose deprecated flag
turned true as DEPRECATED.
- GET /ontologies/{id}/working/diff?groupBy=concept returns the working
changes grouped by the concept they define, with parent labels and a
property count, paged by group under its own revision-bound cursor.
…sion IndependentOntologyClassModelIT covers the field round trips, the enumeration minimum and its legacy carve-out, replacedBy integrity, the DEPRECATED diff row, and grouped diff paging with the 412 cursor rule. NativeOntologyMemoryIT adds a class-create change set and its rollback. Existing ITs that stored one-value enumerations now use two values.
…d per-operation revisions
…tatus and release change summary
…tatus and release change summary
An ontology carries an approvalRule, AnyReviewer by default or
AllReviewers. prepareReview freezes the rule into the task's review
target and leaves the requester's and the author's own user entries out
of the assignees. The rule reaches the workflow as the start variable
approvalMode=allAssignees, which CreateTask turns into the task's
approvalThreshold, so the shared counters stay unchanged.
Each counted vote is recorded on the task in reviewVotes with its
comment; the deciding vote is recorded in the decision transaction with
any voter whose record was lost. Reviewers and the approval rule are
locked with 409 while a release of the ontology is in review.
GET /v1/ontologyReleases/{id}/review and
GET /v1/ontologies/reviews?view=assigned|created|pending read a review
from the task's recorded votes.
Amends ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions
as v13.
Only an ontology review reconciles the deciding vote, so recording counted votes on any other multi-approval task would always leave its last vote out and add version bumps to glossary approvals. The waiting branch now records a vote only for an ontology review. OntologyReleaseReviewReaderTest reads reviews through the reader with literal tasks and votes. OntologyReleaseRepository.page and offset are static so the cursor math has a test with literal rows.
…RDF ontology The release inherits its reviewers from the ontology, and the entity updater drops inherited references from a reviewer list, so the task's REVIEWS rows vanished on the workflow's first stage update. OntologyReview.eligibleReviewers now returns plain copies. A counted vote whose record loses every optimistic-locking retry answers 200 with a warning, because the vote already counted in Flowable and the decision records it. openmetadata.ttl declares om:approvalRule, which the ontology projection writes. The ITs unwrap the SDK's wrapped 409 and fetch the task with its reviewers.
TaskRepository keeps a task's about out of the stored JSON and clears it unless the read asks for it. The review list read tasks without about, so it matched no release and returned no rows in any view.
A steward who reviews glossary approvals and one release review lists pending reviews, and a requester who created them lists created reviews. Each gets the one release, and no statement the list runs names a glossary approval task.
The review list read every open approval task the caller was on, glossary and data product approvals included, and hydrated each one. The task filter now also requires a task about an ontology release, and the list reads the releases of the listed tasks in one query instead of one query per task.
Surefire runs every service test class in one JVM, and a repository the test registers stays bound to its database after the class ends. The fixed list never reads a glossary term, so the test now names the term's type on its reference instead of registering the repository.
A release can be in review under a new task while the task it was in review under before is still open. The list must show the release once, under the current task. No test covered the check in reviewedRelease that drops the older task, so every test passed without it.
The list loads the releases of all listed tasks in one batched read. The list test now asserts that exactly one statement reads release rows and that it covers both releases, so a read per task fails it. Resolving each task's about reads only the names of its release, so the assertion does not count that lookup.
Adds a gray badge for deprecated changes to main's AI-mode change list, as StatusBadge.constant.ts colours a deprecated status.
Main moved 26 commits before PR1 landed. The merge had no conflicts.
PR1 landed on main as 5f2b733. This branch already holds PR1's final code, so the merge keeps the tree.
Code Review ✅ Approved 3 closed / 3 findings🟡 Medium risk · Adding ontology metadata, deprecation classification, grouped diff paging, and RDF import/export changes could misrepresent persisted definitions or release comparisons. Adds abstraction, definition source, deprecation and replacement fields to native ontology concepts and properties, carried through storage, RDF import/export, release capture and grouped working diffs. No open issues remain; the DEPRECATED change type now emits from comparison, the new fields export to RDF, and a decision record covers the new contracts. ✅ 3 closed✅ Bug: DEPRECATED change type is declared but the comparison never emits it
✅ Bug: New semantic fields are sealed into releases but dropped from RDF export
✅ Quality: New cross-component contracts and limits have no decision record
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
…ontology classes (#35997) * WIP: add OntologyApprovalRule schema for release review rules First unit of #35983. The enum carries the Any or All reviewer rule that later commits put on the ontology, freeze into the review target, and turn into the review task's approval threshold. * WIP: record that ontology definition status is derived from releases * WIP: add abstract, source, and deprecation fields to native classes Adds the fields to the concept and property schemas, the create requests, the release payload allowlist, and the RDF catalog vocabulary. Adds the DEPRECATED change type, the REPLACED_BY reference role, and the concept-grouped rows of the working diff. Regenerates the TypeScript types. * Update generated TypeScript types and dereferenced schemas * Validate, project, and diff the class model fields Concepts and properties now carry deprecation and replacement, and concepts carry abstract and a definition source: - A replacement must name another definition of the same kind in the same ontology. It is indexed as a REPLACED_BY reference, so deleting a replacement target is refused like any other dangling reference. - An enumeration needs at least two allowed values. One-value enumerations stored before this rule stay editable until their values change. - Release projection writes om:abstract, dct:source, owl:deprecated, and dct:isReplacedBy, and native import reads them back. - Release and working diffs classify a member whose deprecated flag turned true as DEPRECATED. - GET /ontologies/{id}/working/diff?groupBy=concept returns the working changes grouped by the concept they define, with parent labels and a property count, paged by group under its own revision-bound cursor. * Cover the class model fields in integration tests and record the decision IndependentOntologyClassModelIT covers the field round trips, the enumeration minimum and its legacy carve-out, replacedBy integrity, the DEPRECATED diff row, and grouped diff paging with the 412 cursor rule. NativeOntologyMemoryIT adds a class-create change set and its rollback. Existing ITs that stored one-value enumerations now use two values. * WIP: add abstract, source, and deprecation fields to native classes Adds the fields to the concept and property schemas, the create requests, the release payload allowlist, and the RDF catalog vocabulary. Adds the DEPRECATED change type, the REPLACED_BY reference role, and the concept-grouped rows of the working diff. Regenerates the TypeScript types. * Validate, project, and diff the class model fields Concepts and properties now carry deprecation and replacement, and concepts carry abstract and a definition source: - A replacement must name another definition of the same kind in the same ontology. It is indexed as a REPLACED_BY reference, so deleting a replacement target is refused like any other dangling reference. - An enumeration needs at least two allowed values. One-value enumerations stored before this rule stay editable until their values change. - Release projection writes om:abstract, dct:source, owl:deprecated, and dct:isReplacedBy, and native import reads them back. - Release and working diffs classify a member whose deprecated flag turned true as DEPRECATED. - GET /ontologies/{id}/working/diff?groupBy=concept returns the working changes grouped by the concept they define, with parent labels and a property count, paged by group under its own revision-bound cursor. * Cover the class model fields in integration tests and record the decision IndependentOntologyClassModelIT covers the field round trips, the enumeration minimum and its legacy carve-out, replacedBy integrity, the DEPRECATED diff row, and grouped diff paging with the 412 cursor rule. NativeOntologyMemoryIT adds a class-create change set and its rollback. Existing ITs that stored one-value enumerations now use two values. * Fix class model integration test assertions for wrapped SDK errors and per-operation revisions * Fixes #35981: Derive concept lifecycle status, ontology publication status and release change summary * WIP: record that ontology definition status is derived from releases * Fixes #35981: Derive concept lifecycle status, ontology publication status and release change summary * WIP: add approvalRule, reviewVotes and the release review read schemas * Decide ontology release reviews by the ontology's approval rule An ontology carries an approvalRule, AnyReviewer by default or AllReviewers. prepareReview freezes the rule into the task's review target and leaves the requester's and the author's own user entries out of the assignees. The rule reaches the workflow as the start variable approvalMode=allAssignees, which CreateTask turns into the task's approvalThreshold, so the shared counters stay unchanged. Each counted vote is recorded on the task in reviewVotes with its comment; the deciding vote is recorded in the decision transaction with any voter whose record was lost. Reviewers and the approval rule are locked with 409 while a release of the ontology is in review. GET /v1/ontologyReleases/{id}/review and GET /v1/ontologies/reviews?view=assigned|created|pending read a review from the task's recorded votes. Amends ADR:2026-10-14-ontology-reviews-bind-workflow-tasks-to-revisions as v13. * Record votes only for ontology reviews and test the review read model Only an ontology review reconciles the deciding vote, so recording counted votes on any other multi-approval task would always leave its last vote out and add version bumps to glossary approvals. The waiting branch now records a vote only for an ontology review. OntologyReleaseReviewReaderTest reads reviews through the reader with literal tasks and votes. OntologyReleaseRepository.page and offset are static so the cursor math has a test with literal rows. * Skip the reference delete for a definition that does not exist yet * Keep the review task's own reviewers and declare approvalRule in the RDF ontology The release inherits its reviewers from the ontology, and the entity updater drops inherited references from a reviewer list, so the task's REVIEWS rows vanished on the workflow's first stage update. OntologyReview.eligibleReviewers now returns plain copies. A counted vote whose record loses every optimistic-locking retry answers 200 with a warning, because the vote already counted in Flowable and the decision records it. openmetadata.ttl declares om:approvalRule, which the ontology projection writes. The ITs unwrap the SDK's wrapped 409 and fetch the task with its reviewers. * Fixes #35981: Cover property and ontology edits in the unpublished-changes count, drop restating comments * Fix review vote durability and authorized pagination * fix: persist workflow votes with terminal task decisions * Fixes #35981: Clarify the derived publication status contract * test: assert ontology review approval rule round trips * test(ontology): cover property validation and grouped diff cursors * test(ontology): reject release headers as captured definitions * Recheck review setup under the lock, list reviews by caller, vote per stage Starting a review now rechecks the frozen approval rule and the chosen reviewers against the ontology under the review lock and refuses with 409 when either changed since the request was prepared, so the lock has no window before the release is In Review. The review list starts from the caller's own open approval tasks, which the database narrows to the caller as reviewer, assignee or requester, instead of scanning every release in review and loading its task. A reviewer's vote is recorded once per workflow stage, so a task that moves through several approval stages keeps every stage's vote. Regenerate the API reference so it lists the two review endpoints. * Test ontology review votes through TaskWorkflowHandler.resolveTask A non-final vote leaves the task open and records one vote with its comment. A repeat voter is recorded once, and a voter keeps one vote in each approval stage. * Keep release and member ID binds within one parameter budget in definition status queries The status resolver and the unpublished-change counter chunked only the member IDs and bound every release ID into each chunk. A large page could pass the database bind-parameter limit and fail the list request. Both lists now share one budget and every release and member pair is still queried once. * Test each ontology review view over stored tasks List the assigned, pending and created views through listReviews on MySQL and PostgreSQL, over approval tasks stored the way TaskRepository stores them: about, the requester and the reviewers live in relationship rows, not in the task JSON. The test database gains user_entity so the task's people resolve. Every view returns no reviews on the current head. * List ontology reviews with the release each task is about TaskRepository keeps a task's about out of the stored JSON and clears it unless the read asks for it. The review list read tasks without about, so it matched no release and returned no rows in any view. * Test that the review list never reads the caller's glossary approvals A steward who reviews glossary approvals and one release review lists pending reviews, and a requester who created them lists created reviews. Each gets the one release, and no statement the list runs names a glossary approval task. * List only the approval tasks that are about an ontology release The review list read every open approval task the caller was on, glossary and data product approvals included, and hydrated each one. The task filter now also requires a task about an ontology release, and the list reads the releases of the listed tasks in one query instead of one query per task. * Name the tasks in the glossary approval list test * Keep the review list test from registering a glossary repository Surefire runs every service test class in one JVM, and a repository the test registers stays bound to its database after the class ends. The fixed list never reads a glossary term, so the test now names the term's type on its reference instead of registering the repository. * Test that the review list drops a superseded review task A release can be in review under a new task while the task it was in review under before is still open. The list must show the release once, under the current task. No test covered the check in reviewedRelease that drops the older task, so every test passed without it. * Test that the review list reads its releases in one statement The list loads the releases of all listed tasks in one batched read. The list test now asserts that exactly one statement reads release rows and that it covers both releases, so a read per task fails it. Resolving each task's about reads only the names of its release, so the assertion does not count that lookup. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>



Fixes #35988
Native ontology definitions record abstraction, definition source, deprecation and replacements. RDF import and export preserve those fields, and grouped working diffs remain revision-bound. With definition status in the parent, captured release summaries now include the deprecated count.
The published stack targets release 2.1.0. Each linked Shipping issue is In Progress with Product, P1 and Governance metadata.
main→ PR1 #35990 → PR2 #35994 → PR3 #35997 → PR4 #35995. Two chains start at PR4:This PR targets PR2 #35994. Its child is PR4 #35995. PR9, PR11, PR13, PR14 and PR16 are not published yet.
Current assessment for
fca4419074b, recorded 2026-10-29.Verdict. PASS. A scoped independent review of the merge's own code passed this head. This head merges PR2
d63d5123479, which carriesmainca9b8c04a93.main#36433 added a change-badge colour map with no entry for PR3'sDeprecatedchange type, so the merge maps it to gray, asmain's status badges do. PR3's 58 earlier files keep their changed lines, and the review read the 2 adapted files. The last full review is the 2026-10-25 source integration review at33601808a79, which passed. No minor issue is declared.Test evidence at this head. The Java gates ran on the first staged merge tree
2d02b81e6b1. The adaptation changes no Java file. Package andspotlesspassed, and 285 unit tests in 14 classes passed.OntologyReleaseReviewListTestpassed 6 of 6 on local MySQL and PostgreSQL.OntologyEntityDAOTestandOntologyReleaseComparisonStorageTeststop on the missing Docker socket. The UI gates ran on the adapted staged tree, which is the commit's tree2aaddd9b294. TypeScript reports 0 errors, Jest passes 33 of 33 inOntologyReleasePanel.test.tsx, and ESLint, Prettier and the i18n check are clean.CI. Every check at this head passes except
maven-collate-ci. That job fails with HTTP 422 (No ref found for: harshach/ontology-studio/02-definition-status). The Collate build is pointed at this PR's base branch, and the Collate repository has no branch of that name. That is a limit of the CI setup for stacked PRs, not a fault in this PR's code. PR1, whose base ismain, passes it.Still owed. Docker is down on the build machine, so none of these has run. Run each IT on
-Pmysql-elasticsearchand then-Ppostgres-opensearch, and confirm aTests run:line.TaskResourceITand the task ITs listed on PR1, which this head carries.IndependentOntologyApprovalIT,IndependentOntologyPublicationITandIndependentOntologyReleaseIT, andWorkflowDefinitionResourceITin the global-state lane.mainbrings 184 Java files, the 2.1.0 migrations and schema changes, so the planner selects the full suite.OntologyEntityDAOTestandOntologyReleaseComparisonStorageTest.AI mode.
main's Ontology Studio AI-mode restyle #36433 now gates new screens on AI mode. PR3 adds no UI control. Its UI changes are generated types and the merge's gray badge for a deprecated change. The AI-mode case "shows a deprecated working change with its badge in AI mode" renders that change in AI mode. AI mode lacks none of PR3's controls.Not verified yet. This PR is verified only when its unit, live and performance boxes in the plan are all checked. The operator lands the stack.
Earlier description and verification records
These records preserve the earlier design notes, test results and attachments. Earlier statements about the current head or readiness apply to their recorded revisions. The integration assessment above supersedes those statements.
Describe your changes:
Fixes #35988
Native ontology classes could not say that they are abstract, where their definition comes from, or that they are deprecated and which definition replaces them. This PR adds
abstract,definitionSource,deprecatedandreplacedByto concepts, anddeprecatedandreplacedByto properties. It projects them asom:abstract,dcterms:source,owl:deprecatedanddcterms:isReplacedByand reads them back on import. Release and working diffs classify a member whosedeprecatedturned true asDEPRECATED.GET /api/v1/ontologies/{id}/working/diff?groupBy=conceptserves rows grouped by concept (change type, parent labels, property count, member changes), paged by concept under the same revision binding (a stale cursor returns 412). A property with a single enumeration value is refused withAn enumeration needs at least two allowed values. Adds a decision record for the new fields.Also in this PR: a MySQL deadlock fix.
OntologyReferenceIndex.replaceno longer deletes the reference rows of a definition that does not exist yet. Deleting a missing key range takes a gap lock, and two concurrent creates then deadlocked on their inserts and returned 500 after the retries ran out.Left out: the
changeSummarydeprecated count (PR2 is not in the base) and any UI.Deviations from the plan:
OntologyWorkingStatebehaves on main, so the IT asserts it.What could break: the enumeration rule applies only when a one-value list differs from the stored value, so stored definitions stay editable.
replacedByis validated as a same-kind, same-ontology reference, so deleting a replacement is refused.Type of change:
Tests:
mvn test -pl openmetadata-service -Dtest='Ontology*Test,NativeOntology*Test,RdfOntologyContractTest,OwlProfileGuardTest': 595 run, 0 failures. Line coverage from unit tests alone: projection 98%, importer 98%, validator 95%,OntologyConceptChanges100%, comparison 69%, property repository 71%; the resource and mappers are covered by the ITs.IndependentOntologyClassModelITandNativeOntologyMemoryIT(new cases: class change set with two parents, an equivalent class, a disjoint class and three properties; rollback when the last operation fails), plus the affected ontology ITs, on-Pmysql-elasticsearchand-Ppostgres-opensearch: 739 run, 0 failures, 96 skipped on each.NativeOntologyMemoryITfailed on MySQL in 3 of 3 solo runs; after it, 3 of 3 pass.Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.

Confidence Score: 5/5
The reviewed changes appear safe to merge.Summary
Adds abstraction, source, deprecation, and replacement fields to native ontology definitions.
No actionable issue was established. No previous review threads were supplied. The full PR diff was reviewed because the previous and current commits have different merge bases with the target. Tests were not run during this review.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Definition writes or RDF import] --> B[Working definitions] B --> C[Reference and structure checks] B --> D[Release capture] D --> E[RDF export] B --> F[Compare with active release] F --> G[Flat member changes] F --> H[Concept groups] G --> I[Revision-bound paging] H --> IReviews (8) · Last reviewed commit: "Merge definition status into class model" · Reviewed by Greptile
Summary by Gitar
OntologyReleaseChangeSummarynow includes adeprecatedcount, separate from added, changed and removedOntologyReleasePanelshowsDEPRECATEDchanges with a gray badgeThis will update automatically on new commits.