SlideShare a Scribd company logo
1 of 16
1
Presentation on OData
What is OData
• Open Data Protocol (OData) is an open protocol for sharing data.
• It is built upon AtomPub, itself an extension of Atom Publishing Protocol.
[The Atom Publishing Protocol (AtomPub) is an Application level protocol for
publishing and editing web resources.]
• OData is based on REST (Representational State Transfer) ; therefore a simple web
browser can view the data exposed through an OData service.
• The basic idea behind OData is to use a well known data format (Atom feed) to
expose a list of entities.
• AtomPub extends the basic Atom Protocol by allowing not only read but the whole
set of CRUD operations.
2
• Atom is an XML-based document format that describes Collections of
related
• information known as "feeds". Feeds are composed of a number of items,
known as Entries.
3
How OData Works: Technology Basics
4
• The OData technology has four main parts:
1. OData data model
2. OData protocol
3. OData client libraries
4. OData service
1. The OData data model, which provides a generic way to organize and
describe data.
2. The OData protocol, which lets a client make requests to and get
responses from an OData service. Those interactions include the usual
create/read/update/delete (CRUD) operations, along with an OData-
defined query language.
3. OData client libraries, which make it easier to create software that
accesses data via the OData protocol. Because OData relies on REST,
using an OData-specific client library isn't strictly required. But most
OData clients are applications, and so providing pre-built libraries for
making OData requests and getting results makes life simpler for the
developers who create those applications.
4. An OData service, which exposes an endpoint that allows access to data.
This service implements the OData protocol, and it also uses the
abstractions of the OData data model to translate data between its
underlying form, which might be relational tables, SharePoint lists, or
something else, into the format sent to the client.
5
Consumption of Odata Example
1. Requesting resources : Foe example here we use the service of an open trip
management system .
If a person named Russell White, who has formerly registered TripPin, would like
to find out who are the other people in it.
GET http://services.odata.org/v4/TripPinServiceRW/People HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
This uses version 4
TripPin from where it fetch
data
List of people whose data are retrieved
HTTP Version 1.1
6
In Response
• HTTP/1.1 200 OK
• Content-Length: 1007
• Content-Type: application/json; odata.metadata=minimal Service Route URL Resource path
• OData-Version: 4.0
• {
• "@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People",
• "@odata.nextLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People?%24skiptoken=8",
• "value":[
• {
• "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')",
• "@odata.etag":"W/"08D285C0E2748213"",
• "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')",
• "UserName":"russellwhyte",
• "FirstName":"Russell",
• "LastName":"Whyte",
• "Emails":[
• "Russell@example.com",
• "Russell@contoso.com"
• ],
• "AddressInfo":[
• {
• "Address":"187 Suffolk Ln.",
• "City":{
• "CountryRegion":"United States",
• "Name":"Boise",
• "Region":"ID"
• }
• }
• ],
• "Gender":"Male",
• "Concurrency":635717560892162579
• },
• {
• ......................................
• }
• ]}
7
2. Requesting an individual resource
GET http://services.odata.org/v4/TripPinServiceRW/People('russellwhyte') HTTP/1.1
OData-Version: 4.0 User name of the individual
OData-MaxVersion: 4.0 Resource
3. Queries
GET http://services.odata.org/v4/TripPinServiceRW/People?$top=2 &
$select=FirstName, LastName & $filter=Trips/any(d:d/Budget gt 3000) HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
8
In Response
• HTTP/1.1 200 OK
• Content-Length: 367
• Content-Type: application/json; odata.metadata=minimal
• OData-Version: 4.0
• {
•
"@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People(FirstNam
e,LastName)",
• "value":[
• {
• "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')",
• "@odata.etag":"W/"08D285C0E2748213"",
•
"@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')",
• "FirstName":"Scott",
• "LastName":"Ketchum"
• },
• {
• "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('ronaldmundy')",
• "@odata.etag":"W/"08D285C0E2748213"",
•
"@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('ronaldmundy')",
• "FirstName":"Ronald",
• "LastName":"Mundy"
• }
• ]
• }
9
4. Creating a new resource
POST http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/People HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Length: 428
Content-Type: application/json
{
"UserName":"lewisblack",
"FirstName":"Lewis",
"LastName":"Black",
"Emails":[
"lewisblack@example.com"
],
"AddressInfo":[
{
"Address":"187 Suffolk Ln.",
"City":{
"CountryRegion":"United States",
"Name":"Boise",
"Region":"ID"
}
}
],
"Gender":"Male",
"Concurrency":635519729375200400
}
10
In Response
HTTP/1.1 201 Created
Content-Length: 652
Content-Type:
application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=f
alse;charset=utf-8
ETag: W/'08D1D3800FC572E3'
Location:
http://services.odata.org/V4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop
le('lewisblack')
OData-Version: 4.0
NOTE :- IEEE754Compatible=false ;= means that Int64(Represents a 64-bit signed
integer.) and Decimal are serialized as numbers.
11
5. Relating resources
In RESTful APIs, resources are usually dependent with each other. For that, the concept
of relationships in OData can be defined among resources to add flexibility and
richness to the data model.
Example -
POST
http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop
le('lewisblack')/Trips/$ref HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
Content-Length: 123
Content-Type: application/json
{
"@odata.id":"http://services.odata.org/V4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinSer
viceRW/People('russellwhyte')/Trips(0)"
}
12
In Response
HTTP/1.1 204 No Content
OData-Version: 4.0
6. Invoking a Function
OData supports defining functions and actions to represent complicated logic and
which can be frequently used.
For Example :- After having explored the TripPin OData service, Russell finds out that
it has a function called GetInvolvedPeople from which he can find out the involved
people of a specific trip.
13
GET
http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop
le('russellwhyte')/Trips(0)/Microsoft.OData.SampleService.Models.TripPin.GetInvolved
People()
HTTP/1.1
OData-Version: 4.0
OData-MaxVersion: 4.0
In Response :
HTTP/1.1 200 OK
Content-Length: 582
Content-Type: application/json; odata.metadata=minimal
OData-Version: 4.0
{
"@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People",
"value":[
{
"@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')",
"@odata.etag":"W/"08D285C4BEF5EC5D"",
"@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')
", 14
• "UserName":"russellwhyte",
• "FirstName":"Russell",
• "LastName":"Whyte",
• "Emails":[
• "Russell@example.com",
• "Russell@contoso.com"
• ],
• "AddressInfo":[
• {
• "Address":"187 Suffolk Ln.",
• "City":{
• "CountryRegion":"United States",
• "Name":"Boise",
• "Region":"ID"
• }
• }
• ],
• "Gender":"Male",
• "Concurrency":635717577476533341
• },
• {
• "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')",
• "@odata.etag":"W/"08D285C4BEF5EC5D"",
• "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')",
• "UserName":"scottketchum",
• "FirstName":"Scott",
• "LastName":"Ketchum",
• "Emails":[
• "Scott@example.com"
• ],
• "AddressInfo":[
• {
• "Address":"2817 Milton Dr.",
• "City":{
• "CountryRegion":"United States",
• "Name":"Albuquerque",
• "Region":"NM"
• }
• }
• ],
• "Gender":"Male",
• "Concurrency":635717577476533341
• }
• ] }
15
16

More Related Content

What's hot

Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
honglee71
 

What's hot (20)

NetWeaver Gateway- Introduction to OData
NetWeaver Gateway- Introduction to ODataNetWeaver Gateway- Introduction to OData
NetWeaver Gateway- Introduction to OData
 
Oracle Analytics Cloud
Oracle Analytics CloudOracle Analytics Cloud
Oracle Analytics Cloud
 
Extensibility
ExtensibilityExtensibility
Extensibility
 
Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS  : MySQL, PostgreSQL and SQL SERVERRelational RDBMS  : MySQL, PostgreSQL and SQL SERVER
Relational RDBMS : MySQL, PostgreSQL and SQL SERVER
 
Web Development In Oracle APEX
Web Development In Oracle APEXWeb Development In Oracle APEX
Web Development In Oracle APEX
 
Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0Achieving Lakehouse Models with Spark 3.0
Achieving Lakehouse Models with Spark 3.0
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 
Building Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS GlueBuilding Serverless ETL Pipelines with AWS Glue
Building Serverless ETL Pipelines with AWS Glue
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
Azure Purview Data Toboggan Erwin de Kreuk
Azure Purview Data Toboggan Erwin de KreukAzure Purview Data Toboggan Erwin de Kreuk
Azure Purview Data Toboggan Erwin de Kreuk
 
Consolidating MLOps at One of Europe’s Biggest Airports
Consolidating MLOps at One of Europe’s Biggest AirportsConsolidating MLOps at One of Europe’s Biggest Airports
Consolidating MLOps at One of Europe’s Biggest Airports
 
Oracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSOracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDS
 
Oracle apex training
Oracle apex trainingOracle apex training
Oracle apex training
 
Azure data platform overview
Azure data platform overviewAzure data platform overview
Azure data platform overview
 
REST API debate: OData vs GraphQL vs ORDS
REST API debate: OData vs GraphQL vs ORDSREST API debate: OData vs GraphQL vs ORDS
REST API debate: OData vs GraphQL vs ORDS
 
Azure Data Factory Data Flow
Azure Data Factory Data FlowAzure Data Factory Data Flow
Azure Data Factory Data Flow
 
Database option SDO mismatch: PDB installed version 12.1.0.2.0. CDB installed...
Database option SDO mismatch: PDB installed version 12.1.0.2.0. CDB installed...Database option SDO mismatch: PDB installed version 12.1.0.2.0. CDB installed...
Database option SDO mismatch: PDB installed version 12.1.0.2.0. CDB installed...
 
SSIS Presentation
SSIS PresentationSSIS Presentation
SSIS Presentation
 
Technical Overview of CDS View – SAP HANA Part I
Technical Overview of CDS View – SAP HANA Part ITechnical Overview of CDS View – SAP HANA Part I
Technical Overview of CDS View – SAP HANA Part I
 
CDS Views.pptx
CDS Views.pptxCDS Views.pptx
CDS Views.pptx
 

Viewers also liked

Odata introduction-slides
Odata introduction-slidesOdata introduction-slides
Odata introduction-slides
MasterCode.vn
 

Viewers also liked (12)

OData, Open Data Protocol. A brief introduction
OData, Open Data Protocol. A brief introductionOData, Open Data Protocol. A brief introduction
OData, Open Data Protocol. A brief introduction
 
OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)OData Introduction and Impact on API Design (Webcast)
OData Introduction and Impact on API Design (Webcast)
 
A Look at OData
A Look at ODataA Look at OData
A Look at OData
 
Practical OData
Practical ODataPractical OData
Practical OData
 
Odata introduction-slides
Odata introduction-slidesOdata introduction-slides
Odata introduction-slides
 
OData and the future of business objects universes
OData and the future of business objects universesOData and the future of business objects universes
OData and the future of business objects universes
 
OData Hackathon Challenge
OData Hackathon ChallengeOData Hackathon Challenge
OData Hackathon Challenge
 
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
RESTful Web APIs – Mike Amundsen, Principal API Architect, Layer 7
 
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
API360 – A How-To Guide for Enterprise APIs - Learn how to position your ente...
 
The Architecture of an API Platform
The Architecture of an API PlatformThe Architecture of an API Platform
The Architecture of an API Platform
 
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
API Design Methodology - Mike Amundsen, Director of API Architecture, API Aca...
 
Api architectures for the modern enterprise
Api architectures for the modern enterpriseApi architectures for the modern enterprise
Api architectures for the modern enterprise
 

Similar to Odata

OData Across Boundaries
OData Across BoundariesOData Across Boundaries
OData Across Boundaries
Sam Basu
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
Sanjay Patel
 
Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014
Stephan Klevenz
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
Erik Hatcher
 
CrossRef Technical Basics 2010 CrossRef Workshops
CrossRef Technical Basics 2010 CrossRef WorkshopsCrossRef Technical Basics 2010 CrossRef Workshops
CrossRef Technical Basics 2010 CrossRef Workshops
Crossref
 

Similar to Odata (20)

OData Across Boundaries
OData Across BoundariesOData Across Boundaries
OData Across Boundaries
 
Introduction to o data
Introduction to o dataIntroduction to o data
Introduction to o data
 
OData – Super Cola W3
OData – Super Cola W3OData – Super Cola W3
OData – Super Cola W3
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
Overview of java web services
Overview of java web servicesOverview of java web services
Overview of java web services
 
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)
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
 
Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014
 
Breaking down data silos with OData
Breaking down data silos with ODataBreaking down data silos with OData
Breaking down data silos with OData
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Learning W3C Linked Data Platform with examples
Learning W3C Linked Data Platform with examplesLearning W3C Linked Data Platform with examples
Learning W3C Linked Data Platform with examples
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
CrossRef How-to: A Technical Introduction to the Basics of CrossRef, Chuck Ko...
CrossRef How-to: A Technical Introduction to the Basics of CrossRef, Chuck Ko...CrossRef How-to: A Technical Introduction to the Basics of CrossRef, Chuck Ko...
CrossRef How-to: A Technical Introduction to the Basics of CrossRef, Chuck Ko...
 
Introduction to W3C Linked Data Platform
Introduction to W3C Linked Data PlatformIntroduction to W3C Linked Data Platform
Introduction to W3C Linked Data Platform
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developers
 
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
FIWARE Global Summit - The Way Towards Interoperability between Web Of Things...
 
Web-01-HTTP.pptx
Web-01-HTTP.pptxWeb-01-HTTP.pptx
Web-01-HTTP.pptx
 
CrossRef Technical Basics 2010 CrossRef Workshops
CrossRef Technical Basics 2010 CrossRef WorkshopsCrossRef Technical Basics 2010 CrossRef Workshops
CrossRef Technical Basics 2010 CrossRef Workshops
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Odata

  • 2. What is OData • Open Data Protocol (OData) is an open protocol for sharing data. • It is built upon AtomPub, itself an extension of Atom Publishing Protocol. [The Atom Publishing Protocol (AtomPub) is an Application level protocol for publishing and editing web resources.] • OData is based on REST (Representational State Transfer) ; therefore a simple web browser can view the data exposed through an OData service. • The basic idea behind OData is to use a well known data format (Atom feed) to expose a list of entities. • AtomPub extends the basic Atom Protocol by allowing not only read but the whole set of CRUD operations. 2
  • 3. • Atom is an XML-based document format that describes Collections of related • information known as "feeds". Feeds are composed of a number of items, known as Entries. 3
  • 4. How OData Works: Technology Basics 4 • The OData technology has four main parts: 1. OData data model 2. OData protocol 3. OData client libraries 4. OData service
  • 5. 1. The OData data model, which provides a generic way to organize and describe data. 2. The OData protocol, which lets a client make requests to and get responses from an OData service. Those interactions include the usual create/read/update/delete (CRUD) operations, along with an OData- defined query language. 3. OData client libraries, which make it easier to create software that accesses data via the OData protocol. Because OData relies on REST, using an OData-specific client library isn't strictly required. But most OData clients are applications, and so providing pre-built libraries for making OData requests and getting results makes life simpler for the developers who create those applications. 4. An OData service, which exposes an endpoint that allows access to data. This service implements the OData protocol, and it also uses the abstractions of the OData data model to translate data between its underlying form, which might be relational tables, SharePoint lists, or something else, into the format sent to the client. 5
  • 6. Consumption of Odata Example 1. Requesting resources : Foe example here we use the service of an open trip management system . If a person named Russell White, who has formerly registered TripPin, would like to find out who are the other people in it. GET http://services.odata.org/v4/TripPinServiceRW/People HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 This uses version 4 TripPin from where it fetch data List of people whose data are retrieved HTTP Version 1.1 6
  • 7. In Response • HTTP/1.1 200 OK • Content-Length: 1007 • Content-Type: application/json; odata.metadata=minimal Service Route URL Resource path • OData-Version: 4.0 • { • "@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People", • "@odata.nextLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People?%24skiptoken=8", • "value":[ • { • "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')", • "@odata.etag":"W/"08D285C0E2748213"", • "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')", • "UserName":"russellwhyte", • "FirstName":"Russell", • "LastName":"Whyte", • "Emails":[ • "Russell@example.com", • "Russell@contoso.com" • ], • "AddressInfo":[ • { • "Address":"187 Suffolk Ln.", • "City":{ • "CountryRegion":"United States", • "Name":"Boise", • "Region":"ID" • } • } • ], • "Gender":"Male", • "Concurrency":635717560892162579 • }, • { • ...................................... • } • ]} 7
  • 8. 2. Requesting an individual resource GET http://services.odata.org/v4/TripPinServiceRW/People('russellwhyte') HTTP/1.1 OData-Version: 4.0 User name of the individual OData-MaxVersion: 4.0 Resource 3. Queries GET http://services.odata.org/v4/TripPinServiceRW/People?$top=2 & $select=FirstName, LastName & $filter=Trips/any(d:d/Budget gt 3000) HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 8
  • 9. In Response • HTTP/1.1 200 OK • Content-Length: 367 • Content-Type: application/json; odata.metadata=minimal • OData-Version: 4.0 • { • "@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People(FirstNam e,LastName)", • "value":[ • { • "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')", • "@odata.etag":"W/"08D285C0E2748213"", • "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')", • "FirstName":"Scott", • "LastName":"Ketchum" • }, • { • "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('ronaldmundy')", • "@odata.etag":"W/"08D285C0E2748213"", • "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('ronaldmundy')", • "FirstName":"Ronald", • "LastName":"Mundy" • } • ] • } 9
  • 10. 4. Creating a new resource POST http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/People HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Length: 428 Content-Type: application/json { "UserName":"lewisblack", "FirstName":"Lewis", "LastName":"Black", "Emails":[ "lewisblack@example.com" ], "AddressInfo":[ { "Address":"187 Suffolk Ln.", "City":{ "CountryRegion":"United States", "Name":"Boise", "Region":"ID" } } ], "Gender":"Male", "Concurrency":635519729375200400 } 10
  • 11. In Response HTTP/1.1 201 Created Content-Length: 652 Content-Type: application/json;odata.metadata=minimal;odata.streaming=true;IEEE754Compatible=f alse;charset=utf-8 ETag: W/'08D1D3800FC572E3' Location: http://services.odata.org/V4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop le('lewisblack') OData-Version: 4.0 NOTE :- IEEE754Compatible=false ;= means that Int64(Represents a 64-bit signed integer.) and Decimal are serialized as numbers. 11
  • 12. 5. Relating resources In RESTful APIs, resources are usually dependent with each other. For that, the concept of relationships in OData can be defined among resources to add flexibility and richness to the data model. Example - POST http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop le('lewisblack')/Trips/$ref HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 Content-Length: 123 Content-Type: application/json { "@odata.id":"http://services.odata.org/V4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinSer viceRW/People('russellwhyte')/Trips(0)" } 12
  • 13. In Response HTTP/1.1 204 No Content OData-Version: 4.0 6. Invoking a Function OData supports defining functions and actions to represent complicated logic and which can be frequently used. For Example :- After having explored the TripPin OData service, Russell finds out that it has a function called GetInvolvedPeople from which he can find out the involved people of a specific trip. 13
  • 14. GET http://services.odata.org/v4/(S(34wtn2c0hkuk5ekg0pjr513b))/TripPinServiceRW/Peop le('russellwhyte')/Trips(0)/Microsoft.OData.SampleService.Models.TripPin.GetInvolved People() HTTP/1.1 OData-Version: 4.0 OData-MaxVersion: 4.0 In Response : HTTP/1.1 200 OK Content-Length: 582 Content-Type: application/json; odata.metadata=minimal OData-Version: 4.0 { "@odata.context":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/$metadata#People", "value":[ { "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte')", "@odata.etag":"W/"08D285C4BEF5EC5D"", "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('russellwhyte') ", 14
  • 15. • "UserName":"russellwhyte", • "FirstName":"Russell", • "LastName":"Whyte", • "Emails":[ • "Russell@example.com", • "Russell@contoso.com" • ], • "AddressInfo":[ • { • "Address":"187 Suffolk Ln.", • "City":{ • "CountryRegion":"United States", • "Name":"Boise", • "Region":"ID" • } • } • ], • "Gender":"Male", • "Concurrency":635717577476533341 • }, • { • "@odata.id":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')", • "@odata.etag":"W/"08D285C4BEF5EC5D"", • "@odata.editLink":"http://services.odata.org/V4/(S(fo3by51qwd1q124ngi2rxrzc))/TripPinServiceRW/People('scottketchum')", • "UserName":"scottketchum", • "FirstName":"Scott", • "LastName":"Ketchum", • "Emails":[ • "Scott@example.com" • ], • "AddressInfo":[ • { • "Address":"2817 Milton Dr.", • "City":{ • "CountryRegion":"United States", • "Name":"Albuquerque", • "Region":"NM" • } • } • ], • "Gender":"Male", • "Concurrency":635717577476533341 • } • ] } 15
  • 16. 16

Editor's Notes

  1. Atom is an XML-based document format that describes Collections of related information known as "feeds". Feeds are composed of a number of items, known as Entries. 
  2. The OData data model, which provides a generic way to organize and describe data. The OData protocol, which lets a client make requests to and get responses from an OData service. Those interactions include the usual create/read/update/delete (CRUD) operations, along with an OData-defined query language.  OData client libraries, which make it easier to create software that accesses data via the OData protocol. Because OData relies on REST, using an OData-specific client library isn't strictly required. But most OData clients are applications, and so providing pre-built libraries for making OData requests and getting results makes life simpler for the developers who create those applications. An OData service, which exposes an endpoint that allows access to data. This service implements the OData protocol, and it also uses the abstractions of the OData data model to translate data between its underlying form, which might be relational tables, SharePoint lists, or something else, into the format sent to the client.
  3. IEEE754Compatible=false ;= means that Int64(Represents a 64-bit signed integer.) and Decimal are serialized as numbers.