The OSI connector is Neocarta’s only bidirectional connector. It integrates with Open Semantic Interchange (OSI) — a YAML-based interchange format for semantic models. In the ingest direction, it reads an OSI YAML spec (from a local path or an HTTP(S) URL) and loads the full semantic model into Neo4j. In the export direction, it reads anDocumentation 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.
OsiSemanticModel subgraph from Neo4j by name and emits a spec-compliant OSI YAML file.
A ready-to-use 33-table sample lives at datasets/osi/acme_semantic_model.yaml, exercising metrics, joins with composite keys, and ai_context synonyms.
Import
Parameters
Connected Neo4j driver instance.
Target Neo4j database name.
Timeout in seconds when fetching an OSI spec by HTTP(S) URL.
Ingest Direction
Reads an OSI YAML spec and loads it into Neo4j as anOsiSemanticModel subgraph.
What It Ingests
| Graph node | Description |
|---|---|
OsiSemanticModel (:Domain subtype) | Top-level container for the semantic model |
OsiTable (:Table:OsiTable) | Datasets with primary keys, unique keys, labels, and time-dimension flags |
OsiColumn (:Column:OsiColumn) | Fields with optional is_time_dimension tri-state |
Query | Datasets whose source is a SQL query rather than a 3-part identifier |
Metric | Governed metric definitions |
Expression | Dialect-specific expression definitions linked to Metric nodes |
Join | Join definitions with ordered from_columns / to_columns for composite-key support |
OsiAiContext | AI context aspects, including synonyms that become BusinessTerm upserts |
OsiCustomExtensions | Custom extension aspects with literal-block JSON |
BusinessTerm | Upserted (MERGE on name) from ai_context.synonyms |
OsiTable is stored as (:Table:OsiTable), so graph traversals over (:Table) reach OSI-ingested data the same as data from any other connector.
dataset.source must be either a 3-part database.schema.table identifier or a SQL query string. 1-part and 2-part sources raise ValueError to surface spec-non-compliant input early.ingest() Parameters
A local filesystem path or an
http(s):// URL pointing to the OSI YAML spec.Declared OSI spec version. Emits
UnsupportedOsiVersionWarning if outside SUPPORTED_VERSIONS ("0.1.1") or if the parsed spec’s version field is missing or mismatched.Code Example
CLI
Export Direction
Reads anOsiSemanticModel subgraph from Neo4j by name and emits a spec-compliant OSI YAML file. The connector emits whatever osi_version was stored on the OsiSemanticModel node at ingest time — there is no export-side version argument.
What It Exports
- Full
OsiSemanticModelsubgraph filtered bysemantic_model_name - Preserved column ordering and primary/unique key lists in flow style (
primary_key: [a, b]) - Native YAML structure for
ai_context(not a quoted JSON string) - Literal-block JSON (
|) forcustom_extensions[].data
export() Parameters
The
name property of the :OsiSemanticModel node to export.Destination filesystem path for the OSI YAML output.
Code Example
CLI
Full Round-Trip Example
Required Environment Variables
| Variable | Purpose |
|---|---|
NEO4J_URI | Neo4j connection URI |
NEO4J_USERNAME | Neo4j username |
NEO4J_PASSWORD | Neo4j password |
NEO4J_DATABASE | Target Neo4j database (default: neo4j) |
Synonyms and BusinessTerms
When a field, table, or column carriesai_context: {synonyms: [...]}, each synonym is upserted as a BusinessTerm node (MERGE on name) and linked via TAGGED_WITH. Because the MERGE uses name as the key, synonyms collide cleanly with catalog-derived business terms from connectors like Dataplex — pre-existing nodes keep their original id and properties.
Version Handling
The connector targets OSI spec version 0.1.1 (OsiConnector.SUPPORTED_VERSIONS). The version argument on ingest() is a per-call compatibility check — a single connector instance can ingest multiple files at different versions. An UnsupportedOsiVersionWarning is emitted (not raised) when the version is outside the supported set or mismatches the parsed spec, so ingest always proceeds.
To silence the warning explicitly: