feat(json-ld-reserved-query-filters): Allow filtering by JSON-LD reserved fields#155
Conversation
| * as a direct {@code ?id=...} query. | ||
| */ | ||
| private static final Map<String, String> JSON_LD_RESERVED_TO_ENTITY_FIELD = Map.of( | ||
| "@id", "id", |
There was a problem hiding this comment.
Why was value and context removed from the list?
There was a problem hiding this comment.
The RESERVED_WORDS list at line 38 was dead code — declared private static final but not referenced anywhere in this file (the actual escape logic lives in ReservedWordHandler in the wistefan lib, with its own internal list). I dropped it entirely and introduced JSON_LD_RESERVED_TO_ENTITY_FIELD as a smaller, focused map with a different purpose: translate JSON-LD-style query parameter names into the corresponding NGSI-LD attribute name where the data is persisted on Entity.
Limited to the 4 tokens that have a corresponding queryable field:
- @id → id (routed to NGSI-LD's native id= URL param via the existing line-130 shortcut)
- @type → atType (Entity line 47-50)
- @baseType → atBaseType (Entity line 28-32)
- @schemaLocation → atSchemaLocation (Entity line 37-41)
@value and @context were left out because there's no corresponding queryable attribute on Entity @value is a structural JSON-LD value-object construct (only meaningful inside {"@value": x, "@language": "en"} payloads) and @context is the JSON-LD context URL. Neither is a user-facing
filterable field
No description provided.