Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fiware-ServicePath semantics #757

Closed
pkel-kn opened this issue May 24, 2024 · 3 comments
Closed

Fiware-ServicePath semantics #757

pkel-kn opened this issue May 24, 2024 · 3 comments
Assignees

Comments

@pkel-kn
Copy link

pkel-kn commented May 24, 2024

I have a couple of entities in Fiware-ServicePath: /xyz. The requests

GET /v2/entities

and

GET /v2/entities
Fiware-ServicePath: /#

do not return any entities. The request

GET /v2/entities
Fiware-ServicePath: /xyz

does.

I expect the former two requests to include the entities of the latter request as it is the case with Orion.

The QuantumLeap OpenAPI spec says the service path semantics are like in Orion, so I consider this a bug of QuantumLeap.

My QuantumLeap version is 0.8.2.

@c0c0n3
Copy link
Member

c0c0n3 commented Jun 4, 2024

@pkel-kn thank you for taking the time to report this, much appreciated.

First off, and slightly off topic, keep in mind that, for better or for worse, Quantum Leap doesn't behave exactly the same as Orion. Truth be told, I don't think there's ever been a proper (formal) NGSI service path spec with unambiguous semantics---not in Quantum Leap, not in Orion or any other FIWARE docs I'm aware of. (LD partially fixes this though). So the spec is the implementation and like I said Quantum Leap has a slightly different interpretation of "service path" than Orion does. I don't think there's any easy way to change this in Quantum Leap without breaking or rewriting quite a bit of stuff.

Re: your specific case, to the /v2/entities endpoint

  1. /# has no special meaning. It's just a literal service path just like /xyz. If you happen to have an entity under a service path of /#, Quantum Leap should return it. I don't think this feature is actually any useful so you should most likely ignore it and never use /# as a literal service path.
  2. Any service path string matches all the entities whose service path begins with that string. (https://github.com/orchestracities/ngsi-timeseries-api/blob/master/src/translators/sql_translator.py#L817)

(2) should work for CrateDB, but I'm not sure what happens with a Timescale backend. Which one are you using? If CrateDB is your backend, then adding a service path of / should return all the entity ids. Also it could be a bug in 0.8.2. Unfortunately we have no manpower to support old releases, so you should try upgrading to the latest Quantum Leap version if you can.

@pkel-kn
Copy link
Author

pkel-kn commented Jun 4, 2024

Thank you for looking into this!

Part of my confusion comes from QuantumLeap's documentation, current version. It says that QL service path corresponds to Orion service path by linking to Orion's documentation. I think future users will appreciate if you update this documentation to include what you describe above.

I'm using the Postgres Backend.

I see that the release notes for QuantumLeap 1 mentions some work on service paths. Unfortunately I cannot easily upgrade QuantumLeap. My conclusion is to stay away from ServicePath, at least for now.

@c0c0n3
Copy link
Member

c0c0n3 commented Jun 4, 2024

Thank you for looking into this!

Well, thank you for bringing this up!

my confusion comes from QuantumLeap's documentation

I've just looked at it, the documentation is misleading, to say the least, sorry about that :-)

I think future users will appreciate if you update this documentation

Agree, I've opened #758 about it

My conclusion is to stay away from ServicePath

Given your current setup, that's probably the most sensible thing to do for now

@c0c0n3 c0c0n3 closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants