Nothing
knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(ODataQuery)
Here I'll show some examples to use this package
service <- ODataQuery$new("https://services.odata.org/V4/TripPinServiceRW") service$all()
people_entity <- service$path("People") # Get first page people_entity$retrieve(count=TRUE) # Get all pages people_entity$select("UserName", "FirstName", "LastName")$all()
russellwhyte <- people_entity$get("russellwhyte") first_person <- people_entity$top(1)$one() head(first_person) russellwhyte_friends <- russellwhyte$path("Friends") russellwhyte_friends$all()
get_nearest_airport <- service$func('GetNearestAirport') get_nearest_airport(lat = 33, lon = -118)
people_query <- people_entity$ top(5)$ select('FirstName', 'LastName')$ filter(Concurrency.gt = 500)$ expand('Friends($count=true)')$ orderby('LastName') people_query$all()
opendata_service <- ODataQuery$new("http://beta-odata4.cbs.nl/") entity_81589NED <- opendata_service$path("CBS", "81589NED", Observations") dataset_81589NED <- entity_81589NED$all()
Connecting with older OData v2 works, but some features have been changed.
northwind_service <- ODataQuery$new("https://services.odata.org/V2/Northwind/Northwind.svc/") customer_entity <- northwind_service$path("Customers") customer_entity$ select("CompanyName", "Address", "Phone")$ filter(Country.eq = "Germany", City.eq = "Berlin")
So far, I haven't been able to figure out how their data model works, but at least we can connect to it.
denhaag_service <- ODataQuery$new("https://denhaag.incijfers.nl/jiveservices/odata/") denhaag_service$path('DataSources')
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.