From 240d91f1aa04dd99d60a87e7520b0fe29635a15f Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 18 Aug 2026 18:01:39 +0200 Subject: [PATCH] fix: first and second point bullet point --- .../Entity/QueryEntities/019_02_04.robot | 2 +- .../Entity/RetrieveEntity/D010_01_aux.robot | 4 ++-- .../AppendEntityAttributes/D003_01_inc.robot | 12 +++++----- .../AppendEntityAttributes/D003_02_inc.robot | 12 +++++----- ...t-source-registration-expanded-format.json | 8 +++---- .../two-types-vehicle-offstreetparking.jsonld | 4 ++-- .../entities/expectations/two-vehicles.jsonld | 4 ++-- ...ehicle-simple-attributes-core-context.json | 2 +- .../vehicle-speed-isParked-fragment.jsonld | 22 +++++++++++++++++++ .../expectations/entity-type-023-01-01.json | 2 +- .../ngsi-ld-test-suite-compound.jsonld | 2 +- 11 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot index a7083952..f27030a9 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_04.robot @@ -16,7 +16,7 @@ ${building_filename}= building-minimal.jsonld ${vehicle_filename}= vehicle-simple-attributes.jsonld ${expectation_filename}= vehicle-simple-attributes-core-context.json ${attribute_brandname}= https://ngsi-ld-test-suite/context#brandName -${attribute_isparked}= https://uri.etsi.org/ngsi-ld/default-context/isParked +${attribute_isparked}= https://ngsi-ld-test-suite/context#isParked *** Test Cases *** diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot index d57b7a33..7e3f7785 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot @@ -19,7 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-attributes-second.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld ${fragment_filename} vehicle-brandname-fragment.json -${expected_attribute} brandName +${expected_attribute} https://ngsi-ld-test-suite/context#brandName *** Test Cases *** @@ -35,7 +35,7 @@ D010_01_aux Retrieve Entity That Exists On Both The Context Source And The Conte # mock ends up sending headers only). Serialise to a JSON string first. ${entity_body_json}= Evaluate json.dumps($entity_body) json Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body_json} - ${response}= Retrieve Entity ${entity_id} context=${ngsild_test_suite_context} + ${response}= Retrieve Entity ${entity_id} Check Response Status Code 200 ${response.status_code} Check Response Body Containing an Attribute set to diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot index 61eb57b1..34a5a6cb 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_01_inc.robot @@ -16,8 +16,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_payload_filename} vehicle-simple-attributes.jsonld -${fragment_filename} vehicle-speed-isParked-fragment.json +${fragment_filename} vehicle-speed-isParked-fragment.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${expected_attribute_isParked} https://ngsi-ld-test-suite/context#isParked +${expected_attribute_speed} https://ngsi-ld-test-suite/context#speed *** Test Cases *** D003_01_inc Append Entity Attribute @@ -25,22 +27,22 @@ D003_01_inc Append Entity Attribute [Tags] since_v1.6.1 dist-ops 4_3_3 cf_04 additive-inclusive 4_3_6_2 5_6_3 ${response}= Retrieve Entity ${entity_id} - ${old_body}= Get From Dictionary ${response.json()} isParked + ${old_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} Set Stub Reply POST /ngsi-ld/v1/entities/${entity_id}/attrs/ 204 ${response}= Append Entity Attributes ... ${entity_id} ... ${fragment_filename} - ... ${CONTENT_TYPE_JSON} + ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 204 ${response.status_code} ${stub_count}= Get Stub Count POST /ngsi-ld/v1/entities/${entity_id}/attrs/ Should Be Equal As Integers ${stub_count} 1 ${response}= Retrieve Entity ${entity_id} - ${new_body}= Get From Dictionary ${response.json()} isParked + ${new_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} - Should Have Value In Json ${response.json()} $.speed + Should Contain ${response.json()} ${expected_attribute_speed} Should Not Be Equal ${old_body} ${new_body} *** Keywords *** diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot index 7b762d99..451f1ea8 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/AppendEntityAttributes/D003_02_inc.robot @@ -15,8 +15,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_payload_filename} vehicle-simple-attributes.jsonld -${fragment_filename} vehicle-speed-isParked-fragment.json +${fragment_filename} vehicle-speed-isParked-fragment.jsonld ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${expected_attribute_isParked} https://ngsi-ld-test-suite/context#isParked +${expected_attribute_speed} https://ngsi-ld-test-suite/context#speed *** Test Cases *** D003_02_inc Append Entity Attribute @@ -24,13 +26,13 @@ D003_02_inc Append Entity Attribute [Tags] since_v1.6.1 dist-ops 4_3_3 cf_04 additive-inclusive 4_3_6_2 5_6_3 ${response}= Retrieve Entity ${entity_id} - ${old_body}= Get From Dictionary ${response.json()} isParked + ${old_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} Set Stub Reply POST /ngsi-ld/v1/entities/${entity_id}/attrs/ 207 ${response}= Append Entity Attributes With Parameters ... ${entity_id} ... ${fragment_filename} - ... ${CONTENT_TYPE_JSON} + ... ${CONTENT_TYPE_LD_JSON} ... noOverwrite Wait For Request Check Response Status Code 207 ${response.status_code} @@ -39,8 +41,8 @@ D003_02_inc Append Entity Attribute Should Contain ${stub} noOverwrite ${response}= Retrieve Entity ${entity_id} - ${new_body}= Get From Dictionary ${response.json()} isParked - Should Have Value In Json ${response.json()} $.speed + ${new_body}= Get From Dictionary ${response.json()} ${expected_attribute_isParked} + Should Contain ${response.json()} ${expected_attribute_speed} Should Be Equal ${old_body} ${new_body} *** Keywords *** diff --git a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json index 03e4a0d1..9cc4dd2d 100644 --- a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json +++ b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json @@ -7,7 +7,7 @@ "entities": [ { "id": "urn:ngsi-ld:Vehicle:A456", - "type": "https://ngsi-ld-test-suite/context#Vehicle" + "type": ["https://ngsi-ld-test-suite/context#Vehicle"] } ], "propertyNames": [ @@ -15,17 +15,17 @@ "https://ngsi-ld-test-suite/context#speed" ], "relationshipNames": [ - "isParked" + "https://ngsi-ld-test-suite/context#isParked" ] }, { "entities": [ { - "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"], "idPattern": ".*downtown$" }, { - "type": "https://ngsi-ld-test-suite/context#OffStreetParking", + "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"], "idPattern": ".*47$" } ], diff --git a/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld b/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld index bb08a6df..f85ae76a 100644 --- a/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld +++ b/data/entities/expectations/two-types-vehicle-offstreetparking.jsonld @@ -6,7 +6,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", @@ -28,7 +28,7 @@ "type": "Relationship", "object": "urn:ngsi-ld:Camera:C1" }, - "reliability": { + "https://ngsi-ld-test-suite/context#reliability": { "type": "Property", "value": 0.7 }, diff --git a/data/entities/expectations/two-vehicles.jsonld b/data/entities/expectations/two-vehicles.jsonld index 6cf1695f..7af2714d 100644 --- a/data/entities/expectations/two-vehicles.jsonld +++ b/data/entities/expectations/two-vehicles.jsonld @@ -6,7 +6,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", @@ -26,7 +26,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", diff --git a/data/entities/expectations/vehicle-simple-attributes-core-context.json b/data/entities/expectations/vehicle-simple-attributes-core-context.json index 54eca925..bd9f3348 100644 --- a/data/entities/expectations/vehicle-simple-attributes-core-context.json +++ b/data/entities/expectations/vehicle-simple-attributes-core-context.json @@ -5,7 +5,7 @@ "type": "Property", "value": "Mercedes" }, - "isParked": { + "https://ngsi-ld-test-suite/context#isParked": { "type": "Relationship", "providedBy": { "type": "Relationship", diff --git a/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld b/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld new file mode 100644 index 00000000..1b5f3498 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-speed-isParked-fragment.jsonld @@ -0,0 +1,22 @@ +{ + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + } + }, + "speed": { + "type": "Property", + "value": 99, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/types/expectations/entity-type-023-01-01.json b/data/types/expectations/entity-type-023-01-01.json index a1923831..5a112c41 100644 --- a/data/types/expectations/entity-type-023-01-01.json +++ b/data/types/expectations/entity-type-023-01-01.json @@ -16,7 +16,7 @@ "typeName":"https://ngsi-ld-test-suite/context#Vehicle", "attributeNames":[ "https://ngsi-ld-test-suite/context#brandName", - "isParked" + "https://ngsi-ld-test-suite/context#isParked" ] } ] \ No newline at end of file diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld index 512d86a4..81a01dfa 100644 --- a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld +++ b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld @@ -1,6 +1,6 @@ { "@context": [ - "ngsi-ld-test-suite.jsonld", + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld", "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.9.jsonld" ] } -- GitLab