Schemas

Schema Versions

A schema defines a multi-dimensional database. It contains a logical model, consisting of cubes, hierarchies, and members, and a mapping of this model onto a physical model. The logical model consists of the constructs used to write queries in MDX language: cubes, dimensions, hierarchies, levels, and members.

The physical model is the source of the data which is presented through the logical model. It is typically a star schema, which is a set of tables in a relational database.

Mondrian 3 Schema

Schema Element

The Schema element is the root container of a Mondrian schema file. Think of it as the outer wrapper that holds everything else. Every Mondrian schema XML file has exactly one Schema element.

Every schema needs a name attribute, though Mondrian doesn't use it for critical operations. It's recommended that you also add a description attribute to explain what the schema does in human-readable terms.

You should also specify metamodelVersion="3.14" as this helps track which version of the schema format you're using.

The Schema element contains all the building blocks of your data model. It always requires a PhysicalSchema element, which defines the actual database tables and columns.

Typically, a schema includes one or more Cube elements that define the multidimensional data structures. It may also contain Dimension elements for shared dimensions that multiple cubes can use, and Role elements for access control and security settings.

An analyst typically creates the Schema first as the outer container, then fills it with the components needed to answer business questions, such as dimensions and cubes.

Think of it like a filing cabinet: the Schema is the cabinet itself, and you fill the drawers with organized folders (cubes, dimensions) that help answer specific business questions.

Does this help clarify the concept?

<Schema name="SteelWheels"
caption="Steel Wheels"
description="Optimizing the Sales process at Steel Wheels Inc"
metamodelVersion="3.14" measuresCaption="Metrics"
defaultRole="Associate" missingLink="warning">
Schema Element

In Mondrian v3 the schema parser was extremely sensitive about the order of child elements. If you get child elements in the wrong order (for example, a cube after a role..), Mondrian will ignore the cube.

Last updated

Was this helpful?