Repository navigation
Conversation
Adds isDisplayName to ontologyProperty and createOntologyProperty, absent when unset so existing release digests do not change. Only a data property may set it, and a class has at most one such property, refused by the structure check with DUPLICATE_DISPLAY_NAME. Turtle export writes om:displayNameIntent and the importer reads it back.
Each table asset gains rowCount, profiledAt and sampled, read in one batched query from the latest stored profile and returned only to callers holding ViewDataProfile on the table.
A reader who owns one of two profiled tables gets the facts of that table only, on both the page and the graph endpoints. A row sample is compared with the raw row count, equal profile timestamps resolve deterministically, and the pager reads profile facts only for clusters it keeps.
…ings in one query A CSV import leaves the stored display-name flag as it is, because the format has no column for it. An explicit false is stored as absent so it seals like an unset flag. The sibling check reads only the flagged properties whose domain includes the class, in one query, instead of every reference to the class. The sealed-content test asserts a literal digest. Integration tests cover setting the flag by PATCH, a second flag by PUT and by import apply, and restoring a flagged property.
…name flag, and the sibling read is a join A CSV row keeps the stored display-name flag only while the property stays a data property. The sibling lookup joins the property and reference tables so that FOR UPDATE reads and locks both as current reads on MySQL. The put test sends a real PUT and the false-flag test is named for what it proves.
… as SHACL Adds the ontologyShape entity with typed constraints, release capture and validation, SHACL Turtle export and import, and the storage migration.
…rce to seeded ontology policies
…y a forged domain change in the display-name test On MySQL the locking sibling read switched to a scan of every ontology's property references for a heavily referenced class and locked all of them, blocking writers to other ontologies. FORCE INDEX keeps the read, and its locks, inside the ontology. The Postgres statement is unchanged. The CSV domain test now applies a forged update that adds the domain class and asserts the refusal.
… readable reports, status and policy upgrade
FORCE INDEX alone left the join order free. Once the target index was cached, MySQL started from the property table and locked every property row of every ontology. STRAIGHT_JOIN with the reference table first keeps the locking range inside one ontology's index entries. The Postgres statement is unchanged.
A table binding says which table holds data about a class. It did not say how one row becomes one record of the class. The schemas now let a table binding carry a role, a subject key and a row filter, let a column bound to an OBJECT property carry a join, and let an ontology name one database as its mapping source. The mapping health schema describes the read that lists what an editor still has to fix. The native 2.2.0 migration adds three nullable columns to ontology_concept_binding and backfills nothing, so rows written before it read back with no role, no key and no filter. The statements open the 2.2.0 folder, because 2.1.0 has shipped. Each one adds the columns only where they are missing, so the runner can apply it again. The RDF vocabulary declares the mappingSource predicate. The catalog projection maps every entity field to a predicate, and its contract test requires a declaration for each one. Ontology entities stay out of the catalog graph, so no triple is written for it. The decision record gives the rules and amends ADR:2026-10-19-native-concept-bindings-remain-operational-metadata.
The binding DAO reads and writes the three new columns, and the store gains the reads the checks need: the identity rows of a class, the table rows of an ontology and the ontology's mapping source. A DAO test runs the migration over a table that already holds rows, then runs it a second time, and reads every row back as it was. The test database of the ontology DAO tests now runs the 2.2.0 statements as well. One step saves a binding row, under the ontology lock. It now checks that a role comes with key columns of the bound table, that a class has at most one identity table, that a row filter names a column of the table, and that a column bound to an OBJECT property joins to a table the writer may view in the same database. Once the ontology names a mapping source, the table must sit in that database. A write that sets or changes a row filter needs ViewSampleData on the table. A write that repeats the stored row stays a no-op, so a binding written before these rules stays valid until someone changes it. OntologyBindingAccess takes over the entity loading and authorization that the binding service did inline, so the checks and the service share it. Two integration tests change with the code they call. One writes a row through the new DAO signature. The other gives its relation columns the join they now need.
mappingSource is a reference to one database entity, stored as a MAPPED_TO relationship row and returned for fields=mappingSource, which a reader with ViewBasic on the ontology may ask for. A create request can name it, a PATCH sets, changes or removes it, and a PUT that names none keeps the stored one. A deleted database is refused only where the mapping source is set or changed. A change records no new version of the ontology. A release digest hashes the version of every member, so a versioned change would alter the digest of the next capture although the mapping source is not release content.
GET /v1/ontologies/{id}/mappingHealth pages the table bindings of an
ontology's classes and lists what an editor has to fix: a class with no
identity table, a binding with no role, a relation column with no join,
a join that is not confirmed, a key or a join whose columns do not
pair, and tables outside the mapping source or spread over several
databases.
The read uses catalog metadata only and never queries a bound table. It
names only the classes, tables and properties the caller may view. The
generated API reference lists the endpoint.
Integration tests for the binding API, the ontology mapping source and the mapping health read, with the authorization of each. A row filter write needs ViewSampleData on the table. A mapping source change needs EditAll on the ontology. Mapping health names nothing the caller may not view. Where a right decides a write, a user who holds it and is not an admin makes that write. One test proves that a mapping source change leaves the release digest as it is.
# Conflicts: # openmetadata-spec/src/main/resources/json/schema/type/ontologyProfileViolation.json
# Conflicts: # bootstrap/sql/migrations/native/2.2.0/mysql/schemaChanges.sql # bootstrap/sql/migrations/native/2.2.0/postgres/schemaChanges.sql # openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/OntologyTestDatabase.java
The concept statement was built by joining strings, and each dialect quoted the names. A statement can now compare a column with a value, so a value needs more care than a name. A value reaches a statement only as a TypedValue, which TypedValues parses as the data type of its column. A statement is a TypedStatement: text the code wrote, names, typed values and search text, each kept apart. An SqlEngineFamily writes it as finished text or as the form a driver binds. Nine families write names and strings where six dialects did, because two engines of one dialect can read a backslash differently. Every service type keeps its dialect. What changes in the generated statement: - The JOIN lines carry no relation label comment. The response already returns each label in hops. - Every colon is written as a backslash and a colon, so a reader of :name parameters finds none. - A name that holds a control character is a 400. - ClickHouse writes a backtick inside a name with a backslash before it and doubles a backslash. - The statement applies the row filter of each table it reads. No caller passes a filter yet. ADR:2026-11-22-generated-sql-keeps-typed-values-apart-from-its-text
A binding write stored a row filter value as given. Generated SQL now compares the filter column with that value, so a write that sets or changes a row filter parses each value as the data type of the filter column. A value that does not parse is a 400 that names the column, the data type and what the data type expects. The write answers it before it checks ViewSampleData, as it already does for a missing column. A write that sends the stored filter back unchanged does not parse it, like every other stored part of a binding.
The statement of a concept selected every row of its tables. It now keeps only the rows that the row filter of each table keeps. The stored filter is parsed again when the statement is built, because the filter column can change its data type or leave the table after the write. A stored filter that no longer parses is a 400 that names the table.
`ontology/sql-value-cases.json` gives 686 cases. Each case gives a value, a name or a label as it can arrive, the data type of its column, and what one engine family must do with it: the exact text, the parameters a driver binds, or the refusal. `OntologySqlValueCasesTest` runs each case for the family that it names. A case for every family runs once per family when its outcome is text or a bound form. The expected text of a case is the oracle, so no case is edited to make the test pass. The test skips 74 runs and gives the reason for each. 68 are constraint value runs, which belong to the tests generated from shapes. Four are writes that the authorizer refuses, which need a server. One writes through a change set, and no change set operation writes a binding. One is a stored count, which is no part of SQL generation.
`OntologySqlLiteralIT` writes each string of the value cases as the
engine family of the test database writes it, runs `SELECT <literal>`,
and reads the same characters back. On Postgres it does so with
`standard_conforming_strings` on and off. On MySQL with
`NO_BACKSLASH_ESCAPES` each value comes back with its backslashes
doubled and is still one value. A search finds its own text and no text
that only a wildcard would match.
`OntologyRowFilterValueIT` sends every refused value of the cases to
`PUT /v1/ontologyConcepts/{id}/bindings` and gets the 400 that each case
names. It asserts the full message for each data type, reads back a
value of the right type as it was written, and sends the four refused
writes of a caller without `ViewSampleData`. That caller gets a 403 when
setting a filter and when changing one.
`OntologyConceptQueryIT` gains two tests. The statement applies a stored
row filter, and a stored filter whose value no longer parses is a 400
that names the table.
The record now says what a search does on a MySQL server that runs with
`NO_BACKSLASH_ESCAPES`.
A value that arrives as a number was written in plain decimal form before any length check. A decimal with a large exponent, such as 1E+2000000000, would write one digit for each power of ten. No request reaches that today, because the JSON reader gives a double, but the parser is the one entry point for every value. A number now takes the 1,024 characters that a string takes, and a decimal whose exponent passes that cap is refused before its digits are written out. Every `TypedValue` is now made in `TypedValues`, including the pattern that a driver binds for a search.
A `TypedValue` held the data type of its column and the parsed value. It now also holds the text that the value arrived as, so a caller can return a value as it was written. `-0` parses as zero and keeps `-0`. A number or a boolean keeps the text that JSON writes for it. SQL is still written from the parsed value only, and `toString` still names the data type alone, so a log line shows neither form.
…stream moved the container tests Upstream removed the service module's OntologyTestDatabase and runs container tests against the suite's database server (#38626). The test now takes the lane's dialect instead of parameterising over both.
Upstream's TaskWorkflowHandler.saveChange calls patch without the impersonatedBy argument, which the repository now reads from ImpersonationContext. The test verified the six-argument form.
Upstream's RdfOntologyDescriptionContractTest requires every projected class and stored predicate to carry a comment and every shared predicate to list each class it is used on. The shape class, the shape fields, mappingSource and isDisplayName now satisfy it.
…nding The binding DAO's upsert takes a StoredBinding that carries the role, subject key and row filter; the IT upstream added called the five-argument form.
…le reads Upstream's suggestion task workflow now assigns platform admins when no owner resolves, and its table reads run three to six more statements that do not grow with the data. The ITs pin both.
…s test-case read change
Upstream's test mocks the edit form as a comment field, and this branch's test mocks it as a button that submits a filled payload. The later jest.mock replaced the earlier one, so upstream's comment test lost its field. One mock now serves both.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
The suggestion-type condition computes its result in one return, and the list endpoint validates suggestionType with validateCsvAgainstEnum, which now compares each enum's API form (toString) so generated enums whose constant names differ from their schema values pass.
… added Two schemas gained enums that share a property name with an existing one, so the TypeScript generator prefixed both and renamed Kind to PropertyKind and State to ColumnState. Title the new enums EvidenceKind and RecordsState so the existing ones keep Kind and State. Java types are unchanged: each enum has an explicit javaType.
Code Review ✅ Approved 🔴 High risk 3 closed / 3 findingsApproving table-constraint suggestions can add primary, unique, or foreign-key constraints to existing tables, changing write acceptance and enforcing stored-data integrity. Adds ontology table bindings with roles, subject keys, row filters and joins, plus record statements, shape checks and table constraint suggestions. Three issues from this session were resolved: paging.total no longer shrinks the next fetch limit and hides suggestions, the new suggestion-type condition no longer uses an early return against the ADR, and the validSuggestionTypes insertion no longer sits below another method's Javadoc. No open findings remain. ✅ 3 closed✅ Bug: Adjusted paging.total shrinks the next fetch limit, hiding suggestions
✅ Quality: New suggestion-type condition uses an early return, against the ADR
✅ Quality: validSuggestionTypes inserted below another method's Javadoc
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 |
Describe your changes:
An ontology class could already be bound to tables, but nothing said how one row of those tables becomes one record of the class. This PR lets a table binding say it. A binding now carries a role, a subject key, a row filter and, for a relation column, the join it follows. On top of that the server can:
The server writes statements and never runs them against a bound table. Every read masks what the caller may not view.
How it is split. This is one PR because the parts share the binding model and the 2.2.0 migration. It has no dependency of its own and merges first. Reviewers can read it by area. Start with the schemas and the 2.2.0 migration, then read
ontology/andontology/sql/in the service, then the resources, then the UI task tab. Each area has a decision record underdocs/decisions/, listed at the end of the design section.Type of change:
High-level design:
Table bindings say how rows become records
roleisidentityorcontributing. A class has at most one identity table, and it decides which records exist. A contributing table adds columns to them.subjectKeyis an ordered list of 1 to 16 column paths that identifies one record.rowFilteris one{column, operator, value}. The server parses the value as the data type of its column when it renders SQL, and refuses a stored value that no longer parses.joinwith 1 to 16 column pairs and a status ofinferredorconfirmed. The target is a table in the same database that the writer may view.mappingSource. The server stores it as aMAPPED_TOrelationship. Once it is set, a binding that a write adds or changes must sit in that database.ViewSampleDataon the table.isDisplayName. A class has at most one such property. The CSV format has no column for it, so a CSV import keeps the stored flag. A Turtle import reads it fromom:displayNameIntent.Generated statements start from the identity table
POST /v1/ontologyConcepts/{id}/statements/{find,open,expand,aggregate}each return oneSELECTand a column plan. Every statement starts from the identity table and names a record by its subject key, so two readers get the same record id.expandorders by the related key and pages after a given key.aggregatecounts the records of a class and the links of a relation.TypedValueandTypedStatementrender each value with one escaper per engine family (MySQL, Postgres, Redshift, Trino, Snowflake, BigQuery, Spark, SQL Server and ClickHouse). A statement comes as text to read and as text with:pNparameters to run.x */ OR 1=1 /*could close the comment in the copied text. The label now comes back inhops.Counts, profile facts and mapping health
rowCount,profiledAtandsampledfrom the latest stored profile, only for a caller withViewDataProfile.rowCount, because several engines store an estimate there. A count isexactwith a value, or a state that says why there is none.GET /v1/ontologies/{id}/mappingHealthpages what an editor still has to fix, such as a class with no identity table, an unconfirmed join, a key whose type does not match, a sensitive key column, or a column whose type cannot hold its property. It reads catalog metadata only.OntologyTableMappings.readreturns the table mapping of a whole ontology version in one read, with a count of what the caller may not view.Shapes and the checks they become
ontologyShapeis a native entity in the working draft. It targets one class and holds an ordered list of constraints, each with a stableid. The eight supported SHACL constraints areminCount,maxCount,class,datatype,minInclusive,maxInclusive,inandpattern. An import reports every other SHACL construct instead of refusing the file. Shapes are sealed in releases asSHAPEmembers and export as SHACL.GET /v1/ontologyConcepts/{id}/shapeCheckscompiles the shapes of a class against its bindings. Each part of a constraint is checked exactly, or the answer says why it is not offered. It creates nothing.suggestionTypeTestCase) on the table the check belongs to. Approving it creates atableCustomSQLQuerytest as the approver and gives the suite a scheduled pipeline. Rejecting it creates nothing. The governance bot files the task, so the person whose change started the run can still resolve it.generatedBy.Table constraint suggestions
SuggestionPayload.suggestionTypegainsTableConstraint, with a seededTableConstraintSuggestiontask form. Filing refuses anything but one validPRIMARY_KEY,UNIQUEorFOREIGN_KEYon existing columns.EditAllon the table and adds the constraint as the approver, through the table repository's own validation. The comment that an approval leaves names the constraint added, or says the table already had it. It is posted only after the change returns, and before the task is resolved.Change sets, declined definitions and draft reads
UPSERT_BINDINGandUPSERT_SHAPEoperations, applied with the rest of the draft. Operations and their evidence are returned only to readers of the draft, and evidence names no table the reader may not view. A stored change event holds no operations.POST /v1/ontologies/{id}/declinedDefinitionsrecords the definitions a person declined, keyed by operation type, IRI hash and a canonical content digest.POST .../declinedDefinitions/matchtells a client which candidates were declined before. A binding is keyed by its table, role, key and row filter.Release members are filtered per reader
GET /v1/ontologyReleases/{id}/members/{kind}returns only the members the reader may view. The cursor andpaging.totalcount viewable members only. Before this change, one hidden member made the whole page a 403. The by-id member read is unchanged. Whole-release reads, such as export, SPARQL, comparison and validation, still refuse a reader denied any member, because a partial release would give a wrong result.Other changes
AbstractNativeApplication#validateConfigForSavechecks an app's configuration before POST, PUT and both PATCHes store it. A refused configuration answers 400 and leaves the stored one as it was.OntologyShapeServiceandOntologyDeclinedDefinitionService.openmetadata.ttldescribes the shape class and the new predicates.Decision records
This PR adds
2026-11-21-a-table-binding-says-how-its-rows-become-records,2026-11-21-a-class-has-at-most-one-display-name-property,2026-11-21-graph-table-assets-carry-latest-profile-facts,2026-11-21-ontology-shapes-hold-the-supported-shacl-constraints,2026-11-22-a-count-is-exact-or-absent,2026-11-22-a-declined-definition-is-remembered-by-content,2026-11-22-an-ontology-change-set-can-carry-table-bindings-and-shapes,2026-11-22-generated-sql-keeps-typed-values-apart-from-its-text,2026-11-22-record-statements-start-from-the-identity-table,2026-11-23-a-shape-check-is-exact-or-it-is-not-offered,2026-11-26-a-suggestion-task-can-carry-a-table-constraint,2026-12-01-a-shape-check-reaches-its-table-as-a-proposed-test,2026-12-01-an-apps-configuration-is-checked-before-the-server-stores-it,2026-12-04-the-table-mapping-of-a-version-is-one-readand2026-12-05-the-lookups-of-generated-tests-and-their-tasks-use-an-index. It amends the records on independent entity storage, sealed release members, concept bindings and draft read rights.Migration (2.2.0)
All steps go in
bootstrap/sql/migrations/native/2.2.0/{mysql,postgres}/schemaChanges.sqland thev220data step. Each one checks before it changes anything, so a second run changes nothing.ontology_shape_entityandontology_declined_definition.bindingRole,subjectKeyandrowFiltertoontology_concept_binding. It backfills nothing.test_case.generatedByClassIdandtask_entity.testCaseClassId, with an index on each, so the lookups of generated tests and their tasks stop scanning both tables. Adding a stored column rewrites each table once at upgrade. On 50,000 rows that took 3.9 s fortest_caseand 1.2 s fortask_entity. Release notes should say so.OntologyShapePolicyRulesaddsontologyShapeto the seeded ontology author and reviewer policy rules on an installed catalog. It runs after the two other 2.2.0 steps.API changes
/v1/ontologyShapes(CRUD, versions, restore andPOST /import),/v1/ontologyConcepts/{id}/statements/{find,open,expand,aggregate},GET /v1/ontologyConcepts/{id}/shapeChecks,GET /v1/ontologies/{id}/mappingHealth, and/v1/ontologies/{id}/declinedDefinitionswith/match.role,subjectKey,rowFilterandjoin. Ontologies takemappingSource. Graph pages carry profile facts and counts. Suggestion tasks takeTableConstraintandTestCase. App create, update and patch check the configuration first.docs/generated/api-reference.mdis regenerated.Behavior changes
ViewSampleData, as a view's SQL text is. A reader denied a join's target table still gets the target's id and key column names, but never its name. A reviewer may want to weigh both.Tests:
Which test layer and why
Rules that need no server are unit tests, such as the binding rules, count rules, shape compile, typed values and statement goldens. Every new or changed endpoint has a Java IT, authorization included. The UI change is the task tab, covered by Jest. No Playwright test is added.
Use cases covered
Unit tests
openmetadata-service, plus about 680 golden statement files across nine engine families (scripts/write-ontology-statement-goldens.shregenerates them).mvn test -pl openmetadata-serviceran 23,870 tests with 0 failures, 0 errors and 75 skipped.mvn test -pl openmetadata-mcpran 1,128 tests with 0 failures.Backend integration tests
openmetadata-integration-tests.OntologyShapeCheckReadsITpasses 36 of 36.TaskEntityTypeResolutionIT.approvedMetadataTaskAppliesToEntity[9], a 409 from two invocations creating one glossary. The class passes alone (13 of 13), and its code is identical to main.OpenSearchRBACConditionEvaluatorTestfailed 20 times in one full unit run and did not fail again, alone or in a second full run. Neither side changed that code.The results above come from the branch's own runner, not
make java_affected_run, so the block is empty. Publishing it is pending.UI checks
TaskTabNew.component.test.tsxand 179 of 179 in the API and task form utility suites.tscreports 53 errors, the same set as on main. None is in a file this PR changes.Ingestion integration tests
Playwright (UI) tests
make playwright_affectedis pending.Still pending before merge
spotless:check,check_decision_records.pyand the merge with main are clean at the head. Main has moved since, so a fresh merge check is due.UI screen recording:
Not recorded yet. The only UI behavior change is how the task tab resolves a table constraint suggestion.
Follow-ups after merge
Behavior gaps:
Performance:
Tests:
OntologyShapeCheckReadsIT,IndependentOntologyMappingAdviceCountITandOntologyTableMappingsITrose after merging main (for example 48 to 53 per draft read). They were re-pinned without naming the new statements. The counts still stay flat across 1, 40 and 80 constraints, which is what the tests guard.Checklist:
REVIEW.mdon the final diff. Pending.