Skip to content

feat(querying): support mixed AND/OR filters, !attribute (not-exists), and forward id on polymorphic endpoints - #166

Closed
Mortega5 wants to merge 2 commits into
mainfrom
feat/extend-ngsi-query
Closed

feat(querying): support mixed AND/OR filters, !attribute (not-exists), and forward id on polymorphic endpoints#166
Mortega5 wants to merge 2 commits into
mainfrom
feat/extend-ngsi-query

Conversation

@Mortega5

@Mortega5 Mortega5 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator
  • Combine AND (&) and OR (;) in the same filter query, e.g. status=Active,Started&color=Red (previously rejected outright when a query mixed both operators).

  • Filter on non-existent attributes with !attribute (NGSI-LD syntax), e.g. !status or !relatedParty.datasetId, including combined with AND/OR (!status&color=Red). !id and !type remain rejected since they always exist.

  • Use fields together with OR in subscriptions, e.g. event.product.name=Some;fields=event.product.id (previously blocked with no real functional justification).

  • Filter by id on polymorphic list endpoints, e.g. GET /resource?id=urn:f-1,urn:f-2 (previously the id parameter was silently ignored when listing polymorphic types).

Mortega5 and others added 2 commits July 31, 2026 14:52
…ts) filters

The TMForum standard never actually prohibits combining AND(&) and OR(;) in
a single filter query, and NGSI-LD's own q= already defines AND-before-OR
precedence for an un-parenthesized term chain - so this connector's blanket
rejection was defensive code working around a translation bug, not a spec
requirement. Removes it from QueryParser, SubscriptionQueryParser, and
SubscriptionQueryResolver (which independently duplicated the same guard at
event-match time), replacing the single-LogicalOperator-per-query design with
one that preserves each parameter's original connector.

Also adds support for NGSI-LD's bare `!attribute` (not-exists) syntax,
mirrored directly with no TMForum-side translation layer, including through
relationship sub-paths and reserved-word-escaped fallback attributes. !id and
!type are rejected, since id/type always exist.

SubscriptionQueryParser's "OR cannot combine with fields" rule is dropped
entirely (fields only affects payload projection, orthogonal to match logic,
and had no standards or functional basis). Its other two rules are kept but
narrowed to specific token adjacency instead of "this operator appears
anywhere in the query".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Mortega5
Mortega5 requested a review from wistefan August 4, 2026 08:04
@Mortega5 Mortega5 added the minor Bigger fixes, added functionality, NO breaking changes label Aug 4, 2026
@github-actions

github-actions Bot commented Aug 4, 2026

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

@Mortega5 Mortega5 closed this Aug 4, 2026
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.

1 participant