FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
49 stars 40 forks source link

Strange behavior with q and numbers #1258

Open kiskit opened 1 year ago

kiskit commented 1 year ago

Hello there,

and entity created with the field xy set to -1.03 is not returned by this query: /entities?type=Temperature&q=xy==-1.03 If the entity is created with field set to a negative integer, this request works: /entities?type=Temperature&q=xy==-103

Funny story, we pulled version 1.15.0-next and from what the debugger shows, it always goes into the QNodeIntegerValue case for negative numbers (line 184 of qLex.cpp).

Additionally, it seems impossible to specify numbers as in RFC 8259 (e.g. 103E-2).

kzangeli commented 1 year ago

ok, interesting!

Might be I have never tested a negative floating point number ... I'll get right on this. Pretty important bug!

Thanks for reporting!!!

kzangeli commented 1 year ago

Hopefully fixed it. Stupid bug, thanks for finding it !!! Please try again tomorrow morning (or once a new image has been pushed to dockerhub)

kiskit commented 1 year ago

Hi Ken,

Excellent reactivity and good job, we'll test it eventually. Did you also see the fact that the standard allows for numbers to be expressed with exponentials (I don't know if this is the right term), like 1.03E4 (for 1.03 times 10 to the power of 4)? I don't think Orion can do that or at least couldn't make it work.

kzangeli commented 1 year ago

Yes, about that you're perfectly right. Haven't implemented that, perhaps I should. I'll add it to my ever-growing To-Do-list ... :)

kiskit commented 1 year ago

Maybe I can help. Stay tuned :)

kzangeli commented 1 year ago

ok! :)