USER MANUALS

OData 4 Sources

OData is a protocol created by Microsoft, to access data. The version 4 of OData became standardized by the OASIS OData Technical Committee (TC). It provides CRUD operations and is similar to JDBC or ODBC but not limited to databases.

OData v4 uses JSON (and optionally Atom) for representing data, and requests follow a REST model. For this reason, OData is considered an implementation of a RESTful API which additionally offers a way to describe the published data and its model.

The two main versions of the OData protocol: 2 and 4. This data source is to query OData version 4 sources.

Create OData v4 Data Sources

To consume data from an OData v4 service, create an OData v4 data source. That is, click the menu File > New > Data source and select OData v4.0 (Custom).

Creating a OData v4 data source

Scroll down and expand Service Endpoint:

  • Service Endpoint (mandatory): connection details to the OData service. Select HTTP Client and configure the parameters to connect to the service.

    • Configuration

      Configure service endpoint
      • HTTP Method: select GET.

      • Base URL: URL of the OData v4 endpoint.

    • Filters: usually, you do not need to set anything here.

    The other settings of this panel are configured like any other HTTP Path of a JSON or XML data source (the page HTTP Path explains how to do it).

  • Service Format (mandatory): format used by the wrapper to access the OData service. Must be one of these: JSON or XML-Atom (JSON is default and recommended in OData v4).

Click Save.

Create OData v4 Base Views

Now, you have to create a base view to query the data of an endpoint of this OData service. To do this, in the wizard of the OData data source, click CREATE BASE VIEW and enter these values:

  • Entity Collection (mandatory): name of one of the collections defined at the OData service, specified as the complete URL path (without parameters) required to reach that collection. For example: Customers or Company('DND')/currentCustomers.

  • Entity Name (optional): name of the entity type modeling the data returned by the Entity Collection, as defined in the service’s EDM. If no value is specified, then the Entity Collection will be considered to appear in the Service Document and the Entity Name will be inferred from there. For example: Customers > Customer.

  • Custom Query Options (optional): parameters that will be added to the URLs sent to the OData service for obtaining data. A custom query option is any query option with the following form customOption = customValue. To specify several query options, separate each option with the character &. Custom query options cannot begin with the characters $ nor @, according to the OData v4 standard. Example: http://host/service/Products?debug-mode=true

  • Expand Related Entities (optional): if selected, the references to other entities appear directly in the main entity as arrays or registers.

  • Enable Pagination (optional): if selected, the base view will have two more fields that can be used to paginate through the results. Names of these fields: fetch_size and offset_size.

  • Load Streams (optional): if selected, Stream properties and Stream entities will be returned as BLOB objects instead of a link to the media resources.

  • Use key predicates in URL paths when possible (optional): if selected, key predicates will be used in URL paths instead of filtering.

Examples

You can create a sample base view over a public OData v4 endpoint: https://services.odata.org/TripPinRESTierService/(S(u0oajn0druadw1sqglfm5mmz))/.

After setting the base view parameters, click Create Base View. Now, you can execute query like these:

SELECT * FROM bv_odata4_people WHERE where username = 'russellwhyte';

INSERT INTO bv_odata4_people
   (username, firstname, lastname, gender, age)
VALUES
   ('dataninja', 'Data', 'Ninja', 'Female', 30);

UPDATE bv_odata4_people SET gender = 'Female' WHERE username = 'russellwhyte';

DELETE FROM bv_odata4_people WHERE username = 'russellwhyte';

Known Limitations

  • This custom data source works with OData version 4.0; it does not support previous versions of OData. To query OData 2.0 services, create an OData v2 data source.

  • Filtering of elements by array properties is not supported. OData does not allow this kind of search.

  • Filtering by media read links properties is not supported.

  • The insertion of arrays is not supported.

  • The insertion or update of media file properties is not supported.

  • Addressing derived types properties is not available. When you have entities with a type derived from the declared type of the requested collection, their properties will be added to the schema of the base view, but you cannot project these properties separately.

References

Public OData examples:

Add feedback