datakaveri/dx-resource-server

Query regarding Attribute search API of Resource Server

Closed this issue · 6 comments

Hi Team,

I am exploring Resource APIs.

Below is the CURL command copied from above link for attribute search API-
curl --location --request GET 'https://example.com/ngsi-ld/v1/entities?id=**iisc.ac.in/89a36273d77dac4cf38114fca1bbe64392547f86/example.com/pune-env-flood**/FWR055&q=referenceLevel>15.0'
--header 'token: '

My Queries -
Is value passed for id is the resource id?
Can we pass resource groupd id here?
If we are passing ID of resource then what will be benefit of passing other attributes? is it expecting multiple record for same Resoruce Id?

In My Case - Suppose i have mapped data of Mosquito device data with Resourc ID . Then i think one record per resource id will be generated. In that case attribute search will not be applicable. correct me if i am wrong here.

Please suggest me puspose of different search apis provided by Resource server.

Thanks
Deepak Kumar

Hi Team,

Any suggestion for same?

My Queries -
Is value passed for id is the resource id?
Can we pass resource groupd id here?
If we are passing ID of resource then what will be benefit of passing other attributes? is it expecting multiple record for same Resoruce Id?

  1. Yes, the resource id is passed.
  2. No, you can't pass resource group id.
  3. Benefit of passing other attributes is filtering records based on (Spatial, temporal, and attribute).
    yes every query endpoint except the latest query endpoint will return multiple records satisfying the provided attributes while querying

Refer to IUDX APIs to know more about APIs, attributes/parameters passed, and request and response format

Hi @kailash ,

Thanks for your valuable support.

My Further queries are-
My Understanding -
A sensor should be mapped with one ResourceId in IUDX and The Latest Query Endpoint should respond with the latest reeading/output of the sensor. And in general a sensor generates single record at a time. (Please Correct me if i am wrong here.)
My Queries -
So is it fine if Proxy Resource Server respond with single record in response of Latest Query API?
Please suggest an example where multiple record are possible as response of Latest Query API?

Thanks
Deepak Kumar

Hi @kailash/Team,

Any suggestion for same?

The latest API can respond with a single JSON Object or with a JSON Array, this basically depends on how Items are onboarded in the Catalogue server and how they are being ingested.

For resource Item like this with id like datakaveri.org/04a15c9960ffda227e9546f3f46e629e1fe4132b/rs.iudx.org.in/pune-env-flood/FWR035 API will return a single JSON Object.

But for Resource Items like this with id like suratmunicipal.org/6db486cb4f720e8585ba1f45a931c63c25dbbbda/rs.iudx.org.in/surat-itms-realtime-info/surat-itms-live-eta API will return a Json Array.

For your use case of a sensor value, a single JSON object will work fine.

@kailash Thanks for your valuable reply.