ngsi-timeseries-api icon indicating copy to clipboard operation
ngsi-timeseries-api copied to clipboard

Test integration with Orion-LD

Open c0c0n3 opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe

Ken from FiWare implemented an backward compat patch for Orion-LD that will let NGSI-v2 clients subscribe for NGSI-LD entity changes and get notified of any changes through an NGSI-v2 payload. In principle, this patch should make QL usable with Orion-LD right now, without having to wait for a full blown NGSI-LD implementation. FiWare TSC are eager to know if this is the case :-)

Describe the solution you'd like

Get in touch with Ken to see if there's a Docker image we could use for the integration test, plonk that image into the reporter test suite and see what happens. Then report back to FiWare TSC.

Describe alternatives you've considered

N/A

Additional context

Nov 2020's FiWare TSC minutes.

c0c0n3 avatar Nov 16 '20 12:11 c0c0n3

As mentioned, Orion-LD implements "cross-notifications" in NGSIv2 format for NGSI-LD subscriptions. Check out this doc for a full explanation of the NGSI-LD API, subscriptions being a part of that spec.

This is how a simple subscription can look in NGSI-LD:

POST /ngsi-ld/v1/subscriptions
{
  "id": "urn:ngsi-ld:subscriptions:S1",
  "type": "Subscription",
  "name": "Subscription for T",
  "description": "Description of Test subscription T",
  "entities": [
    {
      "idPattern": ".*",
      "type": "T"         # Note that typePattern is not supported in NGSI-LD ...
    }
  ],
  "notification": {
    "format": "NGSIv2-Normalized",
    "endpoint": {
      "uri": "http://valid.url/url",
      "accept": "application/json"
    }
  },
  "expires": "2028-12-31T10:00:00",
  "throttling": 5
}

As you can see, the notification::format field is set to "NGSIv2-Normalized" (not part of the NGSI-LD spec as it's still just experimental) which is how to get Orion-LD to notify in NGSIv2 format.

Orion-LD listens on the port 1026, just like Orion.

You'll find documentation on NGSI-LD and Orion-LD on the Orion-LD github. If you need help to get familiar with NGSI-LD (it's more complex than NGSIv2), just let me know and we can have a session or two.

docker: https://hub.docker.com/r/fiware/orion-ld

kzangeli avatar Nov 16 '20 15:11 kzangeli

@kzangeli awesome, thanks for this, that's exactly the kind of info we needed. I reckon we should be able to give it a shot. We'll let you know how it goes...

c0c0n3 avatar Nov 17 '20 08:11 c0c0n3

@kzangeli we included a simple integration experiment: https://github.com/smartsdk/ngsi-timeseries-api/tree/master/experiments/ngsi-ld

of course it's dumb simple, but no issue :)

chicco785 avatar Dec 11 '20 21:12 chicco785

No issue, that's good! :) Anytime you have an issue, I'll be happy to work with you to resolve whatever problem occurs.

Now, I need to warn you, in case you are working on latest of Orion-LD ... The "format of the format" :) has changed (yesterday):

The value that used to be NGSIv2-Normalized has been replaced by 4 different values (plus one alias ' x-ngsiv2'):

  • x-ngsiv2-normalized NGSIv2-style notification with long-names (real attribute names)
  • x-ngsiv2-normalized-compacted NGSIv2-style notification with short-names (using the @context of the subscription)
  • x-nsgiv2-keyValues Not implemented but ... NGSIv2-style, keyValues with long-names
  • x-nsgiv2-keyValues-compacted Not implemented but ... NGSIv2-style, keyValues with short-names (using @context ...)
  • x-ngsiv2 (alias for x-ngsiv2-normalized-compacted)

See https://github.com/FIWARE/context.Orion-LD/issues/623 for details.

IoT Agents "want" the NGSI-LD broker to compact the attribute names (according to the context they supplied for the subscription), so I implemented that option - .

I'd be careful with short-names if I were a TRoE (Temporal Representation of Entities) - i.e. Cygnus/QL/Draco/etc. Better to use the long name as the long name is the real name of the attribute/entity-type-value.

But, you need to know that the format value has been changed So, sorry ... this is all really experimental still - I don't foresee any additional name changes.

kzangeli avatar Dec 12 '20 15:12 kzangeli

Stale issue message

github-actions[bot] avatar Mar 10 '21 02:03 github-actions[bot]