Page tree
Skip to end of metadata
Go to start of metadata

This short tutorial shows how to request data from the property service with python and requests (see also Access to REST-Services in Python).

For IDL you can take a similar approach by adapting these instructions to Access to REST-Services in IDL.

The Property Service

The property service represents a web interface which allows to request, insert and modify property data from the database. Operations are performed by sending URL requests, whereas each operation is well defined as a so called route. The property service comes along with a graphical user interface at http://localhost:8002/ui/ which provides visual access to all available routes. Hereby, all routes involving the request of data are enlisted under the View section.

For this tutorial we are using only one route to request all available regions within our database.

  • /region/{dataset}/list

Implementation

Request

For the following example we assume, as the dataset ml-algorithms is already available within the database. Otherwise, we refer to the following Howto: Ingest property data in database (REST API).

The request of all available regions is then very simple. We firstly have to define the dataset ml_dataset which contains our data before we call the above given route.

# define the dataset
ml_dataset = "ml-algorithms";

# retrieving data
print('downloading all properties...')
ml_regions = requests.get("http://localhost:8002/region/%s/list" % ml_dataset).json()

print(ml_regions)

Source Code

Here you can download the full python source code.

request_ property data.py

  • No labels