You are on page 1of 26

ODATA UNLEASHED!

Let‟s Learn How to Exploit It


About me 
 Boris Tsirulnik
 boris.tsirulnik@sap.com
 Software Architect

 Graduated in Computer Sciences – 2002


 Working in SAP Labs Israel since 2003
 Core expertise in Java, Eclipse and Android
This session
 Introduction to OData
 OData Development Tools for Eclipse
 Toss in a demo to make it look longer 
 OData Development Tools contribution to Eclipse
 Ask questions any time
Technology Tipping Point Requires New IT
Approach

New devices and experiences Growing new communities of Simple access to complex
agile developers enterprise systems
Consumer innovations
in the enterprise Expansion of business data and Manage and control mission
decision makers critical systems AND deploy
innovative solutions
What is OData?
Clients HTTP Servers
RESTFUL
GET
POST
PUT
DELETE

Consumers
Producers

ATOM
JSON
What is OData?
“SQL for the web” metaphor

OData can be used to access table-


like structures similar to the way SQL
does

 Entity Data Model (EDM) to


describe OData Services
 Each entity can support Create, Read,
Update, and Delete (CRUD) operations
 Can navigate relationships
What is OData?
“SQL for the web” metaphor

OData SQL/Database

OData Service = Database Schema


Entity Type = Database Table
Function Import = Stored Procedure
GET method = SELECT statement
POST method = INSERT statement
PUT method = UPDATE statement
DELETE method = DELETE statement
… …
What is OData?
OData in Design-time (Model)
What is OData?
OData in Design-time (Entity Data Model )

 EntityTypes – data model definitions(for example


customer, product), structured types consisting of list of
properties (simple or complex)
 Complex Types - structured types also consisting of a list
of properties but with no key
 EntitySets – collections of Entities
 Associations - define the relationship between two or
more Entity Types
 Navigation Properties - special properties on Entity
Types which are bound to a specific association and can
be used to refer to associations of an entity
What is OData?
OData in Design-time (the metadata of OData)
What is OData?
OData in Run-time

 GET http://odata.netflix.com/v2/Catalog/Genres
 GET http://odata.netflix.com/v2/Catalog/Genres('Romantic%20Movies')
 GET http://odata.netflix.com/v2/Catalog/Genres('Romantic%20Movies')/Titles
 GET http://odata.netflix.com/v2/Catalog/Titles('ApSU3')

http://odata.netflix.com/v2/Catalog/People?$filter=Name%20eq%20'christopher%20nolan„

http://odata.netflix.com/v2/Catalog/People?$filter=Name%20eq%20'christopher%20nolan'
&$expand=Awards,TitlesDirected&$format=json
Why OData?
XML

PROPRIETRY
ATOM

ODATA
JSON

Data Structure

PROPRIETRY
ODATA
Query Syntax
Possible Actions
Documentation

PROPRIETRY
ODATA
Why OData?
 The OData Protocol is different from other REST-
based web service approaches in that it provides a
uniform way to describe both the data and the data
model
OData Development Tools for Eclipse
Motivation

 Lower the barrier for developers to produce and


consume OData
 Enable developers to extend the tools for different
environments (Android, PHP)
OData Development Tools for Eclipse
Features

 Model new OData services


 Visualize and explore existing OData services
 Consume existing OData services in Java
 Starter Application
 Semantic Proxies
 Java Client Library
OData Development Tools for Eclipse
Extensibility

 Extend the existing Java Toolkit


 Starter Applications
 Create new consumption Toolkits
 Starter Applications
 Semantic Proxies
 Add support for additional model import sources (e.g.
Excel spreadsheet, Database schema, etc.)
Demo
OData Development Tools for Eclipse
Open Source Contribution

 SAP plans to contribute these tools to the Eclipse


community
 We are looking for mentors from Eclipse Architecture
Council
Stuff I Didn‟t Cover
 How to create OData Producer
 Advanced OData features
 ServiceOperations (Function Import)
 URI query options ($top, $orderby, $expand etc.)

 Batch operations

 Security
URI Conventions
URI Used for Example
$links Get all associations between http://localhost:8080/odata_exam
entries ple/odatajpa.svc/SupplierParts(1L)/
$links/part
$orderby Order data based on desc or http://localhost:8080/odata_exam
asc (default) options ple/odatajpa.svc/SupplierParts?$or
derby=quantity desc
$top Return first N items of the set http://localhost:8080/odata_exam
ple/odatajpa.svc/SupplierParts?$or
derby=quantity desc&$top=4
$skip Skip the first N records of the http://localhost:8080/odata_exam
entity set and get next ple/odatajpa.svc/SupplierParts?$ski
p=2&$top=2
$filter Select only subset of entities that http://localhost:8080/odata_exam
match the predicates provided – ple/odatajpa.svc/SupplierParts?$filt
rich set of operators and er=(quantity gt 200 and quantity lt
URI Conventions
URI Used for Example
$expand Eagerly load associations http://localhost:8080/odata_example
inline /odatajpa.svc/Supplier?$expand=sup
plierParts
$format Specify what media type http://localhost:8080/odata_example
to be used for /odatajpa.svc/Supplier?$expand=sup
response(Atom/Xml/Json) plierParts&$format=Json
$select Return only subset of http://localhost:8080/odata_example
properties /odatajpa.svc/Supplier?$select=suppli
erCity, supplierId
$inlineco Response should include http://localhost:8080/odata_example
unt the count on entities after /odatajpa.svc/Supplier?$inlinecount=al
applying $filter. Valid lpages
values are allpages/none <m:count>16</m:count>
Batch Operations
 OData supports executing multiple operations sent
in a single HTTP request through the use of Batching
 The batch requests can be sent as POST with the
path containing $batch
 OData Batch Request is represented as a Multipart
MIME v1.0 message
The future of OData
 Currently the standard is continuing to evolve
 The Open Data Protocol specification is currently
available under the Microsoft Open Specification
Promise (OSP), allowing third parties, including open
source projects, to build Data Services for any runtime
as well as clients to consume such services.
 OASIS Technical committee is in the process to
standardize OData as an OASIS standard:
https://www.oasis-open.org/committees/odata/
Want to know more?

 Open Data Protocol:


http://www.odata.org
Thank you

Contact information:

Boris Tsirulnik
Software Architect

Technology & Innovation Platform


SAP Labs Israel Ltd.
bois.tsirulnik@sap.com
© 2013 SAP AG. All rights reserved

No part of this publication may be reproduced or transmitted in any form or for any purpose without Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal
the express permission of SAP AG. The information contained herein may be changed without prior Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services
notice. mentioned herein as well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP company.
Some software products marketed by SAP AG and its distributors contain proprietary software
components of other software vendors. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase
Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft products and services mentioned herein as well as their respective logos are trademarks or
Corporation. registered trademarks of Sybase, Inc. Sybase is an SAP company.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, All other product and service names mentioned are the trademarks of their respective
System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, companies. Data contained in this document serves informational purposes only. National
S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, product specifications may vary.
POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, The information in this document is proprietary to SAP. No part of this document may be
BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel reproduced, copied, or transmitted in any form or for any purpose without the express prior
Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or written permission of SAP AG.
registered trademarks of IBM Corporation.
This document is a preliminary version and not subject to your license agreement or any
Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. other agreement with SAP. This document contains only intended strategies, developments,
Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered and functionalities of the SAP® product and is not intended to be binding upon SAP to any
trademarks of Adobe Systems Incorporated in the United States and/or other countries. particular course of business, product strategy, and/or development. Please note that this
document is subject to change and may be changed by SAP at any time without notice.
Oracle is a registered trademark of Oracle Corporation.
SAP assumes no responsibility for errors or omissions in this document. SAP does not
UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. warrant the accuracy or completeness of the information, text, graphics, links, or other items
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are contained within this material. This document is provided without a warranty of any kind,
trademarks or registered trademarks of Citrix Systems, Inc. either express or implied, including but not limited to the implied warranties of
merchantability, fitness for a particular purpose, or non-infringement.
HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web
Consortium, Massachusetts Institute of Technology. SAP shall have no liability for damages of any kind including without limitation direct,
special, indirect, or consequential damages that may result from the use of these materials.
Java is a registered trademark of Sun Microsystems, Inc. This limitation shall not apply in cases of intent or gross negligence.
JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology The statutory liability for personal injury and defective products is not affected. SAP has no
invented and implemented by Netscape. control over the information that you may access through the use of hot links contained in
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, these materials and does not endorse your use of third-party Web pages nor provide any
and other SAP products and services mentioned herein as well as their respective logos are trademarks warranty whatsoever relating to third-party Web pages.
or registered trademarks of SAP AG in Germany and other countries.

You might also like