staplus-client 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. staplus_client-0.3.3/LICENSE +165 -0
  2. staplus_client-0.3.3/PKG-INFO +470 -0
  3. staplus_client-0.3.3/README.md +449 -0
  4. staplus_client-0.3.3/setup.cfg +4 -0
  5. staplus_client-0.3.3/setup.py +27 -0
  6. staplus_client-0.3.3/staplus_client/__init__.py +47 -0
  7. staplus_client-0.3.3/staplus_client/__version__.py +8 -0
  8. staplus_client-0.3.3/staplus_client/dao/__init__.py +18 -0
  9. staplus_client-0.3.3/staplus_client/dao/actuator.py +30 -0
  10. staplus_client-0.3.3/staplus_client/dao/base.py +70 -0
  11. staplus_client-0.3.3/staplus_client/dao/campaign.py +25 -0
  12. staplus_client-0.3.3/staplus_client/dao/datastream.py +35 -0
  13. staplus_client-0.3.3/staplus_client/dao/features_of_interest.py +36 -0
  14. staplus_client-0.3.3/staplus_client/dao/historical_location.py +35 -0
  15. staplus_client-0.3.3/staplus_client/dao/license.py +25 -0
  16. staplus_client-0.3.3/staplus_client/dao/location.py +35 -0
  17. staplus_client-0.3.3/staplus_client/dao/multi_datastream.py +36 -0
  18. staplus_client-0.3.3/staplus_client/dao/observation.py +55 -0
  19. staplus_client-0.3.3/staplus_client/dao/observation_group.py +25 -0
  20. staplus_client-0.3.3/staplus_client/dao/observedproperty.py +35 -0
  21. staplus_client-0.3.3/staplus_client/dao/party.py +25 -0
  22. staplus_client-0.3.3/staplus_client/dao/relation.py +57 -0
  23. staplus_client-0.3.3/staplus_client/dao/sensor.py +35 -0
  24. staplus_client-0.3.3/staplus_client/dao/task.py +30 -0
  25. staplus_client-0.3.3/staplus_client/dao/tasking_capability.py +30 -0
  26. staplus_client-0.3.3/staplus_client/dao/thing.py +36 -0
  27. staplus_client-0.3.3/staplus_client/model/__init__.py +29 -0
  28. staplus_client-0.3.3/staplus_client/model/campaign.py +417 -0
  29. staplus_client-0.3.3/staplus_client/model/datastream.py +166 -0
  30. staplus_client-0.3.3/staplus_client/model/entity.py +29 -0
  31. staplus_client-0.3.3/staplus_client/model/ext/__init__.py +0 -0
  32. staplus_client-0.3.3/staplus_client/model/ext/entity_list.py +75 -0
  33. staplus_client-0.3.3/staplus_client/model/ext/entity_type.py +142 -0
  34. staplus_client-0.3.3/staplus_client/model/ext/unitofmeasurement.py +5 -0
  35. staplus_client-0.3.3/staplus_client/model/feature_of_interest.py +17 -0
  36. staplus_client-0.3.3/staplus_client/model/historical_location.py +21 -0
  37. staplus_client-0.3.3/staplus_client/model/license.py +301 -0
  38. staplus_client-0.3.3/staplus_client/model/location.py +22 -0
  39. staplus_client-0.3.3/staplus_client/model/multi_datastream.py +160 -0
  40. staplus_client-0.3.3/staplus_client/model/observation.py +218 -0
  41. staplus_client-0.3.3/staplus_client/model/observation_group.py +399 -0
  42. staplus_client-0.3.3/staplus_client/model/observedproperty.py +20 -0
  43. staplus_client-0.3.3/staplus_client/model/party.py +315 -0
  44. staplus_client-0.3.3/staplus_client/model/relation.py +246 -0
  45. staplus_client-0.3.3/staplus_client/model/sensor.py +16 -0
  46. staplus_client-0.3.3/staplus_client/model/thing.py +110 -0
  47. staplus_client-0.3.3/staplus_client/query/__init__.py +0 -0
  48. staplus_client-0.3.3/staplus_client/query/query.py +109 -0
  49. staplus_client-0.3.3/staplus_client/service/BearerAuth.py +23 -0
  50. staplus_client-0.3.3/staplus_client/service/__init__.py +17 -0
  51. staplus_client-0.3.3/staplus_client/service/auth_handler.py +23 -0
  52. staplus_client-0.3.3/staplus_client/service/staplusservice.py +162 -0
  53. staplus_client-0.3.3/staplus_client/utils.py +64 -0
  54. staplus_client-0.3.3/staplus_client.egg-info/PKG-INFO +470 -0
  55. staplus_client-0.3.3/staplus_client.egg-info/SOURCES.txt +56 -0
  56. staplus_client-0.3.3/staplus_client.egg-info/dependency_links.txt +1 -0
  57. staplus_client-0.3.3/staplus_client.egg-info/requires.txt +9 -0
  58. staplus_client-0.3.3/staplus_client.egg-info/top_level.txt +1 -0
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,470 @@
1
+ Metadata-Version: 2.1
2
+ Name: staplus-client
3
+ Version: 0.3.3
4
+ Summary: A client library to facilitate interaction with a STAplus Server
5
+ Home-page: https://github.com/securedimensions/STAplus-Python-Client
6
+ Author: Andreas Matheus
7
+ Author-email: andreas.matheus@secure-dimensions.de
8
+ License: LGPL3
9
+ Keywords: ogc,staplus,sensorthingsapi,IoT
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: demjson3>=3.0.5
13
+ Requires-Dist: furl>=2.1.3
14
+ Requires-Dist: geojson>=2.5.0
15
+ Requires-Dist: jsonpickle>=2.0.0
16
+ Requires-Dist: requests>=2.26.0
17
+ Requires-Dist: jsonpatch
18
+ Requires-Dist: python-dateutil
19
+ Requires-Dist: pillow
20
+ Requires-Dist: sd-frost-sta-client
21
+
22
+ # OGC STAplus (SensorThings) API Python Client
23
+
24
+ This STAplus Python Client implements the [STAplus](https://docs.ogc.org/is/22-022r1/22-022r1.html) API. The aim is to simplify development of STAplus and SensorThings enabled client applications.
25
+
26
+ **_NOTE:_** This implementation is an extension to the [FROST API Python Client](https://github.com/FraunhoferIOSB/FROST-Python-Client). To have better control over bug fixing and improvements, this implementation is actually based on a fork of the FROST API Python Client, hosted on a Secure Dimensions Github repository: [STA Python Client](https://github.com/securedimensions/STA-Python-Client).
27
+
28
+ ## Python Version
29
+ This library requires Python 3.11 or better to support parsing ISO datetime values (`datetime.datetime.fromisoformat`). See [here](https://docs.python.org/3/library/datetime.html#datetime.datetime.fromisoformat) for more information.
30
+
31
+ ## Features
32
+ * Support for all STAplus and SensorThings entity types
33
+ * CRUD operations
34
+ * Queries on entity lists
35
+ * Query on single entity
36
+ * MultiDatastreams
37
+ * Cloning Entities
38
+ * Fetching entities relative to an entity (using many-association)
39
+ * Fetching one single entity relative to an entity (using one-association)
40
+
41
+ ## Installation via PyPi
42
+ Installation via pip: `pip install staplus-client`
43
+
44
+ ## Limitations
45
+ This implementation has the following limitations for the Entity `Location` and `FeatureOfInterest`:
46
+
47
+ * `Location/location` must be a GeoJSON Geometry object (this is an Any in the SensorThings datamodel)
48
+ * `FeatureOfInterest/feature` must be a GeoJSON Object (this is an Any in the SensorThings datamodel)
49
+
50
+ For both entities, the `encodingType` attribute is not tested by the implementation. For interoperability with other applications, the value should be `application/geo+json`.
51
+
52
+ ## API
53
+
54
+ The `STAplusService` class is central to the library. An instance of it represents a STAplus service and is identified by a URI.
55
+
56
+
57
+ ### Creating Entities via the STAplus Client
58
+ The source code below demonstrates how to initialize the client for a STAplus endpoint on `url`.
59
+
60
+ ```python
61
+ import staplus_client as staplus
62
+
63
+ url = "<your domain>/staplus/v1.1"
64
+ service = staplus.STAplusService(url)
65
+ ```
66
+
67
+ #### Configuring an Authentication Handler
68
+ When interacting with a STAplus service that has enabled authentication, the use of an `AuthHandler` is required.
69
+
70
+ ```python
71
+ import staplus_client as staplus
72
+
73
+ url = "<your domain>/staplus/v1.1"
74
+ auth_handler.AuthHandler(...)
75
+ service = staPlus.STAplusService(url, auth_handler=auth)
76
+ ```
77
+
78
+ #### Creating a Party Entity
79
+ The `Party` entity represents a user or an institution. When interacting with a STAplus service that has enabled authentication, the `Party` entity represents the acting user and access control controls Create, Update and Delete.
80
+ ```python
81
+ import staplus_client as staplus
82
+
83
+ url = "<your domain>/staplus/v1.1"
84
+ auth_handler.AuthHandler(...)
85
+ service = staPlus.STAplusService(url, auth_handler=auth)
86
+ ljs = staPlus.Party(description='I am Long John Silver the opportunistic pirate created by Robert Louis Stevenson',
87
+ display_name='LJS',
88
+ role='individual')
89
+ service.create(ljs)
90
+ ```
91
+
92
+ #### Creating a STAplus enriched Datastream
93
+ The STAplus `Datastream` is capable to have a `Party` and a `License` associated. Also, the `Thing` is associated to a `Party` entity.
94
+ ```python
95
+ import staplus_client as staplus
96
+
97
+ url = "<your domain>/staplus/v1.1"
98
+ auth_handler.AuthHandler(...)
99
+ service = staplus.STAplusService(url, auth_handler=auth)
100
+ ljs = staplus.Party(description='I am Long John Silver the opportunistic pirate created by Robert Louis Stevenson',
101
+ display_name='LJS',
102
+ role='individual')
103
+ service.create(ljs)
104
+
105
+ # find the CC-BY license
106
+ cc_by = service.licenses().find('CC_BY')
107
+
108
+ # Create a thing associated to LJS
109
+ thing = staplus.Thing('Raspberry Pi', 'Raspberry Pi 4', )
110
+ thing.party = ljs
111
+
112
+ # Create a sensor
113
+ sensor = staplus.Sensor('air temperature sensor', 'SmartCitizen air temperature sensor', 'test/html', None,
114
+ 'https://www.seeedstudio.com/Smart-Citizen-Starter-Kit-p-2865.html')
115
+
116
+ # Create a datastream associated to LJS with CC-BY license
117
+ datastream = staplus.Datastream('air temperature', 'air temperature measured with the SmartCitizen Kit',
118
+ 'http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement',
119
+ staplus.UnitOfMeasurement('Celsius', 'C', 'https://qudt.org/vocab/unit/DEG_C'))
120
+ datastream.observed_property = staplus.ObservedProperty('temperature', 'http://vocabs.lter-europe.net/EnvThes/22035',
121
+ 'air temperature')
122
+ datastream.party = ljs
123
+ datastream.thing = thing
124
+ datastream.sensor = sensor
125
+ datastream.license = cc_by
126
+
127
+ service.create(datastream)
128
+ ```
129
+
130
+ #### Creating a few Observation entities
131
+ ```python
132
+ import staplus_client as staplus
133
+
134
+ url = "<your domain>/staplus/v1.1"
135
+ auth_handler.AuthHandler(...)
136
+ service = staplus.STAplusService(url, auth_handler=auth)
137
+ ljs = staplus.Party(description='I am Long John Silver the opportunistic pirate created by Robert Louis Stevenson',
138
+ display_name='LJS',
139
+ role='individual')
140
+ service.create(ljs)
141
+
142
+ # The feature of interest
143
+ marienplatz = {
144
+ "type": "Feature",
145
+ "geometry": {
146
+ "type": "Point",
147
+ "coordinates": [11.571831046,48.135666124]
148
+ }
149
+ }
150
+ foi = staplus.FeatureOfInterest('Marienplatz', 'famous place in Munich', 'application/vnd.geo+json', marienplatz)
151
+
152
+ # The temperature
153
+ observation = staplus.Observation("2023-07-02T15:34:00Z", 20, "2023-07-02T15:34:00Z")
154
+ observation.feature_of_interest = foi
155
+ observation.datastream = service.datastreams().find(<the datastream id created previously>)
156
+
157
+ service.create(observation)
158
+
159
+ observation = staplus.Observation("2023-07-02T15:34:10Z", 21, "2023-07-02T15:34:10Z")
160
+ observation.feature_of_interest = foi
161
+ observation.datastream = service.datastreams().find(<the datastream id created previously>)
162
+
163
+ service.create(observation)
164
+ ```
165
+
166
+ #### Creating an ObservationGroup Entity
167
+ A `ObservationGroup` entity can be used as a container of observations that belong together.
168
+
169
+ ```python
170
+ import staplus_client as staplus
171
+
172
+ url = "<your domain>/staplus/v1.1"
173
+ service = staPlus.STAplusService(url, auth_handler=auth)
174
+ ljs = staPlus.Party(description='I am Long John Silver the opportunistic pirate created by Robert Louis Stevenson',
175
+ display_name='LJS',
176
+ role='individual')
177
+ service.create(ljs)
178
+ group = staPlus.ObservationGroup("Marienplatz", "observations on Marienplatz", "none", "")
179
+ group.creation_time = parse_datetime("2023-07-02T15:35:00Z")
180
+ # Add all the observations that are associated to the FoI named 'Marienplatz'
181
+ group.observations = service.observations().query().filter("FeatureOfInterest/name eq 'Marienplatz'").list()
182
+ group.license = service.licenses().find('CC_BY')
183
+ group.party = ljs
184
+
185
+ service.create(group)
186
+ ```
187
+
188
+ #### Creating SensorThings Entities
189
+ How to use this implementation on SensorThings Entity Types, please see the [FROST-Python-Client](https://github.com/securedimensions/STAplus-Python-Client) documentation.
190
+
191
+ ### Fetching Entities via the STAplus Client
192
+ This implementation supports the fetching of `EntityList` and `Entity`.
193
+
194
+ #### Fetching an EntityList
195
+ An `EntityList` is the result from fetching entities that have a multiplicity `0..*` or `1..*`. To fetch the list of entities, you need to use the `.list()` function. The following example fetches all datastreams:
196
+
197
+ ```python
198
+ import staplus_client as staplus
199
+
200
+ url = "<your domain>/staplus/v1.1"
201
+ service = staplus.STAplusService(url)
202
+ datastreams = service.datastreams().query().list()
203
+ ```
204
+
205
+ In order to get all entities of a given entity, you can use the function `get_<entity_plural>()`. For example, to fetch all datastreams of a given `Thing` please use the following code:
206
+
207
+ ```python
208
+ import staplus_client as staplus
209
+
210
+ url = "<your domain>/staplus/v1.1"
211
+ service = staplus.STAplusService(url)
212
+ thing = service.things().find(1)
213
+ thing_datastreams = thing.get_datastreams().query().list()
214
+ ```
215
+
216
+ #### Fetching an Entity
217
+ An `Entity` is the result from fetching an entity that has multiplicity `0..1` or `1`. To fetch one single entity you need to use the `.item()` function. The following example fetches the thing associated to a datastream:
218
+
219
+ ```python
220
+ import staplus_client as staplus
221
+
222
+ url = "<your domain>/staplus/v1.1"
223
+ service = staplus.STAplusService(url)
224
+ datastream = service.datastreams().find(1).item()
225
+ datastream_thing = datastream.get_thing().query().item()
226
+ ```
227
+
228
+ ### Cloning an Entity
229
+ When creating an Entity, mandatory entities can be provided either inline or by reference. To support the referencing of existing entities, the `clone()` function can be used. `clone()` returns a copy of the entity but only containing the `@iot.id`. This is important when preparing MQTT messages to publish observations.
230
+
231
+ #### Example ObservationGroup with inline entities
232
+ ```JSON
233
+ {
234
+ "Observations": [
235
+ {
236
+ "Datastream": {
237
+ "@iot.id": 1,
238
+ "description": "desc",
239
+ "name": "new name",
240
+ "observationType": "OM_Observation",
241
+ "observedArea": {
242
+ "coordinates": [11.509234, 48.110728],
243
+ "type": "Point"
244
+ },
245
+ "phenomenonTime": "2023-07-24T06:30:18+00:00/2023-09-14T05:40:25.292000+00:00",
246
+ "resultTime": "2023-07-24T06:30:18+00:00/2023-07-24T06:31:42+00:00",
247
+ "unitOfMeasurement": { "definition": "...", "name": "n", "symbol": "n" }
248
+ },
249
+ "FeatureOfInterest": {
250
+ "@iot.id": 77,
251
+ "description": "A rainy place",
252
+ "encodingType": "application/geo+json",
253
+ "feature": { "coordinates": [-6.22299, 53.306816], "type": "Point" },
254
+ "name": "Dublin",
255
+ "properties": {
256
+ "datastreams": [1, 2, 76, 2, 78, 77],
257
+ "multi_datastreams": [11]
258
+ }
259
+ },
260
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
261
+ "result": 19.111,
262
+ "resultTime": "2024-05-02T19:36:06+00:00"
263
+ },
264
+ {
265
+ "Datastream": {
266
+ "@iot.id": 2,
267
+ "description": "air relative humidity measured with the SmartCitizen Kit",
268
+ "name": "Relative Humidity",
269
+ "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
270
+ "observedArea": {
271
+ "coordinates": [11.509234, 48.110728],
272
+ "type": "Point"
273
+ },
274
+ "phenomenonTime": "2023-07-24T06:30:18+00:00/2023-07-24T06:31:42+00:00",
275
+ "resultTime": "2023-07-24T06:30:18+00:00/2023-07-24T06:31:42+00:00",
276
+ "unitOfMeasurement": {
277
+ "definition": "https://qudt.org/vocab/unit/PERCENT",
278
+ "name": "Percentage",
279
+ "symbol": "%"
280
+ }
281
+ },
282
+ "FeatureOfInterest": {
283
+ "@iot.id": 77,
284
+ "description": "A rainy place",
285
+ "encodingType": "application/geo+json",
286
+ "feature": { "coordinates": [-6.22299, 53.306816], "type": "Point" },
287
+ "name": "Dublin",
288
+ "properties": {
289
+ "datastreams": [1, 2, 76, 2, 78, 77],
290
+ "multi_datastreams": [11]
291
+ }
292
+ },
293
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
294
+ "result": 43.0,
295
+ "resultTime": "2024-05-02T19:36:06+00:00"
296
+ },
297
+ {
298
+ "Datastream": {
299
+ "@iot.id": 76,
300
+ "description": "Precipitation measured with the FT-0310 Weather Station",
301
+ "name": "Rain",
302
+ "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
303
+ "unitOfMeasurement": {
304
+ "definition": "https://qudt.org/vocab/unit/MilliM",
305
+ "name": "millimiter",
306
+ "symbol": "mm"
307
+ }
308
+ },
309
+ "FeatureOfInterest": {
310
+ "@iot.id": 77,
311
+ "description": "A rainy place",
312
+ "encodingType": "application/geo+json",
313
+ "feature": { "coordinates": [-6.22299, 53.306816], "type": "Point" },
314
+ "name": "Dublin",
315
+ "properties": {
316
+ "datastreams": [1, 2, 76, 2, 78, 77],
317
+ "multi_datastreams": [11]
318
+ }
319
+ },
320
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
321
+ "result": 87.0,
322
+ "resultTime": "2024-05-02T19:36:06+00:00"
323
+ },
324
+ {
325
+ "Datastream": {
326
+ "@iot.id": 77,
327
+ "description": "Wind direction measured with the FT-0310 Weather Station",
328
+ "name": "Wind direction",
329
+ "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
330
+ "unitOfMeasurement": {
331
+ "definition": "https://qudt.org/vocab/unit/DEG",
332
+ "name": "degree",
333
+ "symbol": "deg"
334
+ }
335
+ },
336
+ "FeatureOfInterest": {
337
+ "@iot.id": 77,
338
+ "description": "A rainy place",
339
+ "encodingType": "application/geo+json",
340
+ "feature": { "coordinates": [-6.22299, 53.306816], "type": "Point" },
341
+ "name": "Dublin",
342
+ "properties": {
343
+ "datastreams": [1, 2, 76, 2, 78, 77],
344
+ "multi_datastreams": [11]
345
+ }
346
+ },
347
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
348
+ "result": 241.0,
349
+ "resultTime": "2024-05-02T19:36:06+00:00"
350
+ },
351
+ {
352
+ "FeatureOfInterest": {
353
+ "@iot.id": 77,
354
+ "description": "A rainy place",
355
+ "encodingType": "application/geo+json",
356
+ "feature": { "coordinates": [-6.22299, 53.306816], "type": "Point" },
357
+ "name": "Dublin",
358
+ "properties": {
359
+ "datastreams": [1, 2, 76, 2, 78, 77],
360
+ "multi_datastreams": [11]
361
+ }
362
+ },
363
+ "MultiDatastream": {
364
+ "@iot.id": 11,
365
+ "ObservedProperties": [
366
+ {
367
+ "@iot.id": 105,
368
+ "definition": "http://vocab.nerc.ac.uk/standard_name/wind_speed/",
369
+ "description": "Wind speed",
370
+ "name": "wspeed"
371
+ },
372
+ {
373
+ "@iot.id": 106,
374
+ "definition": "http://vocab.nerc.ac.uk/standard_name/wind_gust_from_direction/",
375
+ "description": "Wind gust",
376
+ "name": "wgust"
377
+ }
378
+ ],
379
+ "description": "Wind speed average and gust measured with the FT-0310 Weather Station",
380
+ "multiObservationDataTypes": [
381
+ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
382
+ "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"
383
+ ],
384
+ "name": "Wind speed avg and gust",
385
+ "observationType": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_ComplexObservation",
386
+ "unitOfMeasurements": [
387
+ {
388
+ "definition": "https://qudt.org/vocab/unit/M-PER-SEC",
389
+ "name": "Meters per second",
390
+ "symbol": "m/s"
391
+ },
392
+ {
393
+ "definition": "https://qudt.org/vocab/unit/M-PER-SEC",
394
+ "name": "Meters per second",
395
+ "symbol": "m/s"
396
+ }
397
+ ]
398
+ },
399
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
400
+ "result": [0.0, 0.0],
401
+ "resultTime": "2024-05-02T19:36:06+00:00"
402
+ }
403
+ ],
404
+ "Party": {
405
+ "@iot.id": "36fd7ca4-08bb-11ef-b156-a337e8ef4d15",
406
+ "displayName": "LJS",
407
+ "role": "individual"
408
+ },
409
+ "creationTime": "2024-05-02T19:36:06+00:00",
410
+ "description": " ",
411
+ "endTime": "2024-05-02T19:36:06+00:00",
412
+ "name": "OG 2024-05-02T19:36:06+00:00"
413
+ }
414
+ ```
415
+
416
+ This example with inline `Datastream` and `FeatureOfInterest` entities has the size of 6245 Bytes.
417
+
418
+ #### Example ObservationGroup with referencing entities
419
+ ```JSON
420
+ {
421
+ "Observations": [
422
+ {
423
+ "Datastream": { "@iot.id": 1 },
424
+ "FeatureOfInterest": { "@iot.id": 77 },
425
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
426
+ "result": 19.111,
427
+ "resultTime": "2024-05-03T09:48:33+00:00"
428
+ },
429
+ {
430
+ "Datastream": { "@iot.id": 2 },
431
+ "FeatureOfInterest": { "@iot.id": 77 },
432
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
433
+ "result": 43.0,
434
+ "resultTime": "2024-05-03T09:48:33+00:00"
435
+ },
436
+ {
437
+ "Datastream": { "@iot.id": 76 },
438
+ "FeatureOfInterest": { "@iot.id": 77 },
439
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
440
+ "result": 87.0,
441
+ "resultTime": "2024-05-03T09:48:33+00:00"
442
+ },
443
+ {
444
+ "Datastream": { "@iot.id": 77 },
445
+ "FeatureOfInterest": { "@iot.id": 77 },
446
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
447
+ "result": 241.0,
448
+ "resultTime": "2024-05-03T09:48:33+00:00"
449
+ },
450
+ {
451
+ "FeatureOfInterest": { "@iot.id": 77 },
452
+ "MultiDatastream": { "@iot.id": 11 },
453
+ "phenomenonTime": "2024-04-13T19:57:08+00:00",
454
+ "result": [0.0, 0.0],
455
+ "resultTime": "2024-05-03T09:48:33+00:00"
456
+ }
457
+ ],
458
+ "Party": {
459
+ "@iot.id": "4cd42a10-0932-11ef-919f-57f24e9b90e3",
460
+ "displayName": "LJS",
461
+ "role": "individual"
462
+ },
463
+ "creationTime": "2024-05-03T09:48:33+00:00",
464
+ "description": " ",
465
+ "endTime": "2024-05-03T09:48:33+00:00",
466
+ "name": "OG 2024-05-03T09:48:33+00:00"
467
+ }
468
+ ```
469
+
470
+ This example with referenced `Datastream` and `FeatureOfInterest` entities has the size of 1420 Bytes.