Skip to content

Fixes 38418: RDF graph live writes, table keys, concept bindings, quality evidence and extension points - #38419

Merged
pmbrull merged 11 commits into
mainfrom
pmbrull/kg-rdf-core
Nov 23, 2026
Merged

pmbrull merged 11 commits into
mainfrom
pmbrull/kg-rdf-core

Conversation

@pmbrull

@pmbrull pmbrull commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #38418

The RDF knowledge graph now keeps up with the catalog and carries the facts an agent needs to
reason over it. A distribution built on OpenMetadata also gets small extension points, so it
can add its own MCP guidance without forking the service.

  • Live writes (existing, ADR:2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples):
    an entity write's scope now also owns its concept binding edges, constraint members and latest
    test result/incident, so a rewrite replaces them; a queued entity refresh is retired when the
    same refresh is queued again shortly after (one profiler run queued one table refresh per
    column); an active ontology release change refreshes its bound assets; reindex fixes.
  • Table keys: project as ordered constraint members (composite keys keep column order, and a
    composite foreign key pairs each column with its referred column). Builds on Fixes 37755: Correct stale RDF quality and constraint facts #37756, which
    fixed stale constraint facts and column uniqueness.
  • Concept bindings: the Ontology Studio bindings of the active release reach the serving graph.
  • Quality evidence: the latest profile, test results and open incidents per table and column
    are in the graph. A column tagged sensitive keeps none of its values in the graph (same
    masking rule as the API).
  • Self-describing ontology (2.1.0): ontology_describe can read a single term, with its
    label, comment and the properties whose domain includes it.
  • Entity RDF endpoint: test evidence on a sensitive column is masked in every format
    (JSON-LD, Turtle, RDF/XML, N-Triples). The graph and the endpoint mask a test case with the
    test-case API's own PIIMasker field masking (result, incident, parameters, description).
  • Extension points, each keeping OpenMetadata's behaviour by default:
    McpServer.serverInstructions(), a public
    PersonaRepository.validateContextDefinition, OntologyDocument.loadCanonicalModel(), and the
    public RdfConceptBindingMapper.BOUND_ASSET / BOUND_COLUMN predicates.

Companion Collate PRs, stacked and built on this one: open-metadata/openmetadata-collate#8850 → #8851 → #8852 → #8853. Each lists the tests run in Collate.

Type of change:

  • New feature

High-level design:

  • Writes. Live writes already exist on main: RdfRepository turns an entity write into an RDF
    diff executed after commit through RdfLiveWriter. This PR adds retiring superseded refreshes in
    RdfLiveWriteStore and extends what an entity owns.
    RdfOwnedResources / RdfEntityScope define which triples an entity owns, so a refresh
    never deletes another entity's facts.
  • New fact families. RdfTableKeyMapper (keys, ADR:2026-11-13-column-uniqueness-means-the-column-alone-is-unique),
    RdfConceptBindingMapper + DatabaseConceptBindingLookup (active-release bindings; ADR:2026-10-19-native-concept-bindings-remain-operational-metadata
    still holds for the ontology release and its import/export), RdfQualityEvidence +
    RdfQualityMapper / RdfTestResultMapper (quality, ADR:2026-11-18-the-rdf-graph-carries-the-latest-quality-evidence).
    Profile and test-case writes queue a table refresh; resolution-status (incident) writes queue a
    refresh of their test case (QualityWritesRefreshRdfTest). A table write whose columns or column
    tags change requeues its test cases before the table is stored.
  • Ontology. openmetadata.ttl 2.1.0 adds labels/comments; OntologyDocument /
    OntologyTermEntry serve one term (ADR:2026-11-18-ontology-terms-describe-themselves-and-read-one-at-a-time).
  • Scope. Only RDF facts, fixes to existing features (ontology_describe) and the extension points. The knowledge-graph tool itself, and its search, live in Collate.
  • Rollout. RDF stays off by default. With RDF on, the next reindex projects the new fact
    families; live writes keep them current after that. No schema migration.
  • Alternatives. Keeping these in a Collate fork of the service: rejected, every upgrade
    becomes a merge, and the graph facts serve every OpenMetadata user.

Tests:

Use cases covered

  • An entity update writes only its changed triples; a failed write is retried and repeated refreshes collapse.
  • A composite foreign key pairs each column with its referred column in order.
  • Active-release concept bindings appear in the graph and follow binding add/remove and concept delete.
  • A table's latest profile, test results and open incidents are in the graph; a column that becomes
    sensitive loses them, including when the test-case requeue fails once and is retried.
  • A malformed stored link drops only that evidence, not the table's projection.
  • ontology_describe term=om:InputPort lists properties whose domain is an owl:unionOf.
  • The entity RDF endpoint masks a sensitive column's test evidence in all four formats.
  • The entity RDF endpoint still returns 404 for a soft-deleted table or test case in every format,
    and 200 again after restore (RdfResourceIT#entityRdfReturns404ForSoftDeleted*UntilRestored);
    the graph side stays covered by RdfSoftDeleteIT and RdfSoftDeleteReindexIT.
  • Default extension points leave OpenMetadata's behaviour unchanged.

Unit tests

  • Added/updated: RdfLiveWriteTest, RdfLiveWriterTest, RdfEntityWritePlannerTest,
    RdfOwnedResourcesTest, RdfTableKeyProjectionTest, RdfConceptBindingProjectionTest,
    RdfConceptBindingWriteTest, RdfQualityEvidenceTest, RdfQualityProjectionTest,
    QualityWritesRefreshRdfTest, RdfReindexerTest, RdfUpdaterTest, RdfPropertyMapperTest,
    RdfOntologyContractTest, RdfOntologyDescriptionContractTest, OntologyDocumentTest,
    OntologyDescribeToolTest, RdfToolDescriptionVocabularyTest, PersonaContextDefinitionValidationTest,
    PersonaRepositoryTest, McpSdkUpgradeTest, and others in the run below.
  • Coverage %: not measured (no jacoco run).
  • No direct unit test (the planner lists them): DatabaseRdfQualityEvidenceSource (covered by
    RdfQualityEvidenceIT; unit tests use a fake source), RdfQualityEvidenceSource (interface),
    RdfEntityScope, RdfConceptBindingMapper, RdfQualityMapper, RdfTableKeyMapper,
    RdfTestResultMapper (each exercised through its projection test), OntologyTermEntry
    (through OntologyDocumentTest), EntityProfileResource (through QualityWritesRefreshRdfTest).

Backend integration tests

  • Added/updated: RdfEntityDiffWriteIT, RdfLiveWriteRecoveryIT, RdfQualityEvidenceIT,
    RdfResourceIT.

Local Java test run: PASSED

  • Commit: d7c66f34dc67 (base origin/main) — uncommitted changes were present
  • Finished: 2026-11-22 10:56 UTC · 9.3 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 10 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-mcp (3 classes), openmetadata-service (28 classes) 31 354 0 0 4.0 passed
integration mysql-elasticsearch · rdf 4 77 0 0 5.3 passed
  • Impacted, not run locally: 17 classes (listed in the details)

Pending for merge readiness: --scope full (10 deferred steps, 20 classes, including the
nightly scale and UI ITs listed in the details comment).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Ran this branch (at 2f6f5367549) under Collate on a local stack: MySQL, OpenSearch, Fuseki,
    RDF on, sample catalog over a BigQuery warehouse, RDF reindex run (projectionState: READY).
  2. Through Collate's knowledge-graph tool (which reads this graph): a table's node carried its
    bound concept and each column its bound property and range; table nodes carried test,
    profile, freshness and open-incident evidence.
  3. Not done by hand: the later review fixes (covered by the tests above), and a glossary
    or binding edit observed live without reindex.

UI screen recording:

Not applicable — backend only.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: no JSON Schema change needs a migration (the ontology and JSON-LD contexts are RDF resources, applied by reindex).
  • For a UI feature or feature task: not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review: two rounds against REVIEW.md with fresh reviewers. Round 1 fixed the 🔴 requeue lost on retry and five 🟡. The branch was then rebuilt to drop code only Collate uses (hybrid search moved to Collate), and round 2 on the rebuilt head (ca8d3ae32bc) found no scope or leftover issues; its one 🟡 (a sensitive-column test's parameter values and description reached the graph, as on main) is fixed in 8b578e1062a by sharing PIIMasker's field masking. Round 3 (fresh reviewer, full REVIEW.md pass at ca8d3ae32bc): 0 🔴; fixed in fa6eddef981 the stale test evidence after an untagged column is dropped or renamed, and column-level composite keys limited to tables; kept om:statusProperty (an ontology annotation naming a class's status properties, read by Collate to count nodes by status); declined a reindex-path integration test. Answered: a column that becomes sensitive only through a glossary term keeps its evidence in the graph until the table or test case is next written (the API masks it at once).
  • Decision check: records added/amended under docs/decisions/: 2026-10-19 (amended), 2026-11-03, 2026-11-13, 2026-11-18 ×2.

RetriggerView in GreptileConfidence Score: 5/5

The latest changes appear safe to merge, with no new actionable issues found.

Summary

The PR adds live RDF concept bindings, ordered table keys, latest quality evidence, ontology term descriptions, and extension points.

  • RDF refreshes keep up with changes to the facts each entity owns.
  • Table keys show their ordered columns and foreign-key pairs.
  • Active ontology concepts connect to their bound assets and columns.
  • Tables and test cases show their latest profile and quality evidence.
  • Ontology tools describe one term, and distributions can add their own guidance.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Catalog or quality write] --> B[Queue entity refresh]
  C[Binding or active release change] --> B
  B --> D[Load current entity and quality evidence]
  D --> E[Mask sensitive test fields]
  E --> F[Build RDF facts]
  F --> G[Replace changed and owned triples]
Loading

Reviews (10) · Last reviewed commit: "Keep JsonLdTranslator constructors withi..." · Reviewed by Greptile

@pmbrull
pmbrull requested a review from a team as a code owner November 21, 2026 20:41
@pmbrull
pmbrull requested review from harshach and a balanced review from Copilot November 21, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This 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 skip-pr-checks label.

@pmbrull

pmbrull commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Local Java test run: PASSED — details

  • Commit: 57dbbd79d772 (base origin/main)
  • The summary is in the PR description.

Tests run locally

  • unit · openmetadata-mcp (3 classes), openmetadata-service (39 classes): 42 classes, 626 tests executed (listed below)
  • integration · mysql-elasticsearch · parallel: OpenSearchVectorReaderIT (3 passed)
  • integration · mysql-elasticsearch · rdf: RdfEntityDiffWriteIT (11 passed), RdfLiveWriteRecoveryIT (38 passed), RdfQualityEvidenceIT (2 passed), RdfResourceIT (20 passed)

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.

unit · openmetadata-mcp (3 classes), openmetadata-service (39 classes): 53 classes

ContextMemoryRepositoryTest (49 passed), ContextMemorySearchVisibilityTest (54 passed), ContextMemoryVisibilityTest (31 passed), HybridRankingTest (5 passed), HybridSearchScopeTest (3 passed), JsonLdTranslatorTest (3 passed), LiveReferenceFilterTest (4 passed), McpSdkUpgradeTest (26 passed), OntologyActiveGraphStorageTest (6 passed), OntologyBindingGraphLinksTest (8 passed), OntologyConceptBindingProjectionTest (2 passed), OntologyDescribeToolTest (16 passed), OntologyDocumentTest (9 passed), OntologyReleaseDAOTest (14 passed), OntologyServedBindingsStorageTest (6 passed), OpenSearchAggregationRbacTest (6 passed), OpenSearchHybridSearchTest (9 passed), OpenSearchSearchAccessFilterTest (3 passed), OpenSearchVectorServiceTest (34 passed), PIIMaskerTest (49 passed), PersonaContextDefinitionValidationTest (2 passed), PersonaRepositoryTest (9 passed), QualityWritesRefreshRdfTest (4 passed), RdfConceptBindingProjectionTest (6 passed), RdfConceptBindingWriteTest (4 passed), RdfEntityDeleteLineageTest (1 passed), RdfEntityWritePlannerTest (20 passed), RdfLiveWriteTest (21 passed), RdfLiveWriterTest (6 passed), RdfOntologyContractTest (10 passed), RdfOntologyDescriptionContractTest (7 passed), RdfOwnedResourcesTest (4 passed), RdfPropertyMapperTest (0 passed), RdfPropertyMapperTest$AddTypedPropertyBlankString (4 passed), RdfPropertyMapperTest$ChangeDescriptionTests (2 passed), RdfPropertyMapperTest$ColumnResourceTests (16 passed), RdfPropertyMapperTest$DedicatedMapperFieldTests (2 passed), RdfPropertyMapperTest$ExtensionTests (1 passed), RdfPropertyMapperTest$GeneralPropertyMappingTests (13 passed), RdfPropertyMapperTest$LifeCycleTests (1 passed), RdfPropertyMapperTest$LineageTests (3 passed), RdfPropertyMapperTest$TestCaseResultTests (1 passed), RdfPropertyMapperTest$TranslatorManagedPredicatesTests (2 passed), RdfPropertyMapperTest$VotesTests (1 passed), RdfQualityEvidenceTest (10 passed), RdfQualityProjectionTest (4 passed), RdfReindexerTest (10 passed), RdfTableKeyProjectionTest (6 passed), RdfToolDescriptionVocabularyTest (7 passed), RdfUpdaterTest (17 passed), SearchRepositoryTest (25 passed), TestCaseResolutionStatusRepositoryTest (12 passed), VectorSearchQueryBuilderTest (58 passed)

Broader coverage not executed by this focused run

  • mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true '-Dtest=org/openmetadata/DefaultOperationalConfigProviderTest.java,org/openmetadata/csv/**/*Test.java,org/openmetadata/csv/**/Test*.java,org/openmetadata/csv/**/*Tests.java,org/openmetadata/csv/**/*TestCase.java,org/openmetadata/schema/**/*Test.java,org/openmetadata/schema/**/Test*.java,org/openmetadata/schema/**/*Tests.java,org/openmetadata/schema/**/*TestCase.java,org/openmetadata/sdk/**/*Test.java,org/openmetadata/sdk/**/Test*.java,org/openmetadata/sdk/**/*Tests.java,org/openmetadata/sdk/**/*TestCase.java,org/openmetadata/service/**/*Test.java,org/openmetadata/service/**/Test*.java,org/openmetadata/service/**/*Tests.java,org/openmetadata/service/**/*TestCase.java,CompanyContextToolTest,CreateEntityToolTest,EntityNeighborhoodToolTest,FindByTagToolTest,GetEntityToolTest,McpImpersonationTest,McpReadOnlyModeTest,McpResponseUtilsTest,McpSdkUpgradeTest,McpServerFatalErrorTest,McpServerRequestContextTest,McpServerUnconfirmedTokenTest,OntologyDescribeToolTest,PersonaSearchScopeTest,RdfToolDescriptionVocabularyTest,RdfToolGatingTest,SearchMetadataToolTest,SemanticSearchToolTest,ShaclValidateToolTest,SparqlQueryToolAgentProfileTest,SparqlQueryToolTest' -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<512 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=global-state '-Dit.test=<39 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf '-Dit.test=<38 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=parallel -Dit.test=AlertStateIT,BundleWarmupCertificationIT,ContainerCacheCorrectnessIT,EntityCacheWriteOrderIT,OneTransactionFlushAtomicityIT,RelationshipCacheInvalidationIT,TagRenameCacheIT,UncachedReadIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pcache-tests -DintegrationTests.lane=global-state -Dit.test=CredentialRedisDownIT,CredentialRedisNoRoundTripIT,SessionRedisMultiNodeIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=parallel '-Dit.test=<128 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=global-state -Dit.test=ContextMemoryExtractionIT,GlossaryOntologyExportIT,NativeOntologyEveryPackInstallIT,OntologyConcurrentHardDeleteIT,PatchTableEmbeddingIT,SearchIndexRetryQueueIT,TestSuiteReindexIT,VectorEmbeddingIntegrationIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Ppostgres-opensearch -DintegrationTests.lane=rdf -Dit.test=RdfFirstIndexRunIT,RdfIndexAppScaleIT,RdfIndexRunRecoveryIT,RdfOntologyActivationIT,RdfOntologyChunkedActivationIT,RdfOntologyPropertyHierarchyIT,RdfReindexFailuresIT,RdfReindexInsertOnlyIT,RdfReindexRunLockIT,RdfSemanticSearchIT,RdfSoftDeleteReindexIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
  • mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Psearch-it -DdatabaseType=postgres -DsearchType=opensearch -Djpw.data.mode=ingest '-Dit.test=<32 classes>' -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
Impacted, not run locally (20)
  • RdfCatalogScaleIT → only with -DrdfCatalogScale=true, which no CI lane sets
  • LineagePayloadScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • LineageScenePerformanceScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • OntologyScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • ReindexBenchmarkIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • ReindexCpuHeadroomIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • Scale100kEntitiesIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • ServiceDeleteSearchCleanupScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • TableTotalCountScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • GoogleSsoSignInUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • EntityLoaderSmokeUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • LongCompoundNameSearchUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • PipelineOwnerIndexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • DistributedAutoTuneReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableAllKindsDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SearchAvailableDuringReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SelectiveFieldReindexUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • SimpleReindexTriggerUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • GoogleSsoBootstrapUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
  • MockIdpSmokeUIIT → nightly: openmetadata-nightly k8s-java-it (ui-it + embedded JavaUIIT)
Commands
mvn -B package -pl openmetadata-mcp,openmetadata-service -am -Dspring-boot.repackage.skip=true -Dtest=ContextMemoryRepositoryTest,ContextMemorySearchVisibilityTest,ContextMemoryVisibilityTest,HybridRankingTest,HybridSearchScopeTest,JsonLdTranslatorTest,LiveReferenceFilterTest,McpSdkUpgradeTest,OntologyActiveGraphStorageTest,OntologyBindingGraphLinksTest,OntologyConceptBindingProjectionTest,OntologyDescribeToolTest,OntologyDocumentTest,OntologyReleaseDAOTest,OntologyServedBindingsStorageTest,OpenSearchAggregationRbacTest,OpenSearchHybridSearchTest,OpenSearchSearchAccessFilterTest,OpenSearchVectorServiceTest,PIIMaskerTest,PersonaContextDefinitionValidationTest,PersonaRepositoryTest,QualityWritesRefreshRdfTest,RdfConceptBindingProjectionTest,RdfConceptBindingWriteTest,RdfEntityDeleteLineageTest,RdfEntityWritePlannerTest,RdfLiveWriteTest,RdfLiveWriterTest,RdfOntologyContractTest,RdfOntologyDescriptionContractTest,RdfOwnedResourcesTest,RdfPropertyMapperTest,RdfQualityEvidenceTest,RdfQualityProjectionTest,RdfReindexerTest,RdfTableKeyProjectionTest,RdfToolDescriptionVocabularyTest,RdfUpdaterTest,SearchRepositoryTest,TestCaseResolutionStatusRepositoryTest,VectorSearchQueryBuilderTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel -Dit.test=OpenSearchVectorReaderIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=rdf -Dit.test=RdfEntityDiffWriteIT,RdfLiveWriteRecoveryIT,RdfQualityEvidenceIT,RdfResourceIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

@pmbrull
pmbrull force-pushed the pmbrull/kg-rdf-core branch from 293cd64 to ca8d3ae Compare November 22, 2026 07:26
Copilot AI balanced review requested due to automatic review settings November 22, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Clear sensitive test parameters and descriptions in RDF with the test-case API's canonical field masker.
Copilot AI balanced review requested due to automatic review settings November 22, 2026 07:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 09:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sharing a context memory with a persona is not part of this change; memory sharing and visibility match main again.
Copilot AI balanced review requested due to automatic review settings November 22, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI balanced review requested due to automatic review settings November 22, 2026 10:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

IngestionPipelineRepositoryTest asked SecretsManagerFactory for a DB
manager, but createSecretsManager returns whatever manager an earlier
test left, so a hard delete ran the external secret inventory and threw
a NullPointerException. EntityRepositoryRestoreTest's bulk hard deletes
walk the JVM-wide repository registry through FqnKeyedRowCleanup and
failed on a null entry another test registered (also seen on main).
Reset the secrets manager for the class and stub the registry inside
the existing Entity static mock.
Copilot AI balanced review requested due to automatic review settings November 22, 2026 12:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@harshach harshach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed; see the inline comments.

Comment thread docs/rdf-ontology-contract.md Resolved
Copilot AI balanced review requested due to automatic review settings November 22, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@gitar-bot

gitar-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk 5 closed / 5 findings

Adding quality and test evidence to the RDF graph could leave sensitive-column evidence queryable after glossary-based sensitivity changes until a refresh.

Adds live RDF graph updates for concept bindings, ordered table keys, and quality evidence, plus ontology term descriptions and distribution extension points. Resolved the hybrid search rules gap, stale test evidence after column drops or renames, missing record for superseded refresh retirement and extension point contracts, and soft-deleted entities being served by the RDF endpoint. No open issues found.

✅ 5 closed
✅ Quality: Hybrid search ranking and scope rules exist only in the PR body

📄 openmetadata-service/src/main/java/org/openmetadata/service/search/SearchRepository.java:1069-1083 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/vector/HybridRanking.java:27-35 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/vector/HybridSearchQuery.java:34-35 📄 openmetadata-service/src/main/java/org/openmetadata/service/search/vector/HybridSearchQuery.java:75-89
SearchRepository.hybridSearch is a public contract that Collate's knowledge-graph tool calls ("Collate calls this method for hybrid retrieval"). It fixes several rules: RRF fusion with the configured weights and RRF_RANK_CONSTANT; with no types named, the scope defaults to the dataAsset alias members and test cases are ranked by meaning alone; a column's word hit also counts as a word hit for its table; a type without embeddings uses its word rank for both legs; CHUNK_OVERFETCH = 3. It also fails closed when the access filter cannot be built, and the word leg applies memory visibility without anchor-readable ids. No ADR covers hybrid search, and the PR adds none. The description's "lexical and vector search fused, with the caller's search access filter and memory/file visibility applied to both legs" disappears on squash-merge. The record would assert: "Hybrid search fuses word and meaning legs by weighted RRF over each leg's whole scope, applies the caller's search access filter and memory visibility to both legs, fails closed when the filter cannot be built, and ranks test cases by meaning only when no types are named."

✅ Bug: Dropping or renaming an untagged column leaves test evidence on it

📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java:609-620 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfColumnTags.java:30-33 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfColumnTags.java:59-73 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfQualityEvidence.java:130-144
refreshTable requeues a table's test cases only when its set of (column IRI, tag) pairs changes (RdfColumnTags returns rows only for tagged columns). If an untagged column is dropped or renamed (which changes its FQN-based IRI), both sets stay the same, so the column tests are never re-projected. Their om:testsColumn edge, latest result and open incident stay on an IRI the table no longer has. RdfQualityEvidence.keepOnlyResolvedColumnLink and PIIMasker.hidesTestCaseResults (which hides results whose column no longer resolves) only run when the test case itself is refreshed. That breaks the ADR's promise that "the graph names no column that is gone", and the stale results stay until the next test-case write or a reindex. Fix: also requeue when the set of column IRIs changes. For example, compare the stored hasColumn/hasChildColumn* column set together with the tag pairs, or requeue whenever the column set differs.

✅ Quality: Retiring superseded queued refreshes (100-row window) has no record

📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfLiveWriteStore.java:39 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfLiveWriteStore.java:214-227 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfLiveWriteStore.java:247-250 📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfLiveWriter.java:108-122
The description says "repeated refreshes of the same entity are retired". The code adds that rule to the live-write queue: an EntityUpdate at the head is deleted without being applied when the same payload appears again within the next LATER_COPY_WINDOW = 100 rows. The window is a judgment-call limit. The rule's correctness also depends on an invariant no single file shows: EntityUpdate holds only type and id and re-reads the entity when applied, so any later copy projects the same state or a newer one. No record under docs/decisions/ states this. The amended ADR:2026-11-03-live-rdf-entity-writes-send-only-the-changed-triples covers diff writes and ownership, not queue retirement. The record would assert: "A queued entity refresh is retired unapplied when an identical refresh is queued within the next 100 rows, which is safe only because an entity refresh carries no entity state and reads the entity when applied."

✅ Quality: Distribution extension points have no record of their contract

📄 openmetadata-service/src/main/java/org/openmetadata/service/context/ContextMemorySharePrincipals.java:21-35 📄 openmetadata-mcp/src/main/java/org/openmetadata/mcp/McpServer.java:170-173
The PR adds three extension points that Collate builds against: McpServer.serverInstructions(), the ContextMemorySharePrincipals static registry, and the now-public PersonaRepository.validateContextDefinition. ContextMemorySharePrincipals.additionalPrincipalIds widens which memories a user can see. Correctness depends on the distribution calling set() at startup, before any share or search request. That ordering is not visible from one file, and no ADR states it. The record would assert: "A distribution extends MCP instructions, memory share principals and persona context validation only through these hooks, registered at startup before requests are served; the defaults keep OpenMetadata's behaviour unchanged."

✅ Edge Case: RDF entity endpoint now serves soft-deleted entities

📄 openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java:1855-1859
Before this commit, getEntityAsJsonLd and getEntityAsRdf called Entity.getEntity(..., null). EntityDAO.getCondition treats a null include as NON_DELETED (AND deleted = FALSE), so a soft-deleted entity threw EntityNotFoundException and the endpoint returned 404, which is what RdfResource.getEntityAsRdf documents. The new loadEntityDocument passes Include.ALL for every entity type, not only test cases. As a result, /v1/rdf/entity/{type}/{id} now returns the full RDF of soft-deleted entities, and nothing in the diff or the description says this was intended. Unless serving deleted entities is deliberate, pass Include.NON_DELETED to keep the existing behaviour. If it is deliberate, add an explicit include parameter to the endpoint.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Dropping the Lookups record left the private constructor with six parameters. The five-parameter public constructor now does the work, and the test-only constructor overrides the entity type resolver after delegating to it.
Copilot AI balanced review requested due to automatic review settings November 22, 2026 19:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@pmbrull
pmbrull merged commit 4ecb6d5 into main Nov 23, 2026
58 of 60 checks passed
@pmbrull
pmbrull deleted the pmbrull/kg-rdf-core branch November 23, 2026 04:57
yan-3005 added a commit that referenced this pull request Nov 24, 2026
…lations against SQL (#38482) (#38581)

Before projecting a replayed RDF relationship add (generic relationships and
glossary-term relations), check the SQL row still exists; if it does not,
remove the triple instead of resurrecting it. The reverse-row lookup applies
only to metric -> metric RELATED_TO.

Adapted for 2.1 (main's #38419 is not on this branch):
- RdfProjectionLoaders: keep 2.1's 6-component record (no BoundAssets or
  table-key loaders); add RelationshipExists and GlossaryTermRelationRows.
- RdfLiveWriteTest, RdfGlossaryTermRelationTest, RdfEntityDeleteLineageTest:
  construct the 6-arg loaders; keep 2.1's existing tests and add #38482's
  cases.
- RdfQualityEvidenceTest: dropped, the file does not exist on 2.1.

(cherry picked from commit 0c6f3b0)

Co-authored-by: Kia Yun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDF knowledge graph: live writes, table keys, concept bindings, quality evidence and extension points for distributions

3 participants