Connecting from your application - Linked Data

In the previous section you have learned how to issue queries from the RESTful interface of Denodo. Now you will see how to enable linked data using a new Denodo element: associations.

Associations in Denodo

Associations represent a relationship between elements of two Denodo views. The concept is very similar to the Primary Key / Foreign Key restrictions in relational databases.

Associations allow third-party consumers (like Modeling or Analytical BI tools) the ability to instrospect relationships between virtual views.

NOTE

For example, the elements of the client view can be related with the elements of the address view (every customer is related with an address).

Based on the definition of the associations, the Denodo RESTful Web Service will show links that will allow you to traverse the associations. Let's see how it works by means of an example, using the views created in previous sections of the tutorial.

How to create a new association

To create a new association in Denodo, you can follow these steps:

  1. Right-click over the elements tree and select New > Association.
  2. Drag the views involved in the association. In this case, you have to drag client and address views to the workspace.
  3. Link the fields that map the association. In the example, client_id and client_fid fields.
  4. Go to the Output tab and give a name for the association: client_address.
  5. You have to provide names for each one of the endpoints (Role name fields).
    • Endpoint 'client': address.
    • Endpoint 'address': belongs_to_client.
  6. Mark the Referential contraint checkbox: this will allow the association to be exposed like as a Primary Key / Foreign Key restriction (for JDBC and ODBC clients).
  7. Finally, click Ok.

Using the association

Now it's time to return to the RESTful Web Service and get the results of the client view (see previous section for more information about how to query using the RESTful Web Sevice).

As you can see in the screenshot below, a new column with a link is added to the output table and the text of the link is the Role name configured in the association for the endpoint. In this example, if we click on address link for the customer John Smith, Denodo will follow the association to drill down into his address.

In the same way, in the address page loaded, a link with text belongs_to_client appears to load in the browser the customer information when clicked.