Skip to content

Fixes 34953: Remove the in-process RDF reasoner - #34963

Merged
harshach merged 3 commits into
mainfrom
refactor/rdf-remove-in-process-reasoner
Oct 10, 2026
Merged

harshach merged 3 commits into
mainfrom
refactor/rdf-remove-in-process-reasoner

Conversation

@harshach

@harshach harshach commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #34953

OpenMetadata answered SPARQL inference requests by copying the whole Fuseki store into the server heap (CONSTRUCT { ?s ?p ?o }) and running a Jena reasoner over it. With rdf.inferenceEnabled set, every internal caller of executeSparqlQuery did the same. Past maxInMemoryInferenceTriples (100,000) requests silently returned asserted-only results, and the OWL_LITE/OWL_DL defaults never applied inference.

This PR removes that reasoner. Inference now comes only from rule graphs materialized inside Fuseki; rdfs and owl requests fail with 503 and say why.

Type of change:

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

High-level design:

  • Removed. rdf/reasoning/InferenceEngine, and in RdfRepository the in-memory inference model, its cache, the 100,000-triple limit, isInferenceEnabledByDefault, getDefaultInferenceLevel, executeSparqlQueryWithInference and executeSparqlQueryWithInferenceAsJson.
  • Internal queries. executeSparqlQuery always queries the stored graph, so lineage path finding, RDF insights, centrality and community computation, ontology loading, and the MCP find-by-tag and neighborhood tools no longer inherit inference. RdfGraphService.fullLineage drops its hard-coded custom; its query already uses property paths.
  • Requested inference. executeSparqlQueryWithInferenceResult accepts none, and custom when RdfRepository.supportsMaterializedInference holds (materialized inference on Fuseki). Any other level throws ServiceUnavailableException (503) naming the levels that work. The per-rule graphs are part of Fuseki's union default graph, so custom runs the query unchanged. InferenceMaterializer reuses the same availability check.
  • Status and clients. GET /v1/rdf/status reports default level NONE and availableLevels NONE, plus CUSTOM when materialized inference is available. The SPARQL console offers only those levels, and only none if the status request fails. The MCP sparql_query description says rdfs and owl fail.
  • Configuration. inferenceEnabled, defaultInferenceLevel, cacheInferredTriples and maxInMemoryInferenceTriples are marked deprecated in rdfConfiguration.json (generated TypeScript regenerated) and ignored. The server logs a warning at startup when inferenceEnabled or cacheInferredTriples is set. Operator docs updated (docs/rdf-production-setup.md, docs/rdf-local-development.md).
  • Unchanged. The glossary-scoped /v1/glossaries/{id}/sparql endpoint still applies RDFS/OWL Mini to its SQL-built, single-glossary model. Materialized rules (/v1/rdf/rules, RdfInferenceApp) work as before.
  • Backward compatibility. Clients sending inference: rdfs or owl get 503 instead of results that were usually not inferred. custom without materialized inference also gets 503; previously it built nine hard-coded rules over an in-memory copy. The deprecated settings are still accepted, so no migration is needed.
  • Alternative considered. Keeping the in-process reasoner behind a lower limit. Any limit low enough to protect the heap answers almost no real catalog, and the silent fallback misreports results. Reasoning over the catalog graph will run inside the Fuseki image instead, in a follow-up.

Tests:

Use cases covered

  • rdfs and owl requests return 503 with a message naming the available levels, over REST and in the repository.
  • custom with materialized inference answers from the stored graph, including rule graphs; without it, 503.
  • none and internal queries never issue a whole-store CONSTRUCT or count triples.
  • Complete lineage queries the stored graph through property paths.
  • /v1/rdf/status advertises NONE, plus CUSTOM only when materialized inference is available, whatever the configured OWL defaults.
  • The SPARQL console lists only the levels the status reports, and only none when the status request fails.
  • Rejecting JSON-LD for a triple-term graph still returns 400 on the inference path.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files: RdfInferenceGuardrailTest (rewritten), RdfGraphServiceTest (+1), RdfResourceTest (+2), SparqlInference.utils.test.ts (new), SparqlPlayground.test.tsx (+2). RdfInferenceConfigurationTest is removed with the code it covered.
  • JaCoCo, changed executable lines: 21/26. RdfResource 8/8, RdfGraphService 1/1, InferenceMaterializer 1/1, RdfRepository 11/16; the 5 uncovered lines are the startup warning in the production constructor, which unit tests don't construct.
  • Jest, changed lines: SparqlInference.utils.ts 8/8, SparqlQueryConsole.component.tsx 15/15.
mvn -B -nsu -pl common,openmetadata-spec,openmetadata-service -Pstatic-code-analysis \
  -Dtest=RdfInferenceGuardrailTest,RdfGraphServiceTest,RdfResourceTest,InferenceMaterializerTest,RdfSparqlServiceTest,AgentSparqlServiceTest,LineagePathFinderTest \
  -Dsurefire.failIfNoSpecifiedTests=false test jacoco:report            # 98 tests, 0 failures
cd openmetadata-ui/src/main/resources/ui
yarn test src/utils/Sparql/SparqlInference.utils.test.ts src/pages/SparqlPlayground/SparqlPlayground.test.tsx --coverage   # 16 tests, 0 failures

UI checkstyle (organize-imports, ESLint, Prettier) is clean on the changed UI files, and the repository pre-commit hooks pass.

Backend integration tests

  • Updated RdfResourceIT. The triple-term JSON-LD rejection now runs with CUSTOM, the inference level the server still answers, instead of RDFS, and a new parameterized test asserts RDFS and OWL return 503.
  • Added GlossaryTermRelationFixesIT to the planned run: it reads /v1/rdf/status, whose inference fields this PR changes.
  • No selected test failed: 566 unit tests and 2,687 integration tests across the parallel, isolated, rdf and search-it lanes ran, with 190 configured skips. The block reads FAILED only because the planner selects McpServiceResourceIT, which on main is a TODO stub with no test class and so never writes a report, the same planner limitation Fixes #34394: Allow draft conflict review #34956 reports. The rdf lane used an image built locally from docker/rdf-store through -DrdfContainerImage, with the Fuseki download pointed at the dlcdn.apache.org mirror; the Dockerfile still checks the tarball's sha512.

Local Java test run: FAILED

  • Commit: 32af095e8c66 (base origin/main)
  • Finished: 2026-10-08 17:08 UTC · 45.1 min
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-mcp (8 classes), openmetadata-service (39 classes) 93 566 0 0 2.9 passed
integration mysql-elasticsearch · parallel 63 2393 0 189 7.7 FAILED
integration mysql-elasticsearch · isolated 4 74 0 0 5.4 passed
integration mysql-elasticsearch · rdf 22 219 0 1 24.5 passed
integration postgres-opensearch · search-it 1 1 0 0 4.6 passed

Selected but produced no report: McpServiceResourceIT (mysql-elasticsearch · parallel)

Every test skipped, so these exercised nothing (check their assumptions — usually the engine): RdfIndexAppScaleIT (mysql-elasticsearch · rdf)

Tests run locally

  • unit · openmetadata-mcp (8 classes), openmetadata-service (39 classes): 93 classes, 566 tests executed (listed below)
  • integration · mysql-elasticsearch · parallel: 63 classes, 2204 tests executed (listed below)
  • integration · mysql-elasticsearch · isolated: ConversationSchemaMigrationIT (2 passed), GlossaryOntologyExportIT (16 passed), SystemResourceIT (49 passed), UserMetricsResourceIT (7 passed)
  • integration · mysql-elasticsearch · rdf: AgentSparqlResourceIT (22 passed), LodResourceIT (9 passed), RdfBatchFieldsIT (4 passed), RdfBlueGreenRebuildIT (26 passed), RdfFusekiAuthorizationIT (9 passed), RdfGlossaryGraphIT (11 passed), RdfGraphExploreIT (8 passed), RdfIndexAppScaleIT (0 passed, 1 skipped), RdfIndexRunRecoveryIT (4 passed), RdfInferenceMaterializationIT (15 passed), RdfLiveProjectionIT (3 passed), RdfLiveWriteRecoveryIT (22 passed), RdfReindexFailuresIT (13 passed), RdfReindexInsertOnlyIT (1 passed), RdfReindexRunLockIT (5 passed), RdfRelationExclusionsIT (6 passed), RdfResourceIT (15 passed), RdfRoundTripFidelityIT (6 passed), RdfSemanticSearchIT (10 passed), RdfSqlResourceIT (7 passed), RdfStorageReadinessIT (10 passed), RdfTagsTierCertificationIT (12 passed)
  • integration · postgres-opensearch · search-it: LiveSearchSettingsChangeIT (1 passed)

Per-class counts come from failsafe's reports, which can credit a test to the wrong class when classes run concurrently; the step totals above are exact.

unit · openmetadata-mcp (8 classes), openmetadata-service (39 classes): 93 classes

AgentSparqlServiceTest (18 passed), AgentSparqlTransportTest (11 passed), CentralityComputationTest (0 passed), CentralityComputationTest$EndToEnd (6 passed), CentralityComputationTest$GraphParsing (6 passed), CentralityComputationTest$PredicateWeights (1 passed), CommunityComputationTest (0 passed), CommunityComputationTest$EndToEnd (6 passed), CommunityComputationTest$GraphParsing (6 passed), CommunityComputationTest$GraphTypeParsing (3 passed), CommunityComputationTest$WellFormed (4 passed), CreateEntityToolTest (24 passed), EntityNeighborhoodToolTest (9 passed), FindByTagToolTest (9 passed), InferenceMaterializerTest (12 passed), InferenceRuleServiceTest (5 passed), JenaFusekiDatasetAdminTest (13 passed), JenaFusekiStorageTest (0 passed), JenaFusekiStorageTest$ConfigurationDefaultTests (2 passed), JenaFusekiStorageTest$DatasetRedirectionTests (6 passed), JenaFusekiStorageTest$EncodePathSegmentTests (3 passed), JenaFusekiStorageTest$EntityUpsertQueryTests (5 passed), JenaFusekiStorageTest$ExtractTaskIdTests (6 passed), JenaFusekiStorageTest$GraphTripleCountQueryTests (2 passed), JenaFusekiStorageTest$IsTaskFinishedTests (5 passed), JenaFusekiStorageTest$MaskUserInfoTests (5 passed), JenaFusekiStorageTest$MetricsParsingTests (2 passed), JenaFusekiStorageTest$ParseDatasetEndpointTests (9 passed), JenaFusekiStorageTest$PayloadGuardTests (5 passed), JenaFusekiStorageTest$RelationshipReconciliationQueryTests (1 passed), JenaFusekiStorageTest$RequestTimeoutClassificationTests (2 passed), JenaFusekiStreamingAppendTest (4 passed), LineagePathFinderTest (0 passed), LineagePathFinderTest$EndToEnd (12 passed), LineagePathFinderTest$FrontierParsing (4 passed), LineagePathFinderTest$TypesParsing (2 passed), LodResourceTest (2 passed), McpSdkUpgradeTest (20 passed), OntologyAiAvailabilityTest (3 passed), OntologyDescribeToolTest (5 passed), RdfAutoTuneTest (7 passed), RdfBatchProcessorTest (23 passed), RdfBlueGreenDatasetTest (0 passed), RdfBlueGreenDatasetTest$AlternationTests (3 passed), RdfBlueGreenDatasetTest$RepositoryRoutingTests (5 passed), RdfBulkSinkTest (9 passed), RdfCustomPropertyProjectionTest (5 passed), RdfExtensionProjectionTest (2 passed), RdfGlossaryRelationCleanupQueryTest (1 passed), RdfGlossaryTermGraphFilterTest (6 passed), RdfGraphHelpersTest (17 passed), RdfGraphServiceTest (9 passed), RdfIndexAppTest (0 passed), RdfIndexAppTest$AdmissionTests (3 passed), RdfIndexAppTest$BlueGreenLifecycleTests (5 passed), RdfIndexAppTest$EntityRelationshipConversionTests (3 passed), RdfIndexAppTest$EntitySelectionTests (5 passed), RdfIndexAppTest$InitializationTests (2 passed), RdfIndexAppTest$PromotionRatioGateTests (4 passed), RdfIndexAppTest$RunLockTests (4 passed), RdfIndexAppTest$RunRecordUpdateTests (7 passed), RdfIndexAppTest$StopFunctionalityTests (2 passed), RdfIndexAppTest$ValidationTests (1 passed), RdfInferenceGuardrailTest (9 passed), RdfInsightsServiceTest (11 passed), RdfLineageBatchingTest (5 passed), RdfLineageOntologyTest (10 passed), RdfLiveWriteTest (11 passed), RdfMutationUpdateShapeTest (3 passed), RdfParserHelpersTest (6 passed), RdfPredicatePartitionTest (3 passed), RdfPropertyMapperTest (0 passed), RdfPropertyMapperTest$AddTypedPropertyBlankString (4 passed), RdfPropertyMapperTest$ChangeDescriptionTests (2 passed), RdfPropertyMapperTest$ColumnResourceTests (9 passed), RdfPropertyMapperTest$DedicatedMapperFieldTests (2 passed), RdfPropertyMapperTest$ExtensionTests (1 passed), RdfPropertyMapperTest$GeneralPropertyMappingTests (12 passed), RdfPropertyMapperTest$LifeCycleTests (1 passed), RdfPropertyMapperTest$LineageTests (3 passed), RdfPropertyMapperTest$TestCaseResultTests (1 passed), RdfPropertyMapperTest$TranslatorManagedPredicatesTests (2 passed), RdfPropertyMapperTest$VotesTests (1 passed), RdfRelationPredicateValidationTest (35 passed), RdfRepositoryBulkChunkingTest (11 passed), RdfRepositoryProjectionHealthTest (1 passed), RdfResourceLineageQueryTest (1 passed), RdfResourceTest (21 passed), RdfSparqlServiceTest (11 passed), RdfToolGatingTest (3 passed), RdfValidationServiceTest (6 passed), ShaclValidateToolTest (8 passed), SparqlQueryToolTest (12 passed)

integration · mysql-elasticsearch · parallel: 63 classes

AIApplicationResourceIT (9 passed), AIContextMcpIT (14 passed, 1 skipped), AIContextRestIT (27 passed, 2 skipped), AIFrameworkControlResourceIT (17 passed, 2 skipped), AIGovernancePolicyResourceIT (14 passed, 3 skipped), AgentExecutionResourceIT (33 passed, 5 skipped), BaseEntityIT$ListEntityHistoryByTimestampPaginationTest (185 passed, 17 skipped), ConfigResourceIT (37 passed, 8 skipped), ContextFileIT (2 passed, 1 skipped), ContextMemoryAnchorIT (5 passed, 2 skipped), ContextMemoryIT (120 passed, 13 skipped), ContextMemoryLifecycleIT (16 passed, 1 skipped), ContextMemorySourceEntityTiebreakIT (24 passed, 3 skipped), ContextMemoryStatusMigrationIT (1 passed), ConversationResourceIT (45 passed, 3 skipped), DatabaseSmokeIT (48 passed, 4 skipped), DbTuneIT (7 passed), GlossaryRdfImportIT (128 passed, 4 skipped), GlossaryTermRelationFixesIT (115 passed, 10 skipped), GlossaryTermRelationSettingsIT (25 passed), GlossaryTermRelationSettingsPermissionsIT (10 passed), GlossaryTermResourceIT (232 passed, 9 skipped), IndexingLimitsIT (5 passed, 1 skipped), IngestionPipelineAgentTypeIT (53 passed, 9 skipped), LLMModelResourceIT (6 passed, 1 skipped), LLMServiceResourceIT (22 passed, 2 skipped), McpContextMemoryVisibilityIT (19 passed, 4 skipped), McpExecutionResourceIT (17 passed), McpIntegrationIT (15 passed, 2 skipped), McpOAuthIT (18 passed), McpPermissionIT (14 passed, 1 skipped), McpSearchIT (23 passed, 5 skipped), McpServerResourceIT (1 passed), McpToolsValidationIT (12 passed), McpUserContextIT (4 passed), MetricAssetsIT (79 passed, 7 skipped), OntologyAiResourceIT (6 passed), OntologyAxiomResourceIT (4 passed), OntologyBulkIT (25 passed, 2 skipped), OntologyChangeSetIT (17 passed), OntologyEditLockResourceIT (18 passed, 2 skipped), OntologyEffectiveAttributesIT (26 passed, 3 skipped), OntologyGovernanceIT (13 passed), OntologyImpactIT (16 passed), OntologyModelingIT (12 passed, 1 skipped), OntologyPackResourceIT (19 passed, 2 skipped), OntologyPatternIT (23 passed), OntologyResourceIT (21 passed, 2 skipped), OntologyStructureIT (36 passed, 4 skipped), OntologySubsetIT (6 passed, 1 skipped), PersonaAIContextIT (7 passed), PipelineResourceIT (30 passed), PipelineServiceResourceIT (1 passed), PipelineStatusAuthorizationIT (50 passed, 7 skipped), PrometheusResourceIT (43 passed, 2 skipped), PromptTemplateResourceIT (4 passed), RdfScaleResourcesTest (2 passed, 1 skipped), SavedSparqlQueryResourceIT (3 passed), SearchIndexFieldLimitIT (241 passed, 25 skipped), SeedDataPresenceIT (12 passed, 2 skipped), SystemAlertsIT (12 passed, 1 skipped), TableResourceIT (14 passed), UserResourceIT (141 passed, 14 skipped)

Why these tests
  • added by author: calls /v1/rdf/status, whose inference fields this PR changes ← GlossaryTermRelationFixesIT
  • area ai-mcp-context ← openmetadata-mcp/src/main/java/org/openmetadata/mcp/tools/SparqlQueryTool.java, openmetadata-mcp/src/main/resources/json/data/mcp/tools.json
  • area rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfGraphService.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/inference/InferenceMaterializer.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/reasoning/InferenceEngine.java, openmetadata-service/src/main/java/org/openmetadata/service/resources/rdf/RdfResource.java
  • area system-config ← openmetadata-spec/src/main/resources/json/schema/api/configuration/rdfConfiguration.json
  • called from entity Pipeline ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java
  • called from entity Rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfGraphService.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java, openmetadata-service/src/main/java/org/openmetadata/service/rdf/inference/InferenceMaterializer.java
  • changed test ← openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/RdfResourceIT.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfGraphServiceTest.java, openmetadata-service/src/test/java/org/openmetadata/service/rdf/RdfInferenceGuardrailTest.java, openmetadata-service/src/test/java/org/openmetadata/service/resources/rdf/RdfResourceTest.java
  • entity Rdf ← openmetadata-service/src/main/java/org/openmetadata/service/rdf/RdfRepository.java, openmetadata-service/src/main/java/org/openmetadata/service/resources/rdf/RdfResource.java
  • smoke ← code other than a test class changed
Impacted, not run locally (3)
  • RdfCatalogScaleIT → only with -DrdfCatalogScale=true, which no CI lane sets
  • OntologyScaleIT → nightly: openmetadata-nightly k8s-java-it (scale-it)
  • PipelineOwnerIndexUIIT → 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=AgentSparqlServiceTest,AgentSparqlTransportTest,CentralityComputationTest,CommunityComputationTest,CreateEntityToolTest,EntityNeighborhoodToolTest,FindByTagToolTest,InferenceMaterializerTest,InferenceRuleServiceTest,JenaFusekiDatasetAdminTest,JenaFusekiStorageTest,JenaFusekiStreamingAppendTest,LineagePathFinderTest,LodResourceTest,McpSdkUpgradeTest,OntologyAiAvailabilityTest,OntologyDescribeToolTest,RdfAutoTuneTest,RdfBatchProcessorTest,RdfBlueGreenDatasetTest,RdfBulkSinkTest,RdfCustomPropertyProjectionTest,RdfExtensionProjectionTest,RdfGlossaryRelationCleanupQueryTest,RdfGlossaryTermGraphFilterTest,RdfGraphHelpersTest,RdfGraphServiceTest,RdfIndexAppTest,RdfInferenceGuardrailTest,RdfInsightsServiceTest,RdfLineageBatchingTest,RdfLineageOntologyTest,RdfLiveWriteTest,RdfMutationUpdateShapeTest,RdfParserHelpersTest,RdfPredicatePartitionTest,RdfPropertyMapperTest,RdfRelationPredicateValidationTest,RdfRepositoryBulkChunkingTest,RdfRepositoryProjectionHealthTest,RdfResourceLineageQueryTest,RdfResourceTest,RdfSparqlServiceTest,RdfToolGatingTest,RdfValidationServiceTest,ShaclValidateToolTest,SparqlQueryToolTest -Dsurefire.failIfNoSpecifiedTests=false
mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Pmysql-elasticsearch -DintegrationTests.lane=parallel '-Dit.test=<63 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=ConversationSchemaMigrationIT,GlossaryOntologyExportIT,SystemResourceIT,UserMetricsResourceIT -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=AgentSparqlResourceIT,LodResourceIT,RdfBatchFieldsIT,RdfBlueGreenRebuildIT,RdfFusekiAuthorizationIT,RdfGlossaryGraphIT,RdfGraphExploreIT,RdfIndexAppScaleIT,RdfIndexRunRecoveryIT,RdfInferenceMaterializationIT,RdfLiveProjectionIT,RdfLiveWriteRecoveryIT,RdfReindexFailuresIT,RdfReindexInsertOnlyIT,RdfReindexRunLockIT,RdfRelationExclusionsIT,RdfResourceIT,RdfRoundTripFidelityIT,RdfSemanticSearchIT,RdfSqlResourceIT,RdfStorageReadinessIT,RdfTagsTierCertificationIT -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=LiveSearchSettingsChangeIT -Dfailsafe.failIfNoSpecifiedTests=false -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false

Ingestion integration tests

  • Not applicable — no ingestion changes.

Playwright (UI) tests

  • Not run yet. make playwright_affected selects 31 specs (Ontology Studio, canary and smoke). None opens the SPARQL console's inference selector, and the console files are an impact-map gap. The selector is covered by the Jest tests above.

Manual testing performed

No manual server or UI testing yet. Steps for a deployment with RDF on Fuseki:

  1. POST /api/v1/rdf/sparql with {"query":"SELECT * WHERE { ?s ?p ?o } LIMIT 1","inference":"rdfs"} returns 503 with a message naming none and custom.
  2. The same request with "inference":"custom" returns 503 when RDF_MATERIALIZED_INFERENCE_ENABLED=false, and 200 when it is true.
  3. GET /api/v1/rdf/status returns inference.availableLevels ["NONE"], or ["NONE","CUSTOM"] with materialized inference.
  4. In Governance → SPARQL, the inference dropdown lists only None, plus Custom with materialized inference.

UI screen recording / screenshots:

TODO: attach a short recording of the SPARQL console's inference dropdown. The PR stays in draft until it is attached.

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 migration is needed. rdfConfiguration.json only gains descriptions and deprecated flags, so stored configurations still validate.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added the tag Backward-Incompatible-Change.

SPARQL inference built a Jena inference model inside the OpenMetadata JVM by
copying the whole Fuseki store into the heap with CONSTRUCT { ?s ?p ?o }. With
rdf.inferenceEnabled set, every internal caller of executeSparqlQuery did the
same. Past maxInMemoryInferenceTriples a request silently returned asserted-only
results, and OWL_LITE/OWL_DL defaults never applied inference at all.

Delete InferenceEngine with the in-memory model, its cache and the triple limit.
Requests for rdfs or owl now fail with 503 and say why; custom reads the rule
graphs materialized in Fuseki and needs materializedInferenceEnabled. Internal
queries, including the complete-lineage endpoint, run against the stored graph.

GET /v1/rdf/status advertises only the levels the server can answer, and the
SPARQL console offers only those. Mark inferenceEnabled, defaultInferenceLevel,
cacheInferredTriples and maxInMemoryInferenceTriples deprecated; the server
ignores them and warns at startup when inferenceEnabled is set.
@harshach harshach self-assigned this Oct 8, 2026
@github-actions github-actions Bot added the safe to test Add this label to run secure Github workflows on PRs label Oct 8, 2026
@harshach
harshach marked this pull request as ready for review October 8, 2026 17:10
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

❌ UI Checkstyle Failed

❌ Bundle Runtime Check

A route chunk loads but one of its chunks still exports undefined: a chunking change broke module initialisation. Run yarn build && yarn bundle:runtime locally.

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

Count Rule
1 openmetadata-ui-patterns/no-non-adaptive-palette
All findings
Location Rule Message
🟡 src/components/SparqlQueryConsole/SparqlQueryConsole.component.tsx:869:25 openmetadata-ui-patterns/no-non-adaptive-palette Raw palette class "tw:border-error-300, tw:bg-error-50, tw:text-error-700" is static — it does not flip in dark mode. Use the theme-adapting "utility-" variant

Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 76%
76.34% (120482/157817) 62.33% (74614/119700) 63.74% (24939/39123)

…lable

Saved queries and templates from before this change can store rdfs/owl,
and custom on servers without materialized inference. Loading one left the
inference select empty and Run sent the stale level, returning 503. Derive
the effective level from the levels the RDF status reports, falling back to
none, and use it for the select, Run, and Save.
@gitar-bot

gitar-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 closed / 1 findings

🔴 High risk · Removing in-process RDF reasoning makes rdfs/owl SPARQL requests return 503 and internal queries lose inferred facts, potentially changing catalog results.

Removes the in-process RDF reasoner so SPARQL inference now comes only from materialized rule graphs in Fuseki; rdfs and owl requests return 503 naming the available levels. The SPARQL console now derives an effective inference level, falling back to none for saved queries whose level is unavailable, which resolves the earlier issue where such queries returned 503 on Run. No open findings remain.

✅ 1 closed
✅ Edge Case: Saved queries with rdfs/owl select a hidden level, and Run returns 503

📄 openmetadata-ui/src/main/resources/ui/src/components/SparqlQueryConsole/SparqlQueryConsole.component.tsx:617-620 📄 openmetadata-ui/src/main/resources/ui/src/components/SparqlQueryConsole/SparqlQueryConsole.component.tsx:655-661
handleLoadSaved and handleLoadTemplate still call setInference(saved.inference) without checking it. Personal queries and templates saved before this PR can store inference: 'rdfs' or 'owl'. Now that inferenceOptions only lists the levels the status reports, loading one of those queries sets a value missing from the Select. The dropdown then shows no selection, and Run sends the stale level, so the user gets a 503 with no visible cause in the UI. The same happens with custom on a server without materialized inference. Fix: fall back to 'none' when a loaded query's level is not in availableInferences, or tell the user the stored level is no longer available.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

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

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

@harshach
harshach merged commit c2232f7 into main Oct 10, 2026
83 checks passed
@harshach
harshach deleted the refactor/rdf-remove-in-process-reasoner branch October 10, 2026 01:45
harshach added a commit that referenced this pull request Oct 10, 2026
…e-correctness

Main squash-merged #34963, the reasoner removal this branch was stacked
on, with review edits to the SPARQL console. Take main's copy of those
UI files; keep this branch's InferenceMaterializer and production-setup
doc, which already hold #34963's change plus the fixed-point work.

This branch was previously deployed

1 inactive deployment
test — 5fef6205 Deployed Oct 9, 2026 by harshach via RDF Playwright execution #28259
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backward-Incompatible-Change safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDF SPARQL inference copies the whole graph into the OpenMetadata server

1 participant