Using a Sample schema

A schema in Contiamo is a data model written in the Pantheon Schema Language. It describes how the data abstracted from one or more physical data sources is combined and transformed using a logical model that interprets the data made available by the abstraction as multi-dimensional. The logical model of the schema enables multi-dimensional querying.

To get started quickly, use the below sample schema based on the foodmart demo data source you added in Step 2.

Sample schema definition:

schema Test(dataSource = "Test") {
measure unitSales(column = "sales.unit_sales")
dimension Customer(table = "customer") {
attribute city(column = "city")
}
table sales(physicalTable = "SALES_FACT_1998") {
column customer_id(expression = "CUSTOMER_ID", tableRef = "customer.customer_id")
column unit_sales(expression = "UNIT_SALES")
}
table customer(physicalTable = "CUSTOMER") {
column customer_id(expression = "CUSTOMER_ID")
column city(expression = "CITY")
}
}

where we have abstracted the columns CUSTOMER.CUSTOMER_ID and SALES_FACT_1998.UNIT_SALES from a physical database and created two logically integrated schema tables, namely sales and customer. Based on these two tables, we have created a new measure for unitSales and used the customer table as basis for the Customer dimension and the city column as an attribute. To learn more about how to write schemas in PSL, see: Writing Schemas.

The above schema lists the name of the data source as "Test":

schema Test(dataSource = "Test") {

Make sure the name of the data source corresponds to the name you gave the data source after adding it.

Creating the Schema

To create a schema:

1) Navigate to Schemas in the left-hand side navigation of the Contiamo UI. 2) Click on Create schema. 3) Give your schema a Name and Description. 4) Click on the Edit button. 5) Copy and paste the example schema from above or write your own (see: Writing Schemas). 6) Adapt the data source name in the example schema definition above to match the name you gave the data source in the previous step.

Note

The Inventory on the right-hand side lists the Measures, Dimensions, and Schema tables you reference in your schema definition.