{
  "type": "record",
  "Aspect": {
    "name": "semanticModelInfo"
  },
  "name": "SemanticModelInfo",
  "namespace": "com.linkedin.pegasus2avro.semanticmodel",
  "fields": [
    {
      "Searchable": {
        "boostScore": 10.0,
        "enableAutocomplete": true,
        "fieldNameAliases": [
          "_entityName"
        ],
        "fieldType": "WORD_GRAM",
        "searchLabel": "entityName",
        "searchTier": 1
      },
      "type": "string",
      "name": "name",
      "doc": "Display name of the semantic model."
    },
    {
      "Searchable": {
        "fieldType": "TEXT",
        "hasValuesFieldName": "hasDescription",
        "searchTier": 2
      },
      "type": [
        "null",
        "string"
      ],
      "name": "description",
      "default": null,
      "doc": "Human-readable description of the semantic model."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "createdAt",
          "fieldType": "DATETIME",
          "searchLabel": "createdAt"
        }
      },
      "type": [
        "null",
        {
          "type": "record",
          "name": "AuditStamp",
          "namespace": "com.linkedin.pegasus2avro.common",
          "fields": [
            {
              "type": "long",
              "name": "time",
              "doc": "When did the resource/association/sub-resource move into the specific lifecycle stage represented by this AuditEvent."
            },
            {
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": "string",
              "name": "actor",
              "doc": "The entity (e.g. a member URN) which will be credited for moving the resource/association/sub-resource into the specific lifecycle stage. It is also the one used to authorize the change.",
              "Urn": "Urn"
            },
            {
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": [
                "null",
                "string"
              ],
              "name": "impersonator",
              "default": null,
              "doc": "The entity (e.g. a service URN) which performs the change on behalf of the Actor and must be authorized to act as the Actor.",
              "Urn": "Urn"
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "message",
              "default": null,
              "doc": "Additional context around how DataHub was informed of the particular change. For example: was the change created by an automated process, or manually."
            }
          ],
          "doc": "Data captured on a resource/association/sub-resource level giving insight into when that resource/association/sub-resource moved into a particular lifecycle stage, and who acted to move it into that specific lifecycle stage."
        }
      ],
      "name": "created",
      "default": null,
      "doc": "Audit stamp capturing when this semantic model was created and by whom\n(as reported by the source platform / ingestor)."
    },
    {
      "Searchable": {
        "/time": {
          "fieldName": "lastModifiedAt",
          "fieldType": "DATETIME",
          "searchLabel": "lastModifiedAt"
        }
      },
      "type": [
        "null",
        "com.linkedin.pegasus2avro.common.AuditStamp"
      ],
      "name": "lastModified",
      "default": null,
      "doc": "Audit stamp capturing when this semantic model was last modified and by whom.\nEquals `created` when no modification has occurred since ingestion."
    },
    {
      "type": [
        "null",
        "string"
      ],
      "name": "nativeDefinition",
      "default": null,
      "doc": "The raw, native definition of this semantic model as authored on the\nsource platform (e.g. the Snowflake `CREATE SEMANTIC VIEW` DDL, the\ndbt `semantic_model` YAML, or the Databricks `CREATE METRIC VIEW`\nDDL). Preserved verbatim so consumers can round-trip / debug against\nthe original source; not itself parsed by DataHub."
    },
    {
      "type": [
        "null",
        {
          "type": "record",
          "name": "AiContext",
          "namespace": "com.linkedin.pegasus2avro.metric",
          "fields": [
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "string"
                }
              ],
              "name": "synonyms",
              "default": null,
              "doc": "Alternative names or abbreviations by which this metric is known."
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "instructions",
              "default": null,
              "doc": "Human-readable guidance for AI models on how to interpret this metric."
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": "string"
                }
              ],
              "name": "examples",
              "default": null,
              "doc": "Example values or usage patterns to ground AI reasoning."
            },
            {
              "type": [
                "null",
                "string"
              ],
              "name": "customInstructions",
              "default": null,
              "doc": "Additional free-form instructions for AI model customisation."
            }
          ],
          "doc": "AI-specific context attached to a metric or field to improve disambiguation,\nretrieval, and generation quality (OSI ai_context shape)."
        }
      ],
      "name": "aiContext",
      "default": null,
      "doc": "AI-specific context for improved disambiguation and retrieval."
    },
    {
      "type": {
        "type": "array",
        "items": {
          "type": "record",
          "name": "ModelDataset",
          "namespace": "com.linkedin.pegasus2avro.semanticmodel",
          "fields": [
            {
              "type": "string",
              "name": "name",
              "doc": "Logical alias used to reference this dataset within the semantic model."
            },
            {
              "Relationship": {
                "entityTypes": [
                  "dataset",
                  "query"
                ],
                "name": "SourcedBy"
              },
              "java": {
                "class": "com.linkedin.pegasus2avro.common.urn.Urn"
              },
              "type": "string",
              "name": "source",
              "doc": "URN of the DataHub entity that backs this logical dataset. Accepts either:\n - a `dataset` URN \u2014 when the semantic model reads from a physical table or persisted view\n   (the common case).\n - a `query` URN \u2014 when the source is an inline SQL query with no persistent backing table\n   (e.g. Databricks metric views that use `source: <SELECT ...>`). Ingestion emits a `query`\n   entity carrying the SQL text (`queryProperties.statement`) and its upstream tables\n   (`querySubjects`), then points this field at that URN. The `query`'s `origin` field\n   should point back at the enclosing SemanticModel URN.",
              "Urn": "Urn",
              "entityTypes": [
                "dataset",
                "query"
              ]
            },
            {
              "type": [
                "null",
                {
                  "type": "array",
                  "items": {
                    "type": "record",
                    "name": "SemanticField",
                    "namespace": "com.linkedin.pegasus2avro.semanticmodel",
                    "fields": [
                      {
                        "type": "string",
                        "name": "name",
                        "doc": "The name of this field as exposed by the semantic layer."
                      },
                      {
                        "type": {
                          "type": "enum",
                          "symbolDocs": {
                            "DIMENSION": " A grouping or filtering attribute \u2014 maps to a \"dimension\" in the semantic layer. ",
                            "FILTER": " A named boolean predicate used to filter results, distinct from a dimension. ",
                            "MEASURE": " An aggregatable numeric value \u2014 maps to a \"measure\" or \"fact\" in the semantic layer. ",
                            "OTHER": " A field kind not yet represented as a named symbol. "
                          },
                          "name": "SemanticFieldType",
                          "namespace": "com.linkedin.pegasus2avro.semanticmodel",
                          "symbols": [
                            "DIMENSION",
                            "MEASURE",
                            "FILTER",
                            "OTHER"
                          ],
                          "doc": "Discriminator enum that identifies the kind of a SemanticField inside a SemanticModel dataset."
                        },
                        "name": "type",
                        "doc": "The kind of this field. Must be set for every field; determines how downstream tools\ninterpret the field and whether kind-specific sub-records (e.g. `dimension`) are relevant."
                      },
                      {
                        "type": {
                          "type": "record",
                          "name": "MetricExpression",
                          "namespace": "com.linkedin.pegasus2avro.metric",
                          "fields": [
                            {
                              "type": {
                                "type": "array",
                                "items": {
                                  "type": "record",
                                  "name": "DialectExpression",
                                  "namespace": "com.linkedin.pegasus2avro.metric",
                                  "fields": [
                                    {
                                      "type": {
                                        "type": "enum",
                                        "symbolDocs": {
                                          "ANSI_SQL": " Standard SQL dialect. ",
                                          "DATABRICKS": " Databricks SQL. ",
                                          "MAQL": " GoodData MAQL (Metric Analysis and Query Language). ",
                                          "MDX": " Multi-Dimensional Expressions (OLAP cubes). ",
                                          "OTHER": "A dialect not yet represented as a named symbol.",
                                          "SNOWFLAKE": " Snowflake SQL. ",
                                          "TABLEAU": " Tableau calculations. "
                                        },
                                        "name": "Dialect",
                                        "namespace": "com.linkedin.pegasus2avro.metric",
                                        "symbols": [
                                          "ANSI_SQL",
                                          "SNOWFLAKE",
                                          "MDX",
                                          "TABLEAU",
                                          "DATABRICKS",
                                          "MAQL",
                                          "OTHER"
                                        ],
                                        "doc": "The SQL or expression-language dialect that produced a metric expression.\nValue set is aligned 1:1 with the OSI (Open Semantic Interchange) spec."
                                      },
                                      "name": "dialect",
                                      "doc": "The dialect in which this expression is written."
                                    },
                                    {
                                      "type": "string",
                                      "name": "expression",
                                      "doc": "The raw expression string."
                                    }
                                  ],
                                  "doc": "A metric expression in a specific SQL dialect or semantic layer language."
                                }
                              },
                              "name": "dialects",
                              "doc": "The expression in one or more dialects."
                            }
                          ],
                          "doc": "A metric's logical expression represented across one or more SQL dialects"
                        },
                        "name": "expression",
                        "doc": "The SQL expression that computes this field, in one or more dialects."
                      },
                      {
                        "type": [
                          "null",
                          {
                            "type": "record",
                            "name": "Dimension",
                            "namespace": "com.linkedin.pegasus2avro.semanticmodel",
                            "fields": [
                              {
                                "type": "boolean",
                                "name": "isTime",
                                "default": false,
                                "doc": "Whether this dimension represents a time axis."
                              }
                            ],
                            "doc": "Marks a field as a time dimension within a semantic model dataset.\n\nNOTE: this record is intentionally minimal, can add more as per needs. "
                          }
                        ],
                        "name": "dimension",
                        "default": null,
                        "doc": "Dimension-specific metadata. Populated when `type == DIMENSION`; ignored otherwise."
                      },
                      {
                        "type": [
                          "null",
                          "com.linkedin.pegasus2avro.metric.AiContext"
                        ],
                        "name": "aiContext",
                        "default": null,
                        "doc": "AI-specific context for improved disambiguation and retrieval."
                      }
                    ],
                    "doc": "A named field defined inside a `SemanticModel` dataset (dimension, measure, filter, or other).\nFields are classified by `type` into four kinds \u2014 DIMENSION, MEASURE, FILTER, and OTHER."
                  }
                }
              ],
              "name": "fields",
              "default": null,
              "doc": "Fields (dimensions, measures, filters) defined over this dataset."
            }
          ],
          "doc": "A logical dataset referenced by a SemanticModel, together with its exposed fields."
        }
      },
      "name": "datasets",
      "default": [],
      "doc": "The logical datasets that this semantic model exposes."
    },
    {
      "type": [
        "null",
        {
          "type": "array",
          "items": {
            "type": "record",
            "name": "SemanticModelRelationship",
            "namespace": "com.linkedin.pegasus2avro.semanticmodel",
            "fields": [
              {
                "type": [
                  "null",
                  "string"
                ],
                "name": "name",
                "default": null,
                "doc": "Optional human-readable name for this relationship."
              },
              {
                "type": "string",
                "name": "from",
                "doc": "Alias of the source dataset (as declared in ModelDataset.name)."
              },
              {
                "type": {
                  "type": "array",
                  "items": "string"
                },
                "name": "fromColumns",
                "doc": "Column names on the source side of the join."
              },
              {
                "type": "string",
                "name": "to",
                "doc": "Alias of the target dataset (as declared in ModelDataset.name)."
              },
              {
                "type": {
                  "type": "array",
                  "items": "string"
                },
                "name": "toColumns",
                "doc": "Column names on the target side of the join."
              },
              {
                "type": [
                  "null",
                  "com.linkedin.pegasus2avro.metric.AiContext"
                ],
                "name": "aiContext",
                "default": null,
                "doc": "AI-specific context for improved disambiguation and retrieval."
              },
              {
                "type": [
                  "null",
                  {
                    "type": "enum",
                    "name": "ERModelRelationshipCardinality",
                    "namespace": "com.linkedin.pegasus2avro.ermodelrelation",
                    "symbols": [
                      "ONE_ONE",
                      "ONE_N",
                      "N_ONE",
                      "N_N"
                    ],
                    "doc": "Cardinality of a relationship between two datasets or logical datasets.\nUsed by both ERModelRelationship (physical) and SemanticModelRelationship\n(semantic-layer join paths). Directionality is carried by the source/from\nand destination/to fields on those records, not by this enum."
                  }
                ],
                "name": "cardinality",
                "default": null,
                "doc": "Cardinality of this join. "
              }
            ],
            "doc": "A join relationship between two logical datasets defined within a SemanticModel.\nNamed SemanticModelRelationship to avoid colliding with common relationship models."
          }
        }
      ],
      "name": "relationships",
      "default": null,
      "doc": "Join relationships between the datasets of this semantic model."
    }
  ],
  "doc": "Core information about a SemanticModel entity."
}