> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open-metadata.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable Ontology & Knowledge Graph | OpenMetadata

> What works out of the box, what needs a triple store, and the full configuration surface for RDF, inference, SHACL, federation, and the optional AI-assisted ontology flows.

# Enabling Ontology & Knowledge Graph

Ontology and the knowledge graph are two different things with two different requirements. Knowing which is which saves a lot of unnecessary infrastructure.

## What Works with No Extra Infrastructure

The **ontology** is stored relationally. Everything below works on a stock OpenMetadata deployment:

* The **Ontology Explorer** — graph, filters, and the Model and Data views
* Ontology authoring through the API — concepts, typed relations, attributes, constraints, mappings, and releases
* **Relationship type** management
* **Ontology Library** pack installation
* Ontology **import and export** (OWL, Turtle, N-Triples, JSON-LD, SKOS, CSV)
* **Glossary-scoped SPARQL** (`POST /api/v1/glossaries/{id}/sparql`)
* The `ontology_describe` MCP tool

## What Needs the RDF Triple Store

* The standalone **SPARQL Playground**
* The **Knowledge Graph** tab on tables
* Catalog-wide SPARQL, graph exploration, and graph export
* **Inference** and **SHACL validation** over the catalog
* **Graph insights** — importance, centrality, communities, paths, recommendations, tag analytics
* The `sparql_query`, `entity_neighborhood`, `find_by_tag`, and `shacl_validate` **MCP tools**
* **Linked Open Data** IRI dereferencing

## What Needs an LLM Provider

* The `/api/v1/ontology/ai` relationship, mapping, SPARQL, and domain-draft proposals

Requires `RDF_AI_ENABLED=true` (the older name `RDF_ASK_COLLATE_ENABLED` still works) **and** LLM features turned on (`LLM_ENABLED=true`) with a provider set in `LLM_PROVIDER` (`openai`, `azureOpenAI`, `bedrock`, `google`, or `anthropic`).

## Turning on RDF

> [!WARNING]
>
> The RDF knowledge graph is **Beta** and **disabled by default**. Turning it on for a large existing catalog adds meaningful load while the initial index runs. Test in a non-production environment first and schedule the initial index for a low-traffic window.

Full deployment instructions — Docker, Kubernetes, Helm, sizing, and troubleshooting — are in [Enable RDF (Knowledge Graph)](https://docs.open-metadata.org/v2.1.x/deployment/rdf-knowledge-graph.md). The short version:

**1. Run Apache Jena Fuseki**

Reachable from the OpenMetadata server. The repository ships one at `docker/rdf-store`.

**2. Set the environment variables on both containers**

The **migrations container** loads the ontology and shapes graphs and registers `RdfIndexApp`; the **server container** does everything else. If only one has RDF configured, installation fails with `RdfRepository not initialized`.

```bash theme={null}
RDF_ENABLED=true
RDF_STORAGE_TYPE=FUSEKI
RDF_ENDPOINT=http://fuseki:3030/openmetadata
RDF_DATASET=openmetadata
RDF_REMOTE_USERNAME=admin
RDF_REMOTE_PASSWORD=<password>
RDF_BASE_URI=https://open-metadata.org/
```

**3. Run the initial index**

**Settings → Applications → RDF Knowledge Graph Indexing → Run Now**, or:

```bash theme={null}
curl -X POST "$OM_HOST/api/v1/apps/trigger/RdfIndexApp" -H "Authorization: Bearer $TOKEN"
```

**4. Verify**

```bash theme={null}
curl "$OM_HOST/api/v1/rdf/status" -H "Authorization: Bearer $TOKEN"
```

Expect `enabled: true` and `projectionState: READY`. `REBUILDING` means the index is still running; `DEGRADED` means something needs attention.

### Trying It Locally

The repository ships a startup script that brings up the whole stack with RDF and Fuseki enabled:

```bash theme={null}
./docker/run_local_docker_rdf.sh -m ui -d mysql -f true
```

It sets sensible development defaults, including materialized inference.

## Configuration Reference

All settings live under `rdf:` in `openmetadata.yaml` and are overridable by environment variable.

### Core

| Variable | Default | Purpose |
| - | - | - |
| `RDF_ENABLED` | `false` | Master switch. Every RDF code path is a no-op until true. |
| `RDF_STORAGE_TYPE` | `FUSEKI` | Backend. `QLEVER` is defined in the schema but **not implemented** — setting it fails at startup. |
| `RDF_ENDPOINT` | `http://localhost:3030/openmetadata` | Full URL ending in the dataset name. `RDF_REMOTE_ENDPOINT` is a deprecated fallback. |
| `RDF_DATASET` | `openmetadata` | Dataset name. Must match the path segment in `RDF_ENDPOINT`. |
| `RDF_REMOTE_USERNAME` / `RDF_REMOTE_PASSWORD` | `admin` / `admin` | Basic-auth credentials. |
| `RDF_BASE_URI` | `https://open-metadata.org/` | Base URI for minted resource IRIs. |

### Connection and Write Tuning

| Variable | Default | Purpose |
| - | - | - |
| `RDF_CONNECT_TIMEOUT_MS` | `2000` | Connection timeout. |
| `RDF_REQUEST_TIMEOUT_MS` | `60000` | Per-request timeout. |
| `RDF_WRITE_MAX_RETRIES` | `2` | Retries for idempotent writes after the first attempt. |
| `RDF_WRITE_RETRY_INITIAL_BACKOFF_MS` | `250` | Initial retry backoff. |
| `RDF_WRITE_RETRY_MAX_BACKOFF_MS` | `2000` | Maximum retry backoff. |
| `RDF_BULK_ENTITY_BATCH_SIZE` | `100` | Entity models per bulk write. |
| `RDF_BULK_RELATIONSHIP_SOURCE_BATCH_SIZE` | `100` | Relationship sources per bulk write. |
| `RDF_BULK_LINEAGE_EDGE_BATCH_SIZE` | `50` | Lineage edges per SPARQL update. |

### Inference

| Variable | Default | Purpose |
| - | - | - |
| `RDF_MATERIALIZED_INFERENCE_ENABLED` | `false` | Write inference rule results to durable per-rule named graphs inside the triple store. This is the only source of inference, and it makes the `custom` inference level available. |

> [!WARNING]
>
> `RDF_INFERENCE_ENABLED`, `RDF_DEFAULT_INFERENCE_LEVEL`, `RDF_MAX_IN_MEMORY_INFERENCE_TRIPLES`, and `RDF_CACHE_INFERRED_TRIPLES` are deprecated. The server ignores them. The in-process reasoner they controlled was removed in 2.1, so `rdfs` and `owl` inference requests fail with `503`. See [Reasoning & Validation](https://docs.open-metadata.org/v2.1.x/how-to-guides/ontology/knowledge-graph/reasoning.md).

### Validation and Profile

| Variable | Default | Purpose |
| - | - | - |
| `RDF_SHACL_VALIDATION_MODE` | `REPORT` | `OFF`, `REPORT`, or `ENFORCE_IMPORTS`. Never blocks entity writes. |
| `RDF_STRICT_OWL_PROFILE` | `true` | Reject authored axioms outside the supported OWL 2 DL profile. |

### Linked Data, AI, Federation

| Variable | Default | Purpose |
| - | - | - |
| `RDF_DEREFERENCEABLE_IRIS` | `false` | Authenticated content-negotiated redirects for minted IRIs (`/api/v1/lod/entity/...`). |
| `RDF_AI_ENABLED` | `false` | Expose the optional AI-assisted ontology flows available in Collate. The older name `RDF_ASK_COLLATE_ENABLED` still works. |
| `RDF_FEDERATION_ENABLED` | `false` | Master switch for `SERVICE` clauses to external SPARQL endpoints. |
| `RDF_FEDERATION_ALLOWED_ENDPOINTS` | `[]` | Allowlisted external endpoint URIs. Compared **verbatim** — trailing slashes matter. |

> [!WARNING]
>
> **Federation is a data-exfiltration surface.** A `SERVICE` clause sends parts of your query — and potentially your data — to a third-party endpoint. It is disabled by default, and the allowlist is empty. Enable it only for endpoints you control or explicitly trust.

### Indexing Application

`RdfIndexApp` configuration (**Settings → Applications**):

| Setting | Default | Purpose |
| - | - | - |
| `entities` | `[]` (all supported) | Restrict the reindex to specific entity types. |
| `recreateIndex` | `true` | Clear the store before indexing. |
| `batchSize` | `100` | Entities per batch. |
| `producerThreads` / `consumerThreads` | `2` / `3` | Non-distributed reindex parallelism. |
| `queueSize` | `5000` | Internal queue size for non-distributed reindexing. |
| `useDistributedIndexing` | `true` | Partition-coordinated indexing across servers. |
| `partitionSize` | `10000` | Entities per partition. Smaller values create more partitions. |

Only one reindex job can be active per cluster at a time.

### Inference Application

**RDF Inference Materialization** (`RdfInferenceApp`) is the second application RDF registers. It materializes enabled inference rules into their durable named graphs on a schedule — **every 5 minutes** by default — and only rebuilds rules whose dirty flag is set. Select **Run Now** to materialize immediately.

It only does useful work when `RDF_MATERIALIZED_INFERENCE_ENABLED=true`. See [Reasoning & Validation](https://docs.open-metadata.org/v2.1.x/how-to-guides/ontology/knowledge-graph/reasoning.md).

## Verifying the Whole Thing

```bash theme={null}
# 1. RDF is on and the projection is ready
curl "$OM_HOST/api/v1/rdf/status" -H "Authorization: Bearer $TOKEN"

# 2. The graph has data
curl -X POST "$OM_HOST/api/v1/rdf/sparql" \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"query":"SELECT (COUNT(*) AS ?n) WHERE { GRAPH <https://open-metadata.org/graph/knowledge> { ?s ?p ?o } }"}'

# 3. Inference rules are registered
curl "$OM_HOST/api/v1/rdf/rules" -H "Authorization: Bearer $TOKEN"

# 4. Shapes are loaded and the graph conforms
curl "$OM_HOST/api/v1/rdf/validate" -H "Authorization: Bearer $TOKEN" -D - -o /dev/null | grep OM-SHACL-Conforms
```

In the UI, the SPARQL Playground at `/governance/sparql` should run queries, and any table should show a **Knowledge Graph** tab.

## Next

> [card] [Deployment guide](https://docs.open-metadata.org/v2.1.x/deployment/rdf-knowledge-graph.md)
>
> Docker, Kubernetes, Helm, sizing, and troubleshooting.

> [card] [Knowledge Graph](https://docs.open-metadata.org/v2.1.x/how-to-guides/ontology/knowledge-graph.md)
>
> What you get once it is on.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.