The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. The protocol emerged from experiences implementing AtomPub clients and servers in a variety of products over the past several years. OData is being used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.
OData is consistent with the way the Web works - it makes a deep commitment to URIs for resource identification and commits to an HTTP-based, uniform interface for interacting with those resources (just like the Web). This commitment to core Web principles allows OData to enable a new level of data integration and interoperability across a broad range of clients, servers, services, and tools.
copied from http://odata.org
When a user successfully deploys a VDB into a Teiid Server, similar JDBC and ODBC protocol support, the OData protocol support is implicitly provided by the Teiid server without any further configuration. OData is support is currently not available in the Teiid Embedded. Teiid makes use of JBoss AS and its already configured RestEasy libraries, and OData4J libraries to provide a Rest based access to the VDB. The access would be similar to accessing to any web resources deployed on JBoss AS. For example, if you have a vdb by name northwind deployed and that vdb has a table customers then you can access that table as
http://localhost:8080/odata/northwind.1/customers
this would be akin to, making a JDBC/ODBC connection and issuing a SQL call as
SELECT * FROM customers
the returned results from OData query can be in Atom/AtomPub xml format or JSON format. By default AtomPub based XML result is returned.
For detail protocol access you can read the specification at http://odata.org. You can also read this very useful web resource for an example access of a OData server.
Currently by default the OData access is secured using the HTTPBasic, and user will be authenticated against the Teiid's default security domain "teiid-security" and makes use of the security role odata. However, if you wish to change the security domain, manually edit the web.xml file WAR file in <modules>/org/jboss/teiid/main/deployments directory. In future versions more WS-Security based configurations will be provided.
The following feature limitations currently apply.
OData access is really where the user comes in, depending upon your programming model and needs there are various ways you write your access layer into OData. The following are some suggestions
OData defines its schema using Conceptual Schema Definition Language (CSDL). Every VDB, that is deployed in an ACTIVE state in Teiid server exposes its metadata in CSDL format. For example if you want retrieve metadata for your vdb northwind, you need to issue a query like
http://localhost:8080/odata/northwind/$metadata
Since OData schema model is not a relational schema model, Teiid uses the following semantics to map its relational schema model to OData schema model.
Relational Entity | Mapped OData Entity |
---|---|
Model Name | Schema Namespace, EntityContainer Name |
Table/View | EntityType, EntitySet |
Table Columns | EntityType's Properties |
Primary Key | EntityType's Key Properties |
Foreign Key | Navigation Property on EntityType, Association, AssosiationSet |
Procedure | FunctionImport |
Procedure's Table Return | ComplexType |
Teiid by design does not define any "embedeed" ComplexType in the EnitityType
Teiid does not define any one EntityContainer that resulted from different vdb models as a default container, so all entities must be accessed using full path to them. |