# Schema

The logical data model of a contract: objects such as tables, views, or topics and the properties, types, and constraints they expose.

## Schema Object {#schema-object}

type: SchemaObject

| Property | Type | Required | Description |
|---|---|---|---|
| `dataGranularityDescription` | string | No | Granular level of the data in the object. Examples: `Aggregation by country`. |
| `logicalType` | string | No | The logical element data type. Valid value is: `object`. |
| `physicalName` | string | No | Physical name. Examples: `table_1_2_0`. |
| `properties` | [SchemaProperty](#schema-property)[] | No | A list of properties for the object. |
| `quality` | [DataQualityChecks](/docs/reference/data-contract/data-quality/#data-quality-checks) | No |  |

## Schema Element {#schema-element}

type: SchemaElement

| Property | Type | Required | Description |
|---|---|---|---|
| `authoritativeDefinitions` | [AuthoritativeDefinitions](/docs/reference/data-contract/authoritative-definitions/#authoritative-definitions) | No |  |
| `businessName` | string | No | The business name of the element. |
| `customProperties` | [CustomProperties](/docs/reference/data-contract/custom-properties/#custom-properties) | No |  |
| `description` | string | No | Description of the element. |
| `name` | string | No | Name of the element. |
| `physicalType` | string | No | The physical element data type in the data source. Examples: `table`, `view`, `topic`, `file`. |
| `tags` | [Tags](/docs/reference/data-contract/tags/#tags) | No |  |

## Schema Base Property {#schema-base-property}

type: SchemaBaseProperty

| Property | Type | Required | Description |
|---|---|---|---|
| `classification` | string | No | Can be anything, like confidential, restricted, and public to more advanced categorization. Some companies like PayPal, use data classification indicating the class of data in the element; expected values are 1, 2, 3, 4, or 5. Examples: `confidential`, `restricted`, `public`. |
| `criticalDataElement` | boolean | No | True or false indicator; If element is considered a critical data element (CDE) then true else false. |
| `encryptedName` | string | No | The element name within the dataset that contains the encrypted element value. For example, unencrypted element `email_address` might have an encryptedName of `email_address_encrypt`. |
| `examples` | [AnyType](/docs/reference/data-contract/common-types/#any-type)[] | No | List of sample element values. |
| `logicalType` | string | No | The logical element data type. Valid values are: `string`, `date`, `number`, `integer`, `object`, `array`, `boolean`. |
| `logicalTypeOptions` | object | No | Additional optional metadata to describe the logical type. |
| `partitionKeyPosition` | integer | No | If element is used for partitioning, the position of the partition element. Starts from 1. Example of `country, year` being partition columns, `country` has partitionKeyPosition 1 and `year` partitionKeyPosition 2. Default to -1. Default value is: `-1`. |
| `partitioned` | boolean | No | Indicates if the element is partitioned; possible values are true and false. |
| `physicalType` | string | No | The physical element data type in the data source. For example, VARCHAR(2), DOUBLE, INT. |
| `primaryKey` | boolean | No | Boolean value specifying whether the element is primary or not. Default is false. |
| `primaryKeyPosition` | integer | No | If element is a primary key, the position of the primary key element. Starts from 1. Example of `account_id, name` being primary key columns, `account_id` has primaryKeyPosition 1 and `name` primaryKeyPosition 2. Default to -1. Default value is: `-1`. |
| `quality` | [DataQualityChecks](/docs/reference/data-contract/data-quality/#data-quality-checks) | No |  |
| `required` | boolean | No | Indicates if the element may contain Null values; possible values are true and false. Default is false. |
| `transformDescription` | string | No | Describes the transform logic in very simple terms. |
| `transformLogic` | string | No | Logic used in the element transformation. |
| `transformSourceObjects` | string[] | No | List of objects in the data source used in the transformation. |
| `unique` | boolean | No | Indicates if the element contains unique values; possible values are true and false. Default is false. |

### Specific `LogicalType` Properties & Types

- `string`
- `date`
- `object`
- `array`

## Schema Property {#schema-property}

type: SchemaProperty

## Schema Item Property {#schema-item-property}

type: SchemaItemProperty

| Property | Type | Required | Description |
|---|---|---|---|
| `properties` | [SchemaProperty](#schema-property)[] | No | A list of properties for the object. |
