SlideShare a Scribd company logo
1 of 22
Jovan Popovic Microsoft
Jovan Popovic
Program manager MDCS/SQL Server/Azure
Azure/SQL/ASP.NET/JQuery
PhD Electrical Engineering
http://petlja.rs/
Agenda
• REST
• Why OData?
• OData – details
• Demo
What is REST?
• Way of providing interoperability between computer systems on
the Internet
• Stateless access on resources by Uri
• CRUD operations via HTTP methods
• POST – Create resource
• GET – Read resource
• PUT – Update resource
• DELETE – Delete resource
Problem – Custom REST Endpoints
• Clients need many custom queries.
• How to serve custom requests?
• Using custom Url
• /Company/ByName/Acme
• /CompanyByRegion(‘Serbia’)
• Using custom parameters
• /Company?Name=Acme
• /Company?Region=Serbia
SQL language
• How Databases solve this problem?
• SQL Language
• SELECT <columns>
• WHERE <condition>
• ORDER BY <columns>
• OFFSET <skip>
• FETCH <top>
Idea: SQL on top of REST
• Adding query clauses as parameters
• $select=
• $filter=
• $orderby=
• $take=
• $skip=
• OData standardizes query clauses
• Two types of parameters
• OData reserved parameters beginning with $
• Reserved for future usage
• Custom app-specific parameters cannot start with $
• You can put any parameter
OData specification
• Microsoft initiated OData in 2007.
• Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open
Specification Promise.
• Version 4.0 was standardized at OASIS, March 2014.
• Standardized as ISO/IEC 20802:1 and 20801:2
• OData contributors
• Citrix Systems, IBM, Microsoft, Progress Software, Red Hat, SAP.
OData queries
How to query data via OData REST API
Output formats
• OData specifies the output format
• JSON(default)
• XML
• Response may include metadata
• odata.metadata=minimal
• odata.metadata=full
• odata.metadata=none
• Metadata may be used by client to understand data types in response and
generate client code (if needed)
Resources
• OData has top-level resources
• http://services.odata.org/TripPinRESTierService/People
• http://services.odata.org/TripPinRESTierService/Airlines
• http://services.odata.org/TripPinRESTierService/Airports
• Fetching resources by id/key
• http://services.odata.org/TripPinRESTierService/Airports('KSFO’)
• http://services.odata.org/TripPinRESTierService/People('russellwhyte’)
Querying data with $filter
• Relational expressions
• eq, ne, gt, lt, le, ge
• Logical expression
• and, or, not
• Examples
• http://services.odata.org/TripPinRESTierService/People?$filter=FirstName eq
'Scott'
• http://services.odata.org/TripPinRESTierService/People?$filter=FirstName eq
'Scott' or FirstName eq 'Russell'
Ordering results with $orderby
• Use any column and include direction (asc or desc)
• Examples
• http://services.odata.org/TripPinRESTierService/People?$orderby=FirstName
• http://services.odata.org/TripPinRESTierService/People?$orderby=FirstName
desc
Pagination
• Pagination parameters $skip and $top
• Example
• http://services.odata.org/TripPinRESTierService/People?$skip=30&$top=10
Expansion
• Include related entities with $expand parameter
• Examples
• http://services.odata.org/TripPinRESTierService/People('keithpinckney')?$exp
and=Trips
• http://services.odata.org/TripPinRESTierService/People('russellwhyte')?$expa
nd=Trips($top=1)
• http://services.odata.org/TripPinRESTierService/People('russellwhyte')?$expa
nd=Trips($filter=Name eq 'Trip in US’)
Functions and Actions
• Non-resource oriented REST Endpoints
• Example
• http://services.odata.org/TripPinRESTierService/GetNearestAirport(lat = 33,
lon = -118)
OData ecosystem
Client tools and server API
OData libraries
Demo time
How to build applications using OData services?
JQuery DataTable
o.js
o('StockItems')
.select("StockItemName,UnitPrice,TaxRate,ColorName,Size,Brand")
.where("UnitPrice lt 20")
.orderBy("UnitPrice", "asc")
.skip(20)
.take(10)
.get(data => $(".product-item").view(data) );
References
• http://www.odata.org
• Intro
• Understand OData in 6-steps
• Libraries
• JavaScript Clients: olingo, o.js
• OData vs GraphQL vs ORDS
• OData Services in .NET(Code Project)

More Related Content

What's hot

What's hot (20)

Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data StreamingOracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
Oracle GoldenGate and Apache Kafka: A Deep Dive Into Real-Time Data Streaming
 
Maximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19cMaximum Availability Architecture - Best Practices for Oracle Database 19c
Maximum Availability Architecture - Best Practices for Oracle Database 19c
 
SQLd360
SQLd360SQLd360
SQLd360
 
Oracle Data Integrator
Oracle Data Integrator Oracle Data Integrator
Oracle Data Integrator
 
MuleSoft Anypoint Platform and Three Tier Architecture
MuleSoft Anypoint  Platform and Three Tier ArchitectureMuleSoft Anypoint  Platform and Three Tier Architecture
MuleSoft Anypoint Platform and Three Tier Architecture
 
Oracle Service Bus 12c (12.2.1) What You Always Wanted to Know
Oracle Service Bus 12c (12.2.1) What You Always Wanted to KnowOracle Service Bus 12c (12.2.1) What You Always Wanted to Know
Oracle Service Bus 12c (12.2.1) What You Always Wanted to Know
 
Oracle data integrator 12c - getting started
Oracle data integrator 12c - getting startedOracle data integrator 12c - getting started
Oracle data integrator 12c - getting started
 
Api types
Api typesApi types
Api types
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
 
Maximize Greenplum For Any Use Cases Decoupling Compute and Storage - Greenpl...
Maximize Greenplum For Any Use Cases Decoupling Compute and Storage - Greenpl...Maximize Greenplum For Any Use Cases Decoupling Compute and Storage - Greenpl...
Maximize Greenplum For Any Use Cases Decoupling Compute and Storage - Greenpl...
 
TIBCO vs MuleSoft Differentiators
TIBCO vs MuleSoft DifferentiatorsTIBCO vs MuleSoft Differentiators
TIBCO vs MuleSoft Differentiators
 
Building Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache KafkaBuilding Event Driven (Micro)services with Apache Kafka
Building Event Driven (Micro)services with Apache Kafka
 
Azure data factory
Azure data factoryAzure data factory
Azure data factory
 
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
API Governance and GitOps in Hybrid Integration Platform (MuleSoft)
 
Rest api-basic
Rest api-basicRest api-basic
Rest api-basic
 
Deep Dive into Apache Kafka
Deep Dive into Apache KafkaDeep Dive into Apache Kafka
Deep Dive into Apache Kafka
 
ELT vs. ETL - How they’re different and why it matters
ELT vs. ETL - How they’re different and why it mattersELT vs. ETL - How they’re different and why it matters
ELT vs. ETL - How they’re different and why it matters
 
Hit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate MicroservicesHit Refresh with Oracle GoldenGate Microservices
Hit Refresh with Oracle GoldenGate Microservices
 
Introduction to API
Introduction to APIIntroduction to API
Introduction to API
 
Mulesoft ppt
Mulesoft pptMulesoft ppt
Mulesoft ppt
 

Similar to OData Services

Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
Sanjay Patel
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
Woodruff Solutions LLC
 

Similar to OData Services (20)

Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
OData – Super Cola W3
OData – Super Cola W3OData – Super Cola W3
OData – Super Cola W3
 
Data Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby UsageData Analytics Service Company and Its Ruby Usage
Data Analytics Service Company and Its Ruby Usage
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Rest
RestRest
Rest
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
Consuming Data From Many Platforms: The Benefits of OData - St. Louis Day of ...
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
OData support in Cast Iron 7.5.1
OData support in Cast Iron 7.5.1OData support in Cast Iron 7.5.1
OData support in Cast Iron 7.5.1
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developers
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
 
Odata
OdataOdata
Odata
 
Odata
OdataOdata
Odata
 
Gateways 2020 Tutorial - Automated Data Ingest and Search with Globus
Gateways 2020 Tutorial - Automated Data Ingest and Search with GlobusGateways 2020 Tutorial - Automated Data Ingest and Search with Globus
Gateways 2020 Tutorial - Automated Data Ingest and Search with Globus
 
Druid at naver.com - part 1
Druid at naver.com - part 1Druid at naver.com - part 1
Druid at naver.com - part 1
 
Clean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NETClean up this mess - API Gateway & Service Discovery in .NET
Clean up this mess - API Gateway & Service Discovery in .NET
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

^Clinic ^%[+27788225528*Abortion Pills For Sale In soweto
^Clinic ^%[+27788225528*Abortion Pills For Sale In soweto^Clinic ^%[+27788225528*Abortion Pills For Sale In soweto
^Clinic ^%[+27788225528*Abortion Pills For Sale In soweto
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
how-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdfhow-to-download-files-safely-from-the-internet.pdf
how-to-download-files-safely-from-the-internet.pdf
 
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
Optimizing Operations by Aligning Resources with Strategic Objectives Using O...
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdfStrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
StrimziCon 2024 - Transition to Apache Kafka on Kubernetes with Strimzi.pdf
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
 

OData Services

  • 2. Jovan Popovic Program manager MDCS/SQL Server/Azure Azure/SQL/ASP.NET/JQuery PhD Electrical Engineering http://petlja.rs/
  • 3. Agenda • REST • Why OData? • OData – details • Demo
  • 4. What is REST? • Way of providing interoperability between computer systems on the Internet • Stateless access on resources by Uri • CRUD operations via HTTP methods • POST – Create resource • GET – Read resource • PUT – Update resource • DELETE – Delete resource
  • 5. Problem – Custom REST Endpoints • Clients need many custom queries. • How to serve custom requests? • Using custom Url • /Company/ByName/Acme • /CompanyByRegion(‘Serbia’) • Using custom parameters • /Company?Name=Acme • /Company?Region=Serbia
  • 6. SQL language • How Databases solve this problem? • SQL Language • SELECT <columns> • WHERE <condition> • ORDER BY <columns> • OFFSET <skip> • FETCH <top>
  • 7. Idea: SQL on top of REST • Adding query clauses as parameters • $select= • $filter= • $orderby= • $take= • $skip= • OData standardizes query clauses • Two types of parameters • OData reserved parameters beginning with $ • Reserved for future usage • Custom app-specific parameters cannot start with $ • You can put any parameter
  • 8. OData specification • Microsoft initiated OData in 2007. • Versions 1.0, 2.0, and 3.0 are released under the Microsoft Open Specification Promise. • Version 4.0 was standardized at OASIS, March 2014. • Standardized as ISO/IEC 20802:1 and 20801:2 • OData contributors • Citrix Systems, IBM, Microsoft, Progress Software, Red Hat, SAP.
  • 9. OData queries How to query data via OData REST API
  • 10. Output formats • OData specifies the output format • JSON(default) • XML • Response may include metadata • odata.metadata=minimal • odata.metadata=full • odata.metadata=none • Metadata may be used by client to understand data types in response and generate client code (if needed)
  • 11. Resources • OData has top-level resources • http://services.odata.org/TripPinRESTierService/People • http://services.odata.org/TripPinRESTierService/Airlines • http://services.odata.org/TripPinRESTierService/Airports • Fetching resources by id/key • http://services.odata.org/TripPinRESTierService/Airports('KSFO’) • http://services.odata.org/TripPinRESTierService/People('russellwhyte’)
  • 12. Querying data with $filter • Relational expressions • eq, ne, gt, lt, le, ge • Logical expression • and, or, not • Examples • http://services.odata.org/TripPinRESTierService/People?$filter=FirstName eq 'Scott' • http://services.odata.org/TripPinRESTierService/People?$filter=FirstName eq 'Scott' or FirstName eq 'Russell'
  • 13. Ordering results with $orderby • Use any column and include direction (asc or desc) • Examples • http://services.odata.org/TripPinRESTierService/People?$orderby=FirstName • http://services.odata.org/TripPinRESTierService/People?$orderby=FirstName desc
  • 14. Pagination • Pagination parameters $skip and $top • Example • http://services.odata.org/TripPinRESTierService/People?$skip=30&$top=10
  • 15. Expansion • Include related entities with $expand parameter • Examples • http://services.odata.org/TripPinRESTierService/People('keithpinckney')?$exp and=Trips • http://services.odata.org/TripPinRESTierService/People('russellwhyte')?$expa nd=Trips($top=1) • http://services.odata.org/TripPinRESTierService/People('russellwhyte')?$expa nd=Trips($filter=Name eq 'Trip in US’)
  • 16. Functions and Actions • Non-resource oriented REST Endpoints • Example • http://services.odata.org/TripPinRESTierService/GetNearestAirport(lat = 33, lon = -118)
  • 19. Demo time How to build applications using OData services?
  • 22. References • http://www.odata.org • Intro • Understand OData in 6-steps • Libraries • JavaScript Clients: olingo, o.js • OData vs GraphQL vs ORDS • OData Services in .NET(Code Project)