Connect to an OData source

Version 2

    Connect to an OData Source

    This article will guide you through an example of connecting to an OData source, using Teiid Designer.  It is assumed that you have already installed Teiid Designer version 8.3 or higher.  For this example, we will use a publicly accessible service http://services.odata.org/Northwind/Northwind.svc/ .  You can use other OData sources, but note at the time of this writing Teiid supports OData v2 and some features of V3.

     

    1. Start your local teiid server instance

    • Teiid Designer requires a running Teiid server for Data Preview.  We will use the Data Preview capability to test our OData source.

     

    2. In Teiid Designer, use the 'Teiid Connection' importer to create a source model

    • Select File > Import... > Teiid Connection >> Source Model , then click Next

    DesignerSelectTeiidConnImporter.png

    • On the first page of the wizard, click New... to create a new Data Source
    • On the 'Create DataSource' dialog:

    TeiidConnImporter-CreateODataSrc.png

    • Back on the first wizard page, the ODataNorthwindDS should show up in the data sources list.  Select it, then click Next
    • On the next page of the Teiid Connection import wizard
      • Select odata for the translator
      • Enter ODataNorthwindMdl for the target Model Name
      • click Next

    TeiidConnImporter-SelectTranslatorPage.png

    • The next page of the wizard should display the schema DDL.  click Next

    TeiidConnImporter-ViewODataDDLPage.png

    • The final page of the wizard shows the table to be created, and allows you to select which tables will be imported.  Leave all tables selected.  Click Finish.

    TeiidConnImporter-ODataSelectTablesPage.png

    • The relational model ODataNorthwindMdl should now be created in the ModelExplorer view

     

    3. Preview the OData source tables

    • In ModelExplorer, expand the model and select one of the tables, e.g. Alphabetical_list_of_products.  Click the 'Running man' icon in the ModelExplorer toolbar.  The preview query should execute, with results displayed in the SQL Results View.