We use proprietary and third party´s cookies to improve your experience and our services, identifying your Internet Browsing preferences on our website; develop analytic activities and display advertising based on your preferences. If you keep browsing, you accept its use. You can get more information on our Cookie Policy
Cookies Policy
Ask Your Question

Is STH-Comet service compatible with the NGSI-LD data format?

asked 2020-10-06 15:17:13 +0200

atzavaras gravatar image

I'm using Orion-LD and of course MongoDB in my work. Can I use STH-Comet to retrieve NGSI-LD data from MongoDB? And how can I do that?

Is it able to POST a subscription to Orion-LD so that STH-Comet will be notified of new values of a specific attribute?

What's more, I just discovered that there is a new service called Cygnus-LD, compatible with NGSI-LD data, but I see (in the documentation example) that it is used in order to persist the NGSI-LD notifications in the PostgreSQL. Is it possible to persist them in MongoDB instead?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2020-12-04 09:50:53 +0200

Jason Fox gravatar image

As of December 2020, STH-Comet does not service the NGSI-LD interface and is NGSI-v2 only. However Orion-LD has recently been updated with a new backwards compatibility feature that allows it to send subscriptions in NGSI-v2 format.

An NGSI-LD subscription looks like this:

curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \ -H 'Content-Type: application/json' \ -H 'Link: <https://fiware.github.io/tutorials.Step-by-Step/tutorials-context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"' \ --data-raw '{ "description": "LD Notify me of low stock in Store 002", "type": "Subscription", "entities": [{"type": "Shelf"}], "watchedAttributes": ["numberOfItems"], "q": "numberOfItems<10;locatedIn==urn:ngsi-ld:Building:store002", "notification": { "attributes": ["numberOfItems", "stocks", "locatedIn"], "format": "normalized", "endpoint": { "uri": "http://tutorial:3000/subscription/low-stock-store002", "accept": "application/ld+json" } } }'

The format parameter is usually keyValues or normalized. The accept parameter is usually application/json or application/ld+json. Setting these to NGSIv2-Normalized and application/json should allow STH-Comet to receive subscriptions from Orion-LD.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2020-10-06 15:17:13 +0200

Seen: 556 times

Last updated: Dec 04 '20