Build your first knowledge graph
A hands-on walkthrough: create a domain from scratch, turn your Databricks tables into an ontology, build the graph, explore it in the UI, and serve it to AI agents over MCP.
Before you begin
This guide assumes OntoBricks is already running and connected to your workspace. If not, follow the Install step by step guide first — it takes about 20 minutes.
You'll need at least one Unity Catalog schema with a few related tables — for example customers and their interactions, or products and orders. The relationships between tables become the relationships in your graph.
The 4-click pipeline
Most of what follows is automated. At its core, OntoBricks turns metadata into a queryable graph in four moves — LLM-powered automation does the heavy lifting while you stay in control:
Import
Table & column metadata from Unity Catalog
Generate
Detect → review → complete (append-only)
Auto-map
R2RML mappings to your tables
Synchronize
Materialize triples into the store
1 Create a domain
A domain is one self-contained ontology + graph, versioned in the registry. Everything you build lives inside it.
- From Home or Registry, click New Domain (administrators only). A full-page loading overlay runs until Domain Information finishes its first load.
- Open Domain → General → Backend to pick a graph engine (Lakebase, Lakehouse, Neo4j, or none). Set the domain name (e.g.
customer360) — the triple-store paths update from the name. - Your new version starts in DRAFT status (shown as a colour-coded badge in the navbar). Only DRAFT versions are editable. Use the navbar Versions popup to branch a New Version without leaving the workspace.
A DRAFT version is edited by one user at a time. If someone else opens it, they get a read-only banner naming the current editor. Use the Close button (which prompts to save) to release your lock when you're done.
2 Import Data Assets
Give OntoBricks the schema it will model. This is click 1 of the automated pipeline.
- Go to Domain → Data Assets → Add Data Asset.
- Pick the catalog and schema, then select the tables you want in your graph (names that start with a digit are fine when backtick-quoted).
- OntoBricks fetches table and column metadata from Unity Catalog — no data is moved yet. Optionally upload specifications under Domain → Knowledge Store (parsed text is stored in Lakebase; 10 MB per file).
3 Design the ontology
You have three ways to get an ontology — pick whichever suits you.
Fastest — generate with AI (click 2)
- Open Ontology → Generate.
- Detect entity candidates from Data Assets and optional Knowledge Store documents (locked existing classes stay anchors).
- Review — include, exclude, edit labels; at least one entity must remain.
- Complete — relations, then attributes, then axioms, with checkpoints. The merge is append-only.
- Optionally start from a quick template (CRM, E-Commerce, IoT, Healthcare, Energy). The wizard uses the LLM saved in Domain → General → AI (unavailable when No LLM is selected).
Visual — Ontology Studio
Open Ontology → Studio (the OntoViz canvas) to draw entities and relationships by hand:
- Add an entity, click its name to rename it (e.g.
Person), then use + to add attributes, 🎨 for an icon, 📝 for a description. - Drag from one entity's connector (○) to another to create a relationship; rename it (e.g.
worksIn) and set its direction (→ / ← / ↔). - Use Auto Layout and Center to tidy the diagram; scroll to zoom. Changes save automatically.
A floating AI Assistant (bottom-right of the canvas) lets you edit the ontology in natural language — "add a Department entity", "remove orphans", "list relationships".
Import a standard
From Ontology → Import you can bring in OWL/RDFS or industry standards — FIBO, CDISC, IOF, HL7 FHIR — as a starting point.
When you're happy, click OWL to preview the generated Turtle, Validate to check it, and Save to store it in Unity Catalog. The navbar Ontology indicator turns green ✓.
4 Map entities to tables
Mapping binds each ontology entity to the rows and columns that populate it. This is click 3.
Fastest — Auto-Map
Go to Mapping → Auto-Map. An LLM writes the R2RML mappings for every entity and relationship, with multi-pass column matching and partial-mapping detection.
Precise — Mapping Studio
- Open Mapping → Studio and click an entity to open its mapping dialog.
- Enter a SQL query that returns the entity's rows (e.g.
SELECT * FROM main.default.person) and click Test Query to preview. - Choose the ID column (used to mint unique URIs) and a label column, then map each attribute to a result column. Save Mapping.
- Click relationships to map them: a query returning source and target IDs, then pick the source/target ID columns.
Click Validate in the navbar to confirm every mapping is complete — the Mapping indicator turns green ✓. You can review the generated R2RML under Domain → Export.
5 Choose a backend & build the graph
Pick where the triples live, then materialize them — click 4.
- Under Domain → General → Backend, choose a Graph Backend:
- Lakebase (Postgres) — the default; fast, incremental.
- Lakehouse — governed Unity Catalog Delta triple tables; nothing extra to provision. Default materialization is views only. Administrators can enable Use Lakehouse//RT for queries under Settings → Lakehouse while keeping Build on a classic or serverless warehouse.
- Neo4j — native graph database over Bolt (Aura or self-hosted).
- No Backend — ontology-only; Mapping and Knowledge Graph stay disabled.
- Go to Knowledge Graph → Build, then click Synchronize. OntoBricks executes your mappings and writes the triples to the chosen store (incremental by default).
The backend choice is stored per domain and versioned with it. Switching engines after a build requires rebuilding the graph — artifacts aren't migrated between engines.
6 Explore in the Graph Explorer (UI)
Open Knowledge Graph → Explorer to browse the materialized graph interactively in the WebGL viewer.
- Two-phase search — use the Search tab to preview matching entities, then select the ones to expand into the graph with their relationships and neighbours. The canvas stopwatch reports Preview, Expansion, Display, and Total.
- Click a node to see attributes, values and relationships in the right-hand details panel (sections start collapsed).
- Right-click → Expand neighbours to enrich the view in place. Find Path highlights a path between two entities. Data quality → Data Quality Checks evaluates SHACL shapes on that one entity (quality ring on the canvas).
- Filters narrow the view by entity type, field, or depth; bridges let you jump across domains.
- Data cluster detection finds communities (Louvain, Label Propagation, Greedy Modularity) and can colour or collapse them into super-nodes.
7 Reason & validate (optional)
Turn the graph from stored facts into inferred knowledge:
- Inference (sidebar) — run OWL 2 RL deductive closure and your SWRL business rules to discover new, inferred triples; transitive and symmetric properties are expanded.
- Data Quality (sidebar) — validate the graph against SHACL shapes: cardinality, datatypes, patterns and custom rules, with a configurable per-rule violation cap.
Define these rules ahead of time under Ontology → Business Rules (a graphical SWRL editor) and Ontology → Data Quality (SHACL shapes).
8 Query with GraphQL
OntoBricks generates a typed GraphQL schema from your ontology at runtime — each class becomes a type, each attribute a field, each relationship a typed edge. The same Query area also hosts a SPARQL playground: run a read-only query and inspect the SQL the translator produced.
- Open the Query section to reach the GraphiQL playground for this domain.
- Traverse nested relationships in a single request, e.g.:
{
allCustomer(limit: 3, search: "Martinez") {
id
label
email
hasInteraction {
label
date
}
}
}
9 Publish & expose the domain
External tools — the REST API and MCP — only serve a PUBLISHED version, and only when the domain is flagged for exposure.
- Move the version through its lifecycle: DRAFT → IN-REVIEW → PUBLISHED. Submit for review from Domain → Validation; publish once the sign-off quorum is met (admins can publish directly).
- In Domain → Information → Global, toggle Expose via API & MCP to ON. Domains without this flag are hidden from both the REST API and MCP.
- Confirm on Domain → Validation (Cockpit): the Published Version tile shows exactly which version is being served over API / MCP.
10 Use it via MCP
OntoBricks exposes the graph to LLM agents through the Model Context Protocol. The companion MCP app (e.g. mcp-ontobricks-09x) forwards agent tool calls to your OntoBricks REST + GraphQL API.
In the Databricks Playground
- Deploy the MCP server. It ships in the same bundle —
make deploydeploys it asmcp-ontobricks-<id>(apps whose name starts withmcp-are auto-discoverable in the Playground). Start it if needed:databricks bundle run mcp_ontobricks_app -t <target>. - Open your workspace Playground and select the MCP app from the MCP Servers list.
- Ask questions in natural language — e.g. "What entity types are in the graph?" or "Tell me about Jacob Martinez".
How the agent explores your graph
The tools follow a simple two-step flow — choose a domain, then query it:
list_domains→select_domain— pick which exposed graph to work on.list_entity_types— overview of entity types, counts and predicates.describe_entity— full-text description of an entity: identity, attributes, relationships and neighbours (BFS traversal).get_entity_context/invoke_entity_action— linked UC datasets, cross-domain bridges, Unity Catalog functions, and Databricks Jobs (job:<id>) bound to a class.run_entity_business_rule/check_entity_shacl_facets— run a class SWRL rule on one entity, or check that entity against inherited SHACL shapes.get_graphql_schema→query_graphql— discover the typed schema, then run nested, filtered queries.
From Cursor or Claude Desktop
Point a local MCP client at the deployed app over Streamable HTTP:
{
"mcpServers": {
"ontobricks": {
"type": "streamable-http",
"url": "https://<mcp-ontobricks-app-url>/mcp"
}
}
}
See the MCP Server documentation for the full tool reference, stdio configuration, and MCP Inspector testing.