POST radiation monitoring data into SensorThings
This tutorial was based on an old version of SensorThings API service (2014-09). The data model and encoding (request/response) are not compliant to the existing version (v.1.0).
This is a step-by-step tutorial regarding creating a THING instance and related entities with SensorThings API.
Note: This is based on a SensorThings API implementation in 2014-09. (URL: http://tania.geocens.ca:8080/SensorThings_V1.2/)
Step-by-step guide
Step 1: CREATE a Thing entity instance.
Header: Content Type: application/json
{ "Description": "This is a monitoring station for background radiation." }
Step 2: If no existing ObservedProperty, CREATE a ObservedProperty entity instance.
{ "Name": "Background Radiation", "Description": "Background radiation is the ubiquitous ionizing radiation that people on the planet Earth are exposed to, including natural and artificial sources. Both natural and artificial background radiation varies depending on location and altitude.", "Definition": "http://dbpedia.org/page/Category:Background_radiation" }
Step 3: If no existing Sensor, CREATE a new Sensor.
{ "EncodingType": "http://example.com/encoding-types#description", "Metadata": "This is a radiation monitoring station." }
Step 4: CREATE a new Datastream by linking to the newly created (or existing) Sensor and ObservedProperty
{ "UnitOfMeasurement": { "Name": "milliSievert per hour", "Symbol": "mSv/h", "Definition": "http://en.wikipedia.org/wiki/Sievert" }, "Thing": { "ID": 34 }, "Description": "This is a datastream for measuring the background radiation.", "Sensor": { "ID": 117 }, "ObservedProperty": { "ID": 20 }, "ObservationType": "http://www.opengis.net/def/observationType/OGCOM/2.0/OM_Measurement" }
Step 5: If there is no existing FeatureOfInterest, CREATE a new FeatureOfInterest.
{ "Description": "This is the location where the background radiation observation was performed.", "Geometry": { "Type": "Point", "Coordinates": [ 140.391471, 37.4044746 ] } }
Step 6: CREATE new Observations
{ "Result": "0.049", "FeatureOfInterest": { "ID": 12 }, "ResultTime": "2015-07-02T07:31:45+0900", "PhenomenonTime": "2015-07-02T07:31:45+0900", "Datastream": { "ID": 118 } }
Step 7: Query for Observations based on $filter