Skip to main content

Hi Community,

The first posts about the business glossary dealt about applying more term types (attribute and entity terms), and how they get context by adding relationship types. The previous post was about implementing multilingualism. The post ended with a remark about computed content, being the topic of this post.

To refresh your memory, at the end of the article I showed this screen print, depicting how the translated terms show in the term’s detail page. So like this.

Notice that the translation of the term name is preceded by the language code, so it is a concatenation in other words. I will describe how you can define this. Actually to accomplish this I made use of a document that Ataccama provided and that I will add to this article. The document also describes another use-case, so make sure to have a look! Anyhow, this is how the concatenation of the language code and translated term name is done.

The calculation is defined in a new metadata model entity. As naming convention you can end the entity’s name with CC, so you can easily recognize all entities in which some computation has been defined.

  1. So we start with creating a new entity called languageTranslationCC.
    Now save the entity, but do not yet publish the change!
  2. Open the Computed Content tab
  3. Click the Add Entity button, then select the entity that contains one of the properties that is needed in the concatenation.
  4. Add an alias in the appropriate field. This is needed later in the final query.
  5. Click the Add Property button for this entity and add the following properties (not necessarily in this order).
    In this example name is the functional property that is needed in the calculation, the others are system properties.

     

  6. Repeat steps 3, 4 and 5 for the language entity.

     

  7. Now enter the query that contains the calculation:

    select t.$tID$ as "id_i"

    ,      t.$tID$ as "parent_id_i"

    ,      t.$lFrom$ as "from_h"

    ,      $path(t.$tPath$)$ as "path_i"

    ,      $type()$ as "type_i"

    ,      l.$llanguageCode$ as "languageCode"

    ,      l.$llanguageCode$ || ' - ' || t.$tName$ as "languageTranslation"

    from   $t$ t

    join   $l$ l

      on   l.$lID$ = t."language_ri"


    Note that

    1. the first two items in the select are the same; this is no error!
    2. the concatenated attribute must conform to the general naming conventions of properties:
      Only alphanumeric characters and underscore are allowed in the property name. Name must not start with a number or underscore.
  8. By clicking Add Computed Property you can assign the calculation to a property. The name of the calculation is used as name of the property.
    In this example also a variable had been created for languageCode. This variable has no further usage though, so has no further relevance.

     

  9. Below the Query window you can click the Preview Results button to check if the query works well.

     

  10. The overview screen now also reflects the SQL variables as new properties for the entity.
  11. Now this change can be published.
  12. Following the computed content must be added to the entity where it is needed, in this case entity termTranslation, looking as follows:

     

  13. Embed the entity containing the computed content as single object.

     

  14. Finally add a delegated scalar property that points to the required calculated property in entity languageTranslationCC.

     

  15. The complete set of properties of the entity in this example is now

     

  16. Now the concatenation is shown in the term's screens. Together with the translation the language code is shown (refer to picture at the top).
  17. The calculation has a side-effect when you click on one of translations in the term's screen, thus accessing the detail translation window.
    Now at the lower part of the window the SQL variables/properties from entity languageTranslationCC are shown.

    To hide this the page layout must be edited as follows.
    1. On the top right of the page click the three dots and select Edit page template.
    2. A window opens to the right with the definition of the page layout.
      Add the indicated blacklist in the section of property types SEE and AEE, that apply to the embedded objects.

       

And now you are, finally, done (and likely need some recovering).

So time to quit. New post coming up!

Kind regards,

Albert

Hi @Albert de Ruiter thank you for the detailed article with many useful tips, I see that in some occasions the small details such as how property names are structured can impact the result. Great one for the series, hope that other members find it useful as well!


Reply