250 likes | 585 Views
Open Data Protocol *. Han Wang 11/30/2012. * http://www.odata.org. What. “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. ” [1].
E N D
Open Data Protocol* Han Wang 11/30/2012 * http://www.odata.org
What • “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.”[1] [1]http://www.odata.org/introduction Open Data Protocol
What (cont.) • Enables the creation of HTTP-based data services • Identifies resources using URIs • Publishes and edits resources using simple HTTP messages http://www.odata.org/documentation/overview Open Data Protocol
Why • Problem: web API’s are hardly uniform • OData provides a uniform interface to expose, structure, query, and manipulate data • “Uniform” means operations are the same across any OData service • OData also provides a uniform way to represent metadata Open Data Protocol
Basics • Feeds: Collections of typed Entries • Entries: structured records with keys • A record has a list of Properties of primitive or complex types • Entries may have related Entries or related Feeds through Links Open Data Protocol
Basics (cont.) • A Service Document lists list all the top level feeds • May be formatted in Atom or JSON http://services.odata.org/OData/OData.svc Open Data Protocol
Basics (cont.) • A Service Metadata Document describes the shape of an OData service, the structure of its resources, the known links between resources, and the Service Operationsexposed • Service Operations: simple, service-specific functions that accept input parameters and return entries or complex/primitive values. Open Data Protocol
Basics (cont.) http://services.odata.org/OData/OData.svc/$metadata Open Data Protocol
Data Model • Entity Data Model (EDM): the abstract data model that MUST be used to describe the data exposed by an ODataservice • Common Schema Definition Language (CSDL) defines an XML-based representation of the entity model exposed by an OData service. Open Data Protocol
Data Model (cont.) • Entities • Instances of Entity Types • Structured records • Have named and typed properties and with Entity Keys • Grouped in Entity Sets Open Data Protocol
Data Model (cont.) • Complex Types • Structured types • Consist of a list of properties but with no key Open Data Protocol
Data Model (cont.) • Associations • Define the relationship between two or more Entity Types • Instances of associations are grouped in Association Sets Open Data Protocol
Data Model (cont.) • Navigation Properties • Special properties on Entity Types • Bound to a specific Association • Used to refer to associations of an entry Open Data Protocol
Service Requests • Metadata requests • Service Document • Metadata Document • Data requests • Individual entities • Individual properties • Collections of entities • Query operations: filter, sort, paging, projection, etc. Open Data Protocol
Service Requests (cont.) • Data modification • Create • Update • Delete … • Operations • Actions • Functions Open Data Protocol
URL Conventions • Request the first two products in Category(1), ordered by Name: • http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name • Address the links between Category(1) and Products: • http://services.odata.org/OData/OData.svc/Category(1)/$links/Products • Request all products with the Name 'Milk' that also have a Price less than 2.55: • http://services.odata.org/OData/OData.svc/Products?$filter=Name eq 'Milk' and Price lt '2.55M’ http://www.odata.org/media/30002/OData%20URL%20Conventions.html Open Data Protocol
URL Conventions (cont.) • Request all products, because 9 mod 3 is 0: • http://services.odata.org/OData/OData.svc/Products?$filter=( 4 add 5 ) mod ( 4 sub 1 ) eq0 • Request all Customers with a CompanyName that contains ‘Alfreds’: • http://services.odata.org/Northwind/Northwind.svc/Customers?$filter=substringof('Alfreds', CompanyName) eqtrue • Request just the Rating and ReleaseDate for the matching Products: • http://services.odata.org/OData/OData.svc/Products?$select=Rating,ReleaseDate http://www.odata.org/media/30002/OData%20URL%20Conventions.html Open Data Protocol
Libraries Open Data Protocol
Ecosystem • Consumers (processing OData) • Web browsers, OData Explorer, Excel 2010, LINQPad, Seasame, Tableau, TelerikRadGrid, etc. • Applications (exposing OData) • SharePoint 2010, IBM WebSphere, Windows Azure Table Storage, SQL Server Reporting Services Open Data Protocol
Status • Currently available under the Microsoft Open Specification Promise (OSP) • Allows third parties to build data services for any runtime as well as clients to consume such services. • Microsoft and key partners have proposed an OASIS Technical committee to standardize OData as an OASIS standard. Open Data Protocol
Specifications Open Data Protocol
Glossary • Binary Large Object (BLOB): binary data stored as a single entity. Blobs are often videos, images, documents, etc. • Collection: A Resource that contains a set of Member Resources as defined in [RFC 5023]. In OData, a Collection is represented as an Atom Feed or an array of JSON objects. • CSDL: An XML language for describing Entity Data Models. See [CDSL] for additional information. • Declared Property: A statically declared Property on an Entity or Complex Type. The value of a declared property is a primitive or complex type. • Dynamic Property: An Entry may include additional (nullable) properties beyond its Declared Properties. The set of additional properties, and the type of each, may vary between Entry instances. Such additional properties are referred to as Dynamic Properties and do not have a representation in a Service Metadata Document. If an Entry does not include a value for a Dynamic Property named N, then the Entry must be treated as if it included N with a value of null. A Dynamic Property must not have the same name as a declared property on the same Entry. • Entity Data Model: The abstract data model used by OData services. See the Abstract Data Model section of [OData: Core] additional information. • Entry (Entry Resource): Members of a Collection, as defined by [RFC 5023]. In OData, Entries are represented as Atom Entry Documents, as described in [OData: Atom] or JSON objects, as described in [OData: JSON]. An Entry may represent an instance of an Open Entity Type if, in addition to Declared Properties, the entry includes Dynamic Properties. • Feed: The representation of a Collection in Atom (see [OData: Atom]) or JSON (see [OData: JSON]) • IRI: An Internationalized Resource Identifier as defined in [RFC3987]. Before an IRI found in a document used by HTTP, the IRI is first converted to a URI • Link: Describes an association between two Entries. More specifically, the term refers to a unidirectional association or to one direction of a bidirectional association. • Media Link Entry: A special kind of Entry Resource that contains metadata about a Media Resource, as defined in [RFC 5023]. • Media Resource: Members of a Collection that have representations other than Atom Entry Documents or JSON objects. • Member Resource: A Resource whose IRI is listed in a Collection, as defined in [RFC 5023] • Navigation Property: A property of an Entry that represents a Link from the Entry to one or more related Entries. A Navigation Property is not a structural part of the Entry it belongs to. • OData Data Namespace: The namespace used by OData services when representing data in XML-based formats. The URI identifying the namespace is http://schemas.microsoft.com/ado/2007/08/dataservices . Note: The next version of OData will likely support a more general odata.org-based namespace. • OData Metadata Namespace: The namespace used by OData services when representing metadata in XML-based formats. The URI identifying the namespace is http://schemas.microsoft.com/ado/2007/08/dataservices/metadata . Note: The next version of OData will likely support a more general odata.org-based namespace. • OData Service: A service which implements the Open Data Protocol (OData). • Property: A generic term to represent a declared or dynamic property of an Entry. • Representational state transfer (REST): REST is a set of principles or style of software architecture for distributed hypermedia systems such as the World Wide Web. OData applies the principles of REST whenever possible. • Resource: A network-accessible data object or service identified by an IRI, as defined in [RFC 2616] • Service Document: A document that describes the location and capabilities of one or more Collections, as described by [RFC 5023]. See [OData: Core] for additional information on using Service Documents with OData services. • Service Metadata Document (Metadata Document): A CSDL that describes the data model (i.e. structure and organization of all the resources) exposed as HTTP endpoints by an OData service. See [OData: Core] for additional information. • URI: A Uniform Resource Identifier as defined in [RFC3986] Open Data Protocol