How to invoke Denodo views using generic Endpoints (OData, GraphQL and RESTful)

At this point you have implemented Denodo views as SOAP and REST Data Services in the Denodo internal web container, let's see how to invoke Denodo views as OData and GrahQL services.

Invoke Denodo views using OData Service

Open Data Protocol (OData) is a REST-based protocol for querying and updating data using simple HTTP messages. It is an OASIS standard based on technologies such as HTTP, Atom/XML and JSON.Virtual DataPort provides an OData 4.0 compliant interface, through its Denodo OData service.

The OData Service is available at:
https://denodo-server.acme.com:9090/denodo-odata4-service/denodo-odata.svc/database_name

To use the Denodo OData Service:

  • Login to Design Studio by providing your Username and Password.
  • Click on the more options button and Click on the Open OData Service.
  • A dialog box with two links opens,
  • Click on the Connect to view link to view the Denodo view through Denodo OData service. A new browser window opens with the default ATOM format. Use the default username and password (admin/admin) to view,

    http://localhost:9090/denodo-odata4-service/denodo-odata.svc/tutorial/address

    To change the default format and view the data in JSON format, provide $format=JSON and order by the results using the Advanced Querying in the OData URL,

    http://localhost:9090/denodo-odata4-service/denodo-odata.svc/tutorial/address?$format=JSON&$orderby=city%20asc

    There are more other options like $select, $filter, $orderby and $expand, which can be used with the OData URL and customize the results.

    Invoke Denodo views using GraphQL service

    GraphQL is a data query language, and a runtime for executing those queries against your data.

    • It gives clients the power to ask for exactly what they need.
    • It gets many resources in a single request, reducing the number of API requests.

    Denodo GraphQL Service enables the execution of GraphQL queries against the Denodo virtual data model, allowing graphQL-like queries on top of any data source. The GraphQL Service can be accessed via tools like Postman, GraphQL Playground, GraphiQL, etc.

    To access the GraphQL service, go to

    http://localhost:9090/denodo-graphql-service/graphql/database/schema.json

    This service is always available once you start Virtual DataPort. You can execute GraphQL queries against the Virtual DataPort Server by using the Denodo GraphQL service.

    As a Prerequisite, download and install the GraphQL application from its official site.

    By default, Denodo GraphQL Service responses are represented in JSON format. The minimum Privileges required to access the service will be Connect privilege at database level and Minimum of Execute privilege at view level.

    Let us access the view “address” in the tutorial VDB from GraphiQL.Provide,

    For example, if the username and password is admin/admin, then convert this to Base64 encoded value in the https://www.base64encode.org/, which will be

    {"Authorization":"Basic YWRtaW46YWRtaW4="}

    Let us provide the query to fetch certain columns of the “address” view from the tutorial database on the left panel of GraphiQL,

      {
      address{
      client_fid
      street
      city
      zip
      state
      }
      }

    Invoke Denodo views using RESTful-WS

    The Denodo RESTful Web service is an HTTP service deployed by default in the URL http://localhost:9090/denodo-restfulws that exposes resources like databases and views in the following standard representation formats such as XML, JSON and HTML. You can refer the Connecting from your application - RESTful Web service where RESTful service is explained in detail.

    The next section of the tutorial will show you how to add the implementation to your interface and how the services will return the results without needing to redeploy them.