iotagent-node-lib 2.26.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/.github/workflows/ci.yml +1 -0
  2. package/CHANGES_NEXT_RELEASE +2 -0
  3. package/docker-compose-dev.yml +1 -1
  4. package/lib/fiware-iotagent-lib.js +0 -5
  5. package/lib/plugins/compressTimestamp.js +2 -7
  6. package/lib/plugins/expressionParser.js +0 -47
  7. package/lib/plugins/expressionPlugin.js +6 -78
  8. package/lib/plugins/jexlParser.js +0 -36
  9. package/lib/plugins/pluginUtils.js +0 -119
  10. package/lib/services/ngsi/entities-NGSI-LD.js +586 -199
  11. package/lib/services/ngsi/entities-NGSI-v2.js +607 -297
  12. package/lib/services/ngsi/ngsiUtils.js +15 -22
  13. package/package.json +2 -2
  14. package/test/unit/general/config-multi-core-test.js +2 -1
  15. package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +2 -1
  16. package/test/unit/general/deviceService-test.js +2 -1
  17. package/test/unit/general/loglevel-api_test.js +2 -3
  18. package/test/unit/general/startup-test.js +2 -1
  19. package/test/unit/general/statistics-persistence_test.js +1 -0
  20. package/test/unit/general/statistics-service_test.js +1 -0
  21. package/test/unit/lazyAndCommands/commandRegistry_test.js +1 -0
  22. package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +1 -0
  23. package/test/unit/mongodb/mongodb-connectionoptions-test.js +1 -0
  24. package/test/unit/mongodb/mongodb-group-registry-test.js +1 -0
  25. package/test/unit/mongodb/mongodb-registry-test.js +2 -1
  26. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAliasPlugin1.json +0 -5
  27. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast10.json +1 -1
  28. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast8.json +1 -1
  29. package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast9.json +1 -1
  30. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +16 -15
  31. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4.json +8 -8
  32. package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4a.json +34 -34
  33. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin5.json +8 -8
  34. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin6.json +0 -20
  35. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin7.json +0 -5
  36. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin8.json +10 -10
  37. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +8 -7
  38. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +5 -4
  39. package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin3.json +1 -1
  40. package/test/unit/ngsi-ld/examples/contextRequests/updateContextProcessTimestamp.json +4 -4
  41. package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverride.json +4 -3
  42. package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +4 -3
  43. package/test/unit/ngsi-ld/expressions/expressionBasedTransformations-test.js +4 -6
  44. package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -7
  45. package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +2 -1
  46. package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
  47. package/test/unit/ngsi-ld/general/deviceService-test.js +2 -1
  48. package/test/unit/ngsi-ld/general/https-support-test.js +2 -1
  49. package/test/unit/ngsi-ld/general/iotam-autoregistration-test.js +2 -1
  50. package/test/unit/ngsi-ld/general/startup-test.js +3 -2
  51. package/test/unit/ngsi-ld/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
  52. package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +5 -7
  53. package/test/unit/ngsi-ld/lazyAndCommands/lazy-devices-test.js +8 -6
  54. package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +18 -22
  55. package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +2 -1
  56. package/test/unit/ngsi-ld/ngsiService/active-devices-test.js +2 -1
  57. package/test/unit/ngsi-ld/ngsiService/autocast-test.js +17 -4
  58. package/test/unit/ngsi-ld/ngsiService/geoproperties-test.js +2 -1
  59. package/test/unit/ngsi-ld/ngsiService/languageProperties-test.js +32 -34
  60. package/test/unit/ngsi-ld/ngsiService/staticAttributes-test.js +2 -1
  61. package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +2 -1
  62. package/test/unit/ngsi-ld/ngsiService/unsupported-endpoints-test.js +11 -15
  63. package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +2 -3
  64. package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +2 -1
  65. package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +2 -32
  66. package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +20 -19
  67. package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +21 -7
  68. package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +1 -0
  69. package/test/unit/ngsi-ld/provisioning/device-registration_test.js +2 -1
  70. package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +15 -12
  71. package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +1 -0
  72. package/test/unit/ngsi-ld/provisioning/provisionDeviceMultientity-test.js +1 -0
  73. package/test/unit/ngsi-ld/provisioning/removeProvisionedDevice-test.js +1 -0
  74. package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +1 -0
  75. package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +1 -0
  76. package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +13 -7
  77. package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin1.json +2 -2
  78. package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +6 -0
  79. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +5 -1
  80. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin5.json +4 -4
  81. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin6.json +0 -16
  82. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin7.json +0 -4
  83. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin8.json +8 -8
  84. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +42 -42
  85. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +7 -7
  86. package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin4.json +0 -5
  87. package/test/unit/ngsiv2/examples/contextRequests/updateContextProcessTimestamp.json +6 -6
  88. package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverride.json +7 -1
  89. package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +7 -1
  90. package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +2 -4
  91. package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +4 -8
  92. package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +5 -9
  93. package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
  94. package/test/unit/ngsiv2/general/deviceService-test.js +2 -1
  95. package/test/unit/ngsiv2/general/https-support-test.js +2 -1
  96. package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +2 -1
  97. package/test/unit/ngsiv2/general/startup-test.js +2 -1
  98. package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
  99. package/test/unit/ngsiv2/lazyAndCommands/command-test.js +2 -1
  100. package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +8 -6
  101. package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +2 -1
  102. package/test/unit/ngsiv2/ngsiService/active-devices-test.js +3 -2
  103. package/test/unit/ngsiv2/ngsiService/autocast-test.js +2 -1
  104. package/test/unit/ngsiv2/ngsiService/queryDeviceInformationInCb-test.js +2 -1
  105. package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +2 -1
  106. package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +2 -1
  107. package/test/unit/ngsiv2/plugins/alias-plugin_test.js +2 -3
  108. package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +2 -5
  109. package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +2 -33
  110. package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +7 -16
  111. package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +3 -2
  112. package/test/unit/ngsiv2/provisioning/device-group-api-test.js +1 -0
  113. package/test/unit/ngsiv2/provisioning/device-group-utils-test.js +1 -0
  114. package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +1 -0
  115. package/test/unit/ngsiv2/provisioning/device-registration_test.js +2 -1
  116. package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +15 -12
  117. package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +1 -0
  118. package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -0
  119. package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +1 -0
  120. package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +1 -0
  121. package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +1 -0
  122. package/test/unit/plugins/capture-configuration-inPlugins_test.js +2 -1
  123. package/test/unit/plugins/capture-provision-inPlugins_test.js +2 -1
  124. package/lib/plugins/addEvent.js +0 -32
  125. package/lib/plugins/attributeAlias.js +0 -107
  126. package/lib/plugins/multiEntity.js +0 -255
  127. package/lib/plugins/timestampProcessPlugin.js +0 -95
  128. package/test/unit/ngsi-ld/plugins/event-plugin_test.js +0 -116
  129. package/test/unit/ngsiv2/plugins/event-plugin_test.js +0 -118
  130. package/test/unit/ngsiv2/plugins/translation-inPlugins_test.js +0 -262
@@ -90,10 +90,10 @@ function isFloat(value) {
90
90
  }
91
91
 
92
92
  /**
93
- * It casts attribute values which are reported using JSON native types
93
+ * It casts attribute values which are reported using JSON parsing
94
94
  *
95
95
  * @param {String} payload The payload
96
- * @return {String} New payload where attributes's values are casted to the corresponding JSON types
96
+ * @return {String} New payload where attributes's values are casted to the corresponding JSON values
97
97
  */
98
98
  function castJsonNativeAttributes(payload) {
99
99
  if (!config.getConfig().autocast) {
@@ -105,28 +105,13 @@ function castJsonNativeAttributes(payload) {
105
105
  /* eslint-disable-next-line no-prototype-builtins */
106
106
  payload.hasOwnProperty(key) &&
107
107
  payload[key].value &&
108
- payload[key].type &&
109
108
  typeof payload[key].value === 'string'
110
109
  ) {
111
- if (payload[key].type === 'Number' && isFloat(payload[key].value)) {
112
- payload[key].value = Number.parseFloat(payload[key].value);
113
- } else if (payload[key].type === 'Number' && Number.parseInt(payload[key].value)) {
114
- payload[key].value = Number.parseInt(payload[key].value);
115
- } else if (payload[key].type === 'Boolean') {
116
- payload[key].value = payload[key].value === 'true' || payload[key].value === '1';
117
- } else if (payload[key].type === 'None') {
118
- payload[key].value = null;
119
- } else if (payload[key].type === 'Array' || payload[key].type === 'Object') {
120
- try {
121
- const parsedValue = JSON.parse(payload[key].value);
122
- payload[key].value = parsedValue;
123
- } catch (e) {
124
- logger.error(
125
- context,
126
- 'Bad attribute value type. Expecting JSON Array or JSON Object. Received:%s',
127
- payload[key].value
128
- );
129
- }
110
+ try {
111
+ const parsedValue = JSON.parse(payload[key].value);
112
+ payload[key].value = parsedValue;
113
+ } catch (e) {
114
+ // Keep value as is
130
115
  }
131
116
  }
132
117
  }
@@ -223,6 +208,14 @@ function getMetaData(typeInformation, name, metadata) {
223
208
  }
224
209
  }
225
210
  }
211
+ if (typeInformation.lazy) {
212
+ for (i = 0; i < typeInformation.lazy.length; i++) {
213
+ /* jshint camelcase: false */
214
+ if (name === typeInformation.lazy[i].object_id) {
215
+ return typeInformation.lazy[i].metadata;
216
+ }
217
+ }
218
+ }
226
219
  if (typeInformation.staticAttributes) {
227
220
  for (i = 0; i < typeInformation.staticAttributes.length; i++) {
228
221
  if (name === typeInformation.staticAttributes[i].name) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "iotagent-node-lib",
3
3
  "license": "AGPL-3.0-only",
4
4
  "description": "IoT Agent library to interface with NGSI Context Broker",
5
- "version": "2.26.0",
5
+ "version": "3.1.0",
6
6
  "homepage": "https://github.com/telefonicaid/iotagent-node-lib",
7
7
  "keywords": [
8
8
  "fiware",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "main": "lib/fiware-iotagent-lib",
25
25
  "engines": {
26
- "node": ">=14"
26
+ "node": ">=16"
27
27
  },
28
28
  "scripts": {
29
29
  "clean": "rm -rf package-lock.json && rm -rf node_modules && rm -rf coverage",
@@ -32,7 +32,8 @@ const iotAgentConfig = {
32
32
  port: '1026'
33
33
  },
34
34
  server: {
35
- port: 4041
35
+ port: 4041,
36
+ host: 'localhost'
36
37
  },
37
38
  types: {
38
39
  Light: {
@@ -37,7 +37,8 @@ const iotAgentConfig = {
37
37
  port: '1026'
38
38
  },
39
39
  server: {
40
- port: 4041
40
+ port: 4041,
41
+ host: 'localhost'
41
42
  },
42
43
  authentication: {
43
44
  // Next line is syntactically correct from a configuration point of
@@ -36,7 +36,8 @@ const iotAgentConfig = {
36
36
  port: '1026'
37
37
  },
38
38
  server: {
39
- port: 4041
39
+ port: 4041,
40
+ host: 'localhost'
40
41
  },
41
42
  types: {
42
43
  Light: {
@@ -34,7 +34,8 @@ const iotAgentConfig = {
34
34
  port: '1026'
35
35
  },
36
36
  server: {
37
- port: 4041
37
+ port: 4041,
38
+ host: 'localhost'
38
39
  },
39
40
  types: {
40
41
  Light: {
@@ -73,8 +74,6 @@ describe('Log level API', function () {
73
74
 
74
75
  iotAgentLib.activate(iotAgentConfig, function () {
75
76
  iotAgentLib.clearAll(function () {
76
- iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
77
- iotAgentLib.addQueryMiddleware(iotAgentLib.dataPlugins.attributeAlias.query);
78
77
  done();
79
78
  });
80
79
  });
@@ -38,7 +38,8 @@ const iotAgentConfig = {
38
38
  port: '1026'
39
39
  },
40
40
  server: {
41
- port: 4041
41
+ port: 4041,
42
+ host: 'localhost'
42
43
  },
43
44
  types: {
44
45
  Light: {
@@ -37,6 +37,7 @@ const iotAgentConfig = {
37
37
  },
38
38
  server: {
39
39
  port: 4041,
40
+ host: 'localhost',
40
41
  baseRoot: '/'
41
42
  },
42
43
  stats: {
@@ -32,6 +32,7 @@ const iotAgentConfig = {
32
32
  },
33
33
  server: {
34
34
  port: 4041,
35
+ host: 'localhost',
35
36
  baseRoot: '/'
36
37
  },
37
38
  stats: {
@@ -35,6 +35,7 @@ const iotAgentConfig = {
35
35
  server: {
36
36
  name: 'testAgent',
37
37
  port: 4041,
38
+ host: 'localhost',
38
39
  baseRoot: '/'
39
40
  },
40
41
  types: {},
@@ -38,6 +38,7 @@ const iotAgentConfig = {
38
38
  server: {
39
39
  name: 'testAgent',
40
40
  port: 4041,
41
+ host: 'localhost',
41
42
  baseRoot: '/'
42
43
  },
43
44
  types: {},
@@ -38,6 +38,7 @@ const iotAgentConfig = {
38
38
  },
39
39
  server: {
40
40
  port: 4041,
41
+ host: 'localhost',
41
42
  baseRoot: '/'
42
43
  },
43
44
  stats: {
@@ -40,6 +40,7 @@ const iotAgentConfig = {
40
40
  server: {
41
41
  name: 'testAgent',
42
42
  port: 4041,
43
+ host: 'localhost',
43
44
  baseRoot: '/'
44
45
  },
45
46
  types: {},
@@ -38,7 +38,8 @@ const iotAgentConfig = {
38
38
  port: '1026'
39
39
  },
40
40
  server: {
41
- port: 4041
41
+ port: 4041,
42
+ host: 'localhost'
42
43
  },
43
44
  types: {
44
45
  Light: {
@@ -2,11 +2,6 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
- "pressure": {
6
- "type": "Property",
7
- "unitCode": "Hgmm",
8
- "value": 20071103
9
- },
10
5
  "temperature": {
11
6
  "type": "Property",
12
7
  "unitCode": "CEL",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "date": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "Date",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "time": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "Time",
@@ -1,7 +1,7 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "configuration": {
4
+ "dateTime": {
5
5
  "type": "Property",
6
6
  "value": {
7
7
  "@type": "DateTime",
@@ -1,17 +1,18 @@
1
1
  [
2
- {
3
- "@context": "http://context.json-ld",
4
- "location": {
5
- "type": "GeoProperty",
6
- "value": {
7
- "coordinates": [
8
- 13,
9
- 52
10
- ],
11
- "type": "Point"
12
- }
13
- },
14
- "id": "urn:ngsi-ld:GPS:gps1",
15
- "type": "GPS"
16
- }
2
+ {
3
+ "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:GPS:gps1",
5
+ "type": "GPS",
6
+ "location": {
7
+ "type": "GeoProperty",
8
+ "value": {
9
+ "coordinates": [
10
+ 13,
11
+ 52
12
+ ],
13
+ "type": "Point"
14
+ },
15
+ "observedAt": "1970-01-01T00:00:00.001Z"
16
+ }
17
+ }
17
18
  ]
@@ -1,24 +1,24 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
- "humidity12": {
4
+ "id": "urn:ngsi-ld:WeatherStation:ws1",
5
+ "type": "WeatherStation",
6
+ "weather": {
5
7
  "type": "Property",
6
8
  "value": {
7
- "@type": "Percentage",
8
- "@value": "12"
9
+ "@type": "Summary",
10
+ "@value": "Humidity 6 and pressure 1040"
9
11
  }
10
12
  },
11
- "id": "urn:ngsi-ld:WeatherStation:ws1",
12
13
  "pressure25": {
13
14
  "type": "Property",
14
15
  "value": 52
15
16
  },
16
- "type": "WeatherStation",
17
- "weather": {
17
+ "humidity12": {
18
18
  "type": "Property",
19
19
  "value": {
20
- "@type": "Summary",
21
- "@value": "Humidity 6 and pressure 1040"
20
+ "@type": "Percentage",
21
+ "@value": "12"
22
22
  }
23
23
  }
24
24
  }
@@ -1,36 +1,36 @@
1
1
  [
2
- {
3
- "@context": "http://context.json-ld",
4
- "pressure25": {
5
- "type": "Property",
6
- "value": 52
7
- },
8
- "humidity12": {
9
- "type": "Property",
10
- "value": {
11
- "@type": "Percentage",
12
- "@value": "12"
13
- }
14
- },
15
- "weather": {
16
- "type": "Property",
17
- "value": {
18
- "@type": "Summary",
19
- "@value": "Humidity 6 and pressure 1040"
20
- }
21
- },
22
- "alive": {
23
- "type": "Property",
24
- "value": {
25
- "@type": "None",
26
- "@value": "undefined"
27
- }
28
- },
29
- "updated": {
30
- "type": "Property",
31
- "value": true
32
- },
33
- "id": "urn:ngsi-ld:WeatherStation:ws1",
34
- "type": "WeatherStation"
2
+ {
3
+ "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:WeatherStation:ws1",
5
+ "type": "WeatherStation",
6
+ "weather": {
7
+ "type": "Property",
8
+ "value": {
9
+ "@type": "Summary",
10
+ "@value": "Humidity 6 and pressure 1040"
11
+ }
12
+ },
13
+ "pressure25": {
14
+ "type": "Property",
15
+ "value": 52
16
+ },
17
+ "humidity12": {
18
+ "type": "Property",
19
+ "value": {
20
+ "@type": "Percentage",
21
+ "@value": "12"
22
+ }
23
+ },
24
+ "alive": {
25
+ "type": "Property",
26
+ "value": {
27
+ "@type": "None",
28
+ "@value": "undefined"
29
+ }
30
+ },
31
+ "updated": {
32
+ "type": "Property",
33
+ "value": true
35
34
  }
36
- ]
35
+ }
36
+ ]
@@ -6,26 +6,26 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
- "id": "urn:ngsi-ld:Higrometer:Higro2002",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
10
11
  "pressure": {
11
12
  "type": "Property",
12
13
  "value": {
13
14
  "@type": "Hgmm",
14
- "@value": "17"
15
+ "@value": "16"
15
16
  }
16
- },
17
- "type": "Higrometer"
17
+ }
18
18
  },
19
19
  {
20
20
  "@context": "http://context.json-ld",
21
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
21
+ "id": "urn:ngsi-ld:Higrometer:Higro2002",
22
+ "type": "Higrometer",
22
23
  "pressure": {
23
24
  "type": "Property",
24
25
  "value": {
25
26
  "@type": "Hgmm",
26
- "@value": "16"
27
+ "@value": "17"
27
28
  }
28
- },
29
- "type": "Higrometer"
29
+ }
30
30
  }
31
31
  ]
@@ -12,25 +12,5 @@
12
12
  "type": "Property",
13
13
  "value": 38
14
14
  }
15
- },
16
- {
17
- "@context": "http://context.json-ld",
18
- "id": "urn:ngsi-ld:WM:SO2",
19
- "type": "WM"
20
- },
21
- {
22
- "@context": "http://context.json-ld",
23
- "id": "urn:ngsi-ld:WM:SO3",
24
- "type": "WM"
25
- },
26
- {
27
- "@context": "http://context.json-ld",
28
- "id": "urn:ngsi-ld:WM:SO4",
29
- "type": "WM"
30
- },
31
- {
32
- "@context": "http://context.json-ld",
33
- "id": "urn:ngsi-ld:WM:SO5",
34
- "type": "WM"
35
15
  }
36
16
  ]
@@ -31,11 +31,6 @@
31
31
  "value": 40
32
32
  }
33
33
  },
34
- {
35
- "@context": "http://context.json-ld",
36
- "id": "urn:ngsi-ld:WM:SO4",
37
- "type": "WM"
38
- },
39
34
  {
40
35
  "@context": "http://context.json-ld",
41
36
  "id": "urn:ngsi-ld:WM:SO5",
@@ -6,27 +6,27 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
- "id": "urn:ngsi-ld:Higrometer:Higro2002",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
10
11
  "pressure": {
11
12
  "type": "Property",
12
- "unitCode": "Hgmm",
13
13
  "value": {
14
14
  "@type": "Hgmm",
15
- "@value": "17"
15
+ "@value": "16"
16
16
  }
17
- },
18
- "type": "Higrometer"
17
+ }
19
18
  },
20
19
  {
21
20
  "@context": "http://context.json-ld",
22
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
21
+ "id": "urn:ngsi-ld:Higrometer:Higro2002",
22
+ "type": "Higrometer",
23
23
  "pressure": {
24
24
  "type": "Property",
25
25
  "value": {
26
26
  "@type": "Hgmm",
27
- "@value": "16"
28
- }
29
- },
30
- "type": "Higrometer"
27
+ "@value": "17"
28
+ },
29
+ "unitCode": "Hgmm"
30
+ }
31
31
  }
32
32
  ]
@@ -1,6 +1,8 @@
1
1
  [
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
+ "id": "urn:ngsi-ld:WeatherStation:ws4",
5
+ "type": "WeatherStation",
4
6
  "pressure": {
5
7
  "type": "Property",
6
8
  "value": {
@@ -8,20 +10,19 @@
8
10
  "@value": "52"
9
11
  },
10
12
  "observedAt": "2016-05-30T16:25:22.304Z"
11
- },
12
- "id": "urn:ngsi-ld:WeatherStation:ws4",
13
- "type": "WeatherStation"
13
+ }
14
14
  },
15
15
  {
16
16
  "@context": "http://context.json-ld",
17
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
18
+ "type": "Higrometer",
17
19
  "humidity": {
18
20
  "type": "Property",
19
21
  "value": {
20
22
  "@type": "Percentage",
21
23
  "@value": "12"
22
- }
23
- },
24
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
25
- "type": "Higrometer"
24
+ },
25
+ "observedAt": "2023-03-21T18:30:30.948Z"
26
+ }
26
27
  }
27
28
  ]
@@ -6,14 +6,15 @@
6
6
  },
7
7
  {
8
8
  "@context": "http://context.json-ld",
9
+ "id": "urn:ngsi-ld:Higrometer:Higro2000",
10
+ "type": "Higrometer",
9
11
  "humidity": {
10
12
  "type": "Property",
11
13
  "value": {
12
14
  "@type": "Percentage",
13
15
  "@value": "12"
14
- }
15
- },
16
- "id": "urn:ngsi-ld:Higrometer:Higro2000",
17
- "type": "Higrometer"
16
+ },
17
+ "observedAt": "2023-03-21T16:54:11.464Z"
18
+ }
18
19
  }
19
20
  ]
@@ -14,7 +14,7 @@
14
14
  "@type": "Percentage",
15
15
  "@value": "16"
16
16
  },
17
- "observedAt": "2018-06-13T13:28:34.611Z"
17
+ "observedAt": "2023-03-21T16:57:54.046Z"
18
18
  }
19
19
  }
20
20
  ]
@@ -2,11 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
- "observedAt": "2016-05-30T16:25:22.304Z",
7
7
  "type": "Property",
8
- "value": true
9
- },
10
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2016-05-30T16:25:22.304Z"
10
+ }
11
11
  }
12
12
  ]
@@ -2,10 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
7
  "type": "Property",
7
- "value": true
8
- },
9
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2015-12-14T08:06:01.468Z"
10
+ }
10
11
  }
11
12
  ]
@@ -2,10 +2,11 @@
2
2
  {
3
3
  "@context": "http://context.json-ld",
4
4
  "id": "urn:ngsi-ld:Light:light1",
5
+ "type": "Light",
5
6
  "state": {
6
7
  "type": "Property",
7
- "value": true
8
- },
9
- "type": "Light"
8
+ "value": true,
9
+ "observedAt": "2022-10-22T22:22:22.000Z"
10
+ }
10
11
  }
11
12
  ]