Skip to content

Filtering over nested properties #169

@Alystrasz

Description

@Alystrasz

Hello,
I'm trying to filter a thing's locations, expanding its historical locations (since Things(42)/Locations only returns the current location); the objective is to match locations present in a given area.

Here's the request :

v1.0/Things(42)/HistoricalLocations
    ?$expand=Locations
    &$filter=st_within(location, geography'POLYGON ((-4 -11, 4 -11, 4 11, -4 11, -4 -11))')

Unfortunately, it returns { "value": null }.
This is what my Location entities look like:

{
   "@iot.id": 708,
   "@iot.selfLink": "[...]/v1.0/Locations(708)",
   "name": "42",
   "description": "Location of Station 71",
   "encodingType": "application/vnd.geo+json",
   "location": {
      "coordinates": [ 3.128898, 10.095246 ],
      "properties": {
         "height": "5",
         "receptionTime": "1745420000"
      },
      "type": "Point"
   },
   "Things@iot.navigationLink": "[...]/v1.0/Locations(708)/Things",
   "HistoricalLocations@iot.navigationLink": "[...]/v1.0/Locations(708)/HistoricalLocations"
}
  1. How can I geo-filter locations starting from HistoricalLocations?
  2. Is there a way to filter locations based on any of the "properties" (e.g. receptionTime)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions