Discovery Guide > Working with Models in Discovery > Creating a Model > Adding a Resource to a Model
 
Adding a Resource to a Model
Any supported data source with tabular resources can be added to a model. To see the discovered relationships between the data source tables, you need to index and discover the relationships prior to adding them to the model. (See Working with Data Domains in Discovery.)
When you add resources to a model, Discovery always displays:
All EXPLICIT resources—Resources explicitly selected or dragged into the model.
All IMPLICIT resources—Resources whose parents were selected or dragged into the model.
All RELATED resources —Resources related to EXPLICIT or IMPLICIT resources via a hard relationship (FOREIGN KEY, USER DEFINED, or DISCOVERED).
All DEPENDENT resources—Resources related to EXPLICIT, IMPLICIT, or RELATED resources. This is currently limited to views.
Resources in the Discovery model can be classified as EXPLICIT or RELATED among other types. EXPLICIT types refer to the resources added in the model explicitly by users. When user creates user-defined relationships those resources not identified as EXPLICIT can be marked as RELATED. This can occur when a resource is added explicitly and the added resource was related to another resource, not yet in the current model, by "user defined relationships". This secondary resource is marked as RELATED. This "RELATED" link chain can span more than one level. The related links will be discovered until it is fully exhausted.
Consider three resources A, B, and C where user created "user defined relationship" between A and B, and B and C prior. By a transitive nature of these relationships, A is related to C via B. When A is added to a model both B and C will be included as "RELATED" types. Subsequent Discovery model load/save/refresh will reflect this logic. This will also affect deletion of resources as all related resources are removed when necessary.
You can determine why a resource is included using the model Resources tab. See Working with the Model Resources Tab.
You can add a resource to a model in one of two ways: from the Studio resource tree, or using the Add/Remove resources button in the model Diagram.
To add a resource to a model from the Studio resource tree
1. Select the resource—data source, catalog, schema, table, or view—in the Studio resource tree and drag it onto the model workspace.
Discovery displays the Diagram tab.
The model Diagram displays these objects:
Tables in the selected resource (in blue). If you have indexed and discovered the resource, the model shows the table relationships.
Tables in other indexed/discovered resources that are related to the selected resource.
Views that are dependent on the displayed resources (in green).
2. Use the controls on the Diagram tab to work with the model. See Working with the Model Diagram.