MetadataEditor Manual
MetadataEditor Manual
MetadataEditor Manual
As explained previously, there are three levels of concepts for the business objects in the business model, which provides great power and
flexibility in how you define your metadata. Since one of the levels is an inherited level, there are really only two concept application processes
you need to learn to work with - applying self concepts, and applying parent concepts.
The properties shown in the screenshot above are for a business table, and we will use the business table as a reference here.
The property is a default property for the associated business object, and thus cannot be removed.
The property was inherited from the business object's physical ancestor.
The property has been set as part of the self concept.
The proeprty has been set as part of the object's parent concept.
It is difficult/confusing to set properties without understanding the override hierarchy, so to help make the hierarchy a bit more
apparent in the Properties List, we color code the properties to alert you to what concept level is in play.
Yellow Icon = This property is inherited from the object's physical ancestor.
Blue Icon = We have set the property on the object's own concept. This could be overriding an inherited property.
Orange Icon = This property is set as a result of the parent concept applied to the object.
Purple Icon = This is a special icon resserved for security properties.
Under Construction
Note that the properties dialogs today work as a single transaction - you either accept all changes when you click OK, or roll
back all changes if you click Cancel. Therefore, there is no reset or undo that will take you partially out of a set of changes. We
have plans to make this dialog a bit friendlier than that in the future.
There are also icons in the upper right corner next to any property that is override-able. If you want to modify a property by overriding its inherited
value, you must first click the override button. And to stop overriding, you click the override button once again.
Removing Properties
To remove a property from the Property List:
1. Select the property you wish to remove.
2. Click the red stop sign above the Properties List.
Note that you can only remove overrides and self concept properties for the selected object. If you want to remove inherited or parent concept
properties, you need to edit the inherited business object, or the parent concept.
Building Concepts
Building nested concept trees may take a bit more explanation, best done with an example walkthrough of the Concept Editor.
1. From the main menu's Tools menu, select the Concept Editor.
2.
3.
4.
5.
6.
With the Base concept selected in the Concepts List*, click the plus sign
to add a new, nested concept. Name this concept Number.
Make sure Number is selected in the Concepts List. Note that the properties from Base has been inherited by Number.
Add a Mask property to Number, with a value of $###,##0.00.
With Number selected in the Concept List, add another nested concept named ID.
Select ID in the Concepts List, find the inherited Mask property and click the Override button. Enter an override value of 0 for the mask.
Notice how we now have three defined concepts that can be used anywhere in our business model. Each concept serves a different type
of business object - Base for default, generic columns, Number for those columns we know contain numeric financial data, and ID for ID
columns.
Click OK to save your new concepts.
).
Now, when the column Customernumber is used in a metadata-aware application, it will provide a font of Verdana, and default numeric
format of 0 - no decimals, no commas.
TODO
Inheritance
PME uses object inheritance to maximize re-use of metadata definitions. As you will see, inheritance is used in multiple ways within the PME
allowing for powerful re-use. However that re-use comes at the cost of complexity. For example, if one concept has an ancestor, it can be difficult
to identify where a property in the descendant concept came from, since the property could have come from the descendant concept, its parent,
the parent concept's parent, etc.
In the diagram below, the parent-child concept relationship is shown. A child concept inherits the properties of its parent while still being able to
either override the value of the parent properties or add additional properties of its own.
Inheritance
The next diagram is the same as above but with each property further classified.
Inheritance
PME defines "subjects." Subjects are objects that have exactly one associated concept. Examples are physical tables and business columns. In
the diagram below, new objects are introduced. Every concept can have a security parent object. A security parent only contributes a security
property--nothing else. Note also the default properties. Default properties are coded into PME and are not true concepts. Finally, a subject is
introduced. Notice how the subject wraps the concept, and the concept wraps the properties. You can always ask a subject for its concept and
ask the returned concept what its ancestors are.
Inheritance
The final diagram shows a complete relationship--one where a concept gets its properties from (1) a parent concept, (2) an inherited concept, (3)
default properties, and (4) child properties. Let's look at each:
1.
2.
3.
4.
Inheritance
Connections
The Pentaho Metadata Editor (and the Pentaho metadata architecture) supports a vast and rich set of data sources. Before you begin defining
your [business model], you must first describe the database or data source that you would like to model. You do this by defining one or more
[connections] in the editor.
Connection Types
First, note the Connection Type list on the General tab of the dialog. This is the list of database connections that the Pentaho Metadata Editor
and metadata models can support. The list is quite extensive. If you do not see your database in the Connection Type list, you may be able to add
it. To add a new database type, you will have to copy the JDBC driver archive for your database into the [studio:PME install directory]/libext/JDBC
directory. Restart the Pentaho Metadata Editor, and you will see your database in the Connection Type list.
Method of Access
Under Connection Type, you will see the Method of Access list. Defining a JDBC or OBDC connection typically requires all of the remaining
fields on the general tab have the correct information. But if you are into abstracting those details from your metadata domain, then using the
JNDI method of access is for you. The JNDI access method keeps your server implementation cleaner as well; once you publish your domain to
the server, as long as you have defined the JNDI connections with the same names, you still have a nice implementation where your database
information is only described to the JNDI layer.
To take advantage of the JNDI method of access in the Pentaho Metadata Editor, you will need to define your database connection information in
a properties file for the editor. We walk through a JNDI connection studio:later in this page.
Name your connection. For this example, we will name this connection MySQLSampleData .
Select MySQL as the connection type.
Select Native(JDBC) as the access method.
Enter localhost as the server host name. This assumes you have a local Pentaho BI Server running. If your server (or your sample
database) is hosted elsewhere, enter the name of that host here instead.
Enter the name of the database, in our example, sampledata.
Our example requires the default port for MySQL. Adjust the port as necessary for your setup.
And last, the username and password for the Steel Wheels sample data is pentaho_user, password, respectively.
You should now click the Test button at the bottom of the dialog. If all the information is entered properly, you should receive a "Test OK"
message. If something is wrong, you should receive a message that is specific enough to help you determine the problem.
Click OK when you are satisfied with your connection information.
Name your connection. For this example, we will name this connection HySampleData .
Select Hypersonic as the connection type.
Select JNDI as the access method.
Once you've selected JNDI, notice that the only remaining piece of information that you need to enter on the General tab is the database
name. Enter SampleData here.
This name is actually the JNDI name that you will specify to map to the JNDI connection properties. In order for the Pentaho Metadata Editor to
know what this name really means, you need to set up a simple JNDI properties file.
1. Navigate to [studio:PME install directory]/simple-jndi/jdbc.properties file. Open this file in your favorite text editor.
2. Enter the following text into the jdbc.properties file:
SampleData/type=javax.sql.DataSource
SampleData/driver=org.hsqldb.jdbcDriver
SampleData/url=jdbc:hsqldb:hsql://localhost/sampledata
SampleData/user=pentaho_user
SampleData/password=password
3. Save the file and close it.
4. Go back to the Connection Information dialog, and click the Test button. If all goes well, you should get a "Test OK" message. If not try
saving your connection, exiting the Pentaho Metadata Editor, restarting the editor and trying the Test button again.
TODO
Now that we have a few database connections (see [Setting Up Your Database Connections]), the next step is to describe the physical database
tables and columns that we will want to include in our [business model].
Drill down on your physical tables in the Tree Navigator. Notice that all of the physical columns have been imported with each table.
Out-of-the-Box Properties
The table below shows the properties that are provided with Pentaho Metadata Editor.
Unknown macro: {table-plus}
Id
Description
Category
Values
Name *
This property describes the display name for the business object.
General
Alphanumeric
Description
General
Alphanumeric
General
Alphanumeric
Security
Information
General
Determined by
security widget; see
Adding Security.
Font
Formatting
Determined by font
dialog
Color of
Text
Formatting
Determined by color
dialog
Text
Alignment
Formatting
( Left | Right |
Centered | Justified )
Color of
Background
Formatting
Determined by color
dialog
Relative
Size
This property is normally associated with business tables and is used to calculate join
paths. The sum of all table relative sizes in a path are calculated when deciding on a
multi-table join, and the multi-table join with the smallest summed value is used for the
join path.
Formatting
Numeric
Aggregation
Rule
Determines the method of aggregating the data from this business object.
Model
Descriptors
Data Type
Model
Descriptors
( Unknown | String |
Date | Boolean |
Numeric | Binary |
Image | URL ) +
Length and Precision
(Integers)
Field Type
Model
Descriptors
( Other | Dimension |
Fact | Key | Attribute )
Table Type
Table type is used to automatically determine relationship types with other tables. For
instance, if a Fact table is joined with a Dimension table, this is normally an N to 1
relationship
Model
Descriptors
( Other | Dimension |
Fact )
Formula
This property allows you to create a calculation defining the business object. See
Pentaho Metadata Formulas for more information.
Calculation
Alphanumeric
Is the
Formula
Exact?
Determines whether the formula should be parsed as a Metadata Formula. If false, this
field is treated as a database column name .
Calculation
Boolean
Comments
*
Column
Width
Miscellaneous
( Pixels | Percent of
Page Width | Inches |
Centimeters | Points )
+ Integer
Hidden For
the User?
This hides the object from being displayed in the Business View of the model.
Miscellaneous
Boolean
Mask for
Number or
Date
The format mask that should be used when the data for this object is displayed. For
dates, the format follows the date/time patterns for a Java SimpleDateFormat format
mask. For numbers, the pattern should follow the Java DecimalFormat format mask.
Miscellaneous
Alphanumeric
Target
Schema
This property defines the database schema to use when querying the business object.
Miscellaneous
Alphanumeric
Target
Table
This property defines the physical database table from which the business object is
defined.
Miscellaneous
Alphanumeric
Localized properties.
Custom Properties
You can define any number of custom properties. You must give your property an id and set its type.
The available types are:
String
Date
Numeric Value
Color
Font
Type of Field
Type of Aggregation
Boolean
Field Data Type
Localized String
Type of Table
URL
Security
Text Alignment
Column Width
PhysicalTable
PhysicalColumn
BusinessCategory
BusinessModel
Aggregation rule
Is the Formula Exact?
Hidden for the User?
Font
Mask for Number or Date
Color of Text
Color of Background
TODO
We'll walk through this example to help explain the core components of MQL formulas. First note the OR function. This is a boolean function
which has two parameters, separated by semi-colons. These parameters are boolean expressions.
The first boolean expression first references a business column from our Metadata model. All references appear with brackets around them [].
This reference first refers to the business table, and then to the business column. This boolean expression first does some arithmetic and checks
to see if the final value us larger than 1000.
In the second expression, we compare the business column BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME to EuroCars. Note that
we use double quotes when referring to text. Double quotes are required.
The references here specifically refer to the database column, not derived physical column definitions. All operators and functions may be used in
the definition of the physical table column. One special note, in order for this formula to be recognized, the "isExact" property of the physical table
column must be set to true. Also note, the referenced physical column must be explicitly defined in the metadata model.
Multi-table expressions: Formulas can use any business column in the model
Since the latest versions (after 2008/03/14) it is possible to define formulas that use business columns from anywhere in the business model.
BT_PRODUCT.PRICE ) AS COL0
FROM
FACT_ORDER BT_ORDER_FACT
,DIM_PRODUCT BT_PRODUCT
WHERE
( BT_ORDER_FACT.PRODUCT_TK = BT_PRODUCT.PRODUCT_TK )
Now, suppose we want to generate the multiplication of the 2 sums (different use-case), we define the formula as
"[BT_ORDER_FACT.BC_FACT_ORDER_NRPRODUCTS] * [BT_PRODUCT.BC_DIM_PRODUCT_PRICE]" (without the SUM) and specify an
aggregation for the 2 used business columns. The generated SQL will then be:
SELECT
SUM( BT_ORDER_FACT.NRPRODUCTS )
FROM
FACT_ORDER BT_ORDER_FACT
,DIM_PRODUCT BT_PRODUCT
WHERE
( BT_ORDER_FACT.PRODUCT_TK = BT_PRODUCT.PRODUCT_TK )
It is obviously possible to create 2 versions of the used business columns, one aggregated (exposed to the users) and one non-aggregated
(hidden from the users) for example.
The SQL generator works recursively. That means that it is possible to create a formula that calculates 7% (taxes for example) of the turnover:
ID = BC_FACT_ORDER_TURNOVER_TAXES
Name = Turnover Taxes
Formula = [BT_ORDER_FACT.BC_FACT_ORDER_TURNOVER] * 7 / 100
Exact = Yes
If we add that column to the selection, we get one extra column like this:
(
SUM( BT_ORDER_FACT.NRPRODUCTS
Appendix
Formula Syntax
Function syntax
BT_PRODUCT.PRICE )
* 7 / 100) AS COL1
Metadata References
Business Column References:
[<BUSINESS_TABLE_ID>.<BUSINESS_COLUMN_ID>]
Supported Functions
Function
Name
Parameters
Description
Example
OR
two or more
boolean
expression
parameters
OR(
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "E
[BT_CUSTOMERS.BC_CUSTOMERS_CREDITLIMIT] > 1000
)
AND
two or more
boolean
expression
parameters
AND(
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "E
[BT_CUSTOMERS.BC_CUSTOMERS_CREDITLIMIT] > 1000
)
LIKE
two parameters
LIKE([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME
"%SMITH%")
CONTAINS
two parameters
CONTAINS([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMER
"SMITH")
BEGINSWITH
two parameters
BEGINSWITH([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOM
"JOE")
ENDSWITH
two parameters
ENDSWITH([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOME
"SMITH")
IN
two or more
parameters
IN([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME];
Smith"; "Brian Jones")
NOW
none
NOW()
DATE
three numeric
parameters,
year, month, and
day
A specified date
DATE(2008;4;15)
DATEVALUE
one text
parameter
"year-month-day"
A specified date
DATEVALUE("2008-04-15")
CASE
two or more
parameters
CASE(
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "E
"European Cars";
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME] = "A
"Asian Cars";
"Unknown Cars"
)
COALESCE
one or more
parameters
COALESCE(
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERNAME];
[BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERID];
"Customer is Null"
)
DATEMATH
one expression
parameter
ISNA
one parameter
ISNA([BT_CUSTOMERS.BC_CUSTOMERS_CUSTOMERID])
NULL
none
NULL()
TRUE
none
returns true
TRUE()
FALSE
none
returns false
FALSE()
Supported Operators
Operator
Description
>
<
>=
<=
<>
Description
SUM
COUNT
AVG
MIN
MAX
This page gets you started creating your first domain in the Pentaho Metadata Editor. If you are not familiar with the Pentaho metadata
terminology or concepts, you may want to review the metadata model overview and metadata terminology pages.
Follow the links below to take the next steps, or read on for more details about domains.
01. Setting Up Your Database Connections
02. Importing Physical Tables and Columns
03. Creating a Business Model
04. Creating Business Tables and Columns
05. Creating Relationships Between Business Tables
06. Building a Business View
3. You should see a few progress messages, and your domain is saved.
Opening a Domain
Once you have created more than one domain, you will want to be able to open a different domain. The Pentaho metadata Editor can have only
one domain active at a time.
To open a previously saved domain:
1. From the main menu, select File... | Open.
2. You will be prompted with the list of domains saved in the metadata repository. Select the name of the domain you wish to open and click
OK.
Deleting a Domain
To delete a previously saved domain from the metadata repository:
1. From the main menu, select File... | Delete Domain.
2. You will be prompted with the list of domains saved in the metadata repository. Select the name of the domain you wish to delete and
click OK.
3. You will be prompted with a dialog to confirm your choice to delete the domain. Click Yes, and the domain will be deleted.
Delete is Permanent
Once you delete a domain, your metadata is gone forever. So exercise caution when using delete!
The [business model] is where the logical mapping of business objects to the physical tables and columns we just set up happens. The model is
also the place where we define the relationships between our business tables, and organize the business view.
As mentioned before, a domain can have multiple business models.
TODO
Priority:
MEDIUM
Assigned To:
Created:
N/A
Example
For an example of a MQL query, check out the MQL_Datasource.xaction. This sample action sequence is shipped with the BI server and sits in
the datasources folder in the bi-developers solution. By way of example the MQL query used in that action sequence is shown below:
<mql>
<domain_type>relational</domain_type>
<domain_id>steel-wheels</domain_id>
<model_id>BV_ORDERS</model_id>
<model_name>Orders</model_name>
<selections>
<selection>
<view>CAT_ORDERS</view>
<column>BC_ORDERS_ORDERDATE</column>
</selection>
<selection>
<view>CAT_ORDERS</view>
<column>BC_ORDERS_ORDERNUMBER</column>
</selection>
<selection>
<view>CAT_ORDERS</view>
<column>BC_ORDER_DETAILS_QUANTITYORDERED</column>
</selection>
</selections>
<constraints>
<constraint>
<operator>AND</operator>
<condition>[CAT_ORDERS.BC_ORDERDETAILS_QUANTITYORDERED] >70</condition>
</constraint>
<constraint>
<operator>AND</operator>
The second change is an extension to the formula syntax when referring to business columns. Before, the syntax to reference the model only
supported [<BUSINESS CATEGORY>.<BUSINESS COLUMN>], now we also have [<BUSINESS CATEGORY>.<BUSINESS
COLUMN>.<AGGREGATION>]:
[bc_example.BC_VALUE.sum] >= 100
The last change impacts the order portion of the MQL; it's an identical change to the selection XML, with an optional aggregation child element:
<order>
<direction>asc</direction>
<view_id>bc_example</view_id>
<column_id>BC_VALUE</column_id>
<aggregation>SUM</aggregation>
</order>
See Second Use: Physical Table Column Formulas and Defining the Physical Column Aggregations for additional details.
After creating the business model, the next step is to add the business tables and business columns, then create the relationships between our
business tables.
In the Business Table Properties dialog, you will notice the Name/ID field at the top of the dialog is pre-populated with a value. This is the
id of this business table, and MUST be unique. We recommend that you accept the default value for this field.
The table you chose in step 3 is listed next, then below the fields is another Tree Navigator, with the name of your business table and all the
columns inherited from the physical table included as business columns. The business columns are created for you when the new business table
Follow the instructions above (for creating the table from the Navigator Tree), starting at step 3.
TODO
Presumably the end goal when creating a metadata domain is to have a model that is available to end-users and applications that allows them to
consistently and richly enhance the data they are working with. Whether that be through formatting, security metadata, or some other custom
metadata, it all should result in a more efficient, consistent, clearer and smarter view of the data.
So far, we have walked through modeling your database in a fashion that is more intuitive than its physical representation. The second half of the
metadata work is in, well, defining the metadata! The Pentaho metadata paradigm uses the term concept to mean a collection of metadata
properties that can be applied to a given business object (business table or column, for example).
Concept Defined
Here is the official definition of a concept:
Unknown macro: {multi-excerpt-include}
Concept Overview
This excerpt from the Metadata Business Model Overview describes some of the details regarding concepts and how they are used:
Unknown macro: {multi-excerpt-include}
Required Properties
Required properties and the default concept are two very different things.
All physical and some business objects in the metadata model have a set of required properties. These properties are set automatically on
creation of the object, and are not removable (you can change their values though!). The purpose for required properties is to not allow the user to
get into a predicament where they have removed a property that is integral to the SQL generation process. For instance, if a physical table did not
have a Target Table property set, the SQL generator would complain loudly, since it would not know what physical table to query. So we make
Target Table required and do not allow the user to remove it, although the value is modifiable.
This has ramifications. Using our previous example, when you set a parent concept on the physical table, and the parent concept has a Target
Table property, the physical table will not recognize the parent concept's value for Target Table. This is because the physical table already has a
Target Table property as part of it's self concept, and the self concept always overrides the parent concept. And since you cannot remove a
required property, the parent concept's Target Table will never be recognized at the physical level.
So how do you override a physical object's required property? You set a parent concept at the business model or business view level. Since the
inherited properties are override-able, the parent concept at the business level wins.
All physical metadata objects, the business categories and the business model have required properties. You can see what's required for each
here.
Pentaho metadata provides a Security Information property that allows you to define table or column level security that the Pentaho BI Server can
make use of. Before you can use this property, you need to tell the Pentaho Metadata Editor about your Pentaho BI Server, so that the program
can retrieve the list of Users, Roles and Access Control Lists needed.
3. On the Service tab, enter the Service URL for your server. This is a URL combining the base URL and the service name. The demo
server's Service URL is http://localhost:8080/pentaho/ServiceAction .
4. Next, select the level of detailed security information you want: All, Users or Roles. If you have hundreds of users in your system, you
probably only want to return the roles, and use roles for security information properties. The access control lists are returned with all three
options.
5. In the username field, provide an admin level username to authenticate with the server.
6. And last, enter the password for the user specified above.
You can click the Test button to be sure the settings are correct, and your server is accessible. You should see a message similar to the
following:
Working Offline
You will at times want to work on your model, and may not have access to your Pentaho BI Server. You can save your security information in a
file, and the Pentaho Metadata Editor will be just as happy to retrieve your settings from that file instead of making a trip to the server every time
you open this domain.
1.
2.
3.
4.
5.
6.
7.
With the security property available, now add the individual role or user permissions to the business model, table, or column. These permissions
will then be enforced within Pentaho's BI Platform after publishing the new metadata model.
Once you have all of your business tables created, you will need to create relationships between the tables, so that the query generators and SQL
generators that work with Pentaho metadata can create the data queries correctly.
This is very much like drawing a relational diagram to show primary and foreign key relationships. Although relational links are not the only
relationships that can be modeled. You can create a relationship between any two tables, link any two columns between them and dictate what
the relationship is (one to many, many to many , etc.).
So the important pieces of information to know before you try to create a relationship is:
1. what two business tables would you like to associate with this relationship,
2. what columns in the business tables identify the relationship,
3. and what kind of relationship is it - one to one, one to many, many to one, etc.
4. Select from the From Table / Field list the business table that you would like to start the relationship from.
5. Select from the To Table / Field list the business table that you would like the relationship to go to.
6. You must also specify the business columns (from the adjacent lists) from each business table that identify this relationship. An
alternative, if the business column names are similar, is to click the Guess Matching Fields button, and let the dialog attempt to
determine the columns for you.
7. Next step, define the relationship from the Relationship drop down list.
8. If the relationship requires a complex join, select the complex join checkbox, and enter a formula in the text box provided.
9. Click OK to close the dialog.
10. You should see a new relationship line drawn between the two tables on the Editor Graph, and the relationship represented in the tree.
Note that complex joins appear in the WHERE clause of the SQL statement, so currently any joining that takes place in the FROM
clause of the SQL statement is not supported. An example of a complex join might be
AND([BIZ_TABLE_A.BIZ_COL_A]=[BIZ_TABLE_B.BIZ_COL_A];[BIZ_TABLE_A.BIZ_COL_B]=[BIZ_TABLE_B.BIZ_COL_B]). This
represents a join of two tables based on two key columns vs. a single join column.
Also note, the complex join expression provided must utilize the names of the business tables and business columns, not phyiscal
tables and phyiscal column names.
Follow the instructions from step 4 above to fill in the relationship properties. Note that when the Relationship Properties dialog displays,
the To and From tables are selected for you.
TODO
Relationship Definitions
The relationships that can be chosen are defined with examples:
Link: A 0:0 optional relationship basically states that a person can occupy one parking space, that I don't need a person to have a space and I
don't need a space to have a person.
SubType: A 1:0 relationship; optional only on one side. This would indicate that a person might be a programmer, but a programmer must be a
person. It is assumed that the mandatory side of the relationship is the dominant.
Physical Segment: A 1:1 mandatory relationship and demonstrates a segmentation denormalization. A person must have one and only one DNA
pattern and that pattern must apply to one and only one person.
Possession: A 0:N (zero to many) optional relationship indicating that a person might have no phone, one phone or lots of phones, and that a
phone might be un-owned, but can only be owned by a maximum of one person.
Child: A 1:N mandatory relationship, the most common one seen in databases. A person might be a member or might not, but could be found
multiple times (if the member entity represents membership in multiple clubs, for instance).
Characteristic: A 0:N relationship that is mandatory on the many side. It indicates that a person must have at least one name, but possibly many
names, and that a name might be assigned to a person (might not) but at most to one person.
Paradox: A 1:N relationship mandatory on both sides. The "Chicken and the Egg" is involved since you have to have a person to have citizenship,
but citizenship to have a person.
Association: A N:N (many to many) optional relationship. Conceptually, it means that a person might or might not work for an employer, but could
certainly moonlight for multiple companies. An employer might have no employees, but could have any number of them. Again, not hard to
visualize, but hard to implement. Most solutions of this situation involve creating a third "Associative Entity" to resolve the M:M into two 0:M
relationships. This might be an entity called employee because it does link the person to the employer the person works for.
WARNING: Row Level Security is only in effect at the Model level. Any data constraints defined below the Model Level, such in a
Business Table or Business Column, is ignored and not used.
From the Model Properties dialog, select the General -> Data Constraints Property:
By default, Row Level Security is not enabled. There are two forms of Row Level Security in Pentaho Metadata, Global Constraint and Role
Based Constraints.
Global Constraint
If using the Global Constraint, a single MQL Formula is used to define security for all users. In addition to the standard MQL Functions available,
there are also two additional functions available.
USER() - returns the name of the current user
Constraint
Admin
TRUE()
Sales
[BT_OFFICE.BC_DEPARTMENT]="Sales"
Engineering
[BT_OFFICE.BC_DEPARTMENT]="Engineering"
Important Note
Row Level Security Constraints are applied at the MQL Layer. The Business Columns referenced in the MQL Security Constraints will be
resolved down to SQL Table Columns. The Tables which contain column references included in security constraints will be joined to your query,
based on the relationships defined in the Business Model. It is recommended that you do not use outer joined business columns for the purposes
of security constraints.
Congratulations! You are almost done building your business model! The last step is for you to define the business view for the model.
A business view is defined as
Unknown macro: {multi-excerpt-include}
A business category is just a named bucket for you to group and re-group your business columns in. They can mimic your business table names,
or be named after your favorite rock stars. Categories do not have metadata associated with them, have no tie back to any business table
(although our Editor will give you the impression this relationship exists - don't be fooled), and have the simple purpose of allowing you to bucket
the business columns in your model as intuitively as possibly for your data consumers.
Today, categories are a single level entity. We hope in the future to support nested categories.
Building a business view consists of creating your categories, then moving your business columns from the business tables into the categories.
You can move columns from different business tables into the same category, and even duplicate the same business column into two different
categories.
The Editor Graph only represents the business tables portion of the business model, so we use the Tree Navigator and the Category Editor to
create a business view.
Right-click (or ALT-click) on the Business View branch in the Navigator Tree.
Select the New Category... option from the popup menu.
The Category Properties dialog displays.
Give the category a name in the Name/ID field.
Select OK when you are done.
Under Construction
Note that the dialog that you are presented with at this point leads you to believe that you can set metadata properties
on a category. While technically possible, it makes no sense and is not going to be carried forward. So ignore the
properties features of the Category Properties dialog, and just set a name.
Under Construction
Currently, there is a bug that prevents you from selecting muliple business columns and dragging them for category
placement. We know this makes building the view a bit cumbersome, but the Category Editor can relieve that
frustration. Read on!
1. Either double-click on the Business View branch in the Navigator Tree, or choose the *Category Editor..." option from either the main
menu or the main toolbar.
2. The Category Editor dialog displays.
The Category Editor allows you to create categories directly from your business tables, move columns into categories, add new categories and
remove categories and columns.
In order for the Pentaho BI Server to make use of your metadata domain, you must share an XML representation of the domain with a Pentaho
solution that your server knows about.
You can accomplish this by exporting your domain file, and copying it manually to the solution directory of your choice. Or, you can use the
Pentaho Metadata Editor's publish feature, if you know the credentials to your server.
Publishing
1.
2.
3.
4.
From the main menu's File menu, select the Publish to Server option.
The Publish dialog displays.
Enter the publish location, which is your solution name.
Enter the web publish URL, which is your Pentaho BI Server's base URL followed by the publish service name.
RepositoryFilePublisher is the default.
5. Enter the publish password .
6. Enter the administrator username.
7. Enter the administrator password.
If the metadata.xmi file already exists on the server, you will be prompted to overwrite it.
Troubleshooting Publish
If publishing to the server fails, here are a few things you will want to verify to be sure your information and configuration is
correct:
Make sure that the publish password is set on the server. You cannoot use the server's publish utility if that password is
not set. The publish password is defined in publisher_config.xml in directory pentaho-solutions\system.
Verify that your server credentials have admin level responsibility.
Do not use a trailing or leading slashes on the server URL, solution name or domain file name.