apache olingo - apachecon denver 2014

22
APACHE OLINGO OASIS OData - Client and Server Stephan Klevenz, ApacheCon 2014 Denver

Upload: stephan-klevenz

Post on 11-Aug-2014

700 views

Category:

Data & Analytics


14 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Apache Olingo - ApacheCon Denver 2014

APACHE OLINGOOASIS OData - Client and Server

Stephan Klevenz, ApacheCon 2014 Denver

Page 2: Apache Olingo - ApacheCon Denver 2014

AGENDA• Part I

• OData Protocol • Overview • OASIS

• Part II • Play with OData • Demos

• Basic Processor • Annotation Processor • JPA Processor

Page 3: Apache Olingo - ApacheCon Denver 2014

PART I

Page 4: Apache Olingo - ApacheCon Denver 2014

ODATA PROTOCOL OVERVIEW

OData stands for Open Data Protocol (http://www.odata.org)

• is based on REST principles • supports JSON and AtomPub data formats

• Implementations available in • .NET, Java, JavaScript, Ruby, PHP and ObjectiveC

Page 5: Apache Olingo - ApacheCon Denver 2014

Binary API doesn’t work over the Internet (ODBC, ADO.NET, JDBC…) !Internet is HTTP! !HTTP + SQL !OData as the SQL for the Web

RDBMS

Data

Files

Data

XML

Data

NoSQL

Data

SQL API Parser API Query API

Applications

OData

http

UNLOCK DATA SILOS

Page 6: Apache Olingo - ApacheCon Denver 2014

ODATA PROTOCOL

RESTHTTPGETPUT…

DELETE

ATOMJSON

Server

Producer

Client

Consumer

.NET, Java, Ruby, PHP …

.NET, iOS, JavaScript, Java, Ruby

Excel, Tableau, LINQPad, PowerShel, OData Explorer

Azure, MySQL, AppEngine, SAP, IBM, Oracle

Page 7: Apache Olingo - ApacheCon Denver 2014

Project Astoria(Microsoft internal)

ADO.NET Data Services(Microsoft)

WCF Data Services(Microsoft)

OData 2.0(Microsoft Open

Specification Promisse)

OData 3.0(public)

OData 4.0(OASIS TC)

Page 8: Apache Olingo - ApacheCon Denver 2014

STRUCTURE OF ODATA

ArchitectureREST

ProtocolHTTP

Data Formats(Serialization)

AtomPubJSON

MetadataCSDL

(Conceptual Data Definition Language)

Data as ResourcesGET, PUT … DELETE

Cache, Proxies URIAddressable Data

Flexible Syntax

Entity Data Model (Chen’s 1976)Entities == ResourcesAssociations == Links

CRUD Create, Read, Update, DeleteGET - Read Resource

POST - Create ResourcePUT - Change Resource

DELETE - Delete Resource

Page 9: Apache Olingo - ApacheCon Denver 2014

ENTITY DATA MODEL (EDM)Entity Container

Entity Set

Entity

Property Property

Entity

Property Property

Entity Set

Entity

Property Property

Entity

Property NavigationProperty

Entity

Property NavigationProperty

Association

Association

Page 10: Apache Olingo - ApacheCon Denver 2014

METADATA DOCUMENT

Page 11: Apache Olingo - ApacheCon Denver 2014

OData Resource Is Described in an Entity Data Model by

Collection• Entity Set • A navigation property on an entity type that identifies a collection of

entities •

Entry • Entity Type • Note: Entity Types may be part of a type hierarchy

Property of an entry • Primitive or Complex Entity Type Property

Complex Type • Complex Type

Link • A Navigation Property defined on an Entity Type

Service Operation • Function Import

Page 12: Apache Olingo - ApacheCon Denver 2014

SERVICE DOCUMENT (HATEOAS)

Page 13: Apache Olingo - ApacheCon Denver 2014

ODATA URI CONVENTIONShttp://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name _______________________________________/ __________________/ _________________/ | | | service root URI resource path query options

Root http://services.odata.org/OData/OData.svc/Resource Path /ProductsQuery Options $filter=price lt 3.5

Entity Set /ProductsSingle Entity /Products(3)Member Access /Products(3)/PriceLink Traversal /Products(3)/Supplier

Page 14: Apache Olingo - ApacheCon Denver 2014

URI SYNTAX

Page 15: Apache Olingo - ApacheCon Denver 2014

ATOMPUB - EDM (HATEOAS)

Atom / AtomPub

Property

Entry

Collection / Feed

Service

EDM

Property

Entity

Entity Set

Entity Container

Page 16: Apache Olingo - ApacheCon Denver 2014

ATOM ENTRY

Page 17: Apache Olingo - ApacheCon Denver 2014

OASIS ODATA 4.0

Design Goals

• A "web of structured data" without boundaries between isolated services

• Request exactly the desired subset of data with as few roundtrips as possible

• Keep the query language simple and intuitive

• Make all features of OData combine well with each other

• Keep each single feature as simple as possible

• Avoid having several ways to achieve the same goal

Page 18: Apache Olingo - ApacheCon Denver 2014

• Model Evolution (Versioning)

• Model Reuse and Cross-Service  Navigation

• Deltas

• Asynchronous Requests and Callbacks

• Vocabularies and Annotations

• Actions and Functions

• Improved Query Language ($search, CrossJoin, Lambda …)

• Improved Type System

• Entity References

• New JSON

• MISC (stream properties, geo data types, any()/all() operators …)

Page 19: Apache Olingo - ApacheCon Denver 2014

PART II

Page 20: Apache Olingo - ApacheCon Denver 2014

LET’S PLAY WITH ODATA AND DO SOME

DEMOS

Page 21: Apache Olingo - ApacheCon Denver 2014

QUESTIONS & ANSWERS

Page 22: Apache Olingo - ApacheCon Denver 2014

SOURCES AND CONTACT

http://odata.org http://olingo.apache.org https://www.oasis-open.org/committees/odata/

Stephan Klevenz PMC Member of Apache Olingo [email protected] @sklevenz