Multi Table Metadata JSON
This guide describes the multi table metadata JSON spec.
Create your metadata programmatically. Use the Python API to automatically detect the metadata based on your data.
Overview
The metadata for a single table contains the following elements:
(required)
"METADATA_SPEC_VERSION"
: The version of the metadata. If you are using this, the metadata version will be"MULTI_TABLE_V1"
, indicating that it is a multi table dataset that is compatible with SDV version 1.(required)
"tables"
: A dictionary that maps the table names to the table-specific metadata such as primary keys, column names and data types(required)
"relationships"
: A list of dictionaries that specify the connections between the tables
Tables
The tables dictionary maps each table name to the table-specific metadata. This includes:
(required)
"columns"
: A dictionary that maps the column names to the data types they represent and any other attributes."primary_key"
: The column name that is the primary key in the table"alternate_keys"
: A list of column names that can act as alternate keys in the table
Table Columns
When describing a column, you will provide the column name and the data type, known as the sdtype.
The 5 common sdtypes are: "numerical"
, "datetime"
, "categorical"
, "boolean"
and "id"
. Click on the type below to learn more about the type and how to specify it in the metadata.
Boolean columns represent True or False values.
Properties (None)
Column Relationships
Annotate groups of columns that represents higher level concepts. Denote the concept using the "relationship_type"
keyword, followed by "column_names"
with the list of columns involved. The column names can be present in any order.
Each relationship type supports different types of columns. Browse the table below to explore different options.
An address is defined by 2 or more columns that have the following sdtypes: country_code
, administrative_unit
, state
, state_abbr
, city
, postcode
, street_address
and secondary_address
.
While anyone can add column relationships to their data, SDV Enterprise users will see the highest quality data for the relationships. To learn more about the SDV Enterprise and its extra features, visit our website.
Relationships
A list of dictionary objects that describe the relationship between 2 connected tables, parent and child. The parent table contains the primary key references while the child table has rows that refer to its parent. Multiple child rows can refer to the same parent row.
"parent_table_name"
: The name of the parent table"parent_primary_key"
: The primary key column in the parent table. This column uniquely identifies each row in the parent table ."child_table_name"
: The name of the child table that refers to the parent"child_foreign_key"
: The foreign key column in the child table. The values in this column contain a reference to a row in the parent table
Use multiple dictionaries to represent multiple tables.
Last updated