Repository navigation
Filter by ID: a list of ids is not enough to make a query (steps 13 and 14) - #3
Merged
Merged
Conversation
Both "Filter Data Entities by ID" (13) and "Returning data as GeoJSON" (14)
query /entities with `id` as the only selector. Clause 10.4.3.4 of the NGSI-LD
API requires at least ONE of:
a. a type selector
b. a list of attribute names
c. an NGSI-LD Query
d. an NGSI-LD GeoQuery
e. local scope
and raises BadRequestData ("too wide query") if none is present. The clause
says it in prose as well: "it is not possible to retrieve a set of entities by
only specifying desired Entity identifiers, without further specifying
restrictions on the entities' types or attributes".
`pick` is not a selector - it chooses which members of an entity are returned,
not which entities are - so neither request currently satisfies the rule.
`local=true` is used here rather than `attrs`, for two reasons: it keeps the
page's own point that `type` is not required when filtering by id, and `attrs`
cannot be combined with `pick` (they are alternative projection mechanisms).
Both amended requests were run against a broker and return exactly the
responses the page documents.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Sep 19, 2026
Merged
Clarified the explanation about NGSI-LD query requirements and removed redundant information.
jason-fox
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Two requests query
/entitieswithidas their only selector:id=...&pick=id,type,temperature&format=conciseid=...&format=conciseClause 10.4.3.4 of the NGSI-LD API says a query shall carry at least one of
and raises
BadRequestData— too wide query — if none is present. The clause says it in prose too: "it is not possible to retrieve a set of entities by only specifying desired Entity identifiers, without further specifying restrictions on the entities' types or attributes".pickis not on that list, and is not a selector: it chooses which members of an entity are returned, not which entities are.The fix
Adds
local=trueto both, which is clause (e). Two reasons to prefer it overattrsortype:idmust be unique, sotypeis not required for this request";attrscannot be combined withpick; they are alternative projection mechanisms and a broker rejects the pair.A short paragraph explains the rule so the next person editing these requests knows why the parameter is there.
Verified against a running broker: both amended requests return exactly the responses the page documents, including the GeoJSON
FeatureCollectionfor step 14.The same defect in
tutorials.CRUD-Operationsstep 13 is fixed in a separate PR. Independent of #2 — different lines, no conflict.🤖 Generated with Claude Code