Skip to content

feat(json-ld-reserved-query-filters): Allow filtering by JSON-LD reserved fields#155

Merged
vramperez merged 1 commit into
mainfrom
feat/json-ld-reserved-query-filters
May 20, 2026
Merged

feat(json-ld-reserved-query-filters): Allow filtering by JSON-LD reserved fields#155
vramperez merged 1 commit into
mainfrom
feat/json-ld-reserved-query-filters

Conversation

@vramperez
Copy link
Copy Markdown
Collaborator

No description provided.

@vramperez vramperez requested review from Mortega5 and wistefan May 18, 2026 10:18
@vramperez vramperez added the minor Bigger fixes, added functionality, NO breaking changes label May 18, 2026
@github-actions
Copy link
Copy Markdown

The following api specs are unavailable, please check if there are updates required.

Module Url
account https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF666_Account_Management_API_v4.0.0_swagger.json
agreement https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF651_Agreement_Management_API_v4.0.0_swagger.json
customer-bill-management https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF678_Customer_Bill_Management_API_v4.0.0_swagger.json
customer-management https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF629_Customer_Management_API_v4.0.0_swagger.json
party-catalog https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF632_Party_Management_API_v4.0.0_swagger.json
party-role https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF669_Party_Role_Management_API_v4.0.0_swagger.json
product-catalog https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.1.0/swagger/TMF620_Product_Catalog_Management_API_v4.1.0_swagger.json
product-inventory https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF637_Product_Inventory_Management_API_v4.0.0_swagger.json
product-ordering-management https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF622_Product_Ordering_Management_API_v4.0.0_swagger.json
resource-catalog https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.1.0/swagger/TMF634_Resource_Catalog_Management_API_v4.1.0_swagger.json
resource-function-activation https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF664_Resource_Function_Activation_Management_API_v4.0.0_swagger.json
resource-inventory https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF639_Resource_Inventory_Management_API_v4.0.0_swagger.json
service-catalog https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF633_Service_Catalog_Management_API_v4.0.0_swagger.json
usage-management https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF635_Usage_Management_API_v4.0.0_swagger.json

@vramperez vramperez marked this pull request as draft May 18, 2026 11:02
@vramperez vramperez marked this pull request as ready for review May 18, 2026 14:19
* as a direct {@code ?id=...} query.
*/
private static final Map<String, String> JSON_LD_RESERVED_TO_ENTITY_FIELD = Map.of(
"@id", "id",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was value and context removed from the list?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:
- @idid (routed to NGSI-LD's native id= URL param via the existing line-130 shortcut)
- @typeatType (Entity line 47-50)
- @baseTypeatBaseType (Entity line 28-32)
- @schemaLocationatSchemaLocation (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

@vramperez vramperez merged commit 16b0cdb into main May 20, 2026
76 of 139 checks passed
@vramperez vramperez deleted the feat/json-ld-reserved-query-filters branch May 20, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Bigger fixes, added functionality, NO breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants