odataR: odataR: A package for reading OData information.

Description Details

Description

The odataR package contains some functions to obtain information from databases with the OData interface.

Details

Located under the root of an OData database are some tables. To obtain the information one should specify the correct root and the name of the table. Because this package was created to access the information of the CBS (Statistics Netherlands) the default root is appropriate for this information. The name of a table (here called table_id) can be found in the documentation of the database. For the CBS you can use the catalog https://opendata.cbs.nl/dataportaal/portal.html to see the available tables and their metadata. It is also possible to get the catalog information in a data.frame by using the function odataR_get_cat.

Setting a different root can be done by using the function odataR_set_root and querying the root by executing odataR_get_root.

The other functions in the package are related to actually obtain information from the database. In the CBS database a table name (table_id) points to a set of sub tables that together provide the information. One 'main' sub table contains the topic data and dimensions in coded form indicating where the topic data relates to. The other sub tables convey the meaning of the coded dimensions. E.g. a topic field could be the number of unemployed workers and the dimensions could be gender, age-class, province and year.

The main function is odataR_get_table that extracts the information from the database and decodes the dimensions. This function can also be used to get metadata about the table. It is possible to use the OData query language.

Currently version 3 is used for the CBS data but a conversion to version 4 is taking place at the moment (January 2018)

v3 : http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/

v4 : http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html

For examples of the query language see odataR_get_table

The description of the function odataR_get_cat contains examples to retrieve catalog information. The same query language can be used when that is useful.


HanOostdijk/odataR documentation built on May 14, 2020, 5:57 p.m.