Skip to content

Commit

Permalink
feature: support ngsi-ld context broker telefonicaid#82
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal committed Dec 19, 2020
1 parent 5b8ae3d commit 6272c4d
Show file tree
Hide file tree
Showing 15 changed files with 297 additions and 329 deletions.
8 changes: 7 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ config.iota = {
/**
* Port where the Context Broker is listening.
*/
port: '1026'
port: '1026',

/**
* Version of NGSI
*/
ngsiVersion: 'ld',
jsonLdContext: 'https://schema.lab.fiware.org/ld/context.jsonld'
},

/**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"command-node": "0.1.1",
"request": "2.88.0",
"async": "1.5.2",
"iotagent-node-lib": "git://github.com/telefonicaid/iotagent-node-lib.git#master",
"iotagent-node-lib": "git://github.com/telefonicaid/iotagent-node-lib.git#feature/842_ngsi_ld",
"express": "4.16.4",
"body-parser": "1.18.3",
"logops": "2.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"service" : "dumbMordor",
"service_path": "/deserts",
"entity_name": "TheLastLight",
"entity_type": "SIGFOX",
"entity_type": "Device",
"timezone": "America/Santiago",
"attributes": [],
"lazy": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"service" : "dumbMordor",
"service_path": "/deserts",
"entity_name": "sigApp3",
"entity_type": "SIGFOX",
"entity_type": "Device",
"timezone": "America/Santiago",
"attributes": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"device_id": "sigApp2",
"protocol": "SIGFOX",
"entity_name": "sigApp2",
"entity_type": "SIGFOX",
"entity_type": "Device",
"timezone": "America/Santiago",
"attributes": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,34 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp3",
"attributes": [
{
"name": "time",
"type": "String",
"value": "1430909015"
},
{
"name": "statin",
"type": "String",
"value": "0A5F"
},
{
"name": "lng",
"type": "String",
"value": "-4"
},
{
"name": "lat",
"type": "String",
"value": "41"
},
{
"name": "campo1",
"type": "Integer",
"value": "valor1"
},
{
"name": "campo2",
"type": "Integer",
"value": 64
}
]
}
],
"updateAction": "UPDATE"
}
[
{
"@context": "https://schema.lab.fiware.org/ld/context.jsonld",
"time": {
"type": "Property",
"value": "1430909015"
},
"statin": {
"type": "Property",
"value": "0A5F"
},
"lng": {
"type": "Property",
"value": "-4"
},
"lat": {
"type": "Property",
"value": "41"
},
"campo1": {
"type": "Property",
"value": {
"@type": "Intangible",
"@value": null
}
},
"campo2": {
"type": "Property",
"value": 64
},
"id": "urn:ngsi-ld:Device:sigApp3",
"type": "Device"
}
]
100 changes: 43 additions & 57 deletions test/examples/deviceProvisioning/expectedDataUpdateRequest.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,43 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp2",
"attributes": [
{
"name": "time",
"type": "String",
"value": "1430909015"
},
{
"name": "statin",
"type": "String",
"value": "0A5F"
},
{
"name": "lng",
"type": "String",
"value": "-4"
},
{
"name": "lat",
"type": "String",
"value": "41"
},
{
"name": "theCounter",
"type": "Integer",
"value": 2
},
{
"name": "theParam1",
"type": "Integer",
"value": 0
},
{
"name": "param2",
"type": "Integer",
"value": 0
},
{
"name": "tempDegreesCelsius",
"type": "Integer",
"value": 35
},
{
"name": "voltage",
"type": "Integer",
"value": 3183
}
]
}
],
"updateAction": "UPDATE"
}
[
{
"@context": "https://schema.lab.fiware.org/ld/context.jsonld",
"time": {
"type": "Property",
"value": "1430909015"
},
"statin": {
"type": "Property",
"value": "0A5F"
},
"lng": {
"type": "Property",
"value": "-4"
},
"lat": {
"type": "Property",
"value": "41"
},
"theCounter": {
"type": "Property",
"value": 2
},
"theParam1": {
"type": "Property",
"value": 0
},
"param2": {
"type": "Property",
"value": 0
},
"tempDegreesCelsius": {
"type": "Property",
"value": 35
},
"voltage": {
"type": "Property",
"value": 3183
},
"id": "urn:ngsi-ld:Device:sigApp2",
"type": "Device"
}
]
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
{
"contextElements": [
{
"type": "SIGFOX",
"isPattern": "false",
"id": "sigApp3",
"attributes": [
{
"name": "time",
"type": "String",
"value": " "
},
{
"name": "statin",
"type": "String",
"value": " "
},
{
"name": "lng",
"type": "String",
"value": " "
},
{
"name": "lat",
"type": "String",
"value": " "
},
{
"name": "campo1",
"type": "Integer",
"value": " "
},
{
"name": "campo2",
"type": "Integer",
"value": " "
}
]
[
{
"@context": "https://schema.lab.fiware.org/ld/context.jsonld",
"id": "urn:ngsi-ld:Device:sigApp3",
"type": "Device",
"time": {
"type": "Property",
"value": " "
},
"statin": {
"type": "Property",
"value": " "
},
"lng": {
"type": "Property",
"value": " "
},
"lat": {
"type": "Property",
"value": " "
},
"campo1": {
"type": "Property",
"value": {
"@type": "Intangible",
"@value": null
}
},
"campo2": {
"type": "Property",
"value": {
"@type": "Intangible",
"@value": null
}
}
],
"updateAction": "APPEND"
}
}
]
Loading

0 comments on commit 6272c4d

Please sign in to comment.