iotagent-node-lib 2.24.0 → 2.26.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 +6 -7
- package/config.js +6 -1
- package/doc/advanced-topics.md +23 -1
- package/doc/apiary/iotagent.apib +5 -5
- package/doc/deprecated.md +13 -7
- package/doc/expressionLanguage.md +44 -34
- package/doc/getting-started.md +1 -1
- package/doc/howto.md +8 -0
- package/doc/installationguide.md +18 -0
- package/doc/usermanual.md +77 -0
- package/examples/TTOpen-service.json +1 -1
- package/lib/commonConfig.js +15 -1
- package/lib/constants.js +1 -0
- package/lib/fiware-iotagent-lib.js +3 -1
- package/lib/jexlTranformsMap.js +12 -1
- package/lib/plugins/jexlParser.js +2 -2
- package/lib/services/devices/deviceService.js +20 -1
- package/lib/services/devices/devices-NGSI-v2.js +3 -1
- package/lib/services/devices/registrationUtils.js +21 -1
- 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/lib/services/northBound/restUtils.js +3 -5
- package/lib/templates/deviceGroup.json +1 -1
- package/package.json +2 -2
- package/test/unit/examples/deviceProvisioningRequests/provisionNewDeviceEmpty.json +43 -0
- package/test/unit/examples/mongoCollections/configurations.json +3 -3
- package/test/unit/expressions/jexlExpression-test.js +29 -8
- package/test/unit/general/deviceService-test.js +31 -29
- package/test/unit/memoryRegistry/deviceRegistryMemory_test.js +26 -25
- package/test/unit/mongodb/mongodb-group-registry-test.js +3 -3
- package/test/unit/mongodb/mongodb-registry-test.js +30 -21
- 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/updateContextExpressionPlugin30.json +11 -0
- package/test/unit/ngsi-ld/expressions/jexlBasedTransformations-test.js +18 -4
- package/test/unit/ngsi-ld/general/deviceService-test.js +31 -29
- 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/unsupported-endpoints-test.js +171 -0
- package/test/unit/ngsi-mixed/provisioning/ngsi-versioning-test.js +0 -3
- package/test/unit/ngsiv2/examples/contextRequests/updateContextMultientityJexlExpressionPlugin1.json +22 -0
- package/test/unit/ngsiv2/expressions/jexlBasedTransformations-test.js +21 -6
- package/test/unit/ngsiv2/general/deviceService-test.js +25 -23
- package/test/unit/ngsiv2/plugins/multientity-plugin_test.js +58 -0
- package/test/unit/ngsiv2/provisioning/device-provisioning-api_test.js +25 -6
|
@@ -134,7 +134,7 @@ const groupCreation = {
|
|
|
134
134
|
apikey: '801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
135
135
|
entity_type: 'TheLightType',
|
|
136
136
|
trust: '8970A9078A803H3BL98PINEQRW8342HBAMS',
|
|
137
|
-
cbHost: 'http://
|
|
137
|
+
cbHost: 'http://192.168.1.1:1026',
|
|
138
138
|
commands: [],
|
|
139
139
|
lazy: [],
|
|
140
140
|
attributes: [
|
|
@@ -181,7 +181,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
181
181
|
|
|
182
182
|
describe('When an existing device tries to be retrieved with retrieveOrCreate()', function () {
|
|
183
183
|
beforeEach(function (done) {
|
|
184
|
-
contextBrokerMock = nock('http://
|
|
184
|
+
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
185
185
|
.matchHeader('fiware-service', 'testservice')
|
|
186
186
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
187
187
|
.post('/v2/registrations')
|
|
@@ -193,12 +193,12 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
193
193
|
.post('/v2/entities?options=upsert')
|
|
194
194
|
.reply(204);
|
|
195
195
|
|
|
196
|
-
async.series(
|
|
197
|
-
|
|
198
|
-
results
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
196
|
+
async.series(
|
|
197
|
+
[request.bind(request, groupCreation), request.bind(request, deviceCreation)],
|
|
198
|
+
function (error, results) {
|
|
199
|
+
done();
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
202
|
});
|
|
203
203
|
|
|
204
204
|
it('should return the existing device', function (done) {
|
|
@@ -214,7 +214,7 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
214
214
|
|
|
215
215
|
describe('When an unexisting device tries to be retrieved for an existing APIKey', function () {
|
|
216
216
|
beforeEach(function (done) {
|
|
217
|
-
contextBrokerMock = nock('http://
|
|
217
|
+
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
218
218
|
.matchHeader('fiware-service', 'testservice')
|
|
219
219
|
.matchHeader('fiware-servicepath', '/testingPath')
|
|
220
220
|
.post('/v2/registrations')
|
|
@@ -232,32 +232,34 @@ describe('NGSI-v2 - Device Service: utils', function () {
|
|
|
232
232
|
});
|
|
233
233
|
|
|
234
234
|
it('should register the device and return it', function (done) {
|
|
235
|
-
iotAgentLib.retrieveDevice(
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
235
|
+
iotAgentLib.retrieveDevice(
|
|
236
|
+
'UNEXISTENT_DEV',
|
|
237
|
+
'801230BJKL23Y9090DSFL123HJK09H324HV8732',
|
|
238
|
+
function (error, device) {
|
|
239
|
+
should.not.exist(error);
|
|
240
|
+
should.exist(device);
|
|
241
241
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
device.id.should.equal('UNEXISTENT_DEV');
|
|
243
|
+
should.exist(device.protocol);
|
|
244
|
+
device.protocol.should.equal('MQTT_UL');
|
|
245
|
+
done();
|
|
246
|
+
}
|
|
247
|
+
);
|
|
247
248
|
});
|
|
248
249
|
});
|
|
249
250
|
|
|
250
251
|
describe('When an unexisting device tries to be retrieved for an unexisting APIKey', function () {
|
|
251
252
|
it('should raise an error', function (done) {
|
|
252
|
-
iotAgentLib.retrieveDevice(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
253
|
+
iotAgentLib.retrieveDevice(
|
|
254
|
+
'UNEXISTENT_DEV_AND_GROUP',
|
|
255
|
+
'H2332Y909DSF3H346yh20JK092',
|
|
256
|
+
function (error, device) {
|
|
257
|
+
should.exist(error);
|
|
258
|
+
error.name.should.equal('DEVICE_GROUP_NOT_FOUND');
|
|
259
|
+
should.not.exist(device);
|
|
260
|
+
done();
|
|
261
|
+
}
|
|
262
|
+
);
|
|
261
263
|
});
|
|
262
264
|
});
|
|
263
265
|
});
|
|
@@ -96,16 +96,19 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
96
96
|
iotAgentLib.clearRegistry(done);
|
|
97
97
|
});
|
|
98
98
|
it('should return the appropriate device', function (done) {
|
|
99
|
-
iotAgentLib.getDevicesByAttribute(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
iotAgentLib.getDevicesByAttribute(
|
|
100
|
+
'internalId',
|
|
101
|
+
'internal3',
|
|
102
|
+
'smartgondor',
|
|
103
|
+
'gardens',
|
|
104
|
+
function (error, devices) {
|
|
105
|
+
should.not.exist(error);
|
|
106
|
+
should.exist(devices);
|
|
107
|
+
devices.length.should.equal(1);
|
|
108
|
+
devices[0].id.should.equal('id3');
|
|
109
|
+
done();
|
|
110
|
+
}
|
|
111
|
+
);
|
|
109
112
|
});
|
|
110
113
|
});
|
|
111
114
|
|
|
@@ -194,9 +197,9 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
194
197
|
});
|
|
195
198
|
});
|
|
196
199
|
});
|
|
197
|
-
|
|
198
|
-
describe('When a the registry is queried for device in a particular name and type', function (){
|
|
199
|
-
|
|
200
|
+
|
|
201
|
+
describe('When a the registry is queried for device in a particular name and type', function () {
|
|
202
|
+
beforeEach(function (done) {
|
|
200
203
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
201
204
|
.post('/v2/entities?options=upsert')
|
|
202
205
|
.times(10)
|
|
@@ -204,21 +207,21 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
204
207
|
|
|
205
208
|
const devices = [];
|
|
206
209
|
|
|
207
|
-
for (let i = 0; i < 10; i++)
|
|
208
|
-
|
|
209
|
-
devices.push(
|
|
210
|
-
{
|
|
210
|
+
for (let i = 0; i < 10; i++) {
|
|
211
|
+
devices.push({
|
|
211
212
|
id: 'id' + i,
|
|
212
|
-
name
|
|
213
|
+
name: 'name' + i,
|
|
213
214
|
type: 'Light' + i,
|
|
214
215
|
internalId: 'internal' + i,
|
|
215
216
|
service: 'smartgondor',
|
|
216
217
|
subservice: 'gardens',
|
|
217
|
-
active: [
|
|
218
|
+
active: [
|
|
219
|
+
{
|
|
218
220
|
id: 'attrId',
|
|
219
221
|
type: 'attrType' + i,
|
|
220
222
|
value: i
|
|
221
|
-
}
|
|
223
|
+
}
|
|
224
|
+
]
|
|
222
225
|
});
|
|
223
226
|
}
|
|
224
227
|
|
|
@@ -230,17 +233,15 @@ describe('NGSI-v2 - In memory device registry', function () {
|
|
|
230
233
|
afterEach(function (done) {
|
|
231
234
|
iotAgentLib.clearRegistry(done);
|
|
232
235
|
});
|
|
233
|
-
it('should return the name and type of device', function (done)
|
|
234
|
-
|
|
235
|
-
iotAgentLib.getDeviceByNameAndType('name5', 'Light5','smartgondor', 'gardens' ,function(error, device)
|
|
236
|
-
{
|
|
236
|
+
it('should return the name and type of device', function (done) {
|
|
237
|
+
iotAgentLib.getDeviceByNameAndType('name5', 'Light5', 'smartgondor', 'gardens', function (error, device) {
|
|
237
238
|
should.not.exist(error);
|
|
238
239
|
should.exist(device);
|
|
239
240
|
should.exist(device.name);
|
|
240
241
|
should.exist(device.type);
|
|
241
242
|
device.name.should.equal('name5');
|
|
242
243
|
device.type.should.equal('Light5');
|
|
243
|
-
Object.keys(device).length.should.equal(
|
|
244
|
+
Object.keys(device).length.should.equal(12);
|
|
244
245
|
done();
|
|
245
246
|
});
|
|
246
247
|
});
|
|
@@ -448,16 +448,16 @@ describe('MongoDB Group Registry test', function () {
|
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
450
|
});
|
|
451
|
-
|
|
451
|
+
|
|
452
452
|
describe('When the device info request with name and type', function () {
|
|
453
453
|
beforeEach(function (done) {
|
|
454
454
|
async.series([async.apply(request, optionsCreation)], done);
|
|
455
455
|
});
|
|
456
|
-
|
|
456
|
+
|
|
457
457
|
afterEach(function (done) {
|
|
458
458
|
iotAgentLib.clearRegistry(done);
|
|
459
459
|
});
|
|
460
|
-
|
|
460
|
+
|
|
461
461
|
it('should return the name and type of device', function (done) {
|
|
462
462
|
request(optionsGet, function (error, response, body) {
|
|
463
463
|
should.exist(body);
|
|
@@ -440,16 +440,19 @@ describe('NGSI-v2 - MongoDB Device Registry', function () {
|
|
|
440
440
|
iotAgentLib.clearRegistry(done);
|
|
441
441
|
});
|
|
442
442
|
it('should return the appropriate device', function (done) {
|
|
443
|
-
iotAgentLib.getDevicesByAttribute(
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
443
|
+
iotAgentLib.getDevicesByAttribute(
|
|
444
|
+
'internalId',
|
|
445
|
+
'internal3',
|
|
446
|
+
'smartgondor',
|
|
447
|
+
'gardens',
|
|
448
|
+
function (error, devices) {
|
|
449
|
+
should.not.exist(error);
|
|
450
|
+
should.exist(devices);
|
|
451
|
+
devices.length.should.equal(1);
|
|
452
|
+
devices[0].id.should.equal('id3');
|
|
453
|
+
done();
|
|
454
|
+
}
|
|
455
|
+
);
|
|
453
456
|
});
|
|
454
457
|
});
|
|
455
458
|
|
|
@@ -507,8 +510,8 @@ describe('NGSI-v2 - MongoDB Device Registry', function () {
|
|
|
507
510
|
});
|
|
508
511
|
});
|
|
509
512
|
});
|
|
510
|
-
|
|
511
|
-
|
|
513
|
+
|
|
514
|
+
describe('When the device is queried with the name and type', function () {
|
|
512
515
|
beforeEach(function (done) {
|
|
513
516
|
contextBrokerMock = nock('http://192.168.1.1:1026')
|
|
514
517
|
.post('/v2/entities?options=upsert')
|
|
@@ -545,15 +548,21 @@ describe('NGSI-v2 - MongoDB Device Registry', function () {
|
|
|
545
548
|
iotAgentLib.clearRegistry(done);
|
|
546
549
|
});
|
|
547
550
|
it('should return the device with name and type', function (done) {
|
|
548
|
-
iotAgentLib.getDeviceByNameAndType(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
device
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
551
|
+
iotAgentLib.getDeviceByNameAndType(
|
|
552
|
+
'Light4:id4',
|
|
553
|
+
'Light4',
|
|
554
|
+
'smartgondor',
|
|
555
|
+
'gardens',
|
|
556
|
+
function (error, device) {
|
|
557
|
+
should.not.exist(error);
|
|
558
|
+
should.exist(device);
|
|
559
|
+
should.exist(device.name);
|
|
560
|
+
should.exist(device.type);
|
|
561
|
+
device.name.should.equal('Light4:id4');
|
|
562
|
+
device.type.should.equal('Light4');
|
|
563
|
+
done();
|
|
564
|
+
}
|
|
565
|
+
);
|
|
557
566
|
});
|
|
558
567
|
});
|
|
559
568
|
});
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
"type": "ContextSourceRegistration",
|
|
3
|
+
"information": [
|
|
4
|
+
{
|
|
5
|
+
"entities": [
|
|
5
6
|
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"id": "urn:ngsi-ld:Light:light1",
|
|
9
|
-
"type": "Light"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"properties": [
|
|
13
|
-
"temperature"
|
|
14
|
-
]
|
|
7
|
+
"type": "Light",
|
|
8
|
+
"id": "urn:ngsi-ld:Light:light1"
|
|
15
9
|
}
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
],
|
|
11
|
+
"propertyNames": [
|
|
12
|
+
"temperature"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"mode": "exclusive",
|
|
17
|
+
"operations": [
|
|
18
|
+
"retrieveOps"
|
|
19
|
+
],
|
|
20
|
+
"endpoint": "http://smartgondor.com",
|
|
21
|
+
"contextSourceInfo": [
|
|
22
|
+
{
|
|
23
|
+
"key": "jsonldContext",
|
|
24
|
+
"value": "http://context.json-ld"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"@context": "http://context.json-ld"
|
|
18
28
|
}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
{
|
|
5
|
-
"entities": [
|
|
2
|
+
"type": "ContextSourceRegistration",
|
|
3
|
+
"information": [
|
|
6
4
|
{
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
"entities": [
|
|
6
|
+
{
|
|
7
|
+
"type": "Motion",
|
|
8
|
+
"id": "urn:ngsi-ld:Motion:motion1"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"propertyNames": [
|
|
12
|
+
"moving"
|
|
13
|
+
]
|
|
9
14
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
],
|
|
16
|
+
"mode": "exclusive",
|
|
17
|
+
"operations": [
|
|
18
|
+
"retrieveOps"
|
|
19
|
+
],
|
|
20
|
+
"endpoint": "http://smartgondor.com",
|
|
21
|
+
"contextSourceInfo":[
|
|
22
|
+
{
|
|
23
|
+
"key": "jsonldContext",
|
|
24
|
+
"value": "http://context.json-ld"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"@context": "http://context.json-ld"
|
|
28
|
+
}
|
|
@@ -4,15 +4,25 @@
|
|
|
4
4
|
{
|
|
5
5
|
"entities": [
|
|
6
6
|
{
|
|
7
|
-
"type": "
|
|
8
|
-
"id": "urn:ngsi-ld:
|
|
7
|
+
"type": "Light",
|
|
8
|
+
"id": "urn:ngsi-ld:Light:light1"
|
|
9
9
|
}
|
|
10
10
|
],
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"propertyNames": [
|
|
12
|
+
"temperature"
|
|
13
13
|
]
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
|
+
"mode": "exclusive",
|
|
17
|
+
"operations": [
|
|
18
|
+
"retrieveOps"
|
|
19
|
+
],
|
|
16
20
|
"endpoint": "http://smartgondor.com",
|
|
21
|
+
"contextSourceInfo": [
|
|
22
|
+
{
|
|
23
|
+
"key": "jsonldContext",
|
|
24
|
+
"value": "http://context.json-ld"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
17
27
|
"@context": "http://context.json-ld"
|
|
18
|
-
}
|
|
28
|
+
}
|
package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommands.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,11 +15,13 @@
|
|
|
9
15
|
"type": "Robot"
|
|
10
16
|
}
|
|
11
17
|
],
|
|
12
|
-
"
|
|
18
|
+
"propertyNames": [
|
|
13
19
|
"position",
|
|
14
20
|
"orientation"
|
|
15
21
|
]
|
|
16
22
|
}
|
|
17
23
|
],
|
|
24
|
+
"mode": "exclusive",
|
|
25
|
+
"operations" :["updateOps"],
|
|
18
26
|
"type": "ContextSourceRegistration"
|
|
19
27
|
}
|
package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerIoTAgentCommandsAndLazy.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "ContextSourceRegistration",
|
|
3
|
+
"information": [
|
|
4
|
+
{
|
|
5
|
+
"entities": [
|
|
6
|
+
{
|
|
7
|
+
"type": "Robot",
|
|
8
|
+
"id": "urn:ngsi-ld:Robot:r2d2"
|
|
9
|
+
}
|
|
10
|
+
],
|
|
11
|
+
"propertyNames": [
|
|
12
|
+
"batteryLevel",
|
|
13
|
+
"position",
|
|
14
|
+
"orientation"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"mode": "exclusive",
|
|
19
|
+
"operations": [
|
|
20
|
+
"retrieveOps",
|
|
21
|
+
"updateOps",
|
|
22
|
+
"mergeEntity"
|
|
23
|
+
],
|
|
24
|
+
"endpoint": "http://smartgondor.com",
|
|
25
|
+
"contextSourceInfo": [
|
|
26
|
+
{
|
|
27
|
+
"key": "jsonldContext",
|
|
28
|
+
"value": "http://context.json-ld"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"@context": "http://context.json-ld"
|
|
32
|
+
}
|
package/test/unit/ngsi-ld/examples/contextAvailabilityRequests/registerProvisionedDevice.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,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
|
}
|
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
|
+
}
|