Skip to main content

Display custom relationships as fields on resource pages (MDP)

Use this feature to highlight the most important custom relationships in your system by displaying them as fields on the Overview page in addition to the Related page.

Relationships as field added to an out-of-the-box section on a resource page:

relationships_as_fields.png

Relationships as field added to a custom section on a resource page:

relationships_as_fields_custom.png

Relationships as field added to Eureka Explorer page:

relationship_as_field_ee.png

Why would I do this?

This feature allows data consumers to see and edit the most important related resources for a resource without having to click over to the Related tab.

Use the following guidelines to plan relationships as fields.

  • Identify the related resource you want to display as a field on the Overview page.

  • If the relationship is bi-directional, decide if you want to show the relationship as field on both resources.

  • Identify the title to be used for the relationship field to be displayed on the Overview page. For example, in the example in this article we use the titles, Related Stewards, Related Acronyms.

  • Identify if you want to show the relationship in a custom section or in one of the out-of-the-box section.

STEP 1: Add the relationship as field on the Overview page

This example builds on the example explained in creating custom relationships.

  • Add the following syntax to specify the relationship you want to show as a field on the Overview page.

    ## locate the code where you are defining the relationship
    :MetricToAcronym 
      rdf:type                    dwec:RelationshipPresentation ;
      dwec:inRelationshipSection  :RelationshipSection ;
      dwec:forType                :Metric ;
      dwec:forTargetType          :Acronym ;
    ##Add the following code to display the relationship as a field.  
    rdfs:label                  "Related Acronym" ;
      dwec:usesFieldPresentation  [
        rdf:type                dwec:RelationshipFieldPresentation ;
        rdf:type                dwec:Mandatory ;
        dwec:inMetadataSection  :MetadataSectionInformational ;
      ] ;

    Here is a description of the code for defining relationship as a field:

    Table 1.

    Property

    Description

    rdfs:label

    Define the label for the field. For example, Related Acronym.

    Note: A reletionship can have only one label.If you have already set a label for the relationship while making it facetable, you should not set this label again.

    dwec:usesFieldPresentation

    Define the presentation properties for the field. This includes defining the section where the relationship field will show and if the field should display even when it does not have value.

    rdf:type

    Set it as dwec:RelationshipFieldPresentation

    Add rdf:type dwec:Mandatory if you want to always show the field on the Overview page even when it is blank.

    dwec:inMetadataSection

    Define the section where the field will show. It can be an out-of-the-box section or a custom section. For example, MetadataSectionInformational

    To show the relationships as fields in the Eureka Explorer sidebar, set the value as MetadataSectionLineageSidebar.



View the results

  1. The relationship is displayed as field on the resource page.

    relationship_as_field.png
  2. You can now easily append more related resources by simply clicking the Edit button on the Overview tab.