diff --git a/primer/.gitkeep b/primer/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/primer/Environment_Primer.postman_environment.json b/primer/Environment_Primer.postman_environment.json new file mode 100644 index 0000000000000000000000000000000000000000..321cddf06523d4b8e420aa3a68543f566930459a --- /dev/null +++ b/primer/Environment_Primer.postman_environment.json @@ -0,0 +1,27 @@ +{ + "id": "f5427c16-709a-471a-ba29-0fadcb5e7f65", + "name": "Environment Primer", + "values": [ + { + "key": "link", + "value": "https://uri.etsi.org/ngsi-ld/primer/store-context.jsonld", + "type": "default", + "enabled": true + }, + { + "key": "broker", + "value": "http://localhost:9090", + "type": "default", + "enabled": true + }, + { + "key": "notificationURL", + "value": "http://localhost:8080", + "type": "default", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2023-09-26T14:38:18.971Z", + "_postman_exported_using": "Postman/10.18.6" +} \ No newline at end of file diff --git a/primer/NGSI-LD-Primer_Examples_v1.2.postman_collection.json b/primer/NGSI-LD-Primer_Examples_v1.2.postman_collection.json new file mode 100644 index 0000000000000000000000000000000000000000..e729d4f1e6359d6249087c94ea5c44a67dae4c78 --- /dev/null +++ b/primer/NGSI-LD-Primer_Examples_v1.2.postman_collection.json @@ -0,0 +1,3986 @@ +{ + "info": { + "_postman_id": "b21e845c-2909-490f-a023-cbee7e7b6d75", + "name": "NGSI-LD-Primer Examples v1.2", + "description": "This collection consists of NGSI-LD request examples for the store examples used in the NGSI-LD Tutorial and NGSI-LD Primer.", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "1479065", + "_collection_link": "https://fiware-demo.postman.co/workspace/NGSI-LD-Primer-Examples~2ef57b21-e7bc-4032-a0b0-77edeba09065/collection/1479065-b21e845c-2909-490f-a023-cbee7e7b6d75?action=share&source=collection_link&creator=1479065" + }, + "item": [ + { + "name": "Figure 5.3-1 - Create Store:001 - context in body", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);\r", + "console.log(payloadBody.id);\r", + "var entityId = payloadBody.id;\r", + "var entityType = payloadBody.type;\r", + "pm.collectionVariables.set(\"created\", payloadBody);\r", + "pm.collectionVariables.set(\"entityId\", entityId);\r", + "pm.collectionVariables.set(\"entityType\", entityType);\r", + "pm.collectionVariables.set(\"@context\", payloadBody[\"@context\"][0]);\r", + "pm.test(\"Status code is 201\", function () {\r", + " pm.response.to.have.status(201);\r", + "});\r", + "pm.test(\"Check location header\", function () {\r", + " pm.response.to.have.header(\"Location\");\r", + " pm.expect(pm.response.headers.get(\"Location\")).to.include(entityId);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"@context\": [\n {\n \"Store\": \"https://uri.etsi.org/ngsi-ld/primer/Store\",\n \"address\": \"https://uri.etsi.org/ngsi-ld/primer/address\",\n \"storeName\": \"https://uri.etsi.org/ngsi-ld/primer/storeName\",\n \"streetAddress\": \"https://uri.etsi.org/ngsi-ld/primer/streetAddress\",\n \"addressRegion\": \"https://uri.etsi.org/ngsi-ld/primer/addressRegion\",\n \"addressLocality\": \"https://uri.etsi.org/ngsi-ld/primer/addressLocality\",\n \"postalCode\": \"https://uri.etsi.org/ngsi-ld/primer/postalCode\"\n },\n \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld\"\n ],\n \"id\": \"urn:ngsi-ld:Store:001\",\n \"type\": \"Store\",\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Main Street 65\",\n \"addressRegion\": \"Metropolis\",\n \"addressLocality\": \"Duckburg\",\n \"postalCode\": \"42000\"\n }\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 57.4874121,\n -20.2845607\n ]\n }\n },\n \"storeName\": {\n \"type\": \"Property\",\n \"value\": \"Checker Market\"\n }\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [ + { + "name": "Create Store:001 - context in body", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/ld+json" + }, + { + "key": "Accept", + "value": "application/ld+json", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"@context\": [\n {\n \"Store\": \"https://uri.etsi.org/ngsi-ld/primer/Store\",\n \"address\": \"https://uri.etsi.org/ngsi-ld/primer/address\",\n \"storeName\": \"https://uri.etsi.org/ngsi-ld/primer/storeName\",\n \"streetAddress\": \"https://uri.etsi.org/ngsi-ld/primer/streetAddress\",\n \"addressRegion\": \"https://uri.etsi.org/ngsi-ld/primer/addressRegion\",\n \"addressLocality\": \"https://uri.etsi.org/ngsi-ld/primer/addressLocality\",\n \"postalCode\": \"https://uri.etsi.org/ngsi-ld/primer/postalCode\"\n },\n \"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld\"\n ],\n \"id\": \"urn:ngsi-ld:Store:001\",\n \"type\": \"Store\",\n \"address\": {\n \"type\": \"Property\",\n \"value\": {\n \"streetAddress\": \"Main Street 65\",\n \"addressRegion\": \"Metropolis\",\n \"addressLocality\": \"Duckburg\",\n \"postalCode\": \"42000\"\n }\n },\n \"location\": {\n \"type\": \"GeoProperty\",\n \"value\": {\n \"type\": \"Point\",\n \"coordinates\": [\n 57.4874121,\n -20.2845607\n ]\n }\n },\n \"storeName\": {\n \"type\": \"Property\",\n \"value\": \"Checker Market\"\n }\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "status": "Created", + "code": 201, + "_postman_previewlanguage": "plain", + "header": [ + { + "key": "vary", + "value": "Origin" + }, + { + "key": "vary", + "value": "Access-Control-Request-Method" + }, + { + "key": "vary", + "value": "Access-Control-Request-Headers" + }, + { + "key": "location", + "value": "/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001" + }, + { + "key": "x-content-type-options", + "value": "nosniff" + }, + { + "key": "x-xss-protection", + "value": "1; mode=block" + }, + { + "key": "cache-control", + "value": "no-cache, no-store, max-age=0, must-revalidate" + }, + { + "key": "pragma", + "value": "no-cache" + }, + { + "key": "expires", + "value": "0" + }, + { + "key": "strict-transport-security", + "value": "max-age=31536000 ; includeSubDomains" + }, + { + "key": "x-frame-options", + "value": "DENY" + }, + { + "key": "content-length", + "value": "0" + }, + { + "key": "date", + "value": "Wed, 26 Apr 2023 07:52:54 GMT" + }, + { + "key": "set-cookie", + "value": "0366a6e80ac49177aaea641818cde5c6=ecefc03f1774cb849d66f8dd3a9f7ec0; path=/; HttpOnly; Secure; SameSite=None" + } + ], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "Figure 5.4-1 - NGSI-LD Entity retrieval", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains entity to be found\", function () {\r", + " var entity = pm.response.json();\r", + " var keys = Object.keys(entity);\r", + " entityId = pm.collectionVariables.get(\"entityId\");\r", + " entityType = pm.collectionVariables.get(\"entityType\");\r", + " pm.expect(keys.length).to.eql(6);\r", + " pm.expect(keys).to.contain(\"id\");\r", + " pm.expect(keys).to.contain(\"type\"); \r", + " pm.expect(entity.id).to.eql(entityId);\r", + " pm.expect(entity.type).to.eql(entityType);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.1-1 - Create Store:002 - context in link header", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var entityId002 = payloadBody.id;", + "var entityType002 = payloadBody.type;", + "pm.collectionVariables.set(\"created002\", payloadBody);", + "pm.collectionVariables.set(\"entityId002\", entityId002);", + "pm.collectionVariables.set(\"entityType002\", entityType002);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test(\"Check location header\", function () {", + " pm.response.to.have.header(\"Location\");", + " pm.expect(pm.response.headers.get(\"Location\")).to.include(entityId002);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Store:002\",\r\n \"type\": \"Store\",\r\n \"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 4\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": {\r\n \"type\": \"Point\",\r\n \"coordinates\": [\r\n 57.5522,\r\n -20.3484\r\n ]\r\n },\r\n \"isMeasuredBy\": {\r\n \"type\": \"Relationship\",\r\n \"object\": \"urn:ngsi-ld:GPSTracker:001\"\r\n }\r\n },\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"6-Stars\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.1-3 - Create Shelf:123", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var entityId123 = payloadBody.id;", + "var entityType123 = payloadBody.type;", + "pm.collectionVariables.set(\"created123\", payloadBody);", + "pm.collectionVariables.set(\"entityId123\", entityId123);", + "pm.collectionVariables.set(\"entityType123\", entityType123);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test(\"Check location header\", function () {", + " pm.response.to.have.header(\"Location\");", + " pm.expect(pm.response.headers.get(\"Location\")).to.include(entityId123);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": " <{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text", + "disabled": true + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \t\"id\": \"urn:ngsi-ld:Shelf:123\",\r\n \t\"type\": \"Shelf\",\r\n \t\"maxCapacity\": {\r\n \t\t\"type\": \"Property\",\r\n \t\t\"value\": 100\r\n \t}\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.2-1 - Delete Entity Store:002", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:002", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:002" + ] + } + }, + "response": [] + }, + { + "name": "Re-create Entity Store:002", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var entityId002 = payloadBody.id;", + "var entityType002 = payloadBody.type;", + "pm.collectionVariables.set(\"created002\", payloadBody);", + "pm.collectionVariables.set(\"entityId002\", entityId002);", + "pm.collectionVariables.set(\"entityType002\", entityType002);", + "pm.test(\"Status code is 201\", function () {", + " pm.response.to.have.status(201);", + "});", + "pm.test(\"Check location header\", function () {", + " pm.response.to.have.header(\"Location\");", + " pm.expect(pm.response.headers.get(\"Location\")).to.include(entityId002);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Store:002\",\r\n \"type\": \"Store\",\r\n \"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 4\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": {\r\n \"type\": \"Point\",\r\n \"coordinates\": [\r\n 57.5522,\r\n -20.3484\r\n ]\r\n },\r\n \"isMeasuredBy\": {\r\n \"type\": \"Relationship\",\r\n \"object\": \"urn:ngsi-ld:GPSTracker:001\"\r\n }\r\n },\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"6-Stars\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.3-1 - Merge Entity urn:ngsi-ld:Store:002", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.address);", + "var address002 = payloadBody.address;", + "pm.collectionVariables.set(\"address002\", address002);", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/merge-patch+json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Store:002\",\r\n \"type\": \"Store\",\r\n\t\"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Superman Street 4\",\r\n \"addressRegion\": \"urn:ngsi-ld:null\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:002", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:002" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.3-3 - NGSI-LD Entity retrieval", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains merged Entity\", function () {\r", + " var entity = pm.response.json();\r", + " var keys = Object.keys(entity);\r", + " pm.expect(keys).to.contain(\"address\");\r", + " addressChanged = entity.address;\r", + " addressKeys = Object.keys(addressChanged.value);\r", + " pm.expect(addressKeys).to.contain(\"postalCode\");\r", + " pm.expect(addressKeys).to.contain(\"addressLocality\");\r", + " pm.expect(addressKeys).to.contain(\"streetAddress\");\r", + " pm.expect(addressKeys).to.not.contain(\"addressRegion\");\r", + " address002 = pm.collectionVariables.get(\"address002\");\r", + " pm.expect(addressChanged.value.streetAddress).eql(address002.value.streetAddress)\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:002", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:002" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.4-1 - Replace Entity urn:ngsi-ld:Store:002", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.address);", + "var address002replace = payloadBody.address;", + "var storeName002replace = payloadBody.storeName.value;", + "pm.collectionVariables.set(\"address002replace\", address002replace);", + "pm.collectionVariables.set(\"storeName002replace\", storeName002replace);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Store:002\",\r\n \"type\": \"Store\",\r\n\t\"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 4\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": {\r\n \"type\": \"Point\",\r\n \"coordinates\": [\r\n 57.5522,\r\n -20.3484\r\n ]\r\n }\r\n },\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"Luxury Store\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:002", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:002" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.2.4-3 - NGSI-LD Entity retrieval with sysAttrs included", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Validate that result contains replaced Entity\", function () {", + " var entity = pm.response.json();", + " var keys = Object.keys(entity);", + " var addressKeys = Object.keys(entity.address)", + " entityId002 = pm.collectionVariables.get(\"entityId002\");", + " entityType002 = pm.collectionVariables.get(\"entityType002\");", + " address002replace = pm.collectionVariables.get(\"address002replace\");", + " storeName002replace = pm.collectionVariables.get(\"storeName002replace\");", + " pm.expect(keys.length).to.eql(8);", + " pm.expect(keys).to.contain(\"id\");", + " pm.expect(keys).to.contain(\"type\"); ", + " pm.expect(keys).to.contain(\"createdAt\");", + " pm.expect(keys).to.contain(\"modifiedAt\"); ", + " pm.expect(entity.id).to.eql(entityId002);", + " pm.expect(entity.type).to.eql(entityType002);", + " pm.expect(address002replace.value.streetAddress).to.eql(entity.address.value.streetAddress);", + " pm.expect(addressKeys).to.contain(\"createdAt\");", + " pm.expect(addressKeys).to.contain(\"modifiedAt\");", + " pm.expect(storeName002replace).to.eql(entity.storeName.value);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/ld+json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:002?options=sysAttrs", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:002" + ], + "query": [ + { + "key": "options", + "value": "sysAttrs" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.1-1 - Append Relationship to Store:001", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var contains = payloadBody.contains.object;", + "pm.collectionVariables.set(\"contains\", contains);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"contains\":{\r\n \"type\":\"Relationship\",\r\n \"object\":\"urn:ngsi-ld:Shelf:123\",\r\n \"observedAt\":\"2019-09-09T14:09:07Z\"\r\n\t}\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve appended Entity Store:001", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains appended Entity\", function () {\r", + " var entity = pm.response.json();\r", + " var contains = pm.collectionVariables.get(\"contains\");\r", + " var appendedContains = entity.contains.object;\r", + " pm.expect(appendedContains).to.eql(contains);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.1-3 - Append Relationship to Shelf:123", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var isContainedIn = payloadBody.isContainedIn.object;", + "pm.collectionVariables.set(\"isContainedIn\", isContainedIn);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Link", + "type": "text", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"isContainedIn\":{\r\n \"type\":\"Relationship\",\r\n \"object\":\"urn:ngsi-ld:Store:001\",\r\n \"observedAt\":\"2019-09-09T14:09:07Z\"\r\n\t}\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:123/attrs", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Shelf:123", + "attrs" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve appended Entity Shelf:123", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains appended Entity\", function () {\r", + " var entity = pm.response.json();\r", + " var isContainedIn = pm.collectionVariables.get(\"isContainedIn\");\r", + " var appendedIsContainedIn = entity.isContainedIn.object;\r", + " pm.expect(appendedIsContainedIn).to.eql(isContainedIn);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Shelf:123", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Shelf:123" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.2-1- Update Entity Store:001", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "console.log(payloadBody.id);", + "var storeName = payloadBody.storeName.value;", + "pm.collectionVariables.set(\"storeName\", storeName);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"storeName\":{\r\n \"type\":\"Property\",\r\n \"value\":\"Mega Market\"\r\n\t}\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve updated Entity Store:001", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains updated Entity\", function () {\r", + " var entity = pm.response.json();\r", + " var storeName = pm.collectionVariables.get(\"storeName\");\r", + " var newStoreName = entity.storeName.value;\r", + " pm.expect(newStoreName).to.eql(storeName);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.3-1 - Partial Property Update Store:001 storeName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "var storeNameUpdated = payloadBody.value;", + "pm.collectionVariables.set(\"storeNameUpdated\", storeNameUpdated);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"value\": \"Mega Store\"\r\n} " + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs/storeName", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs", + "storeName" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve partially updated Entity Store:001", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains updated storeName\", function () {\r", + " var entity = pm.response.json();\r", + " var storeNameUpdated = pm.collectionVariables.get(\"storeNameUpdated\");\r", + " var newStoreName = entity.storeName.value;\r", + " pm.expect(newStoreName).to.eql(storeNameUpdated);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.3-3 - Partial Property of Relationship Update Store:001 contains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "var observedAt = payloadBody.observedAt;", + "pm.collectionVariables.set(\"observedAtUpdated\", observedAt);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Link", + "type": "text", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"observedAt\": \"2019-09-09T14:09:07Z\"\r\n} " + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs/storeName", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs", + "storeName" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve partially updated Entity Store:001 observedAt", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains correct observedAt timestamp\", function () {\r", + " var entity = pm.response.json();\r", + " var observedAtUpdated = pm.collectionVariables.get(\"observedAtUpdated\");\r", + " var observedAt = entity.storeName.observedAt;\r", + " var storeNameUpdated = pm.collectionVariables.get(\"storeNameUpdated\");\r", + " var newStoreName = entity.storeName.value;\r", + " pm.expect(observedAt).to.eql(observedAtUpdated);\r", + " pm.expect(newStoreName).to.eql(storeNameUpdated);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.4-1 - Delete Relationship contains", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Link", + "type": "text", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs/contains", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs", + "contains" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve Entity Store:001 without contains Relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result does not contain 'contains' relationship anymore\", function () {\r", + " var entity = pm.response.json();\r", + " var keys = Object.keys(entity);\r", + " pm.expect(keys).to.not.contain(\"contains\");\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 8.3.5-1 - Replace Property storeName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var payloadBody = JSON.parse(pm.request.body.raw);", + "var storeName = payloadBody.value;", + "pm.collectionVariables.set(\"storeNameReplaced\", storeName);", + "var owner = payloadBody.owner.object;", + "pm.collectionVariables.set(\"owner\", owner);", + "", + "pm.test(\"Status code is 204\", function () {", + " pm.response.to.have.status(204);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "PUT", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"type\": \"Property\",\r\n \"value\": \"Sustainable Shopping Market\",\r\n \"owner\": {\r\n \"type\": \"Relationship\",\r\n \"object\": \"urn:ngsi-ld:SustainableShopping:456\"\r\n },\r\n \"observedAt\": \"2023-08-03T16:00:05Z\"\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs/storeName", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs", + "storeName" + ] + } + }, + "response": [] + }, + { + "name": "Retrieve Entity Store:001 with replaced storeName", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "pm.test(\"Validate that result contains replaced storeName\", function () {\r", + " var entity = pm.response.json();\r", + " var storeNameReplaced = pm.collectionVariables.get(\"storeNameReplaced\");\r", + " \r", + " var owner = pm.collectionVariables.get(\"owner\");\r", + " var newStoreName = entity.storeName.value;\r", + " var ownerRel = entity.storeName.owner.object;\r", + " pm.expect(newStoreName).to.eql(storeNameReplaced);\r", + " pm.expect(owner).to.eql(ownerRel);\r", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "disabled": true + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.2.1-1 - Retrieve by id - simplified - application/json", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Validate that result contains the correct address and storeName\", function () {", + " var entity = pm.response.json();", + " ", + " var newStoreName = entity.storeName;", + " var address = entity.address;", + " var addressKeys = Object.keys(address);", + " pm.expect(addressKeys).to.contain(\"postalCode\");", + " pm.expect(addressKeys).to.contain(\"streetAddress\");", + " pm.expect(addressKeys).to.contain(\"addressRegion\");", + " var entity001 = pm.collectionVariables.get(\"created\");", + " var storeName = pm.collectionVariables.get(\"storeNameReplaced\");", + " pm.expect(address.streetAddress).eql(entity001.address.value.streetAddress)", + " pm.expect(newStoreName).eql(storeName)", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001?options=keyValues", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001" + ], + "query": [ + { + "key": "options", + "value": "keyValues" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.1-1 - Query by type", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(2);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:001\" || itemid===\"urn:ngsi-ld:Store:002\" )});", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.2-1 - Query by type - filter by name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:002\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store&q=storeName==\"Luxury Store\"", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + }, + { + "key": "q", + "value": "storeName==\"Luxury Store\"" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.2-3 - Query by type - filter by addressRegion", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:001\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store&q=address[addressRegion]==\"Metropolis\" ", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + }, + { + "key": "q", + "value": "address[addressRegion]==\"Metropolis\" " + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.2-4 - Query by type - filter by addressRegion AND addressLocality", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(0);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store&q=address[addressRegion]==\"Metropolis\"%3Baddress[addressLocality]==\"Cat City\"", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + }, + { + "key": "q", + "value": "address[addressRegion]==\"Metropolis\"%3Baddress[addressLocality]==\"Cat City\"" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.3-1 - Query by type - filter by isContainedIn Relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Shelf:123\" )", + " var isContainedIn = item.isContainedIn.object;", + " pm.expect(isContainedIn===\"urn:ngsi-ld:Store:001\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Shelf&q=isContainedIn==urn:ngsi-ld:Store:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Shelf" + }, + { + "key": "q", + "value": "isContainedIn==urn:ngsi-ld:Store:001" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.4-1 - Query by type - filter by meta information", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Shelf:123\" )", + " var observedAt = item.isContainedIn.observedAt;", + " pm.expect(observedAt===\"2019-09-09T14:09:07Z\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Shelf&q=isContainedIn.observedAt>=2019-09-09T14:09:07Z ", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Shelf" + }, + { + "key": "q", + "value": "isContainedIn.observedAt>=2019-09-09T14:09:07Z " + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.3.4-2 - Query by type - filter by meta information - no result", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(0);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Shelf&q=isContainedIn.observedAt>2019-09-09T14:09:07Z ", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Shelf" + }, + { + "key": "q", + "value": "isContainedIn.observedAt>2019-09-09T14:09:07Z " + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.4-1 - GeoQuery Stores", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:002\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store&geoproperty=location&georel=near%3BmaxDistance==1000&geometry=Point&coordinates=[57.5522023,-20.34840123]", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + }, + { + "key": "geoproperty", + "value": "location" + }, + { + "key": "georel", + "value": "near%3BmaxDistance==1000" + }, + { + "key": "geometry", + "value": "Point" + }, + { + "key": "coordinates", + "value": "[57.5522023,-20.34840123]" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.5-1 - Query by type - count", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"NGSILD-Results-Count header is present\", function () {", + " pm.response.to.have.header(\"NGSILD-Results-Count\");", + "});", + "", + "var countHeader = pm.response.headers.get(\"NGSILD-Results-Count\");", + " pm.expect(countHeader).eql(\"2\");", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities?type=Store&count=true&limit=0", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Store" + }, + { + "key": "count", + "value": "true" + }, + { + "key": "limit", + "value": "0" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.1-1 - POST Query by type", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(2);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:001\" || itemid===\"urn:ngsi-ld:Store:002\" )});", + "})", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ]\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.2-1 - POST Query by type - filter by name", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:002\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ],\n \"q\": \"storeName==\\\"Luxury Store\\\"\"\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.2-2 - POST Query by type - filter by addressRegion", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:001\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ],\n \"q\": \"address[addressRegion]==\\\"Metropolis\\\"\"\n}\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.2-3 - POST Query by type - filter by addressRegion AND addressLocality", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(0);", + "});", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ],\n \"q\": \"address[addressRegion]==\\\"Metropolis\\\";address[addressLocality]==\\\"Cat City\\\"\"\n}\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.3-1 - POST Query by type - filter by isContainedIn Relationship", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Shelf:123\" )", + " var isContainedIn = item.isContainedIn.object;", + " pm.expect(isContainedIn===\"urn:ngsi-ld:Store:001\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Shelf\"\n }\n ],\n \"q\": \"isContainedIn==urn:ngsi-ld:Store:001\"\n}\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.4-1 - POST Query by type - filter by meta information", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Shelf:123\" )", + " var observedAt = item.isContainedIn.observedAt;", + " pm.expect(observedAt===\"2019-09-09T14:09:07Z\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Shelf\"\n }\n ],\n \"q\": \"isContainedIn.observedAt>=2019-09-09T14:09:07Z\"\n}\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.4-2 - POST Query by type - filter by meta information - no result", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(0);", + "});" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Shelf\"\n }\n ],\n \"q\": \"isContainedIn.observedAt>2019-09-09T14:09:07Z\"\n}\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.2.5-1 - POST GeoQuery Stores", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Validate that result on contains entity to be found\", function () {", + " pm.expect(jsonData.length).to.eql(1);", + "});", + "", + "pm.test('The result includes only the expected entities', () => {", + " _.each(jsonData, (item) => {", + " var itemid = item.id;", + " pm.expect(itemid===\"urn:ngsi-ld:Store:002\" )});", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ],\n \"geoQ\": {\n \"geoproperty\": \"location\",\n \"georel\": \"near;maxDistance==1000\",\n \"geometry\": \"Point\",\n \"coordinates\": [\n 57.5522023,\n -20.34840123\n ]\n }\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ] + } + }, + "response": [] + }, + { + "name": "Figure 9.6.3-1 - POST Query by type - count", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"NGSILD-Results-Count header is present\", function () {", + " pm.response.to.have.header(\"NGSILD-Results-Count\");", + "});", + "", + "var countHeader = pm.response.headers.get(\"NGSILD-Results-Count\");", + " pm.expect(countHeader).eql(\"2\");", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"type\": \"Query\",\n \"entities\": [\n {\n \"type\": \"Store\"\n }\n ]\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/query?count=true&limit=0", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "query" + ], + "query": [ + { + "key": "count", + "value": "true" + }, + { + "key": "limit", + "value": "0" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 10.2.1-1 - Subscription Stores (storeName)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"id\": \"urn:ngsi-ld:Subscription:storeSubscription\",\r\n \t\"type\": \"Subscription\",\r\n \t\"entities\": [\r\n\t\t{\r\n\t\t\t\"type\": \"Store\"\r\n \t\t}\r\n\t],\r\n \t\"watchedAttributes\": [\"storeName\"],\r\n \"notification\": {\r\n \t\"attributes\": [\"storeName\",\"address\"],\r\n \t\"format\": \"normalized\",\r\n \t\"endpoint\": {\r\n \t\"uri\": \"{{notificationURL}}\",\r\n \t\"accept\": \"application/json\"\r\n \t}\r\n }\r\n}\r\n" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/subscriptions", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions" + ] + } + }, + "response": [] + }, + { + "name": "Figure 10.2.1-2 - Partial Property Update Store:001 storeName", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"value\": \"Mega Store\"\r\n} " + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/urn:ngsi-ld:Store:001/attrs/storeName", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "urn:ngsi-ld:Store:001", + "attrs", + "storeName" + ] + } + }, + "response": [] + }, + { + "name": "Figure 10.2.1-4 - Create Store:003 - context in link header", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Store:003\",\r\n \"type\": \"Store\",\r\n\t\"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Lion Street 25\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n\t\"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": {\r\n \t\t\t\"type\": \"Point\",\r\n \t\t\t\"coordinates\": [\r\n \t\t\t\t57.5722,\r\n \t\t\t\t-20.3584\r\n \t\t\t]\r\n \t\t\t} \r\n\t},\r\n \t\"storeName\": {\r\n \t\"type\": \"Property\",\r\n \t\"value\": \"Giga Market\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Figure 10.2.2-1 - Interval Subscription Stores (storeName)", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"id\": \"urn:ngsi-ld:Subscription:intervalStoreSubscription\",\r\n \t\"type\": \"Subscription\",\r\n \t\"entities\": [\r\n\t\t{\r\n\t\t\t\"type\": \"Store\"\r\n \t\t}\r\n\t],\r\n \t\"timeInterval\": 60,\r\n \"notification\": {\r\n \t\"attributes\": [\"storeName\",\"address\"],\r\n \t\"format\": \"normalized\",\r\n \t\"endpoint\": {\r\n \t\"uri\": \"{{notificationURL}}\",\r\n \t\"accept\": \"application/json\"\r\n \t}\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/subscriptions", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions" + ] + } + }, + "response": [] + }, + { + "name": "Figure 10.2.2-3 - Retrieve intervalStoreSubscription", + "request": { + "method": "GET", + "header": [ + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:intervalStoreSubscription", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:intervalStoreSubscription" + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.2-1 - Create Store:004 and Shelf:234", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n {\r\n \"id\": \"urn:ngsi-ld:Store:004\",\r\n \"type\": \"Store\",\r\n \"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 7\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": { \r\n \"type\": \"Point\", \r\n \"coordinates\": [57.5522, -20.3484] \r\n }\r\n },\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"6-Stars\"\r\n },\r\n \"contains\":{\r\n \"type\":\"Relationship\",\r\n \"object\":\"urn:ngsi-ld:Shelf:123\",\r\n \"observedAt\":\"2019-09-11T17:11:07Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"urn:ngsi-ld:Shelf:234\",\r\n \"type\": \"Shelf\",\r\n \"maxCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": 80\r\n }\r\n }\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/create", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "create" + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.3-1 - Update Store:004 and Shelf:234", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n {\r\n \"id\": \"urn:ngsi-ld:Store:004\",\r\n \"type\": \"Store\",\r\n \"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 7\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n },\r\n \"observedAt\": \"2019-09-12T17:11:07Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"urn:ngsi-ld:Shelf:234\",\r\n \"type\": \"Shelf\",\r\n \"maxCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": 85\r\n }\r\n }\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/update", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "update" + ], + "query": [ + { + "key": "options", + "value": "noOverwrite", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.3-3 - Update Store:004 and Shelf:234 with noOverwrite", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n {\r\n \"id\": \"urn:ngsi-ld:Store:004\",\r\n \"type\": \"Store\",\r\n \"owner\": {\r\n \"type\": \"Property\",\r\n \"value\": \"John Doe\"\r\n }\r\n },\r\n {\r\n \"id\": \"urn:ngsi-ld:Shelf:234\",\r\n \"type\": \"Shelf\",\r\n \"minCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": \"65\"\r\n }\r\n }\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/update?options=noOverwrite", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "update" + ], + "query": [ + { + "key": "options", + "value": "noOverwrite" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.4-1 - Upsert Store:004 and Shelf:345", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n {\r\n \"id\": \"urn:ngsi-ld:Store:004\",\r\n \"type\": \"Store\",\r\n \"address\": {\r\n \"type\": \"Property\",\r\n \"value\": {\r\n \"streetAddress\": \"Tiger Street 7\",\r\n \"addressRegion\": \"Metropolis\",\r\n \"addressLocality\": \"Cat City\",\r\n \"postalCode\": \"42420\"\r\n }\r\n },\r\n \"location\": {\r\n \"type\": \"GeoProperty\",\r\n \"value\": { \r\n \"type\": \"Point\", \r\n \"coordinates\": [57.5522, -20.3484] \r\n }\r\n },\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"6-Stars\"\r\n },\r\n \"contains\":{\r\n \"type\":\"Relationship\",\r\n \"object\":\"urn:ngsi-ld:Shelf:345\",\r\n \"observedAt\":\"2019-09-11T17:11:07Z\"\r\n }\r\n },\r\n {\r\n \"id\": \"urn:ngsi-ld:Shelf:345\",\r\n \"type\": \"Shelf\",\r\n \"minCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": \"65\"\r\n }\r\n }\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/upsert", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "upsert" + ], + "query": [ + { + "key": "options", + "value": "replace", + "disabled": true + }, + { + "key": "options", + "value": "update", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.4-3 - Upsert Store:004 and Shelf:345 with options=update", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n {\r\n \"id\": \"urn:ngsi-ld:Store:004\",\r\n \"type\": \"Store\",\r\n \"storeName\": {\r\n \"type\": \"Property\",\r\n \"value\": \"12-Stars\"\r\n }\r\n },\r\n {\r\n \"id\": \"urn:ngsi-ld:Shelf:345\",\r\n \"type\": \"Shelf\",\r\n \"minCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": \"40\"\r\n },\r\n \"maxCapacity\": {\r\n \"type\": \"Property\",\r\n \"value\": \"80\"\r\n }\r\n }\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/upsert?options=update", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "upsert" + ], + "query": [ + { + "key": "options", + "value": "replace", + "disabled": true + }, + { + "key": "options", + "value": "update" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 11.5-1 - Delete Store:004 and Shelf:345", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n \"urn:ngsi-ld:Store:004\",\r\n \"urn:ngsi-ld:Shelf:345\"\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/delete", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "delete" + ], + "query": [ + { + "key": "options", + "value": "replace", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.2.1-1 - Retrieve Available Entity Type", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/types/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "types", + "" + ], + "query": [ + { + "key": "details", + "value": "false", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.2.1-3- Retrieve Details of Available Entity Types", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/types/?details=true", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "types", + "" + ], + "query": [ + { + "key": "details", + "value": "true" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.2.2-1- Retrieve Available Entity Type Information", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/types/Store", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "types", + "Store" + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.3.1-1 - Retrieve Available Attributes", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/attributes/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "attributes", + "" + ], + "query": [ + { + "key": "details", + "value": "false", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.3.1-3 - Retrieve Details of Available Attributes", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/attributes/?details=true", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "attributes", + "" + ], + "query": [ + { + "key": "details", + "value": "true" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 12.3.2-1 - Retrieve Available Attribute Information", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/attributes/address", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "attributes", + "address" + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.1-1 - Create or Update EntityTemporal Wine:001", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"id\": \"urn:ngsi-ld:Wine:001\",\r\n \"type\": \"Wine\",\r\n \"price\": {\r\n \"type\": \"Property\",\r\n \"value\": 7.83,\r\n \"observedAt\": \"2021-04-04T11:40:00.000000Z\"\r\n },\r\n \"quantity\": {\r\n \"type\": \"Property\",\r\n \"value\": 20,\r\n \"observedAt\": \"2021-04-04T11:40:00.000000Z\"\r\n },\r\n \"putBackOnShelf\": {\r\n \"type\": \"Relationship\",\r\n \"object\": \"urn:ngsi-ld:Shelf:234\",\r\n \"observedAt\": \"2021-04-04T11:40:00.000000Z\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "" + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.2.1-1 - Create or Update Attribute of EntityTemporal Wine:001", + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"price\": {\r\n \"type\": \"Property\",\r\n \"value\": 7.90,\r\n \"observedAt\": \"2021-04-04T11:42:00.000000Z\"\r\n },\r\n \"brand\": {\r\n \"type\": \"Property\",\r\n \"value\": \"Corvo\",\r\n \"observedAt\": \"2021-04-04T11:42:00.000000Z\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001/attrs", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001", + "attrs" + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.2.2-1 - Delete Attribute of EntityTemporal Wine:001", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001/attrs/brand", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001", + "attrs", + "brand" + ], + "query": [ + { + "key": "deleteAll", + "value": "true", + "disabled": true + }, + { + "key": "datasetId", + "value": null, + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.3.1-1 - Modify Attribute instance of EntityTemporal Wine:001", + "request": { + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n \"price\": {\r\n \"type\": \"Property\",\r\n \"value\": 8.10,\r\n \"observedAt\": \"2021-04-04T11:42:00.000000Z\"\r\n }\r\n}" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001/attrs/price/:instanceId", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001", + "attrs", + "price", + ":instanceId" + ], + "variable": [ + { + "key": "instanceId", + "value": "urn:ngsi-ld:29e74a25-65c6-4371-98dc-1a97b3be5ab7" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.3.2-1 - Delete Attribute instance of EntityTemporal Wine:001", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001/attrs/price/:instanceId", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001", + "attrs", + "price", + ":instanceId" + ], + "variable": [ + { + "key": "instanceId", + "value": "urn:ngsi-ld:29e74a25-65c6-4371-98dc-1a97b3be5ab7" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.4.2-1 - Retrieve EntityTemporal Entity Type", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001" + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.4.3-1 - Retrieve Temporal Evolution of Wine Entities", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities?type=Wine&timeproperty=observedAt&timerel=before&timeAt=2021-04-04T11:41:00.000000Z", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Wine" + }, + { + "key": "timeproperty", + "value": "observedAt", + "description": "observedAt, createdAt, modifiedAt, deletedAt" + }, + { + "key": "timerel", + "value": "before", + "description": "before, after, between" + }, + { + "key": "timeAt", + "value": "2021-04-04T11:41:00.000000Z" + }, + { + "key": "endTimeAt", + "value": "", + "description": "Timestamp needed for \"between\"", + "disabled": true + }, + { + "key": "lastN", + "value": "", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.4.3-3 - Retrieve Temporal Evolution of Entities with lastN", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities?type=Wine&timeproperty=createdAt&timerel=after&timeAt=2021-04-04T11:40:00.000000Z&lastN=1", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Wine" + }, + { + "key": "timeproperty", + "value": "createdAt", + "description": "observedAt, createdAt, modifiedAt, deletedAt" + }, + { + "key": "timerel", + "value": "after", + "description": "before, after, between" + }, + { + "key": "timeAt", + "value": "2021-04-04T11:40:00.000000Z" + }, + { + "key": "endTimeAt", + "value": "", + "description": "Timestamp needed for \"between\"", + "disabled": true + }, + { + "key": "lastN", + "value": "1" + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.4.4-1 - Retrieve the average and maximum value of price", + "request": { + "method": "GET", + "header": [ + { + "key": "Content-Type", + "type": "text", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities?type=Wine&timerel=after&timeAt=2020-04-04T11:38:00.000000Z&options=aggregatedValues&attrs=ngsi-ld:primer/price&aggrMethods=max,avg", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities" + ], + "query": [ + { + "key": "type", + "value": "Wine" + }, + { + "key": "timerel", + "value": "after", + "description": "before, after, between" + }, + { + "key": "timeAt", + "value": "2020-04-04T11:38:00.000000Z" + }, + { + "key": "endTimeAt", + "value": "", + "description": "Timestamp needed for \"between\"", + "disabled": true + }, + { + "key": "lastN", + "value": "1", + "disabled": true + }, + { + "key": "timeproperty", + "value": "observedAt", + "description": "Default is observedAt", + "disabled": true + }, + { + "key": "options", + "value": "aggregatedValues", + "description": "Set aggregatedValues if aggrMethods is present" + }, + { + "key": "attrs", + "value": "ngsi-ld:primer/price" + }, + { + "key": "aggrMethods", + "value": "max,avg" + }, + { + "key": "aggrPeriodDuration", + "value": "PT0S", + "description": "Default is PT0S", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Figure 13.3.4-1 - Delete EntityTemporal Wine:001", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "url": { + "raw": "{{broker}}/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Wine:001", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "temporal", + "entities", + "urn:ngsi-ld:Wine:001" + ] + } + }, + "response": [] + }, + { + "name": "Clean Up", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 204\", function () {\r", + " pm.response.to.have.status(204);\r", + "});\r", + "pm.collectionVariables.clear();" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Link", + "value": "<{{link}}>; rel=\"http://www.w3.org/ns/json-ld#context\"; type=\"application/ld+json\"", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "[\r\n \"urn:ngsi-ld:Store:001\",\r\n \"urn:ngsi-ld:Store:002\",\r\n \"urn:ngsi-ld:Shelf:123\"\r\n]" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/entityOperations/delete", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "entityOperations", + "delete" + ], + "query": [ + { + "key": "options", + "value": "replace", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Clean Up - Delete subscription storeSubscription", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:storeSubscription", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:storeSubscription" + ] + } + }, + "response": [] + }, + { + "name": "Clean Up - Delete subscription intervalStoreSubscription", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Content-Type", + "value": "application/json" + }, + { + "key": "Accept", + "value": "application/ld+json" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{broker}}/ngsi-ld/v1/subscriptions/urn:ngsi-ld:Subscription:intervalStoreSubscription", + "host": [ + "{{broker}}" + ], + "path": [ + "ngsi-ld", + "v1", + "subscriptions", + "urn:ngsi-ld:Subscription:intervalStoreSubscription" + ] + } + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/primer/store-context.jsonld b/primer/store-context.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..87542a8978071117b0f0e14855d0415c27d7d124 --- /dev/null +++ b/primer/store-context.jsonld @@ -0,0 +1,40 @@ +{ + "@context": [{ + "Customer": "https://uri.etsi.org/ngsi-ld/primer/Customer", + "InventoryItem": "https://uri.etsi.org/ngsi-ld/primer/InventoryItem", + "Product": "https://uri.etsi.org/ngsi-ld/primer/Product", + "Shelf": "https://uri.etsi.org/ngsi-ld/primer/Shelf", + "Store": "https://uri.etsi.org/ngsi-ld/primer/Store", + "Wine": "https://uri.etsi.org/ngsi-ld/primer/Wine", + "address": "https://uri.etsi.org/ngsi-ld/primer/address", + "addressLocality": "https://uri.etsi.org/ngsi-ld/primer/addressLocality", + "addressRegion": "https://uri.etsi.org/ngsi-ld/primer/addressRegion", + "brand": "https://uri.etsi.org/ngsi-ld/primer/brand", + "contains": "https://uri.etsi.org/ngsi-ld/primer/contains", + "customerName": "https://uri.etsi.org/ngsi-ld/primer/customerName", + "hasPurchased": "https://uri.etsi.org/ngsi-ld/primer/hasPurchased", + "hasPurchasedAt": "https://uri.etsi.org/ngsi-ld/primer/hasPurchasedAt", + "hasVisited": "https://uri.etsi.org/ngsi-ld/primer/hasVisited", + "holds": "https://uri.etsi.org/ngsi-ld/primer/holds", + "isContainedIn": "https://uri.etsi.org/ngsi-ld/primer/isContainedIn", + "isHeldIn": "https://uri.etsi.org/ngsi-ld/primer/isHeldIn", + "isInventoryOf": "https://uri.etsi.org/ngsi-ld/primer/isInventoryOf", + "isMeasuredBy": "https://uri.etsi.org/ngsi-ld/primer/isMeasuredBy", + "maxCapacity": "https://uri.etsi.org/ngsi-ld/primer/maxCapacity", + "minCapacity": https://uri.etsi.org/ngsi-ld/primer/minCapacity, + "owner": "https://uri.etsi.org/ngsi-ld/primer/owner", + "postalCode": "https://uri.etsi.org/ngsi-ld/primer/postalCode", + "price": "https://uri.etsi.org/ngsi-ld/primer/price", + "productName": "https://uri.etsi.org/ngsi-ld/primer/productName", + "putBackOnShelf": "https://uri.etsi.org/ngsi-ld/primer/putBackOnShelf", + "quantity": "https://uri.etsi.org/ngsi-ld/primer/quantity", + "relatesTo": "https://uri.etsi.org/ngsi-ld/primer/relatesTo", + "shelfCount": "https://uri.etsi.org/ngsi-ld/primer/shelfCount", + "size": "https://uri.etsi.org/ngsi-ld/primer/size", + "stockCount": "https://uri.etsi.org/ngsi-ld/primer/stockCount", + "storeName": "https://uri.etsi.org/ngsi-ld/primer/storeName", + "streetAddress": "https://uri.etsi.org/ngsi-ld/primer/streetAddress" + }, + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.7.jsonld" + ] +} \ No newline at end of file