Comments (7)
What subscription did you use to get these Observations? The Datastream should not be expanded in the Observation, when getting it over MQTT. That would be a bug.
As to 3, the spec states:
Response:When a new entity is added to the entity set (e.g., a new Observation created) or an existing entity of the entity set is updated, the service returns a complete JSON representation of the newly created or updated entity.
So the question would then be what exactly "a complete JSON representation" is. We've interpreted it as everything, including self and navigation links, since you can always turn those off using the $select parameter.
from frost-server.
I think it a BUG. I used 'paho.mqtt.client' to receive Observations. The received payload in msg is:
{
"phenomenonTime" : "2016-03-01T22:50:00.000Z",
"resultTime" : "2016-03-01T22:50:00.000Z",
"result" : "1.8",
"[email protected]" : "http://localhost:8080/FROST-Server/v1.0/Observations('191129a0-604e-11e8-b7bf-a3be7c3b0fe3')/Datastream",
"Datastream" : {
"unitOfMeasurement" : {
"name" : null,
"symbol" : null,
"definition" : null
},
"@iot.id" : "t1edu.teco.wang/IBADENWR82/Datastreams/Air-Temperature-IBADENWR82"
},
"[email protected]" : "http://localhost:8080/FROST-Server/v1.0/Observations('191129a0-604e-11e8-b7bf-a3be7c3b0fe3')/FeatureOfInterest",
"FeatureOfInterest" : {
"@iot.id" : "t1edu.teco.wang/IBADENWR82/FoI/IBADENWR82/48.441/9.257"
},
"@iot.id" : "191129a0-604e-11e8-b7bf-a3be7c3b0fe3",
"@iot.selfLink" : "http://localhost:8080/FROST-Server/v1.0/Observations('191129a0-604e-11e8-b7bf-a3be7c3b0fe3')"
}
For sure I can get everything through REST. My point is that if it's worth it to put these links in the MQTT message instead of just expanding entities. When a user tries to get Observations
over MQTT, his expectation is likely to be self-contained JSON messages with all interesting information, so that it can be processed right away. Otherwise he may have to query the information about FeatureOfInterst
over REST or maintain a small cache locally to store these information. I think its the point of messaging over MQTT.
from frost-server.
I agree it would be useful to be able to get the expanded datastream and feature of interest, but that would be a change to the standard, so that discussion should go on the Github page of the standard: https://github.com/opengeospatial/sensorthings
Can you also give us the JSON of Observation you use in those create requests? did they contain a datastream and FoI entity?
Did you create the Observation using HTTP, or using MQTT?
Did you create them using v1.0/Datastream(x)/Observations
, or using v1.0/Observations
?
from frost-server.
I created the Observation via HTTP. Its DataStream and FoI are created separately. The @iot.id of the DataStream is specified in the URL and the @iot.id of the FoI is packed in JSON.
{"phenomenonTime": "2016-03-01T22:50:00.000Z", "FeatureOfInterest": {"@iot.id": "t1edu.teco.wang/IBADENWR82/FoI/IBADENWR82/48.441/9.257"}, "resultTime": "2016-03-01T22:50:00.000Z", "result": "1.8"}
from frost-server.
It should be fixed in the latest master.
I did notice you've encoded the result value as a string in your Observation json, even though it looks like it is a number. Is that intentional? If you put it as a number in the json, then the server is able to treat it as a number when ordering and filtering.
from frost-server.
Thank you for the quick fixing. You are right, now i convert the result to float before sending the Observation to the Frost-Server.
The Observation looks like:
{
"phenomenonTime" : "2015-12-31T22:16:00.000Z",
"resultTime" : "2015-12-31T22:16:00.000Z",
"result" : 1.2,
"[email protected]" : "http://localhost:8080/FROST-Server/v1.0/Observations('cbaff990-6280-11e8-b689-070f60f264ee')/Datastream",
"[email protected]" : "http://localhost:8080/FROST-Server/v1.0/Observations('cbaff990-6280-11e8-b689-070f60f264ee')/FeatureOfInterest",
"@iot.id" : "cbaff990-6280-11e8-b689-070f60f264ee",
"@iot.selfLink" : "http://localhost:8080/FROST-Server/v1.0/Observations('cbaff990-6280-11e8-b689-070f60f264ee')"
}
Now the question would be: how can i get FoI, if i want to fetch Observations via MQTT?
By querying the navigationLink additionally? Then cache it locally?
Or it there any smarter way?
from frost-server.
Yes, currently there is no way to automatically get the FoI using MQTT, you'll have to fetch the FoI separately. If the Sensor is not moving, you can cache it and in that case it's not much of an issue. You don't want to repeatedly get the same data any way, so you'd just fetch the FoI when initialising.
If the sensor is moving it's more of an issue, since you'd have to separately query the server for each Observation you receive. I guess that's an oversight when defining the standard. I'll open an issue about it on the SensorThings Github page.
from frost-server.
Related Issues (20)
- Database auto-update for Basic Authentication does not work under some conditions HOT 3
- Helm chart bug: Mqtt not using external db connection string when frost.db.enableIntegratedDb is set to false HOT 4
- Server Error 500 when trying to patch a thing HOT 2
- Redirect URI not using `serviceRootUrl` HOT 3
- persistence_idGenerationMode_<ENTITY> is not applied HOT 5
- The phenomenonTime field on a MultiDatastream is updated based on the resultTimes, not the expected phenomenonTimes. HOT 1
- [Issue]SensorThings API with Tomcat 10 HOT 3
- GEOM column in Locations is sometimes created as NULL causing issues on the REST-API
- InternalMessageBus errors on fraunhoferiosb/frost-server-http HOT 5
- [Docker Image] Failed to initialize PostgreSQL DB HOT 10
- [Question]Can STA check duplicate data? HOT 1
- Disapperaing properties with empty string as value HOT 2
- Change Datastream/observationType to enum and check its values
- FROST Server very slow on large requests HOT 5
- Database is not using PhenomenonTime-Index HOT 5
- Issue With Authentication with FROST Server HOT 1
- Inconsistency in current Location of a Thing when Historical Locations are deleted or updated HOT 1
- Issue querying FROST-Server with umlauts in name HOT 4
- Query performance issues on Observations with plugins_coreModel_idType LONG HOT 3
- Using batch createObservations failed HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frost-server.