52North / sensorweb-server-helgoland

Thin Web binding API to access series data.
GNU General Public License v2.0
24 stars 21 forks source link

Support for generic attribute query parameters #628

Open dirk-ecker opened 2 years ago

dirk-ecker commented 2 years ago

It would be nice if all entities would support generic query parameters corresponding with their result attributes or at least for selected attributes.

Here in example for the features entity

http:///helgoland-adapters-webapp/api/features?properties.domainId=Wupper-Talsperre_Ablauf,Wupper-Talsperre_Absperrbauwerk

gives me

{
        id: '7',
        properties: {
          label: 'Wupper-Talsperre, Ablauf',
          href: 'http://agro060.icg.kfa-juelich.de:1113/helgoland-adapters-webapp/api/features/7',
          domainId: 'Wupper-Talsperre_Ablauf'
        },
        type: 'Feature',
        geometry: { type: 'Point', coordinates: [Array], crs: [Object] }
      },
      {
        id: '71',
        properties: {
          label: 'Wupper-Talsperre, Absperrbauwerk',
          href: 'http://agro060.icg.kfa-juelich.de:1113/helgoland-adapters-webapp/api/features/71',
          domainId: 'Wupper-Talsperre_Absperrbauwerk'
        },

or am I missing something and this is already possible?

Another good alternative would be https://graphql.org, that supports a rich query language.

Thanks in advance for your response.

CarstenHollmann commented 2 years ago

You can already query the feature by their domainID using the features and matchDomainIds parameters. Here is an example request:

http:///helgoland-adapters-webapp/api/features?features=Wupper-Talsperre_Ablauf,Wupper-Talsperre_Absperrbauwerk&matchDomainIds=true

CarstenHollmann commented 2 years ago

This is supported in the Helgoland-API version 2.x and 3.x.

dirk-ecker commented 2 years ago

Okay, we use 3.5 so this should work. How is this done in the source? I can find isMatchDomainIds, but only the declaration of the method, not the use. Seems to be generic magic or ...?

dirk-ecker commented 2 years ago

My colleague found out that this does not work because the parameter is converted to lowercase. So it searches for wupper-talsperre_ablauf,wupper-talsperre_absperrbauwerk instead of Wupper-Talsperre_Ablauf,Wupper-Talsperre_Absperrbauwerk.

Ist this intended or a bug?

CarstenHollmann commented 2 years ago

This is intended but it seems that there is an issue in the used sensorweb-server-dao-impl version. I have tested the current version and with this the filtering on the domainIds works.

CarstenHollmann commented 2 years ago

There is a new Sensor Web Server Helgoland Adapters version available where the filtering on domainIds works.

dirk-ecker commented 2 years ago

@CarstenHollmann Thank you.