Setting up a data model - 6.1

Talend Data Fabric Studio User Guide

EnrichVersion
6.1
EnrichProdName
Talend Data Fabric
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

If you have the appropriate user authorization, you can create one or multiple data models for any domain and store them in the MDM Hub.

Once created, an authorized user of Talend MDM Web User Interface can validate hub data against these data models. For more information, see the Talend MDM Web User Interface User Guide.

A few steps are necessary to complete the creation of a data model:

  1. Create business entities in the model.

  2. Adding attributes in each of the created business entities.

  3. Set annotations to entities or attributes regarding access control, display issues, role authorization, foreign key, etc.

You can also define reusable types for any data model. These reusable types are sets of attributes that can be used in one or more entities of the data model. Using reusable types is a way of factoring the data model and managing the impact of changes since any modification on a reusable type will have an impact on every entity that uses this type.

Once the data model is created, you can easily create Views over one or multiple business entities held in this data model. Creating a View on a business entity allows a business user inside Talend MDM Web User Interface to visualize specific records in this entity according to the defined criteria.

Note

Once the data model is created, you can right-click any of the entities held in this data model and automatically generate a default View for the selected entity.

For more information, see Views.

Once the creation of the data model is complete, you may need to design one or more Processes and create a View to define search parameters on business entities and data records in the created data model.

For more information on Processes and Triggers, see Processes and Triggers respectively.

For more information on Views, see Views.

How to create a data model

Prerequisite(s): You have already connected to the MDM server from Talend Studio.

To create a new data model, proceed as follows:

  1. In the MDM Repository tree view, right-click Data Models and select New from the contextual menu.

    A dialog box appears.

  2. Enter a name for the new model. Make sure that the name contains valid characters and does not already exist.

  3. By default, the Create the corresponding Data Container at the same time check box is selected, so that the corresponding data container with the same name will be created.

    If needed, you can clear this check box and create the corresponding data container with the same name later.

    Warning

    A data container and its corresponding data model must have the same name.

  4. Click OK to validate your changes and close the dialog box. The newly created data model and its corresponding data container will appear in the MDM Repository tree view.

  5. Click the data model, and an editor appears in the Studio workspace where you can set up the parameters for the new data model.

You can define your business entities, attributes, annotations, etc. in the upper part of the editor; while the lower part will display the properties of any of the elements you select in the editor.

The editor also enables you to switch to the XML schema source by clicking the Schema Source tab. After clicking the Schema Source tab at the bottom of the editor, you can create the data model directly in the schema source, that is, an XML schema document. For more information, see How to work with the schema source of a data model.

Additionally, the editor also enables you to switch to a graphical view of the data model. For more information, see How to work with the graphical view of a data model.

How to create business entities in the data model

Prerequisite(s): You have already created a data model. For further information, see How to create a data model.

To create business entities in the data model:

  1. Right-click in the Data Model Entities panel and select New Entity to open the [New Entity] dialog box.

  2. In the Name field, enter a valid name for the new entity.

    Warning

    Make sure the entity name does not contain the character "-". Otherwise, warnings about invalid characters will be displayed in the MDM Problems view.

  3. Select the Complex type option if you want to define a complete structure, such as an address. The steps that follow differ according to the selected type.

    Note

    You cannot create two complex types where one is a base type and the other is a type that derives from the base type, and then create entities based on these types.

    Instead, you should first define a higher level entity which implements its own complex type (for example, Media) to define all common elements for the entity. Next, define another complex-type element (for example, MediaSpecifics) which can extend Media and then be extended in turn. In this example, MediaSpecifics could be extended with Books to add elements that are specific to books and Audio to add elements that are specific to audio media.

    At this point you can create a Browse_item_Media#Books View that filters (where clause) on @xsi:type - equals - Books and a Browse_item_Media#Audio View that filters on @xsi:type - equals - Audio. The standard Browse_item_Media View would return all media.

    For more information on creating Views, see Views.

  4. Select the Simple type option if you want to define a single element type such as a phone number, an email, etc. The steps that follow differ according to the selected type.

    Note

    You can still change the entity type after you create it if you right-click the entity in the Data Model Entities panel and select Change to a Complex Type or Change to a Simple Type.

  5. If you select Complex type, select the group type among:

    -All: to list the elements in any sequence,

    -Sequence: to list the elements according to the defined sequence,

    -Choice: to have a choice on the elements.

  6. Enter a name for the complex type in the corresponding field, if you want to create a reusable type of this entity.

    Warning

    Make sure the name of a complex type does not contain the character "-". Otherwise, warnings about invalid characters will be displayed in the MDM Problems view.

    Reusable types are sets of attributes that can be used in one or more entities.

    Note

    The complex type list gives you access to all complex types you create in your data model. When defining a new entity, you can select from this list the complex type from which you want to inherit elements in the new business entity. Each complex type you define can serve as the basis for another complex type. For further information, see Data model inheritance and polymorphism.

  7. If needed, select the Abstract check box to define the complex type as an abstract one.

    Abstract complex types are useful for creating generic base types which contain information common to a set of types. For example, you can define Shape as an abstract complex type, and then derive two complex types Circle or Square from Shape.

    An abstract complex type cannot be used directly as the main type of an entity. Instead, you can use a complex type derived from this abstract complex type.

  8. Click OK to validate your changes and close the dialog box.

    The created business entity is listed in the Data Model Entities panel with a by-default record, which takes its name from the entity name with the suffix Id, and the complex type, if any, is displayed in the Data Model Types panel.

    Note

    Each time you create a new business entity, a default Primary Key record, which takes its name from the entity name with the suffix Id, and a Unique Key record which has the same name as the Entity are automatically created. For example, if you create a new business entity and name it Agency, the Primary Key record AgencyId will be created automatically.

    A Primary Key can be an integer but a Foreign Key must always be a string. The server surrounds Foreign Keys with square brackets to support compound keys.

  9. Repeat the above steps to create as many business entities as you need in your data model.

    All business entities you create are listed in the Data Model Entities panel.

To finish defining the business entities in your data model, you must create attributes in these business entities. These attributes represent the characteristics of each of the business entities. For further information, see How to add attributes to the business entity.

Displaying user data differently based on locale

You can also set up the elements you create so that the Talend MDM Web User Interface displays the data for a record differently depending on the user's locale.

Prerequisite(s): You have already created business entities in the data model. For further information, see How to create business entities in the data model.

  1. Right-click the element, and then click Change to a Simple Type in the contextual menu.

    The [Make Simple Type] dialog box opens.

  2. Select the Custom radio button and set the Type as MULTI_LINGUAL by selecting this option in the drop-down list, and then click OK.

Users of Talend MDM Web User Interface will now be able to create localized instances of the data for this field. For further information, see the Talend MDM Web User Interface User Guide.

How to add attributes to the business entity

Prerequisite(s): You have already created business entities in the data model. For further information, see How to create business entities in the data model.

To add attributes to the business entity, do the following:

  1. Expand the business entity you created and the group type in succession and right-click subelement then select Edit Element from the contextual menu.

    A dialog box is displayed.

  2. Change the name to Id then click OK to close the dialog box.

  3. Right-click Id, select Add Element (after) from the contextual menu, and then select Add string Element.

    A dialog box displays.

  4. Enter a name and a minimum and maximum number of occurrences for the new attribute in the corresponding fields.

    Note

    Talend Studio supports the definition of multi-occurrence attributes. You can set the Maximum Occurrence value to a specific number or leave it blank, which means the maximum number of occurrences is not bounded: in this case, the cardinality will be [1..many] or [0..many].

  5. Click OK to validate your changes and close the dialog box.

  6. Follow the same steps to create as many attributes as needed in the business entity.

    All attributes you create are listed under the business entity in the Data Model Entities panel, and all complex types are listed in the Data Model Types panel.

    Note

    The data model editor includes a Properties view that displays all the properties of the selected entity/attribute in the data model. You can use this detail view to edit dynamically any of the entity or attribute listed in the data model. For further information, see How to use the Properties view in the data model editor.

  7. If required, right-click any of the listed element and select Edit element to open a dialog box where you can change the parameters for the selected element.

In the data model editor, you can click the Schema Source tab to switch to the XML schema source of the data model, or click the Design tab to switch to the graphical view of the data model.

For more information, see How to work with the schema source of a data model and How to work with the graphical view of a data model.

After defining business entities and attributes in your data model, you must set annotations to these entities or attributes regarding access control, display issues, role authorization, foreign keys, etc. For details, see the following sections.

How to work with the graphical view of a data model

In the data model editor, you can click the Design tab to switch to the graphical view of the data model.

The view presents the data model in a graphical format, which shows the complex types in the upper area and the data model entities in the lower area.

You can make the graphical view zoom in or zoom out by clicking the and the buttons at the bottom of the view.

In the Data Model Types area, each complex type is represented by a rectangle. The entire area can be collapsed or expanded by clicking the arrow in the upper left corner.

In the Data Model Entities area, each entity is represented by a rectangle, with its attributes and attribute types. The relationships between entities are represented by links between them, which have a key icon with a green arrow .

Within a rectangle (entity), if an element has more than one subelement, you can click the plus or minus button before the element to expand or collapse it.

In the Data Model Entities area, each time you click a complex type, a link will be displayed pointing to the representation of the complex type in the Data Model Types area, which helps you to learn the definition of the complex type.

In the Data Model Entities area, if two linked entities are far from each other, each time you hover the pointer over the link between two entities, the link and the two relevant entities will be highlighted, and a tooltip figure will pop up which shows the information of From and To entities. Moreover, if you click the icon next to an entity in the tooltip figure, it will jump to the corresponding entity directly.

To better understand the relationships between entities in a data model, you can customize the layout of the graphical view.

To change the layout of the graphical view, do the following:

  1. Right-click anywhere in the view, and then select Arrange All from the contextual menu.

  2. Drag-and-drop a data model type or an entity (rectangle) to the desired place.

  3. Save your changes.

Once you have finished changing the layout of the graphical view, you can save the graphical view of data model types or data model entities as an image file.

To save the graphical view of a data model as an image file, do the following:

  1. Right-click anywhere in the view, and then select File > Save As Image File... from the contextual menu.

  2. In the [Save As Image File] dialog box, browse to or enter the folder where you want to save the image file in the Folder field.

    You can also enter the file name in which you want to save the image file in the File Name field, and select the image file format from the Image Format list.