Repository navigation
Fixes 37755: Correct stale RDF quality and constraint facts - #37756
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Local Java test run: PASSED — details
Tests run locally
Per-class counts come from the test reports, which can credit a test to the wrong class when classes run concurrently, and keep only the last run of a nested class that several test classes inherit. The summary's step totals are Maven's own counts. Broader coverage not executed by this focused run
Why these tests
Impacted, not run locally (2)
Commandsmvn -B package -pl openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=JenaFusekiStorageTest,RdfEntityDeleteLineageTest,RdfEntityWritePlannerTest,RdfOwnedResourcesTest,RdfPredicatePartitionTest,RdfPropertyMapperTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=RdfEntityDiffWriteIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false |
manerow
left a comment
There was a problem hiding this comment.
Approving. The ownership change is consistent across the diff, replace, bulk and delete paths, and the Java walk and the SPARQL pattern are pinned together by assertWalkMatchesStoreScope.
A few notes, none blocking:
- The Compatibility check failed on 11-13 (Collate build). Collate doesn't reference any of the changed classes, other open PRs pass it, and the branch is 62 commits behind
main, so it looks like base skew. It needs a re-run after a rebase before merge. - In a live catalog, tables reach the RDF writer without
profile.TableRepository.setFieldshas no fetcher for it, bothRdfProjectionLoaders.loadEntityand the reindexer go throughsetFields, andaddTableProfileDatadoesn't trigger an RDF update. So the next write of each table removes any existing measurements and writes none, and the "corrected profile at the same timestamp" case can only happen with the hand-builtTableobjects in the tests. This was already the case before this PR, but it means the graph will carry no profile measurements after this change. om:isUniquehas a new meaning, butontology/CHANGELOG.md(line 39) still describes the old one andowl:versionInfois unchanged. External SPARQL users would only learn about it from the ADR.
Code Review ✅ Approved 🔴 High risk 2 closed / 2 findingsExpanding RDF cleanup to constraint, profile, and column facts could remove shared catalog data if ownership boundaries are misclassified. Corrects stale RDF quality and constraint facts by removing obsolete profile values, constraint members and column links during rewrites, and by keeping composite PK/UNIQUE group membership without marking each column as individually unique. Two review findings were resolved: the ownership change now matches the live-write ADR's stated scope, and the composite-key ✅ 2 closed✅ Quality: Ownership change contradicts the Accepted live-write ADR's stated scope
✅ Quality: Composite-key om:isUnique semantics change is a graph contract, unrecorded
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
Fixes #37755
RDF rewrites remove obsolete profile values, constraint members and column links. Composite PK/UNIQUE constraints retain group membership without claiming each column is individually unique. Constraint references use canonical FQNs so dotted and quoted names resolve to the table column node.
Type of change
High-level design
Extend the shared ownership scope and projection walk used by differential writes, replacements, bulk reindexing and deletion. Manage their direct links even when the new projection omits them. Shared referenced columns and lineage survive cleanup.
Rollout: run
RdfIndexAppwithrecreateIndex: trueafter deployment to purge already disconnected resources.Tests
Use cases covered
Canonical identities and constraint cleanup for dotted and quoted column names; corrected and removed table/nested-column profiles; changed timestamps; constraint edits/removal; composite and single-column keys; removed columns; bulk reconciliation/deletion; preserved references and lineage.
Unit tests
113 passed across six classes, including updated
RdfOwnedResourcesTest,RdfPropertyMapperTestandRdfEntityWritePlannerTest. The quoted-name regressions reproduced six failures before the fix. Per-class line coverage was not measured; broader coverage remains pending.Backend integration tests
Updated
RdfEntityDiffWriteIT: ten passed against real HTTP/TDB2 storage usingopenmetadata/fuseki:6.2.0-318ff87. The test lane also started MySQL, Elasticsearch and OpenMetadata from the reactor build.RdfOntologyContractTestadditionally passed all 10 checks against the updated ontology comment.The initial live run exposed canonical-literal differences in the new oracle. The oracle now reads the expected projection from a cleared Fuseki dataset and still requires exact graph equality.
Local Java test run: PASSED
442e0478e170(baseorigin/main)--scope full).Ingestion integration tests / Playwright / UI recording
Not applicable — backend RDF projection fix.
Manual testing performed
Ran the focused affected-test planner with
RdfEntityDiffWriteITplusRdfPredicatePartitionTest,RdfEntityDeleteLineageTestandJenaFusekiStorageTest. Tests wrote successive projections over HTTP, queried the stored graph, and verified cleanup. Exact commands and class counts are in the validation comment.Checklist
REVIEW.mdat442e0478e170846ac38c03b4916953fdbc61ab43: no remaining findings

Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Fixes stale RDF constraint and profile facts when entities are rewritten or deleted.
pmbrullexplicitly deferred removal of already disconnected resources to arecreateIndex: truerebuild; this is documented in the PR and decision record. No new actionable issues were found. Tests were not run during this review.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Entity write or deletion] --> B[Shared ownership scope] B --> C[Table constraints] B --> D[Table measurements] B --> E[Columns and nested columns] E --> F[Column measurements] B --> G[Remove obsolete owned facts] H[Referenced columns and separate lineage resources] --> I[Outside expanded cleanup]Reviews (1) · Last reviewed commit: "fix(rdf): quote constrained column names" · Reviewed by Greptile