RDF indexing and storage
The RDF indexing and storage system keeps a queryable RDF projection of OpenMetadata entities and relationships. It rebuilds that projection from the SQL store, applies committed changes through a durable live-write path, and uses a remote RDF store so service nodes remain stateless. SQL remains the source of record, while RDF serves graph views, SPARQL queries, lineage, and ontology features. The semantic knowledge graph page gives the wider product context, while ontology and RDF operations explains the RDF model and query-facing behavior.
System purpose
The projection turns entity data into RDF for graph views, SPARQL queries, lineage, and ontology features. SQL remains the source of record. RDF is current when a rebuild is healthy and committed live changes have either reached the RDF store or remain safely queued for retry. A run that finds RDF disabled is recorded as unchanged, so it cannot make an old projection look rebuilt. Optional custom inference adds derived triples in separate graphs without changing the asserted projection.
Projection lifecycle
The projection moves through rebuild, ready, and degraded states. A rebuild creates or refreshes entity and relationship triples, while live writes keep the serving graph aligned with later SQL commits. Materialized inference is a separate refresh of derived graphs that depends on the current asserted graph and configured rules.
This diagram shows how SQL changes, rebuild work, live delivery, and optional inference reach the serving RDF dataset.
flowchart LR
SQL[SQL entities and relationships] --> Batch[Batch rebuild]
SQL --> Live[Post-commit live-write queue]
Batch --> Store[RDF storage boundary]
Live --> Store
Store --> Fuseki[Fuseki RDF dataset]
Fuseki --> Asserted[Asserted RDF graph]
Asserted --> Infer[Optional rule materialization]
Infer --> Derived[Derived RDF graphs]
Batch --> State[Run and health state]
Live --> State
Infer --> State
State --> API[RDF status and query APIs]
Batch rebuilds
The RDF index application reads selected entity types from SQL and translates each entity to RDF. The mapper excludes credentials, helper and audit values, embedded time-series results, and UI-only state from the graph. It still loads fields needed by dedicated structured mappers, so supported metadata is not lost when a generic context does not emit it. openmetadata-service/…/RdfIndexApp.java• L212-225, openmetadata-service/…/RdfIndexApp.java• L769-781, openmetadata-service/…/RdfBatchProcessor.java• L83-238, openmetadata-service/…/RdfIndexingFields.java• L24-35, and openmetadata-service/…/RdfPropertyMapper.java• L63-112
The index accepts supported repository-backed entity types by default, skips types excluded from RDF, and reports an empty supported selection instead of starting a meaningless run. Structured metadata and entity references become queryable RDF resources where the model supports them. openmetadata-service/…/RdfIndexApp.java• L212-225, openmetadata-service/…/RdfIndexApp.java• L769-781, and openmetadata-service/…/RdfPropertyMapper.java• L229-297
The normal batch path uses bounded producer and consumer work. Several readers can translate models in parallel, while storage writes pass through one ordered writer. Backpressure keeps translated work within a bounded memory and request budget. A failed entity batch is split to isolate bad records, while a storage circuit or write budget stops repeated attempts. Relationship failures are tracked separately, and relationship retries can isolate a failing source without marking every edge in the batch as failed. openmetadata-service/…/RdfIndexApp.java• L769-781, openmetadata-service/…/RdfBatchProcessor.java• L142-171, openmetadata-service/…/RdfBatchProcessor.java• L247-379, openmetadata-service/…/RdfBatchProcessor.java• L382-463, and openmetadata-service/…/RdfBulkSink.java• L32-51
Rebuilds that clear the serving graph mark the projection incomplete until the run finishes and restore the ontology graphs before indexing resumes. Each run records progress and failures as work completes. A new run removes old failure records on a best-effort basis, but a cleanup problem does not block indexing. A glossary-term incremental run also removes old term relations before adding current ones so stale predicates do not accumulate. openmetadata-service/…/RdfIndexApp.java• L244-258, openmetadata-service/…/RdfIndexApp.java• L466-492, and openmetadata-service/…/RdfIndexApp.java• L841-849
Entity mapping keeps direct entity predicates separate from relationship-managed edges. Reconciliation can remove stale direct values while preserving relationship and lineage data that other update paths own. Context arrays are combined before mapping so one logical field does not produce duplicate predicates. openmetadata-service/…/RdfPropertyMapper.java• L139-177, openmetadata-service/…/RdfPropertyMapper.java• L312-329, and openmetadata-service/…/RdfPropertyMapper.java• L354-399
References: openmetadata-service/…/RdfIndexApp.java• L212-225 openmetadata-service/…/RdfIndexApp.java• L244-258 openmetadata-service/…/RdfIndexApp.java• L466-492 openmetadata-service/…/RdfIndexApp.java• L769-781 openmetadata-service/…/RdfIndexApp.java• L841-849 openmetadata-service/…/RdfBatchProcessor.java• L83-238 openmetadata-service/…/RdfBatchProcessor.java• L247-463 openmetadata-service/…/RdfBulkSink.java• L32-51 openmetadata-service/…/RdfIndexingFields.java• L24-35 openmetadata-service/…/RdfPropertyMapper.java• L63-112 openmetadata-service/…/RdfPropertyMapper.java• L139-177 openmetadata-service/…/RdfPropertyMapper.java• L229-329 openmetadata-service/…/RdfPropertyMapper.java• L354-399
Distributed indexing
Large rebuilds use a SQL-backed coordinator to divide entity ranges into claimable partitions. Servers claim work, save progress after storage acknowledgement, and reclaim stale partitions after worker failure. The coordinator combines partition, entity, and server results into one job state. openmetadata-service/…/DistributedRdfIndexCoordinator.java• L83-235 and openmetadata-service/…/DistributedRdfIndexExecutor.java• L117-169
Each worker reads with a keyset cursor. Its saved cursor is the last acknowledged cursor rather than the last row read. A restart can therefore repeat unacknowledged work but does not skip it. openmetadata-service/…/RdfPartitionWorker.java• L79-169
References: openmetadata-service/…/DistributedRdfIndexCoordinator.java• L83-235 openmetadata-service/…/DistributedRdfIndexExecutor.java• L117-169 openmetadata-service/…/RdfPartitionWorker.java• L79-169
Live writes
Entity and relationship changes enter the live path after the surrounding SQL transaction commits. The command stores only the identity and operation needed to reload current metadata from SQL during replay. This prevents a delayed replay from restoring an obsolete entity snapshot. openmetadata-service/…/RdfUpdater.java• L84-152, openmetadata-service/…/RdfLiveWrite.java• L25-85, and openmetadata-service/…/RdfProjectionLoaders.java• L26-70
The command is stored in a shared SQL queue before delivery to RDF. One writer drains the queue in order across service nodes. Failed commands keep their retry state, while commands that exhaust their retry limit move to a dead-letter table and mark the projection degraded. A later full rebuild repairs the projection and clears dead letters covered by that repair. openmetadata-service/…/RdfLiveWriteStore.java• L24-49, openmetadata-service/…/RdfLiveWriteStore.java• L116-239, and openmetadata-service/…/RdfUpdater.java• L37-62
Entity fields and relationship-managed fields have separate ownership. An entity refresh replaces fields owned by the entity mapper without removing relationship or lineage edges. Relationship reconciliation removes only the edges owned by that relationship path. Glossary term relations use their typed path so a generic relation hook does not create a duplicate edge. openmetadata-service/…/RdfRepository.java• L491-517, openmetadata-service/…/RdfRepository.java• L516-649, and openmetadata-service/…/RdfUpdater.java• L104-129
References: openmetadata-service/…/RdfUpdater.java• L84-152 openmetadata-service/…/RdfLiveWrite.java• L25-85 openmetadata-service/…/RdfLiveWriteStore.java• L24-239 openmetadata-service/…/RdfProjectionLoaders.java• L26-70 openmetadata-service/…/RdfRepository.java• L491-649
Rebuild cutover
A blue-green rebuild writes to an idle dataset while the current dataset continues to serve reads and live writes. The system records live mutations in a durable journal, replays them into the built dataset, and changes the shared serving pointer only after the build catches up. openmetadata-service/…/RdfDatasetManager.java• L29-53, openmetadata-service/…/RdfDatasetManager.java• L83-201, and openmetadata-service/…/RdfRebuildStore.java• L166-193
Promotion checks ownership, lease health, graph contents, and the configured success threshold. It also creates a new serving generation and marks inference rules dirty because derived results belong to the previous serving graph. If a check fails, the old dataset keeps serving and the incomplete build remains available for inspection. An in-place rebuild marks the projection degraded before it clears the serving graph, while storage compaction after a successful in-place run remains best effort. openmetadata-service/…/RdfIndexApp.java• L612-717, openmetadata-service/…/RdfIndexApp.java• L719-766, and openmetadata-service/…/RdfRebuildStore.java• L268-305
The promotion gate refuses to activate a build when successful records fall below the configured minimum ratio or when successful records produce no triples. The default success ratio is 95 percent. The serving pointer stays unchanged when the gate rejects the build. openmetadata-service/…/RdfIndexApp.java• L612-677
References: openmetadata-service/…/RdfDatasetManager.java• L29-201 openmetadata-service/…/RdfRebuildStore.java• L166-193 openmetadata-service/…/RdfRebuildStore.java• L268-305 openmetadata-service/…/RdfIndexApp.java• L244-305 openmetadata-service/…/RdfIndexApp.java• L612-717
Run coordination and recovery
Run coordination uses SQL state that all service nodes can see. A reindex lock has an owner, a heartbeat, and an expiry of five minutes. It prevents a scheduled or on-demand run from rewriting the graph beside another run. The same lock also protects storage maintenance from running beside a reindex. openmetadata-service/…/RdfReindexRunLock.java• L19-27, openmetadata-service/…/RdfReindexRunLock.java• L45-77, and openmetadata-service/…/RdfInfraDAOs.java• L485-573
The index application acquires the lock before storage work, renews it while the run continues, and stops if renewal shows that another run took ownership. A blue-green rebuild renews a matching dataset lease and does not promote after lease loss. Scheduled RDF indexing also waits when a Search reindex is already scanning the same entity tables, while an on-demand run can proceed and records that contention. openmetadata-service/…/RdfIndexApp.java• L169-179, openmetadata-service/…/RdfIndexApp.java• L356-370, openmetadata-service/…/RdfIndexApp.java• L528-589, and openmetadata-service/…/RdfIndexApp.java• L377-417
Recovery does not mark a run failed only because its run record says it is still running. It checks the lock and waits past its expiry before ending the run. The shared background scheduler provides delayed recovery, live-write work, and inference lease renewal without allowing one slow RDF task to block all maintenance tasks. openmetadata-service/…/RdfIndexRunRecovery.java• L26-127, openmetadata-service/…/RdfBackgroundScheduler.java• L21-101, and openmetadata-service/…/InferenceRunLock.java• L24-99
Run failures are stored by job and stage. Operators can inspect entity, relationship, lineage, reader, partition, and server failures after a run instead of losing them when the worker exits. A failed serving-graph clear includes its root cause in the run message so operators can identify the storage error from the recorded result. openmetadata-service/…/RdfInfraDAOs.java• L617-737 and openmetadata-service/…/RdfReindexResource.java• L47-173
References: openmetadata-service/…/RdfReindexRunLock.java• L19-77 openmetadata-service/…/RdfInfraDAOs.java• L485-737 openmetadata-service/…/RdfIndexApp.java• L169-179 openmetadata-service/…/RdfIndexApp.java• L356-417 openmetadata-service/…/RdfIndexApp.java• L528-589 openmetadata-service/…/RdfIndexRunRecovery.java• L26-127 openmetadata-service/…/RdfBackgroundScheduler.java• L21-101 openmetadata-service/…/RdfRebuildStore.java• L240-305 openmetadata-service/…/InferenceRunLock.java• L24-99
Inference materialization
Materialized inference is the optional process that turns enabled custom CONSTRUCT rules into derived triples inside Fuseki. It does not run a reasoner in the service process. SQL stores the rule definitions and status, while Fuseki stores one named graph per rule under an inferred-graph namespace. openmetadata-service/…/RdfRepository.java• L1679-1686, openmetadata-service/…/InferenceRuleRepository.java• L33-70, and openmetadata-service/…/InferenceGraphStore.java• L18-44
Each materialization run clears the rule graphs and applies enabled rules in passes until no new triples appear. Rules can therefore read conclusions from earlier rules in the same run. The validator accepts only local, finite, monotone rule shapes so the process can reach a fixed point. A run that cannot converge fails or stops as superseded when its inputs change. openmetadata-service/…/InferenceMaterializer.java• L28-35, openmetadata-service/…/InferenceMaterializer.java• L122-196, and openmetadata-service/…/InferenceRuleValidator.java• L97-137
Materialized inference has its own cluster-wide lease. A rule edit marks the rule bundle dirty, and a dataset promotion marks the bundle dirty again because its source graph changed. The scheduled app reports a skipped run as a conflict rather than as a failed projection when another run owns the lease or newer input supersedes the run. openmetadata-service/…/InferenceRuleService.java• L25-75, openmetadata-service/…/InferenceRuleRepository.java• L137-150, and openmetadata-service/…/RdfInferenceApp.java• L61-132
References: openmetadata-service/…/RdfInferenceApp.java• L40-150 openmetadata-service/…/InferenceRuleRepository.java• L33-70 openmetadata-service/…/InferenceMaterializer.java• L28-196 openmetadata-service/…/InferenceRuleValidator.java• L97-137 openmetadata-service/…/InferenceRunLock.java• L24-99
Storage boundary
The storage boundary separates RDF projection work from the remote RDF server. The repository supplies entity, relationship, lineage, and query operations. The adapter owns transport, dataset access, request limits, time limits, and connection recovery. Decorators preserve the full storage contract while adding rebuild routing, inference invalidation, and asserted-graph tracking around the selected backend.
Storage adapters
openmetadata-service/…/RdfStorageInterface.java defines the contract for remote RDF storage. It covers entity and relationship writes, SPARQL operations, graph management, readiness, triple counts, maintenance and compaction, and optional dataset management. Backends can provide bulk and insert-only write paths, while the default contract keeps indexing behavior available when a backend lacks those optimizations. openmetadata-service/…/RdfStorageInterface.java• L25-87, openmetadata-service/…/RdfStorageInterface.java• L239-336, and openmetadata-service/…/RdfStorageFactory.java• L17-57
The repository adds policies around the adapter. Source-graph changes invalidate materialized inference. Writes are tracked so queries that require asserted data exclude inferred graphs. Rebuild views route writes either to the serving dataset or to the build target. The forwarding layer keeps optional backend capabilities available through these wrappers, while serving maintenance and rebuild writes use the manager's coordination rules. openmetadata-service/…/ForwardingRdfStorage.java• L25-189, openmetadata-service/…/InferenceInvalidatingRdfStorage.java• L26-135, openmetadata-service/…/AssertedGraphTrackingRdfStorage.java• L45-161, and openmetadata-service/…/RebuildingRdfStorage.java• L34-61
Inference invalidation is conservative when a write may have reached the store. A successful entity write marks rules dirty only when the entity graph changed, while a failed entity write marks them dirty because the remote result may be uncertain. Other successful source mutations mark the rule set dirty after the delegate completes. openmetadata-service/…/InferenceInvalidatingRdfStorage.java• L45-67, openmetadata-service/…/InferenceInvalidatingRdfStorage.java• L69-135
Asserted-graph tracking records the graphs affected by known writes. If a SPARQL update has targets that cannot be determined, it refreshes the graph list instead. It records this in a finally path because a failed or timed-out remote update may still have changed the store. openmetadata-service/…/AssertedGraphTrackingRdfStorage.java• L122-182
Rebuild routing sends serving mutations through the dataset manager so the manager can pause or journal them. Mutations sent to a build target go directly to that isolated dataset. The same boundary keeps maintenance from holding a database row lock during a long serving-dataset operation and limits Turtle inputs before they enter the journal. openmetadata-service/…/RebuildingRdfStorage.java• L55-61, openmetadata-service/…/RebuildingRdfStorage.java• L135-185
References: openmetadata-service/…/RdfStorageInterface.java• L25-87 openmetadata-service/…/RdfStorageInterface.java• L239-336 openmetadata-service/…/RdfStorageFactory.java• L17-57 openmetadata-service/…/ForwardingRdfStorage.java• L25-189 openmetadata-service/…/InferenceInvalidatingRdfStorage.java• L26-135 openmetadata-service/…/AssertedGraphTrackingRdfStorage.java• L45-182 openmetadata-service/…/RebuildingRdfStorage.java• L34-61 openmetadata-service/…/RebuildingRdfStorage.java• L135-185
RDF repository
The RDF repository is the service-facing boundary for projection writes and reads. It translates entities, applies bounded bulk work, writes relationship and lineage edges, serves graph views, and selects direct or inferred query paths. It also loads the shared ontology when the RDF feature starts and reloads it after a full store clear. openmetadata-service/…/RdfRepository.java• L185-220, openmetadata-service/…/RdfRepository.java• L412-446, and openmetadata-service/…/RdfGraphService.java• L29-114
Bulk work has both entity-count and payload-size bounds. Reconcile updates replace the fields owned by the mapper. Insert-only writes append data for a fresh build. Relationship and lineage batches use their own source and edge boundaries because their payload sizes and ownership rules differ. openmetadata-service/…/RdfRepository.java• L561-689, openmetadata-service/…/RdfRepository.java• L930-1089, and openmetadata-service/…/RdfRepository.java• L1332-1402
References: openmetadata-service/…/RdfRepository.java• L185-220 openmetadata-service/…/RdfRepository.java• L412-446 openmetadata-service/…/RdfRepository.java• L491-689 openmetadata-service/…/RdfGraphService.java• L29-114
SPARQL service
The SPARQL service is the common boundary for RDF reads and updates. It checks federation policy, validates the request form, selects a result format, and chooses direct data or supported materialized custom inference. Read requests accept read-only forms. Update requests are bounded before they reach the store and record an untracked write when the remote outcome is uncertain. openmetadata-service/…/RdfSparqlService.java• L33-85
User-authored query execution also passes through a shared runtime guard. The guard limits total work and work per principal, applies a deadline, cancels timed-out tasks, and returns the original runtime failure instead of disguising a system error as a query or resource error. openmetadata-service/…/SparqlQueryExecutionGuard.java• L29-43, openmetadata-service/…/SparqlQueryExecutionGuard.java• L66-135, and openmetadata-service/…/SparqlQueryExecutionGuard.java• L152-169
Queries at the default inference level read asserted data only when materialized inference is enabled. The query path names all known non-inferred graphs and refreshes that graph list after local writes or after a change whose targets cannot be known. This prevents derived graphs from leaking into direct graph, lineage, or agent results. openmetadata-service/…/AssertedOnlyQueries.java• L26-107, openmetadata-service/…/AssertedGraphTrackingRdfStorage.java• L112-182, and openmetadata-service/…/RdfRepository.java• L1661-1677
Shared limits bound query text, rows, execution time, and response bytes. Graph results use a shared serializer. When an RDF 1.2 triple term cannot be represented by the requested format, the service returns a caller input error instead of reporting a healthy store as a server failure. openmetadata-service/…/RdfSparqlService.java• L58-137, openmetadata-service/…/RdfGraphSerializer.java• L25-79, and openmetadata-service/…/UnsupportedRdfSerializationException.java• L16-27
References: openmetadata-service/…/RdfSparqlService.java• L33-137 openmetadata-service/…/SparqlQueryExecutionGuard.java• L29-169 openmetadata-service/…/AssertedOnlyQueries.java• L26-107 openmetadata-service/…/AssertedGraphTrackingRdfStorage.java• L112-182 openmetadata-service/…/RdfGraphSerializer.java• L25-79 openmetadata-service/…/UnsupportedRdfSerializationException.java• L16-27
SQL-to-SPARQL translation
The SQL-to-SPARQL service gives clients a relational query view over the RDF projection. It parses supported SQL, maps table and field names to RDF classes and properties, validates the generated SPARQL, and sends it through the RDF storage boundary. openmetadata-service/…/SqlToSparqlService.java• L12-75
The mapping context is the contract between SQL names and the ontology. Its mappings cover core metadata entities, relationships, lineage, and structured fields. The query builder uses those mappings to create RDF patterns for projections, joins, filters, ordering, limits, and nested fields. openmetadata-service/…/SqlMappingContext.java• L13-131 and openmetadata-service/…/SparqlBuilder.java• L43-121
The builder accepts the supported SQL forms and turns mapped identifiers into RDF patterns. Unknown tables or projected fields fail translation rather than silently querying a different RDF term. Nested paths are resolved through the mapping context, so an unknown nested field also fails instead of producing a partial path. openmetadata-service/…/SparqlBuilder.java• L137-191 and openmetadata-service/…/SparqlBuilder.java• L253-335
References: openmetadata-service/…/SqlToSparqlService.java• L12-75 openmetadata-service/…/SqlMappingContext.java• L13-131 openmetadata-service/…/SparqlBuilder.java• L43-121 openmetadata-service/…/SparqlBuilder.java• L137-191 openmetadata-service/…/SparqlBuilder.java• L253-335
Fuseki store
The primary adapter is openmetadata-service/…/JenaFusekiStorage.java. It connects to a remote Apache Jena Fuseki dataset and provides the RDF store used by all service nodes. It loads the OpenMetadata ontology when needed and checks the dataset before an index run starts. openmetadata-service/…/JenaFusekiStorage.java• L169-225 and openmetadata-service/…/JenaFusekiStorage.java• L717-744
Readiness checks more than network access. The adapter verifies a usable dataset endpoint, negotiates server write capabilities, and checks that SPARQL updates can write data that graph-less reads can see. The optional server extension can advertise query, update, deadline, and upload limits. Missing optional guarantees produce warnings while client limits remain active. Low disk is reported as a held-back write condition so queued work can wait rather than treat the store as corrupt. openmetadata-service/…/JenaFusekiStorage.java• L279-355, openmetadata-service/…/JenaFusekiStorage.java• L374-405, and openmetadata-service/…/FusekiWriteCapabilities.java• L25-107
Writes use bounded payloads and one write permit per storage handle. Reconcile writes replace mapper-owned RDF fields while preserving relationship-managed fields. Insert-only writes append data to a fresh rebuild dataset through a bounded RDF upload path. Short failures retry, while repeated connection, timeout, or gateway failures open a circuit that stops new traffic for a cooldown period. openmetadata-service/…/JenaFusekiStorage.java• L746-853, openmetadata-service/…/JenaFusekiStorage.java• L1031-1229, and openmetadata-service/…/JenaFusekiStorage.java• L1303-1349
Maintenance updates use a separate time budget from ordinary writes. When Fuseki drops the connection before answering an idempotent maintenance update, the adapter sends it once more within the remaining budget. It does not resend after a timeout because the remote operation may still be running. openmetadata-service/…/JenaFusekiStorage.java• L1641-1689
The adapter can create, remove, inspect, and switch between named datasets for blue-green rebuilds. A switch replaces the connection target and clears negotiated capabilities so readiness is checked for the new dataset. It also exposes remote heap information when the server provides it. openmetadata-service/…/JenaFusekiStorage.java• L606-715 and openmetadata-service/…/JenaFusekiStorage.java• L1241-1284
Physical storage cleanup is best effort. Fuseki TDB2 can reclaim space after logical deletes through compaction, but a compaction failure does not invalidate an otherwise valid projection. Maintenance uses a separate time budget from request writes. openmetadata-service/…/JenaFusekiStorage.java• L1636-1648 and openmetadata-service/…/JenaFusekiStorage.java• L1804-1833
References: openmetadata-service/…/JenaFusekiStorage.java• L169-225 openmetadata-service/…/JenaFusekiStorage.java• L279-405 openmetadata-service/…/JenaFusekiStorage.java• L606-715 openmetadata-service/…/JenaFusekiStorage.java• L717-744 openmetadata-service/…/JenaFusekiStorage.java• L746-853 openmetadata-service/…/JenaFusekiStorage.java• L1031-1229 openmetadata-service/…/JenaFusekiStorage.java• L1303-1349 openmetadata-service/…/JenaFusekiStorage.java• L1636-1648 openmetadata-service/…/JenaFusekiStorage.java• L1641-1689 openmetadata-service/…/JenaFusekiStorage.java• L1804-1833 openmetadata-service/…/FusekiWriteCapabilities.java• L25-107
Dataset identities
The system uses one configured dataset plus fixed alternates. A blue-green run clears and seeds an idle alternate, then switches a SQL routing pointer instead of changing every caller. Fixed names keep the number of Fuseki datasets bounded across repeated rebuilds. Each promotion also changes the serving generation so downstream results can detect that they were computed from an older dataset. openmetadata-service/…/RdfDatasetNames.java• L19-55, openmetadata-service/…/RdfRebuildStore.java• L52-95, and openmetadata-service/…/RdfInfraDAOs.java• L576-615
References: openmetadata-service/…/RdfDatasetNames.java• L19-55 openmetadata-service/…/RdfDatasetManager.java• L63-95 openmetadata-service/…/RdfRebuildStore.java• L52-95 openmetadata-service/…/RdfInfraDAOs.java• L576-615
Health and operations
Health combines persisted run state with runtime delivery state. This prevents a successful historical run from hiding a current live-write backlog, a dead-lettered mutation, an unavailable store, or stale materialized inference.
Projection states
The status API reports DISABLED, REBUILDING, READY, or DEGRADED. The resolver ignores runs marked as having left the projection unchanged, such as runs that found RDF disabled or ended before indexing, and uses the newest run that touched the graph. It then changes READY to DEGRADED when shared health data shows unrepaired failures or excessive live-write lag. openmetadata-service/…/RdfProjectionStateResolver.java• L57-105, openmetadata-service/…/RdfResource.java• L318-352, and openmetadata-service/…/RdfIndexApp.java• L176-184
The health record tracks a failure version and a repaired version. A complete rebuild marks the failure version repaired, and the live-write store removes dead letters covered by that repair. Local failures remain pending until shared SQL health storage is available. openmetadata-service/…/RdfProjectionHealth.java• L18-90 and openmetadata-service/…/RdfLiveWriteStore.java• L206-263
Reasoning results use a separate freshness check. A result is current only when its dataset generation, live-write watermark, ontology digest, and rule bundle digest still match the serving state. A degraded projection makes the result freshness unknown rather than current. openmetadata-service/…/ReasoningFreshness.java• L21-51
References: openmetadata-service/…/RdfProjectionStateResolver.java• L29-105 openmetadata-service/…/RdfResource.java• L318-352 openmetadata-service/…/RdfProjectionHealth.java• L18-90 openmetadata-service/…/RdfLiveWriteStore.java• L206-263 openmetadata-service/…/ReasoningFreshness.java• L21-51 openmetadata-service/…/RdfIndexApp.java• L176-184
Readiness checks
Readiness is a service-level gate for indexing and query use. It combines RDF repository availability with the Fuseki dataset checks, so a reachable HTTP endpoint is not treated as a usable projection store. openmetadata-service/…/RdfRepository.java• L473-489 and openmetadata-service/…/JenaFusekiStorage.java• L279-355
The graph view and agent query paths also use projection state as a stability check. They reject work while the projection is rebuilding or degraded rather than returning data whose completeness is unknown. openmetadata-service/…/AgentSparqlService.java• L27-79
References: openmetadata-service/…/RdfRepository.java• L473-489 openmetadata-service/…/JenaFusekiStorage.java• L279-355 openmetadata-service/…/AgentSparqlService.java• L27-79
Agent SPARQL access
The agent SPARQL path provides automation with a bounded read view of the server-selected RDF projection. It accepts authenticated SELECT queries only and checks that the projection is READY before execution and again before returning results. openmetadata-service/…/AgentSparqlService.java• L27-107
The path rejects dataset selection, named graph access, federation, updates, and unsafe extensions. A query without an explicit limit uses a server row limit and reports whether the result was truncated. Stable error codes and one audit event keep caller identity, execution identity, outcome, row count, and duration visible without logging query text. openmetadata-service/…/AgentSparqlQueryValidator.java• L25-104, openmetadata-service/…/AgentSparqlQueryInspector.java• L60-204, and openmetadata-service/…/AgentSparqlAudit.java• L20-65
References: openmetadata-service/…/AgentSparqlService.java• L50-107 openmetadata-service/…/AgentSparqlQueryValidator.java• L25-104 openmetadata-service/…/AgentSparqlQueryInspector.java• L60-204 openmetadata-service/…/AgentSparqlAudit.java• L20-65
Failure reporting
Index runs expose progress and failures at entity, relationship, reader, partition, and server levels. The admin-only failure endpoint returns records from a run and supports filters for RDF-indexable entity types. openmetadata-service/…/RdfReindexResource.java• L47-173
Inference runs report processed, failed, and skipped rule work separately from the main index run. A skipped inference run means another run owns the lease or newer inputs superseded it; it does not mean that the asserted projection failed. openmetadata-service/…/RdfInferenceApp.java• L106-132 and openmetadata-service/…/InferenceMaterializer.java• L170-183
References: openmetadata-service/…/RdfReindexResource.java• L47-173 openmetadata-service/…/RdfInfraDAOs.java• L617-737 openmetadata-service/…/RdfInferenceApp.java• L106-132 openmetadata-service/…/InferenceMaterializer.java• L170-183
RDF validation
RDF validation checks a bounded entity graph or the full graph against SHACL. Entity validation uses a DESCRIBE scope. Full-graph validation checks the triple count before fetching data and rejects a graph that is too large for the in-memory validation limit. openmetadata-service/…/RdfValidationService.java• L28-127
Validation reports use the same RDF serialization boundary as graph results. This keeps report formats consistent and rejects a format that cannot represent RDF 1.2 triple terms as a caller error. openmetadata-service/…/RdfValidationService.java• L145-173, openmetadata-service/…/RdfGraphSerializer.java• L39-79, and openmetadata-service/…/UnsupportedRdfSerializationException.java• L21-27
References: openmetadata-service/…/RdfValidationService.java• L28-173 openmetadata-service/…/RdfGraphSerializer.java• L39-79 openmetadata-service/…/UnsupportedRdfSerializationException.java• L21-27
Ontology exports
Glossary ontology export builds a temporary RDF model from a glossary, its terms, relationships, axioms, configured namespaces, and the latest stored ontology annex. It preserves the authored distinction between SKOS concepts and OWL classes, emits term realizations and attributes, and returns a caller-selected RDF graph format. openmetadata-service/…/GlossaryOntologyExporter.java• L44-99, openmetadata-service/…/GlossaryOntologyModelBuilder.java• L47-75, and openmetadata-service/…/GlossaryTermProjection.java• L39-105
The class IRI rule keeps a term's record IRI separate from its authored OWL class IRI. The live metadata projection continues to address the record by its entity IRI, while ontology axioms use the authored class IRI when one exists. RDF declarations keep each custom IRI in one OWL 2 role. openmetadata-service/…/GlossaryTermClassIri.java• L20-42 and openmetadata-service/…/OwlEntityDeclarations.java• L27-95
Ontology import parses external OWL or SKOS into glossary records, preserves supported relations and data attributes, and stores unmatched source statements in the ontology annex. When RDF is enabled, normal post-commit hooks mirror the created glossary records into the projection. openmetadata-service/…/GlossaryRdfImporter.java• L90-109, openmetadata-service/…/GlossaryRdfImporter.java• L194-234, and openmetadata-service/…/GlossaryRdfImporter.java• L246-294
References: openmetadata-service/…/GlossaryOntologyExporter.java• L44-99 openmetadata-service/…/GlossaryOntologyModelBuilder.java• L47-75 openmetadata-service/…/GlossaryTermProjection.java• L39-105 openmetadata-service/…/GlossaryTermClassIri.java• L20-42 openmetadata-service/…/OwlEntityDeclarations.java• L27-95 openmetadata-service/…/GlossaryRdfImporter.java• L90-109 openmetadata-service/…/GlossaryRdfImporter.java• L194-234 openmetadata-service/…/GlossaryRdfImporter.java• L246-294
Native ontology imports
Native ontology import provides a bounded preview path for RDF that represents ontology definitions directly. It parses Turtle, RDF/XML, N-Triples, or JSON-LD without loading external documents or named graphs, then converts supported concepts, properties, and axioms into a change set against the current ontology working snapshot. openmetadata-service/…/OntologyResource.java• L272-297, openmetadata-service/…/SafeRdfModelParser.java• L18-72, and openmetadata-service/…/NativeOntologyRdfImporter.java• L55-63
Before definitions are read, the source is normalized to a deterministic view. Imports are removed, text values use one preferred language, and repeated single-value fields use a stable first value. The reader then maps the supported OWL, RDFS, and SKOS definitions and axioms into the native ontology model. Statements outside that model are skipped and counted in the import report, while malformed expressions still fail the read. openmetadata-service/…/RdfSourceNormalizer.java• L22-65, openmetadata-service/…/RdfSourceNormalizer.java• L67-161, and openmetadata-service/…/NativeOntologyRdfReader.java• L47-111
The preview protects the service with input, triple-count, and parse-time limits. It requires absolute identifiers, rejects RDF/XML DOCTYPE declarations and named graphs, and rejects unsupported statements instead of silently dropping them. The reconciler matches existing definitions by IRI, keeps stable generated names for new definitions, detects duplicate or conflicting names, and limits one change set to 1,000 operations. openmetadata-service/…/SafeRdfModelParser.java• L20-79 and openmetadata-service/…/NativeOntologyRdfImporter.java• L61-181, openmetadata-service/…/NativeOntologyRdfImporter.java• L363-375
The native path creates ontology draft operations rather than writing directly to Fuseki. A later accepted change set follows the normal ontology write path, so the usual post-commit RDF update keeps the projection aligned with the SQL definitions. openmetadata-service/…/OntologyResource.java• L272-297 and openmetadata-service/…/NativeOntologyRdfImporter.java• L87-180
References: openmetadata-service/…/OntologyResource.java• L272-297 openmetadata-service/…/SafeRdfModelParser.java• L18-79 openmetadata-service/…/RdfSourceNormalizer.java• L22-161 openmetadata-service/…/NativeOntologyRdfReader.java• L47-111 openmetadata-service/…/NativeOntologyRdfReader.java• L229-377 openmetadata-service/…/NativeOntologyRdfImporter.java• L55-181 openmetadata-service/…/NativeOntologyRdfImporter.java• L363-375
Change checklist
When these files or sections are changed, remember to consider these:
- When an entity field changes, classify it as graph data, non-graph data, or dedicated structured data. Keep the repository load fields and mapper behavior aligned so sensitive values stay out and supported metadata does not disappear.
- When an entity or relationship predicate changes, update batch reconciliation, live add/remove paths, and stale-predicate cleanup together.
- When the storage contract changes, check the Fuseki adapter, forwarding decorators, rebuild wrapper, inference invalidation wrapper, asserted-graph tracking, repository batching, and single-writer sink together.
- When asserted-graph tracking changes, keep known target detection, unknown-target graph refresh, failed-update handling, graph-load handling, and asserted-only query cache invalidation aligned.
- When Fuseki readiness rules change, keep endpoint checks, dataset registration evidence, write-method checks, capability warnings, low-disk handling, and the graph-visibility probe aligned.
- When Fuseki advertises or removes server write limits, keep the negotiated upload budget, client deadline, append transport, payload guard, and retry behavior consistent.
- When maintenance update handling changes, keep the idempotent-clear rule, dropped-connection detection, remaining maintenance budget, and no-resend-after-timeout behavior aligned.
- When dataset naming or promotion changes, keep the SQL active-dataset pointer, serving generation, rebuild journal, fixed alternate names, dataset routing, inference dirty versions, and recovery ownership consistent.
- When run coordination changes, keep reindex and inference lock expiry, heartbeats, recovery delay, run records, distributed partition claims, Search reindex admission, maintenance locking, and lock-loss stop behavior aligned.
- When rebuild promotion changes, keep the triple-count check, success-ratio threshold, old-dataset fallback, build inspection state, and in-place degraded marker aligned.
- When request limits or timeouts change, review entity chunking, lineage chunking, serialized-payload guards, query output bounds, retry limits, and the worker acknowledgement point.
- When graph serialization changes, keep SPARQL query results, validation reports, ontology exports, media types, and RDF 1.2 triple-term errors aligned.
- When ontology annex or glossary export behavior changes, keep annex revisions, configured IRIs and prefixes, term class IRIs, relationship predicates, realizations, and ontology-scoped query rules consistent.
- When native ontology import changes, keep parser limits, accepted RDF formats, source normalization, language choice, single-value selection, absolute-IRI and named-graph rules, supported statement handling, skip reporting, change-set matching, name conflict checks, and the normal ontology commit path aligned.
- When SQL-to-SPARQL mappings change, keep SQL table and field names, RDF classes and properties, nested paths, prefixes, supported builder forms, and generated query validation aligned.
- When inference rule validation or materialization changes, keep rule dirty versions, inferred graph naming, fixed-point limits, asserted-only query filtering, lease handling, and dataset-generation changes aligned.
- When live-write payloads change, keep SQL reload behavior, delete handling, lineage detail loading, queue ordering, dead-letter repair, and freshness watermarks aligned.
- When run states or health rules change, keep app run records, projection status, shared health versions, dead-letter repair, readiness gates, reasoning freshness, and status API output aligned.
- When user-authored SPARQL execution changes, keep admission limits, per-principal limits, timeout cancellation, permit release, runtime-error propagation, and the service's query error mapping aligned.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Fuseki is unreachable or returns repeated connect, timeout, 502, 503, or 504 errors | Writes retry and then the storage circuit opens. Live commands remain queued or become dead letters, and the projection becomes degraded | Readiness checks, bounded retries, circuit breaking, durable queue state, and shared health versions |
| The endpoint returns success but does not identify a registered Fuseki dataset | Indexing targets a non-dataset endpoint and fails before work starts | Dataset registration evidence from the endpoint check and capability negotiation |
| Fuseki does not allow SPARQL updates or does not expose usable write methods | Append writes and graph-visibility probes cannot establish a usable projection store | Write capability checks and the update-and-read readiness probe |
| Fuseki does not enable union visibility for the named knowledge graph | Graph-less reads cannot see indexed triples stored in the named graph | A temporary write-and-query probe during readiness checks |
| Fuseki reports low disk before a write | New writes wait or fail as a storage condition instead of being counted as ordinary remote failures | Storage-guard classification, durable live queue, and operator disk recovery |
| A field that contains credentials or non-graph data is added to the indexable field set | Sensitive or non-useful values become queryable RDF, or a later mapper change exposes them by default | Keep non-graph field exclusions and indexable-field selection aligned with the mapper contract |
| A scheduled RDF run meets an active Search reindex | The RDF run waits and may end as stopped without indexing | Search reindex admission guard; on-demand runs can override with contention logged |
| A second RDF run or storage maintenance starts while the reindex lock is held | The new work is skipped instead of clearing or compacting data beside an active writer | Shared SQL lock with owner details, a five-minute expiry, heartbeat renewal, and guarded release |
| The RDF reindex lock or blue-green dataset lease is lost | The run stops or fails instead of writing beside another owner | Heartbeat renewal, lease checks, and promotion ownership checks |
| A bulk RDF request exceeds the real serialized payload limit | The storage request fails or times out, delaying a whole batch | Count and byte budgets, post-serialization guards, bisection, and bounded batch isolation |
| A rebuild lease expires or its mutation journal reaches its limit | The rebuild cannot safely continue or promote | Heartbeats, journal limits, persisted ownership, and abort without changing the serving pointer |
| A source write fails after it may have reached Fuseki | Materialized inference can remain based on old source data unless it is refreshed | Conservative dirty marking for uncertain writes and later rule materialization |
| A SPARQL update targets an unknown graph set or fails after partial application | Asserted-only queries can use stale graph knowledge | finally-path graph tracking and full graph relisting when targets cannot be resolved |
| A blue-green build has too few triples or falls below the success threshold | The new dataset is not activated, and the previous dataset continues to serve | Triple-count validation and promotion success-ratio checks |
| A worker stops after reading but before storage acknowledgement | The partition repeats work from an earlier cursor position | Cursors advance only after acknowledgement, and stale claims are reclaimed |
| Live delivery exhausts its retry limit | The command leaves the queue and the RDF projection misses a committed change | Dead-letter retention, degraded health, and repair by a later full rebuild |
| An in-place rebuild clears the serving graph and stops before completion | The serving projection remains incomplete until a full rebuild repairs it | Degraded status before the clear and no automatic success mark after an interrupted run |
| Fuseki drops the connection before answering a maintenance clear | The clear may be reported as failed even though the server did not confirm its result | Resend only for EOF or socket-drop errors and only within the remaining maintenance budget; do not resend after a timeout |
| A full-graph validation request exceeds the in-memory graph limit | Validation is rejected instead of loading an unsafe amount of RDF | Triple-count precheck and bounded entity-scoped validation |
| A graph contains RDF 1.2 triple terms and the caller requests JSON-LD | Serialization is rejected as invalid caller input rather than returning a misleading or partial graph | Format capability check before serialization and a stable unsupported-format error |
| An agent query uses a forbidden form, exceeds a query or result bound, or runs while the projection is not ready | The request is rejected with a stable error and no incomplete agent result is returned | Parsed-query inspection, shared limits, readiness checks before and after execution, and bounded result mapping |
| A SQL query names an unmapped table, projected field, or nested field | SQL-to-SPARQL translation fails and the RDF query is not sent to the store | Shared table and field mappings plus generated-query validation |
Native RDF exceeds the input, triple, or parse-time budget, or contains a named graph, relative identifier, or RDF/XML DOCTYPE | The preview is rejected before it can create ontology operations | Bounded parsing, absolute-IRI checks, named-graph rejection, and XML entity protection |
| Native RDF contains an unsupported statement, duplicate definition IRI, conflicting name, or more than 1,000 changes | The preview fails instead of producing a partial or ambiguous ontology change set | Deterministic source normalization, full statement accounting, skip reporting, deterministic names, conflict checks, and the change-set size limit |
| A materialized inference rule is invalid, non-monotone, or uses a forbidden external service | The rule is rejected or disabled, and no unsafe derived graph is produced | Strict rule validation and stored disable reasons |
| Inference inputs change during materialization or a run loses its lease | The run stops without marking newer inputs clean, and derived results remain dirty for a later run | Dirty versions, fixed-point pass limits, lease renewal, and conflict-style skipped status |
| A direct query runs with materialized inference enabled without an explicit dataset | Inferred triples can appear in a query that expects asserted data only | Asserted graph discovery, inferred-graph prefix filtering, and write-triggered cache invalidation |
| A result was computed before a dataset promotion, live-write watermark advance, or rule change | Reasoning output is reported stale or unknown instead of current | Serving generation, live-write watermark, ontology digest, rule digest, and degraded-health checks |
| A glossary term has an authored class IRI that is treated as its record IRI | Live updates or deletes address the wrong RDF subject | One class-IRI rule and separate entity-IRI record addressing |
| User-authored SPARQL exceeds global or per-principal capacity | The request is rejected before execution, or one principal cannot consume the whole query budget | Shared admission permits with separate total and principal limits |
| User-authored SPARQL exceeds its execution deadline | The caller receives a timeout and the worker is cancelled instead of running without a bound | Timed future execution, cancellation, and permit release |
A worker raises a runtime Error during SPARQL execution | A classpath or system failure is reported as a misleading query-level failure if it is wrapped | Preserve Error causes and rethrow them outside query exception mapping |
Key files
| File | Why to read it |
|---|---|
| openmetadata-service/…/RdfIndexApp.java | Main rebuild lifecycle, run admission, unchanged-projection reporting, Search contention handling, blue-green promotion, status updates, ontology reload, and cleanup |
| openmetadata-service/…/RdfInferenceApp.java | Scheduled inference materialization lifecycle and run reporting |
| openmetadata-service/…/RdfBatchProcessor.java | Entity, relationship, lineage, batch isolation, and failure-record behavior |
| openmetadata-service/…/RdfReindexRunLock.java | Shared run and maintenance lock ownership, expiry, renewal, and release |
| openmetadata-service/…/RdfBulkSink.java | Single-writer storage flow and backpressure model |
| openmetadata-service/…/DistributedRdfIndexCoordinator.java | Shared job, partition, claim, retry, and result aggregation model |
| openmetadata-service/…/RdfPartitionWorker.java | Acknowledged cursors and partition restart behavior |
| openmetadata-service/…/RdfIndexRunRecovery.java | Startup recovery and lock-based detection of stopped runs |
| openmetadata-service/…/RdfUpdater.java | Post-commit live-write entry points, relationship filtering, and untracked-write watermarks |
| openmetadata-service/…/RdfLiveWrite.java | Replayable live operation types and SQL-backed entity reload behavior |
| openmetadata-service/…/RdfLiveWriteStore.java | Durable queue, retry, dead-letter, and shared health behavior |
| openmetadata-service/…/RdfProjectionLoaders.java | Current SQL reloads used by delayed live-write replay |
| openmetadata-service/…/RdfDatasetManager.java | Rebuild journal replay and serving-dataset cutover |
| openmetadata-service/…/RdfRebuildStore.java | Dataset leases, journal fences, generations, and promotion pointer |
| openmetadata-service/…/RdfInfraDAOs.java | Shared locks, failure records, dataset pointer, health-related state, and ontology annex persistence |
| openmetadata-service/…/RdfRepository.java | Service boundary for translation, bulk writes, relationships, lineage, graph reads, inference paths, and dataset routing |
| openmetadata-service/…/RdfIndexingFields.java | Entity field selection that protects structured RDF mapping and excludes non-graph fields |
| openmetadata-service/…/RdfPropertyMapper.java | Entity-to-RDF field rules, structured properties, direct predicate ownership, and graph-safe exclusions |
| openmetadata-service/…/RdfStorageInterface.java | Remote storage contract, bulk modes, maintenance, readiness, and dataset capabilities |
| openmetadata-service/…/ForwardingRdfStorage.java | Complete capability forwarding used by storage decorators |
| openmetadata-service/…/InferenceInvalidatingRdfStorage.java | Source-write uncertainty and inference dirty-state policy |
| openmetadata-service/…/AssertedGraphTrackingRdfStorage.java | Asserted graph tracking after known and uncertain writes |
| openmetadata-service/…/RebuildingRdfStorage.java | Serving-write journaling and build-dataset routing |
| openmetadata-service/…/JenaFusekiStorage.java | Fuseki connection, write transport, readiness, maintenance resend, limits, retries, compaction, dataset switching, and circuit breaking |
| openmetadata-service/…/SparqlQueryExecutionGuard.java | Bounded admission, timeout handling, permit release, and runtime-error propagation for user-authored SPARQL |
| openmetadata-service/…/AssertedOnlyQueries.java | Separation of asserted reads from materialized inferred graphs |
| openmetadata-service/…/InferenceRuleRepository.java | Durable rule definitions, dirty state, inferred graph identities, and materialization results |
| openmetadata-service/…/InferenceMaterializer.java | Fixed-point inference run, lease handling, convergence, and failure semantics |
| openmetadata-service/…/InferenceRuleValidator.java | Accepted rule shape and safety limits for server-side materialization |
| openmetadata-service/…/ReasoningFreshness.java | Freshness contract for results derived from the RDF serving state |
| openmetadata-service/…/RdfProjectionStateResolver.java | Mapping of projecting runs and runtime health to projection state, including runs that did not touch the graph |
| openmetadata-service/…/RdfValidationService.java | Bounded entity and full-graph SHACL validation flow |
| openmetadata-service/…/RdfGraphSerializer.java | Common RDF output boundary and unsupported-format handling |
| openmetadata-service/…/GlossaryOntologyExporter.java | Glossary-to-ontology materialization and export flow |
| openmetadata-service/…/GlossaryRdfImporter.java | External ontology import into glossary records and annex preservation |
| openmetadata-service/…/NativeOntologyRdfImporter.java | Native RDF preview reconciliation into ontology change-set operations |
| openmetadata-service/…/RdfSourceNormalizer.java | Deterministic narrowing of source RDF before native ontology reading |
| openmetadata-service/…/NativeOntologyRdfReader.java | Supported ontology definitions, axioms, and skip reporting read from normalized RDF |
| openmetadata-service/…/SafeRdfModelParser.java | Bounded native RDF parsing and input safety rules |
| openmetadata-service/…/SparqlBuilder.java | Mapping of supported SQL AST forms to RDF query patterns |