Open Data Protocol

Last updated

In computing, Open Data Protocol (OData) is an open protocol that allows the creation and consumption of queryable and interoperable Web service APIs in a standard way. Microsoft initiated OData in 2007. [1] Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise. Version 4.0 was standardized at OASIS, [2] with a release in March 2014. [3] In April 2015 OASIS submitted OData v4 and OData JSON Format v4 to ISO/IEC JTC 1 for approval as an international standard. [4] In December 2016, ISO/IEC published OData 4.0 Core as ISO/IEC 20802-1:2016 [5] [6] and the OData JSON Format as ISO/IEC 20802-2:2016. [7]

Contents

The protocol enables the creation and consumption of HTTP-based Web APIs, which allow Web clients to publish and edit resources, identified using URLs and defined in a data model, using simple HTTP messages. OData shares some similarities with JDBC and with ODBC; like ODBC, OData is not limited to relational databases.

Standardization

After initial development by Microsoft, OData became a standardized protocol of the OASIS OData Technical Committee (TC).

OASIS OData Technical Committee

"The OASIS OData TC works to simplify the querying and sharing of data across disparate applications and multiple stakeholders for re-use in the enterprise, Cloud, and mobile devices. A REST-based protocol, OData builds on HTTP, AtomPub, and JSON using URIs to address and access data feed resources. It enables information to be accessed from a variety of sources including (but not limited to) relational databases, file systems, content management systems, and traditional Web sites. OData provides a way to break down data silos and increase the shared value of data by creating an ecosystem in which data consumers can interoperate with data producers in a way that is far more powerful than currently possible, enabling more applications to make sense of a broader set of data. Every producer and consumer of data that participates in this ecosystem increases its overall value." [8]

TC participants include CA Technologies, Citrix Systems, IBM, Microsoft, Progress Software, Red Hat, SAP SE and SDL.

Architecture

OData is a protocol for the creation and consumption of Web APIs. OData thus builds on HTTP, AtomPub, and JSON using URIs to address and access data feed resources.

Resource identification

OData uses URIs to identify resources. For every OData service whose service root is abbreviated as http://host/service/ , the following fixed resources can be found:

The service document

The service document lists entity sets, functions, and singletons that can be retrieved. Clients can use the service document to navigate the model in a hypermedia-driven fashion.

The service document is available at http://host/service/

The metadata document

The metadata document describes the types, sets, functions and actions understood by the OData service. Clients can use the metadata document to understand how to query and interact with entities in the service.

The metadata document is available at http://host/service/$metadata .

Dynamic resources

The URIs for the dynamic resources may be computed from the hypermedia information in the service document and metadata document.

Resource operation

OData uses the HTTP verbs to indicate the operations on the resources.

Querying

URLs requested from an OData endpoint may include query options. The OData protocol specifies various 'system query options' endpoints should accept, these can be used to filter, order, map or paginate data.

Query options can be appended to a URL after a ? character and are separated by & characters; each option consists of a $-sign prefixed name and its value, separated by a = sign, for example: OData/Products?$top=2&$orderby=Name. A number of logical operators and functions are defined for use when filtering data, for example: OData/Products?$filter=Price lt 10.00 and startswith(Name,'M') requests products with a price smaller than 10 and a name starting with the letter 'M'.

Resource representation

OData uses different formats for representing data and the data model. In OData protocol version 4.0, JSON format is the standard for representing data, with the Atom format still being in committee specification stage. For representing the data model, the Common Schema Definition Language (CSDL) is used, which defines an XML representation of the entity data model exposed by OData services.

A sample OData JSON data payload

A collection of products:

{"@odata.context":"http://services.odata.org/V4/OData/OData.svc/$metadata#Products","value":[{"ID":0,"Name":"Meat","Description":"Red Meat","ReleaseDate":"1992-01-01T00:00:00Z","DiscontinuedDate":null,"Rating":14,"Price":2.5},{"ID":1,"Name":"Milk","Description":"Low fat milk","ReleaseDate":"1995-10-01T00:00:00Z","DiscontinuedDate":null,"Rating":3,"Price":3.5},...]}

A sample OData Atom data payload

A collection of products:

<feedxml:base="http://services.odata.org/V4/OData/OData.svc/"m:context="http://services.odata.org/V4/OData/OData.svc/$metadata#Products"xmlns="http://www.w3.org/2005/Atom"xmlns:d="http://docs.oasis-open.org/odata/ns/data"xmlns:m="http://docs.oasis-open.org/odata/ns/metadata"xmlns:georss="http://www.georss.org/georss"xmlns:gml="http://www.opengis.net/gml"><id>http://services.odata.org/v4/odata/odata.svc/Products</id><titletype="text">Products</title><updated>2015-05-19T03:38:50Z</updated><linkrel="self"title="Products"href="Products"/><entry><id>http://services.odata.org/V4/OData/OData.svc/Products(0)</id><categoryterm="#ODataDemo.Product"scheme="http://docs.oasis-open.org/odata/ns/scheme"/><linkrel="edit"title="Product"href="Products(0)"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/Categories"type="application/xml"title="Categories"href="Products(0)/Categories/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/Categories"type="application/atom+xml;type=feed"title="Categories"href="Products(0)/Categories"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/Supplier"type="application/xml"title="Supplier"href="Products(0)/Supplier/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/Supplier"type="application/atom+xml;type=entry"title="Supplier"href="Products(0)/Supplier"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/ProductDetail"type="application/xml"title="ProductDetail"href="Products(0)/ProductDetail/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/ProductDetail"type="application/atom+xml;type=entry"title="ProductDetail"href="Products(0)/ProductDetail"/><title/><updated>2015-05-19T03:38:50Z</updated><author><name/></author><contenttype="application/xml"><m:properties><d:IDm:type="Int32">0</d:ID><d:Name>Bread</d:Name><d:Description>Wholegrainbread</d:Description><d:ReleaseDatem:type="DateTimeOffset">1992-01-01T00:00:00Z</d:ReleaseDate><d:DiscontinuedDatem:null="true"/><d:Ratingm:type="Int16">4</d:Rating><d:Pricem:type="Double">2.5</d:Price></m:properties></content></entry><entry><id>http://services.odata.org/V4/OData/OData.svc/Products(1)</id><categoryterm="#ODataDemo.Product"scheme="http://docs.oasis-open.org/odata/ns/scheme"/><linkrel="edit"title="Product"href="Products(1)"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/Categories"type="application/xml"title="Categories"href="Products(1)/Categories/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/Categories"type="application/atom+xml;type=feed"title="Categories"href="Products(1)/Categories"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/Supplier"type="application/xml"title="Supplier"href="Products(1)/Supplier/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/Supplier"type="application/atom+xml;type=entry"title="Supplier"href="Products(1)/Supplier"/><linkrel="http://docs.oasis-open.org/odata/ns/relatedlinks/ProductDetail"type="application/xml"title="ProductDetail"href="Products(1)/ProductDetail/$ref"/><linkrel="http://docs.oasis-open.org/odata/ns/related/ProductDetail"type="application/atom+xml;type=entry"title="ProductDetail"href="Products(1)/ProductDetail"/><title/><updated>2015-05-19T03:38:50Z</updated><author><name/></author><contenttype="application/xml"><m:properties><d:IDm:type="Int32">1</d:ID><d:Name>Milk</d:Name><d:Description>Lowfatmilk</d:Description><d:ReleaseDatem:type="DateTimeOffset">1995-10-01T00:00:00Z</d:ReleaseDate><d:DiscontinuedDatem:null="true"/><d:Ratingm:type="Int16">3</d:Rating><d:Pricem:type="Double">3.5</d:Price></m:properties></content></entry>... </feed>

A sample OData metadata document

<edmx:EdmxVersion="4.0"xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx"><edmx:DataServices><SchemaNamespace="ODataDemo"xmlns="http://docs.oasis-open.org/odata/ns/edm"><EntityTypeName="Product"><Key><PropertyRefName="ID"/></Key><PropertyName="ID"Type="Edm.Int32"Nullable="false"/><PropertyName="Name"Type="Edm.String"/><PropertyName="Description"Type="Edm.String"/><PropertyName="ReleaseDate"Type="Edm.DateTimeOffset"Nullable="false"/><PropertyName="DiscontinuedDate"Type="Edm.DateTimeOffset"/><PropertyName="Rating"Type="Edm.Int16"Nullable="false"/><PropertyName="Price"Type="Edm.Double"Nullable="false"/></EntityType><ComplexTypeName="Address"><PropertyName="Street"Type="Edm.String"/><PropertyName="City"Type="Edm.String"/><PropertyName="State"Type="Edm.String"/><PropertyName="ZipCode"Type="Edm.String"/><PropertyName="Country"Type="Edm.String"/></ComplexType><EntityContainerName="DemoService"><EntitySetName="Products"EntityType="ODataDemo.Product"></EntitySet></EntityContainer></Schema></edmx:DataServices></edmx:Edmx>

Ecosystem

The ecosystem of OData consists of the client/server libraries that implement the protocol, and applications that are based on the protocol.

Libraries

There are a number of OData libraries available to access/produce OData APIs:

.NET

  • Server and client: Microsoft's OData .NET libraries [9]
  • Client: Simple.OData.Client [10]

Java

JavaScript

  • Client: Apache Olingo [14] (featured by OASIS [15] )
  • Client: data.js [16]
  • Client: JayData [17] for higher level of abstraction (LINQ-like syntax, support for OData geo features, IndexedDB, WebSQL, integration for DevExtreme, Kendo UI, Angular.js, Knockout.js and Sencha).
  • Client: OpenUI5 library maintained by SAP
  • Client (Node.js): JayData for node [18]
  • Client: Breeze [19]
  • Client: OData4 and Invantive Bridge Online [20]
  • Client: odata-fluent-query: [21] a JavaScript OData query language parser
  • Server: node-odata [22]

PHP

  • Client: odataphp [23]
  • Server: POData [24]

Python

  • Client: PyOData [25]
  • Server and client: Pyslet [26]

Ruby

  • Client: ruby_odata library [27]
  • Client: Free OData V4.0 Library for Ruby [28]
  • Server: Safrano [29]

Others

Other languages implemented include: [30]

  • AJAX: ASP.NET Ajax Library [31] for getting to OData.
  • C++: odatacpp_client [32] is a client-side-only implementation of the OData protocol.
  • Windward Studios [33] supports OData in their Reporting & Document Generation Solutions.
  • Reporting tool List & Label has a specialized data provider for OData.
  • Blackberry (C++): OData-BB10 [34] Open Data Protocol (OData) library for BlackBerry 10 (BB10) Cascades apps

Applications

Applications include: [35]

Tools

See also

Related Research Articles

The Organization for the Advancement of Structured Information Standards is a nonprofit consortium that works on the development, convergence, and adoption of open standards for cybersecurity, blockchain, Internet of things (IoT), emergency management, cloud computing, legal data exchange, energy, content technologies, and other areas.

<span class="mw-page-title-main">Atom (web standard)</span> Web standards

The name Atom applies to a pair of related Web standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol is a simple HTTP-based protocol for creating and updating web resources.

Sitemaps is a protocol in XML format meant for a webmaster to inform search engines about URLs on a website that are available for web crawling. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes, and how important it is in relation to other URLs of the site. This allows search engines to crawl the site more efficiently and to find URLs that may be isolated from the rest of the site's content. The Sitemaps protocol is a URL inclusion protocol and complements robots.txt, a URL exclusion protocol.

FeedSync for Atom and RSS, previously Simple Sharing Extensions, are extensions to RSS and Atom feed formats designed to enable the bi-directional synchronization of information by using a variety of data sources. Initially developed by Ray Ozzie, Chief Software Architect at Microsoft, it is now maintained by Jack Ozzie, George Moromisato, Matt Augustine, Paresh Suthar and Steven Lees. Dave Winer, the designer of the UserLand Software RSS specification variants, has given input for the specifications.

GRDDL is a markup format for Gleaning Resource Descriptions from Dialects of Languages. It is a W3C Recommendation, and enables users to obtain RDF triples out of XML documents, including XHTML. The GRDDL specification shows examples using XSLT, however it was intended to be abstract enough to allow for other implementations as well. It became a Recommendation on September 11, 2007.

RDFa or Resource Description Framework in Attributes is a W3C Recommendation that adds a set of attribute-level extensions to HTML, XHTML and various XML-based document types for embedding rich metadata within Web documents. The Resource Description Framework (RDF) data-model mapping enables its use for embedding RDF subject-predicate-object expressions within XHTML documents. It also enables the extraction of RDF model triples by compliant user agents.

<span class="mw-page-title-main">Metalink</span> File format that describes one or more computer files available for download

Metalink is an extensible metadata file format that describes one or more computer files available for download. It specifies files appropriate for the user's language and operating system; facilitates file verification and recovery from data corruption; and lists alternate download sources.

Security Assertion Markup Language 2.0 (SAML 2.0) is a version of the SAML standard for exchanging authentication and authorization identities between security domains. SAML 2.0 is an XML-based protocol that uses security tokens containing assertions to pass information about a principal between a SAML authority, named an Identity Provider, and a SAML consumer, named a Service Provider. SAML 2.0 enables web-based, cross-domain single sign-on (SSO), which helps reduce the administrative overhead of distributing multiple authentication tokens to the user. SAML 2.0 was ratified as an OASIS Standard in March 2005, replacing SAML 1.1. The critical aspects of SAML 2.0 are covered in detail in the official documents SAMLCore, SAMLBind, SAMLProf, and SAMLMeta.

The Open Packaging Conventions (OPC) is a container-file technology initially created by Microsoft to store a combination of XML and non-XML files that together form a single entity such as an Open XML Paper Specification (OpenXPS) document. OPC-based file formats combine the advantages of leaving the independent file entities embedded in the document intact and resulting in much smaller files compared to normal use of XML.

<span class="mw-page-title-main">EPUB</span> E-book file format

EPUB is an e-book file format that uses the ".epub" file extension. The term is short for electronic publication and is sometimes styled ePub. EPUB is supported by many e-readers, and compatible software is available for most smartphones, tablets, and computers. EPUB is a technical standard published by the International Digital Publishing Forum (IDPF). It became an official standard of the IDPF in September 2007, superseding the older Open eBook (OEB) standard.

<span class="mw-page-title-main">Web Services Description Language</span> XML-based interface description language

The Web Services Description Language is an XML-based interface description language that is used for describing the functionality offered by a web service. The acronym is also used for any specific WSDL description of a web service, which provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns. Therefore, its purpose is roughly similar to that of a type signature in a programming language.

The Office Open XML file formats are a set of file formats that can be used to represent electronic office documents. There are formats for word processing documents, spreadsheets and presentations as well as specific formats for material such as mathematical formulas, graphics, bibliographies etc.

<span class="mw-page-title-main">WebFinger</span> Protocol for the discovery of information about people and things identified by a URI

WebFinger is a protocol specified by the Internet Engineering Task Force IETF in RFC 7033 that allows for discovery of information about people and things identified by a URI. Information about a person might be discovered via an acct: URI, for example, which is a URI that looks like an email address.

XHTML+RDFa is an extended version of the XHTML markup language for supporting RDF through a collection of attributes and processing rules in the form of well-formed XML documents. XHTML+RDFa is one of the techniques used to develop Semantic Web content by embedding rich semantic markup. Version 1.1 of the language is a superset of XHTML 1.1, integrating the attributes according to RDFa Core 1.1. In other words, it is an RDFa support through XHTML Modularization.

The Open Publication Distribution System (OPDS) catalog format is a syndication format for electronic publications based on Atom and HTTP. OPDS catalogs enable the aggregation, distribution, discovery, and acquisition of electronic publications. OPDS catalogs use existing or emergent open standards and conventions, with a priority on simplicity.

The Salmon Protocol is a message exchange protocol running over HTTP designed to decentralize commentary and annotations made against newsfeed articles such as blog posts. It allows a single discussion thread to be established between the article's origin and any feed reader or "aggregator" which is subscribing to the content. Put simply, that if an article appeared on 3 sites: A, B and C, that members of all 3 sites could see and contribute to a single thread of conversation regardless of site they were viewing from.

gSOAP is a C and C++ software development toolkit for SOAP/XML web services and generic XML data bindings. Given a set of C/C++ type declarations, the compiler-based gSOAP tools generate serialization routines in source code for efficient XML serialization of the specified C and C++ data structures. Serialization takes zero-copy overhead.

The RESTful Service Description Language (RSDL) is a machine- and human-readable XML description of HTTP-based web applications.

Really Simple Discovery (RSD) is an XML format and a publishing convention for making services exposed by a blog, or other web software, discoverable by client software.

References

  1. Flasko, Mike (18 July 2007). "Welcome!". MSDN Blogs. OData Team. Archived from the original on May 5, 2014.
  2. "OASIS Open Data Protocol (OData) Technical Committee" . Retrieved 2013-08-05.
  3. "OASIS Approves OData 4.0 Standards for an Open, Programmable Web". oasis-open.org. 17 March 2014.
  4. "OASIS has Submitted OData v4 and OData JSON Format v4 to ISO/IEC JTC 1 for approval as an International Standard". MS Open Tech. Archived from the original on 2015-05-20. Retrieved 2015-05-18.
  5. "OData Published as an ISO Standard · OData - the Best Way to REST". www.odata.org. Retrieved 2021-05-11.
  6. "ISO/IEC 20802-1:2016". ISO. Retrieved 2021-05-11.
  7. "ISO/IEC 20802-2:2016". ISO. Retrieved 2021-05-11.
  8. "OASIS Open Data Protocol (OData) TC | OASIS". www.oasis-open.org. Retrieved September 24, 2019.
  9. Microsoft's OData .NET libraries
  10. Simple.OData.Client
  11. Apache Olingo
  12. Jello-Framework
  13. odata-client
  14. Apache Olingo
  15. "Libraries · OData - the Best Way to REST". www.odata.org. Retrieved 2019-02-19.
  16. "data.js". CodePlex Archive.
  17. JayData
  18. JayData for node
  19. Breeze
  20. OData4 and Invantive Bridge Online
  21. odata-fluent-query
  22. node-odata
  23. odataphp
  24. POData
  25. PyOData
  26. Pyslet
  27. ruby_odata library
  28. Free OData V4.0 Library for Ruby
  29. Safrano
  30. "Libraries". odata.org.
  31. ASP.NET Ajax Library
  32. odatacpp_client
  33. Windward Studios
  34. OData-BB10
  35. "Ecosystem". odata.org.
  36. Progress DataDirect Hybrid Data Pipeline
  37. "SAP NetWeaver Gateway" . Retrieved 2012-11-22.
  38. IBM developerWorks eXtreme Scale REST data service (OData)
  39. "Welcome to Office 365 APIs". docs.microsoft.com. 28 August 2018. Retrieved September 24, 2019.
  40. "Set Up Salesforce Connect to Access External Data with the OData 2.0 or 4.0 Adapter".
  41. Skyvia Connect
  42. "OData - Tableau". help.tableau.com. Retrieved September 24, 2019.
  43. "OData and Spotfire". The TIBCO Blog. Retrieved 2016-03-30.
  44. Mulesoft
  45. "Anypoint Exchange". www.mulesoft.com. Retrieved September 24, 2019.
  46. SuccessFactors
  47. Ceridian HCM's Dayforce
  48. "HR Reporting Software - Dayforce | Ceridian". www.ceridian.com. Retrieved September 24, 2019.
  49. "What You Need to Know About Redfish API". Exxact. 2017-12-01. Retrieved 2019-08-31.
  50. "Nucleon Database Master" . Retrieved 16 November 2017.

OData OASIS Standards

Committee Specifications

Committee Notes