Closed yclausen closed 2 years ago
Hi @yclausen! Thanks for your suggestion!
the API is still very limited in its scope
Yep. QuantumLeap, just like the various FIWARE context broker implementations, takes a "templating" approach to queries where clients can fill in params for a small set of template queries to get data out of the service. In general, this isn't a very flexible approach, b/c the number of queries those templates can produce is a very small subset of all the possible queries you can think of. At the other end of the spectrum, you could provide clients w/ a query languages they can use to write any possible query---e.g. graph ql, sql, etc. This is a more comp-sci sort of approach to the problem, but maybe less practical to implement correctly in Python. (A language like Haskell would be ideal.)
Our thinking is that the template approach could work reasonably well if your templates can handle most of the queries clients would want to use. Surely, a good question is what's that set of most used queries?
The extension of queries based on IdPatterns identically to what can be implemented in ContextBroker would be a positive improvement.
I agree with you. But as you brought it up, I'd like to ask the community a question. How do you get data out of Quantum Leap? Do you use the query API, query the DB directly or both? This would help us narrow that set of most useful queries I mentioned earlier. If we realise the set is too broad, then maybe we should consider the query language approach instead...
Thank you very much for the quick and detailed reply. From our side I can say that we are mainly focused on using the API of Quantumleap.
@yclausen thank you so much for the answer!
@c0c0n3 so we need to make changes using python?
@NEC-Vishal good question. I'm more inclined to keep the current templating approach and just add one more feature to the existing template to cater for ID patterns. It could be done w/ a regex, using an approach similar to what we have for the fiware service path at the moment:
@NEC-Vishal, @chicco785 do you agree?
@NEC-Vishal good question. I'm more inclined to keep the current templating approach and just add one more feature to the existing template to cater for ID patterns. It could be done w/ a regex, using an approach similar to what we have for the fiware service path at the moment:
@NEC-Vishal, @chicco785 do you agree?
agree!
Hi @chicco785 @c0c0n3 yes agree! I have gone through this issue and https://github.com/orchestracities/ngsi-timeseries-api/blob/master/src/translators/sql_translator.py#L822 , I have concluded below points:
I will start working as per my understanding and will raise PR for the same. Please correct me if I misunderstood or missed any point.
Hi @NEC-Vishal,
I think you're on the right track, that's great, thank you so much for this. We'll also need to update the spec with the new parameter
The server reads the spec on startup and makes the parameters available to the Python code accordingly. So without updating the spec, the client won't be able to pass in the id pattern when making the HTTP call. Or more accurately, the client could add it to the URL, but the server would ignore it.
Hi @chicco785 @c0c0n3 I have raise a PR (pr648) regarding this issue, Please check the workflow.
Thanks
Hi @NEC-Vishal! Thanks alot! I commented on #648
hi @yclausen, @NEC-Vishal implemented the feature you requested and we've just merged #653 which contains the implementation. If you could please give it a try---use the orchestracities/quantumleap:edge
image. Any feedback most welcome!
oh and again kudos to @NEC-Vishal !
When using Quantumleap API for use cases in the company, we noticed that the API is still very limited in its scope for certain queries. The extension of queries based on IdPatterns identically to what can be implemented in ContextBroker would be a positive improvement.