@@ -15,14 +15,14 @@ identified by a URI.
1515
1616### CRUD operations
1717The source code below demonstrates the CRUD operations for Thing objects. Operations for other entities work similarly.
18- ```
18+ ``` python
1919import frost_sta_client as fsc
2020
2121url = " exampleserver.com/FROST-Server/v1.1"
2222service = fsc.SensorThingsService(url)
2323```
2424#### Creating Entities
25- ```
25+ ``` python
2626from geojson import Point
2727
2828point = Point((- 115.81 , 37.24 ))
@@ -37,7 +37,7 @@ service.create(thing)
3737#### Querying Entities
3838Queries to the FROST Server can be modified to include filters, selections or expansions. The return value is always
3939an EntityList object, containing the parsed json response of the server.
40- ```
40+ ``` python
4141things_list = service.things().query().filter(' id eq 1' ).list()
4242
4343for thing in things_list:
@@ -50,7 +50,7 @@ replaying to the request with the first chunk accompanied by the link to the nex
5050
5151The class ` EntityList ` implements the function ` __iter__ ` and ` __next__ ` which makes it capable of iterating
5252through the entire list of entities, including the calls to all chunks.
53- ```
53+ ``` python
5454things_list = service.things().query().list()
5555
5656for thing in things_list:
@@ -59,7 +59,7 @@ for thing in things_list:
5959
6060In a case where only the current chunk is supposed to be iterated, the ` entities ` list can be used.
6161
62- ```
62+ ``` python
6363things_list = service.things().query().top(20 ).list()
6464
6565for thing in things_list.entities:
@@ -69,7 +69,7 @@ for thing in things_list.entities:
6969### Queries to related entity lists
7070
7171For example the Observations of a given Datastream can be queried via
72- ```
72+ ``` python
7373datastream = service.datastreams().find(1 )
7474observations_list = datastream.get_observations().query().filter(" result gt 10" ).list()
7575```
@@ -84,7 +84,7 @@ combination with a for-loop).
8484
8585The callback function is called with one argument, which is the current index of the iteration.
8686
87- ```
87+ ``` python
8888def callback_func (loaded_entities ):
8989 print (" loaded {} entities!" .format(loaded_entities))
9090
@@ -100,7 +100,7 @@ DataArrays can be used to make the creation of Observations easier, because with
100100has to be created.
101101
102102An example usage looks as follows:
103- ```
103+ ``` python
104104 import frost_sta_client as fsc
105105
106106 service = fsc.SensorThingsService(" exampleserver.com/FROST-Server/v1.1" )
@@ -115,7 +115,7 @@ An example usage looks as follows:
115115 datastream = datastream,
116116 feature_of_interest = foi)
117117 obs2 = fsc.Observation(result = 5 ,
118- phenomenon_time='2022-12-19T17 :00:00Z',
118+ phenomenon_time = ' 2022-12-19T10:00:00Z/2022-12-19T11 :00:00Z' ,
119119 datastream = datastream,
120120 feature_of_interest = foi)
121121 dav.add_observation(obs1)
0 commit comments