Search code examples
fiwarefiware-orion

FIWARE Orion-LD upsert replace endpoint: only attributes or completely (including type)?


I have a question regarding the ngsi-ld/v1/entityOperations/upsert?options=replace endpoint.

The NGSI-LD specification (Nov 2021) states under 5.6.8.3: "All the existing Entity content shall be replaced" and under 5.6.8.4: "If there were an existing Entity with the same Entity Id, it shall be completely replaced by the new Entity content provided, if the requested update mode is 'replace'."

We were trying to replace entities using a new type (no attributes given) with the fiware/orion-ld:1.0.0 broker. This does not work ("non-matching entity type"), as the implementation seems targeted at replacing the attributes only.

Does someone have the final words of wisdom on the definition of this endpoint?

Thank you!


Solution

  • According to the Latest 1.8.1 ETSI Specification:

    4.16 Supporting Multiple Entity Types

    There is no operation to remove Entity Types from an Entity. The philosophy here is to assume that an Entity always had all Entity Types, but possibly not all Entity Types have previously been known in the system. The only option to remove an Entity Type is to delete the Entity and re-create it with the same id. Alternatively, a batch with replace update mode can be used, as described in clause 5.6.8

    The 1.8.1 specification was only released last week, but it appears that the implied scope of the replace batch update mode to modify Entity type has been clarified and agrees with your usage. The existing Orion-LD "non-matching entity type" error is probably based on ambiguous wording from a previous specification.

    Context Broker implementation conformance lags the specifications, so the best thing to do would be to raise an issue on Orion to track when it will conform to that clause.