iotagent-node-lib 2.25.0 → 3.0.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/CHANGES_NEXT_RELEASE +0 -1
- package/config.js +6 -1
- package/doc/deprecated.md +4 -1
- package/doc/howto.md +8 -0
- package/doc/installationguide.md +18 -0
- package/doc/usermanual.md +77 -0
- package/lib/commonConfig.js +15 -1
- package/lib/constants.js +1 -0
- package/lib/fiware-iotagent-lib.js +1 -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/devices/deviceService.js +1 -0
- package/lib/services/devices/registrationUtils.js +21 -1
- package/lib/services/ngsi/entities-NGSI-LD.js +600 -199
- package/lib/services/ngsi/entities-NGSI-v2.js +620 -298
- package/lib/services/ngsi/ngsiUtils.js +15 -22
- package/lib/services/northBound/contextServer-NGSI-LD.js +221 -38
- package/lib/services/northBound/contextServer.js +14 -1
- package/lib/services/northBound/northboundServer.js +1 -0
- package/package.json +1 -1
- package/test/unit/general/loglevel-api_test.js +0 -2
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +1 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent1.json +24 -14
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent2.json +25 -15
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgent4.json +15 -5
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommands.json +9 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommandsAndLazy.json +32 -0
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice.json +12 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice2.json +9 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup.json +12 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup2.json +12 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDeviceWithGroup3.json +9 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateCommands1.json +10 -2
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent1.json +11 -1
- package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/updateIoTAgent2.json +12 -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 +2 -5
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +1 -7
- package/test/unit/ngsi-ld/general/startup-test.js +17 -2
- package/test/unit/ngsi-ld/lazyAndCommands/command-test.js +1 -12
- package/test/unit/ngsi-ld/lazyAndCommands/merge-patch-test.js +249 -0
- package/test/unit/ngsi-ld/ngsiService/autocast-test.js +15 -3
- package/test/unit/ngsi-ld/ngsiService/unsupported-endpoints-test.js +171 -0
- package/test/unit/ngsi-ld/plugins/alias-plugin_test.js +0 -2
- package/test/unit/ngsi-ld/plugins/compress-timestamp-plugin_test.js +0 -31
- package/test/unit/ngsi-ld/plugins/multientity-plugin_test.js +18 -18
- package/test/unit/ngsi-ld/plugins/timestamp-processing-plugin_test.js +19 -6
- package/test/unit/ngsiv2/examples/contextRequests/updateContextAliasPlugin1.json +2 -2
- 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 +1 -7
- package/test/unit/ngsiv2/expressions/expressionBasedTransformations-test.js +0 -3
- package/test/unit/ngsiv2/expressions/expressionCombinedTransformations-test.js +0 -6
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +1 -7
- package/test/unit/ngsiv2/plugins/alias-plugin_test.js +0 -2
- package/test/unit/ngsiv2/plugins/bidirectional-plugin_test.js +0 -4
- package/test/unit/ngsiv2/plugins/compress-timestamp-plugin_test.js +0 -32
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +5 -15
- package/test/unit/ngsiv2/plugins/timestamp-processing-plugin_test.js +1 -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
package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice2.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,10 +15,12 @@
|
|
|
9
15
|
"type": "TheLightType"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"luminance"
|
|
14
20
|
]
|
|
15
21
|
}
|
|
16
22
|
],
|
|
23
|
+
"mode": "exclusive",
|
|
24
|
+
"operations" :["retrieveOps"],
|
|
17
25
|
"type": "ContextSourceRegistration"
|
|
18
26
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,7 +15,7 @@
|
|
|
9
15
|
"type": "TheLightType"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"luminance",
|
|
14
20
|
"luminescence",
|
|
15
21
|
"commandAttr",
|
|
@@ -17,5 +23,10 @@
|
|
|
17
23
|
]
|
|
18
24
|
}
|
|
19
25
|
],
|
|
26
|
+
"mode": "exclusive",
|
|
27
|
+
"operations": [
|
|
28
|
+
"retrieveOps",
|
|
29
|
+
"updateOps"
|
|
30
|
+
],
|
|
20
31
|
"type": "ContextSourceRegistration"
|
|
21
32
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,7 +15,7 @@
|
|
|
9
15
|
"type": "SensorMachine"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"luminance",
|
|
14
20
|
"luminescence",
|
|
15
21
|
"commandAttr",
|
|
@@ -17,5 +23,10 @@
|
|
|
17
23
|
]
|
|
18
24
|
}
|
|
19
25
|
],
|
|
26
|
+
"mode": "exclusive",
|
|
27
|
+
"operations" : [
|
|
28
|
+
"retrieveOps",
|
|
29
|
+
"updateOps"
|
|
30
|
+
],
|
|
20
31
|
"type": "ContextSourceRegistration"
|
|
21
32
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,10 +15,12 @@
|
|
|
9
15
|
"type": "Light"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"temperature"
|
|
14
20
|
]
|
|
15
21
|
}
|
|
16
22
|
],
|
|
23
|
+
"mode": "exclusive",
|
|
24
|
+
"operations" :["retrieveOps"],
|
|
17
25
|
"type": "ContextSourceRegistration"
|
|
18
26
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type":"ContextSourceRegistration",
|
|
3
|
+
"contextSourceInfo":[
|
|
4
|
+
{
|
|
5
|
+
"key": "jsonldContext",
|
|
6
|
+
"value": "http://context.json-ld"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
3
9
|
"information":[
|
|
4
10
|
{
|
|
5
11
|
"entities":[
|
|
@@ -8,11 +14,13 @@
|
|
|
8
14
|
"id":"urn:ngsi-ld:Light:light1"
|
|
9
15
|
}
|
|
10
16
|
],
|
|
11
|
-
"
|
|
17
|
+
"propertyNames":[
|
|
12
18
|
"move"
|
|
13
19
|
]
|
|
14
20
|
}
|
|
15
21
|
],
|
|
22
|
+
"mode": "exclusive",
|
|
23
|
+
"operations":["updateOps"],
|
|
16
24
|
"endpoint":"http://smartgondor.com",
|
|
17
25
|
"@context": "http://context.json-ld"
|
|
18
|
-
}
|
|
26
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,10 +15,14 @@
|
|
|
9
15
|
"type": "Light"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"pressure"
|
|
14
20
|
]
|
|
15
21
|
}
|
|
16
22
|
],
|
|
23
|
+
"mode": "exclusive",
|
|
24
|
+
"operations": [
|
|
25
|
+
"retrieveOps"
|
|
26
|
+
],
|
|
17
27
|
"type": "ContextSourceRegistration"
|
|
18
28
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"@context": "http://context.json-ld",
|
|
3
3
|
"endpoint": "http://smartgondor.com",
|
|
4
|
+
"contextSourceInfo":[
|
|
5
|
+
{
|
|
6
|
+
"key": "jsonldContext",
|
|
7
|
+
"value": "http://context.json-ld"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
4
10
|
"information": [
|
|
5
11
|
{
|
|
6
12
|
"entities": [
|
|
@@ -9,11 +15,16 @@
|
|
|
9
15
|
"type": "TheLightType"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"luminance",
|
|
14
20
|
"commandAttr"
|
|
15
21
|
]
|
|
16
22
|
}
|
|
17
23
|
],
|
|
24
|
+
"mode": "exclusive",
|
|
25
|
+
"operations" : [
|
|
26
|
+
"retrieveOps",
|
|
27
|
+
"updateOps"
|
|
28
|
+
],
|
|
18
29
|
"type": "ContextSourceRegistration"
|
|
19
30
|
}
|
|
@@ -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
|
]
|
|
@@ -198,9 +198,6 @@ describe('NGSI-LD - Expression-based transformations plugin', function () {
|
|
|
198
198
|
|
|
199
199
|
iotAgentLib.activate(iotAgentConfig, function () {
|
|
200
200
|
iotAgentLib.clearAll(function () {
|
|
201
|
-
iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.attributeAlias.update);
|
|
202
|
-
iotAgentLib.addQueryMiddleware(iotAgentLib.dataPlugins.attributeAlias.query);
|
|
203
|
-
iotAgentLib.addUpdateMiddleware(iotAgentLib.dataPlugins.expressionTransformation.update);
|
|
204
201
|
done();
|
|
205
202
|
});
|
|
206
203
|
});
|
|
@@ -746,13 +743,13 @@ describe('NGSI-LD - Expression-based transformations plugin', function () {
|
|
|
746
743
|
});
|
|
747
744
|
});
|
|
748
745
|
|
|
749
|
-
describe('When an update comes for attributes without expressions and
|
|
746
|
+
describe('When an update comes for attributes without expressions and Array type', function () {
|
|
750
747
|
// Case: Update for a JSON array attribute without expression
|
|
751
748
|
|
|
752
749
|
const values = [
|
|
753
750
|
{
|
|
754
751
|
name: 'r',
|
|
755
|
-
type: '
|
|
752
|
+
type: 'Array',
|
|
756
753
|
value: ['v0.1', 'v0.2', 'v0.3']
|
|
757
754
|
}
|
|
758
755
|
];
|