Learn R Programming

ODataQuery

Query on R OData

This package aims to make OData services more accessible to R users.

Installation

install.packages("devtools")
devtools::install_github("https://github.com/lverweijen/ODataQuery")

Example usage

# Initialisation
url <- "https://services.odata.org/V4/TripPinServiceRW"
trip_service <- ODataQuery$new(url)
people_entity <- trip_service$path("People")

# Find all people whose name starts with an R
people_entity$
  select("UserName", "FirstName", "LastName")$
  filter(to_odata(startsWith(FirstName, "R")))$
  all()

# Find a person named Scott
people_entity$
  filter(to_odata(FirstName == "Scott"))$
  one()

# Find Scott's friends
people_entity$
  get("scottketchum")$
  path("Friends")$
  all()

See vignettes demo and querying for more examples.

Other R packages dealing with OData

Copy Link

Version

Install

install.packages('ODataQuery')

Monthly Downloads

261

Version

0.5.3

License

GPL-3

Maintainer

Laurent Verweijen

Last Published

July 5th, 2021

Functions in ODataQuery (0.5.3)

and_query

Create a combined filter
retrieve_all

Retrieve data. If data is paged, concatenate pages. Only return the value without metadata.
retrieve_one

Retrieve single instance.
odata_function

Make an OData function available to R
to_odata

Macro to convert R to OData syntax
retrieve_data

Retrieve data
ODataQuery

ODataQuery