Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/neo4j-labs/neocarta/llms.txt

Use this file to discover all available pages before exploring further.

The Unity Catalog connector reads schema metadata from the open Unity Catalog REST API (/api/2.1/unity-catalog). Unity Catalog is an Apache-2.0 open-source project at github.com/unitycatalog/unitycatalog that provides a vendor-neutral catalog spec — the connector speaks that open API over a plain HTTP client, not the Databricks SDK. This means it works against any conformant Unity Catalog server: a local OSS server, a self-hosted deployment, or a managed one.
The Unity Catalog connector is for the open REST API. For managed-Databricks governance features like governed tags, see the Databricks connector. The two connectors are intentionally separate packages.

What It Ingests

Unity Catalog conceptNeocarta node
CatalogDatabase
SchemaSchema
Table or viewTable
ColumnColumn
Tables and views both become Table nodes. The connector does not produce Value nodes (no value sampling) or REFERENCES edges (the open API exposes no primary/foreign key metadata).

Limitations

  • No REFERENCES edges — the open Unity Catalog API exposes no primary/foreign-key constraint metadata. is_primary_key and is_foreign_key are left null on all columns.
  • No glossary or tags — the open REST API has no tag or glossary concept. Glossary support is a planned follow-up sourced from INFORMATION_SCHEMA.
  • No value sampling — no Value nodes or HAS_VALUE edges are produced.
  • Views are not a distinct node type — both tables and views become Table nodes.
  • Client-side schema filtering — the schemas argument filters after listing all schemas; it does not push the filter to the server.

Import

from neocarta.connectors.unity_catalog import UnityCatalogSchemaConnector

Parameters

base_url
str
required
Base URL of the Unity Catalog REST API, including the version prefix, e.g. http://localhost:8080/api/2.1/unity-catalog.
neo4j_driver
neo4j.Driver
required
Connected Neo4j driver instance.
token
str
default:"None"
Bearer token for the Authorization header. Pass None for a local OSS server that requires no auth.
database_name
str
default:"neo4j"
Target Neo4j database name.
timeout
float
default:"30.0"
Per-request HTTP timeout in seconds.

ingest() Parameters

catalog
str
required
The Unity Catalog catalog name to ingest (maps to a Database node).
schemas
list[str]
Optional client-side filter restricting ingestion to specific schemas. Omit to ingest all schemas in the catalog.
include_nodes
list[NodeLabel]
Node labels to produce. None (the default) includes all available: Database, Schema, Table, Column.
include_relationships
list[RelationshipType]
Relationship types to produce. None (the default) includes HAS_SCHEMA, HAS_TABLE, HAS_COLUMN.

Code Example

import os
from dotenv import load_dotenv
from neo4j import GraphDatabase
from neocarta.connectors.unity_catalog import UnityCatalogSchemaConnector

load_dotenv()

neo4j_driver = GraphDatabase.driver(
    uri=os.getenv("NEO4J_URI"),
    auth=(os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD")),
)
neo4j_database = os.getenv("NEO4J_DATABASE", "neo4j")

# The connector owns its HTTP client; use it as a context manager to release
# the connection pool on exit.
with UnityCatalogSchemaConnector(
    base_url=os.getenv("UC_SERVER_URL", "http://localhost:8080/api/2.1/unity-catalog"),
    token=os.getenv("UC_TOKEN"),   # None for a local OSS server
    neo4j_driver=neo4j_driver,
    database_name=neo4j_database,
) as connector:
    connector.ingest(
        catalog="unity",
        schemas=["default"],  # optional — omit to ingest all schemas
    )

neo4j_driver.close()
print("Connector completed successfully!")

CLI

pip install "neocarta[cli]"

neocarta unity-catalog schema \
  --base-url "http://localhost:8080/api/2.1/unity-catalog" \
  --catalog unity

Environment Variables

The connector reads no environment variables itself — pass base_url and token explicitly in your calling code. Suggested variables to define in .env:
VariableExamplePurpose
NEO4J_URIbolt://localhost:7687Neo4j connection URI
NEO4J_USERNAMEneo4jNeo4j username
NEO4J_PASSWORDyour-passwordNeo4j password
NEO4J_DATABASEneo4jTarget Neo4j database
UC_SERVER_URLhttp://localhost:8080/api/2.1/unity-catalogUnity Catalog base URL
UC_TOKENdapi...Bearer token (optional for local OSS servers)
UC_CATALOGunityCatalog name to ingest

Source Setup

  1. Run or point at a Unity Catalog server exposing the open REST API. For local testing, the open-source distribution provides a bin/start-uc-server script that listens on http://localhost:8080 with no authentication.
  2. If the server enforces auth, obtain a bearer token and pass it via token= (sent as Authorization: Bearer <token>).
  3. Identify the catalog name to ingest (and optionally the schemas to restrict to).

Build docs developers (and LLMs) love