Create a Semantic Model
Disclaimer: the images used in this doc to present and help understand each feature, were captured at the end of the implementation of each individual feature. As the application keeps evolving and the UI keeps being improved and enriched, it is possible that currently they do not entirely correspond to the latest version of the plugin.
1. Compose Semantic Model using the GUI
When the user creates a new model or opens an existing one, the default view that is presented is the application Canvas:
The name of the model, presented in the title bar on top, can be edited by clicking on it, and directly changing it - this change as all others in the UI remain local to the browser session until the model is saved. Only when the user uses the Save action the changes made in the UI are effectively persisted.
On the left side of the Canvas exists a panel with the detailed structured of the Data Source chosen when the model was created. When the data source is a database connection, depending on the type of the database, the user will see a tree including the schemas when they exist, down to the tables and views inside of each one, that are available to be used in the model. The width of the left panel can be adjusted to the user convenience as suitable to fully see the names of tables/views, just position the mousse in the border and drag horizontally:
1.1 Preview Data
By having the possibility of previewing the data and quickly check the type and length of each column, the user can better decide which columns can be connected in the model relationships. For each Table or View listed as a leaf in the available Data tree, exists the Preview functionality, which allows to preview a small set of the Table or View data:
The maximum number of rows retrieved from the database for each Table or View is configured by an administrator when SME plugin was installed, if not changed the default value is 100.
The eye icon works as a toggle, one click shows the preview data panel for the table/view, a following click in the same table/view closes the panel, while clicking in the preview action of a different table/view will replace the table/view in the preview data panel. Only one table/view can be previewed at a time.
Hovering each column, in the header of the table inside the preview data panel, will present metadata information about that column.
The columns in the preview table also allow the user to sort their content ascending or descending, just by clicking alternately in the correspondent column’s header.
1.2 Create new Cube with Facts Table
To create new elements in the canvas the user can use the tables or views available in the Data Source, and drag them into the canvas. When a table or view is dragged into the canvas, the possible actions are presented, so the user can drop the table or view in the wanted option.
To create a new cube, drag the table or view that is wanted as the cube Facts Table, and drop it in the Use as Fact Table drop-off zone inside the Create a Cube zone:
As a result, a new cube is created in the model, having the dragged table or view as its Facts Table:
Each new cube created will be automatically named Cube n
, where n is a integer starting in 1 and incremented at each new cube creation (when the canvas support the creation of multiple cubes). The name of the cube can be changed by the user, by clicking on it and introducing the new name.
Take into consideration that the cube name must be unique within the model (when the canvas support the creation of multiple cubes).
2. Compose Semantic Model using Advanced XML mode
Using the advanced mode to edit the model, is a feature directed to expert users with deep knowledge on the Mondrian xml syntax. When the user enters the advanced mode, the current xml representation of the model is presented, and the user has the ability to change it.
The xml content is continuously validated against the Mondrian XSD when its being changed, for that reason a red underline can appear at any moment, or because the user entered a XML syntax error or because the user is not respecting the structure required by Mondrian, in terms of required elements or attributes or even the order in which the elements are expected. When that happens just hover on that error to get more details on what is causing the error. It won’t be possible to save the model while there are unresolved errors in the XML.
2.1 Auto Format
At any given time the user can also use the Auto Format action to remove unnecessary spacing/tabs/empty lines and properly ident the xml.
2.2 Find/Replace
The XML editor also support Find/Replace functionality built-in, just use the keys CTRL+F
combination simultaneous, while positioned inside the editor to activate it. Using the Replace toggle will alternate between just Find or Find/Replace mode:
2.3 Auto Complete
The user can directly write inside the XML editor to create or change a model. While doing that, the autocomplete functionality will provide some help suggesting valid elements and attributes according to the place where the user is positioned in the model.
The Auto Complete algorithm is prepared to provide suggestions in the following situations:
When writing a new element (open
<
or partially writing its name):autocomplete only suggests possible child elements of the parent element the user is currently inside of
in case the name is partially written, only suggests the subset that matches with what is written
When starting to write attributes inside a known element:
autocomplete only suggests possible attributes of the element the user is on
autocomplete does not suggest attributes already in use in the current element, as we can not repeat attributes inside the same element
When writing the content of an attribute that is specified as an
enumeration
:autocomplete suggests the possible values of that enumeration
Auto Complete can be activated manually by using the keys CTRL+Space
combination simultaneous.