Working with Entity Relationship Models

Objective

After completing this lesson, you will be able to use entity relationship models in SAP Datasphere

Entity Relationship Models

Let's explore how you can use entity relationship models in SAP Datasphere.

Entity Relationship Models

The figure shows a screenshot of an entity relationship model with an association between Sales Manager in a Fact view (Sales Transactions) and Sales Manager in a Dimension view (Sales Manager).

You can create an entity relationship model to import, visualize, edit, and deploy multiple data entities (tables and views) together. You can use an entity relationship model to better understand a subset of the entities in your space, and to communicate this information to other stakeholders.

An entity relationship model provides a diagram for arranging your data entities (tables and views) in relation to one another. You can do the following:

  • Add entities from the repository or import them from a connection or a CSN file, as well as creating new entities directly.
  • Modify the properties of your entities including adding human-readable business names and creating associations directly in the diagram.
  • Save and deploy all the contents of your model with a single action.

The work that you do in an entity relationship model benefits all the users in your space as they can use the entities that you import or enhance as sources in their views.

The rules for creating associations depend on the semantic usage of the entity:

  • A fact can point to a:
    • Dimension: One attribute in the (source) fact must be mapped to each (target) dimension key column so that all target key columns are mapped.
    • Text entity: One attribute in the (source) fact must be mapped to each (target) text entity identifier key column.
  • A dimension can point to a:
    • Dimension: One attribute in the (source) dimension must be mapped to each (target) dimension key column so that all target key columns are mapped.
    • Text entity: One attribute in the (source) dimension must be mapped to each (target) text entity identifier key column.
    • Hierarchy: Each key attribute in the (source) dimension must be mapped to a (target) hierarchy child attribute key column.
  • A text entity must not point to other entities.
  • A hierarchy will generally not point to other entities.
  • A hierarchy with directory must point to:
    • A dimension acting as its directory. The hierarchy name attribute in the (source) hierarchy entity must be mapped to the primary key column in the (target) dimension.
    • Any dimension (other than the data node dimension) providing nodes to the hierarchy. The appropriate node type values columns in the (source) hierarchy must be mapped to the key columns in the (target) dimension.
  • A relational dataset can point to any other entity and should generally follow the rules for dimensions.