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.
- package/.github/workflows/ci.yml +1 -0
- package/CHANGES_NEXT_RELEASE +2 -0
- package/docker-compose-dev.yml +1 -1
- package/lib/fiware-iotagent-lib.js +0 -5
- package/lib/plugins/compressTimestamp.js +2 -7
- package/lib/plugins/expressionParser.js +0 -47
- package/lib/plugins/expressionPlugin.js +6 -78
- package/lib/plugins/jexlParser.js +0 -36
- package/lib/plugins/pluginUtils.js +0 -119
- package/lib/services/ngsi/entities-NGSI-LD.js +586 -199
- package/lib/services/ngsi/entities-NGSI-v2.js +607 -297
- package/lib/services/ngsi/ngsiUtils.js +15 -22
- package/package.json +2 -2
- package/test/unit/general/config-multi-core-test.js +2 -1
- package/test/unit/general/contextBrokerKeystoneSecurityAccess-test.js +2 -1
- package/test/unit/general/deviceService-test.js +2 -1
- package/test/unit/general/loglevel-api_test.js +2 -3
- package/test/unit/general/startup-test.js +2 -1
- package/test/unit/general/statistics-persistence_test.js +1 -0
- package/test/unit/general/statistics-service_test.js +1 -0
- package/test/unit/lazyAndCommands/commandRegistry_test.js +1 -0
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +1 -0
- package/test/unit/mongodb/mongodb-connectionoptions-test.js +1 -0
- package/test/unit/mongodb/mongodb-group-registry-test.js +1 -0
- package/test/unit/mongodb/mongodb-registry-test.js +2 -1
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAliasPlugin1.json +0 -5
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast10.json +1 -1
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast8.json +1 -1
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextAutocast9.json +1 -1
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin32.json +16 -15
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4.json +8 -8
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextExpressionPlugin4a.json +34 -34
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin5.json +8 -8
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin6.json +0 -20
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin7.json +0 -5
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityPlugin8.json +10 -10
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +8 -7
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +5 -4
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin3.json +1 -1
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextProcessTimestamp.json +4 -4
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverride.json +4 -3
- package/test/unit/ngsi-ld/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +4 -3
- package/test/unit/ngsi-ld/expressions/expressionBasedTransformations-test.js +4 -6
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -7
- package/test/unit/ngsi-ld/general/config-jsonld-contexts-test.js +2 -1
- package/test/unit/ngsi-ld/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
- package/test/unit/ngsi-ld/general/deviceService-test.js +2 -1
- package/test/unit/ngsi-ld/general/https-support-test.js +2 -1
- package/test/unit/ngsi-ld/general/iotam-autoregistration-test.js +2 -1
- package/test/unit/ngsi-ld/general/startup-test.js +3 -2
- package/test/unit/ngsi-ld/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
- package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +5 -7
- package/test/unit/ngsi-ld/lazyAndCommands/lazy-devices-test.js +8 -6
- package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +18 -22
- package/test/unit/ngsi-ld/lazyAndCommands/polling-commands-test.js +2 -1
- package/test/unit/ngsi-ld/ngsiService/active-devices-test.js +2 -1
- package/test/unit/ngsi-ld/ngsiService/autocast-test.js +17 -4
- package/test/unit/ngsi-ld/ngsiService/geoproperties-test.js +2 -1
- package/test/unit/ngsi-ld/ngsiService/languageProperties-test.js +32 -34
- package/test/unit/ngsi-ld/ngsiService/staticAttributes-test.js +2 -1
- package/test/unit/ngsi-ld/ngsiService/subscriptions-test.js +2 -1
- package/test/unit/ngsi-ld/ngsiService/unsupported-endpoints-test.js +11 -15
- package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +2 -3
- package/test/unit/ngsi-ld/plugins/bidirectional-plugin_test.js +2 -1
- package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +2 -32
- package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +20 -19
- package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +21 -7
- package/test/unit/ngsi-ld/provisioning/device-provisioning-api_test.js +1 -0
- package/test/unit/ngsi-ld/provisioning/device-registration_test.js +2 -1
- package/test/unit/ngsi-ld/provisioning/device-update-registration_test.js +15 -12
- package/test/unit/ngsi-ld/provisioning/listProvisionedDevices-test.js +1 -0
- package/test/unit/ngsi-ld/provisioning/provisionDeviceMultientity-test.js +1 -0
- package/test/unit/ngsi-ld/provisioning/removeProvisionedDevice-test.js +1 -0
- package/test/unit/ngsi-ld/provisioning/singleConfigurationMode-test.js +1 -0
- package/test/unit/ngsi-ld/provisioning/updateProvisionedDevices-test.js +1 -0
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +13 -7
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin1.json +2 -2
- package/test/unit/ngsiv2/examples/contextRequests/updateContextExpressionPlugin32.json +6 -0
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin11.json +5 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin5.json +4 -4
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin6.json +0 -16
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin7.json +0 -4
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityPlugin8.json +8 -8
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin1.json +42 -42
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin2.json +7 -7
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityTimestampPlugin4.json +0 -5
- package/test/unit/ngsiv2/examples/contextRequests/updateContextProcessTimestamp.json +6 -6
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverride.json +7 -1
- package/test/unit/ngsiv2/examples/contextRequests/updateContextTimestampOverrideWithoutMilis.json +7 -1
- package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +2 -4
- package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +4 -8
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +5 -9
- package/test/unit/ngsiv2/general/contextBrokerOAuthSecurityAccess-test.js +2 -1
- package/test/unit/ngsiv2/general/deviceService-test.js +2 -1
- package/test/unit/ngsiv2/general/https-support-test.js +2 -1
- package/test/unit/ngsiv2/general/iotam-autoregistration-test.js +2 -1
- package/test/unit/ngsiv2/general/startup-test.js +2 -1
- package/test/unit/ngsiv2/lazyAndCommands/active-devices-attribute-update-test.js +2 -1
- package/test/unit/ngsiv2/lazyAndCommands/command-test.js +2 -1
- package/test/unit/ngsiv2/lazyAndCommands/lazy-devices-test.js +8 -6
- package/test/unit/ngsiv2/lazyAndCommands/polling-commands-test.js +2 -1
- package/test/unit/ngsiv2/ngsiService/active-devices-test.js +3 -2
- package/test/unit/ngsiv2/ngsiService/autocast-test.js +2 -1
- package/test/unit/ngsiv2/ngsiService/queryDeviceInformationInCb-test.js +2 -1
- package/test/unit/ngsiv2/ngsiService/staticAttributes-test.js +2 -1
- package/test/unit/ngsiv2/ngsiService/subscriptions-test.js +2 -1
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +2 -3
- package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +2 -5
- package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +2 -33
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +7 -16
- package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +3 -2
- package/test/unit/ngsiv2/provisioning/device-group-api-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/device-group-utils-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +1 -0
- package/test/unit/ngsiv2/provisioning/device-registration_test.js +2 -1
- package/test/unit/ngsiv2/provisioning/device-update-registration_test.js +15 -12
- package/test/unit/ngsiv2/provisioning/listProvisionedDevices-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/provisionDeviceMultientity-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/removeProvisionedDevice-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/singleConfigurationMode-test.js +1 -0
- package/test/unit/ngsiv2/provisioning/updateProvisionedDevices-test.js +1 -0
- package/test/unit/plugins/capture-configuration-inPlugins_test.js +2 -1
- package/test/unit/plugins/capture-provision-inPlugins_test.js +2 -1
- package/lib/plugins/addEvent.js +0 -32
- package/lib/plugins/attributeAlias.js +0 -107
- package/lib/plugins/multiEntity.js +0 -255
- package/lib/plugins/timestampProcessPlugin.js +0 -95
- package/test/unit/ngsi-ld/plugins/event-plugin_test.js +0 -116
- package/test/unit/ngsiv2/plugins/event-plugin_test.js +0 -118
- 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
|
|
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
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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": "
|
|
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": ">=
|
|
26
|
+
"node": ">=16"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rm -rf package-lock.json && rm -rf node_modules && rm -rf coverage",
|
|
@@ -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
|
});
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
"
|
|
4
|
+
"id": "urn:ngsi-ld:WeatherStation:ws1",
|
|
5
|
+
"type": "WeatherStation",
|
|
6
|
+
"weather": {
|
|
5
7
|
"type": "Property",
|
|
6
8
|
"value": {
|
|
7
|
-
"@type": "
|
|
8
|
-
"@value": "
|
|
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
|
-
"
|
|
17
|
-
"weather": {
|
|
17
|
+
"humidity12": {
|
|
18
18
|
"type": "Property",
|
|
19
19
|
"value": {
|
|
20
|
-
"@type": "
|
|
21
|
-
"@value": "
|
|
20
|
+
"@type": "Percentage",
|
|
21
|
+
"@value": "12"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
[
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"type": "
|
|
10
|
-
"value":
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
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:
|
|
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": "
|
|
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:
|
|
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": "
|
|
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
|
]
|
|
@@ -6,27 +6,27 @@
|
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"@context": "http://context.json-ld",
|
|
9
|
-
"id": "urn:ngsi-ld:Higrometer:
|
|
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": "
|
|
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:
|
|
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": "
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
"@value": "17"
|
|
28
|
+
},
|
|
29
|
+
"unitCode": "Hgmm"
|
|
30
|
+
}
|
|
31
31
|
}
|
|
32
32
|
]
|
package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin1.json
CHANGED
|
@@ -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
|
-
|
|
25
|
-
"type": "Higrometer"
|
|
24
|
+
},
|
|
25
|
+
"observedAt": "2023-03-21T18:30:30.948Z"
|
|
26
|
+
}
|
|
26
27
|
}
|
|
27
28
|
]
|
package/test/unit/ngsi-ld/examples/contextRequests/updateContextMultientityTimestampPlugin2.json
CHANGED
|
@@ -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
|
-
|
|
17
|
-
"type": "Higrometer"
|
|
16
|
+
},
|
|
17
|
+
"observedAt": "2023-03-21T16:54:11.464Z"
|
|
18
|
+
}
|
|
18
19
|
}
|
|
19
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
|
-
|
|
8
|
+
"value": true,
|
|
9
|
+
"observedAt": "2016-05-30T16:25:22.304Z"
|
|
10
|
+
}
|
|
11
11
|
}
|
|
12
12
|
]
|