Skip to main content

One post tagged with "Queries"

The NGSI-LD query language, geo-queries, scopes, ordering and paging, as Andromeda implements them.

View All Tags

One filter, one meaning

· 23 min read
Matej Škvarč
Andromeda Maintainer

Take a Vehicle whose speed is 80. Before v1.1.0, if you subscribed to Vehicles with q=speed.value==80, Andromeda notified you about it. If you sent Query Entities the same q, it told you no Vehicle matched. Some of the four other brokers I tried give the same two answers.

Query Entities was right. Clause 4.9 of NGSI-LD v1.9.1 (ETSI GS CIM 009) says every name after the first in an attribute path "represents a (sub)Property or (sub)Relationship". A Property's value is neither, so speed.value asks for a sub-Property called value, and the Vehicle doesn't have one. The q that tests the value is plain speed==80.

The bug came from Andromeda evaluating each filter in three places, with separate code in each deciding what a term means. v1.1.0 replaces that code with one description of what the filter means, which all three places use.