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.