Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format names for "cross-notifications" LD-V2 #623

Closed
kzangeli opened this issue Dec 9, 2020 · 2 comments
Closed

format names for "cross-notifications" LD-V2 #623

kzangeli opened this issue Dec 9, 2020 · 2 comments

Comments

@kzangeli
Copy link
Collaborator

kzangeli commented Dec 9, 2020

x-ngsiv2-normalized
x-ngsiv2-normalized-compacted
x-nsgiv2-keyValues
x-nsgiv2-keyValues-compacted

@jason-fox
Copy link
Member

jason-fox commented Dec 10, 2020

x-ngsiv2-normalized
x-ngsiv2-normalized-compacted
x-ngsiv2-keyValues 
x-ngsiv2-keyValues-compacted

Where x-ngsiv2 is a suitable alias for x-ngsiv2-normalized-compacted

x-ngsiv2-normalized

Uses URNs for types, attribute names. Receiver can apply an @context compaction themselves.

{
 "subscriptionId": "urn:ngsi-ld:Subscription:5fd1f31e8b9b83697b855a5d",
 "data": [
  {
   "id": "urn:ngsi-ld:Device:filling001",
   "type": "https://uri.etsi.org/ngsi-ld/default-context/FillingSensor",
   "https://w3id.org/saref#fillingLevel": {
    "type": "Property",
    "value": 0.33,
    "metadata": {
     "unitCode": "C62",
     "accuracy": {
      "type": "Property",
      "value": 0.05
     },
     "observedAt": "2020-12-10T10:11:57.000Z"
    }
   },
   "https://uri.etsi.org/ngsi-ld/default-context/controllingAsset": {
    "type": "Relationship",
    "value": "urn:ngsi-ld:Building:farm001",
    "metadata": {
     "observedAt": "2020-12-10T10:11:57.000Z"
    }
   }
  }
 ]
}

x-ngsiv2-normalized-compacted

Uses shortnames for types, attribute names. Context broker pre-applies compaction operation. Receiver gets simple JSON payload

{
 "subscriptionId": "urn:ngsi-ld:Subscription:5fd1f31e8b9b83697b855a5d",
 "data": [
  {
   "id": "urn:ngsi-ld:Device:filling001",
   "type": "FillingSensor",
   "fillingLevel": {
    "type": "Property",
    "value": 0.33,
    "metadata": {
     "unitCode": "C62",
     "accuracy": {
      "type": "Property",
      "value": 0.05
     },
     "observedAt": "2020-12-10T10:11:57.000Z"
    }
   },
   "https://uri.etsi.org/ngsi-ld/default-context/controllingAsset": {
    "type": "Relationship",
    "value": "urn:ngsi-ld:Building:farm001",
    "metadata": {
     "observedAt": "2020-12-10T10:11:57.000Z"
    }
   }
  }
 ]
}

@kzangeli
Copy link
Collaborator Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants