GNU/Linux ODATA Query Examples

ODATA Query OptionDescription
$orderbyUri parameter for sorting…
$selectUri parameter to select specific coluimns…
$topUri parameter to limit the result…
$skipUri parameter to skip number of rows…
$filterUri parameter to filter result…
$expandUri parameter to expand related entity…
$inlinecountUri parameter to include a total record count…

Example to retrieve metadata from JBoss DV Odata service…

https://localhost:8443/odata/vdbname/$metadata

Retrieve all records in JSON format…

https://localhost:8443/odata/vdbname/modelname?$format=json

Order by column ‘Name’ and retrieve first 5 records…

https://localhost:8443/odata/vdbname/modelname?amp;$orderby=Name&$top=5

Order by column ‘Name’ and retrieve records 6-10 records…

https://localhost:8443/odata/vdbname/modelname?$orderby=Name&skip=5&$top=5

Filter ODATA result ($filter=Name eq ‘John’)…

https://localhost:8443/odata/vdbname/modelname?$filter=Name%20eq%20%27John%27

Select specific rows…

https://localhost:8443/odata/vdbname/modelname?$select=ID,Name,Description