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.
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:
Click on the Connect to view
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%20ascThere are more other options like $select, $filter, $orderby and $expand, which can be used with the OData URL and customize the results.
GraphQL is a data query language, and a runtime for executing those queries against your data.
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
}
}
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.