From 6cbcc904d61d214ad3f0108b1de3cd5d6049b3db Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 1 Jul 2026 18:26:28 +0200 Subject: [PATCH] feat: add TCs for the concise representation --- .pre-commit-config.yaml | 2 +- .../Entity/QueryEntities/019_31.robot | 68 +++++++++++++++ .../Entity/RetrieveEntity/018_05.robot | 30 ++++--- .../Entity/RetrieveEntity/018_08.robot | 22 +++-- .../Entity/RetrieveEntity/018_09.robot | 22 +++-- .../Entity/RetrieveEntity/018_23.robot | 87 +++++++++++++++++++ .../Entities/CreateEntity/001_16.robot | 71 +++++++++++++++ .../Entities/MergeEntity/056_11.robot | 52 +++++++++++ .../Entities/ReplaceEntity/054_05.robot | 52 +++++++++++ .../AppendEntityAttributes/010_13.robot | 49 +++++++++++ .../ReplaceEntityAttribute/055_04.robot | 57 ++++++++++++ .../UpdateEntityAttributes/011_10.robot | 49 +++++++++++ .../046_44.robot | 60 +++++++++++++ ...uilding-advanced-attributes-concise.jsonld | 23 +++++ .../building-geoproperty-concise.jsonld | 23 +++++ .../building-merge-replace-concise.jsonld | 11 +++ .../building-mixed-normalized-concise.jsonld | 15 ++++ ...g-multi-instances-attribute-concise.jsonld | 17 ++++ .../building-property-shapes-concise.jsonld | 17 ++++ .../building-relationship-concise.jsonld | 10 +++ .../building-sub-attribute-concise.jsonld | 14 +++ ...ilding-advanced-attributes-normalized.json | 23 +++++ .../concise/building-append-normalized.json | 12 +++ ...ttributes-instances-and-types-concise.json | 62 +++++++++++++ .../building-geoproperty-normalized.json | 24 +++++ ...building-json-property-object-concise.json | 12 +++ ...-property-object-sub-property-concise.json | 13 +++ .../building-language-property-concise.json | 10 +++ ...anguage-property-sub-property-concise.json | 11 +++ .../building-location-attribute-concise.json | 13 +++ .../concise/building-merge-normalized.json | 26 ++++++ .../concise/building-mixed-normalized.json | 16 ++++ ...-multi-instances-attribute-normalized.json | 16 ++++ ...ng-multi-instances-attributes-concise.json | 30 +++++++ ...ding-multivalued-relationship-concise.json | 10 +++ ...observation-space-geoproperty-concise.json | 11 +++ ...g-operation-space-geoproperty-concise.json | 31 +++++++ .../building-property-shapes-normalized.json | 22 +++++ .../building-relationship-concise.json | 7 ++ .../building-relationship-normalized.json | 8 ++ ...building-replace-attribute-normalized.json | 22 +++++ .../concise/building-replace-normalized.json | 12 +++ .../building-simple-attributes-concise.json | 12 +++ .../building-sub-attribute-normalized.json | 13 +++ ...ing-two-geometry-attribute-concise.geojson | 24 +++++ .../concise/building-update-normalized.json | 22 +++++ ...uilding-vocab-property-string-concise.json | 7 ++ .../building-append-fragment-concise.jsonld | 9 ++ .../building-replace-attribute-concise.json | 3 + .../building-update-fragment-concise.jsonld | 7 ++ data/entities/vehicle-scope-attribute.json | 4 +- ...cation-attribute-concise-notification.json | 12 +++ ...ding-entities-entityCreated-concise.jsonld | 22 +++++ doc/analysis/requests.py | 4 +- .../ContextInformationConsumption.resource | 2 + 55 files changed, 1256 insertions(+), 27 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_31.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_23.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_16.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/MergeEntity/056_11.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/ReplaceEntity/054_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_13.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/ReplaceEntityAttribute/055_04.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_10.robot create mode 100644 TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_44.robot create mode 100644 data/entities/concise/building-advanced-attributes-concise.jsonld create mode 100644 data/entities/concise/building-geoproperty-concise.jsonld create mode 100644 data/entities/concise/building-merge-replace-concise.jsonld create mode 100644 data/entities/concise/building-mixed-normalized-concise.jsonld create mode 100644 data/entities/concise/building-multi-instances-attribute-concise.jsonld create mode 100644 data/entities/concise/building-property-shapes-concise.jsonld create mode 100644 data/entities/concise/building-relationship-concise.jsonld create mode 100644 data/entities/concise/building-sub-attribute-concise.jsonld create mode 100644 data/entities/expectations/concise/building-advanced-attributes-normalized.json create mode 100644 data/entities/expectations/concise/building-append-normalized.json create mode 100644 data/entities/expectations/concise/building-different-attributes-instances-and-types-concise.json create mode 100644 data/entities/expectations/concise/building-geoproperty-normalized.json create mode 100644 data/entities/expectations/concise/building-json-property-object-concise.json create mode 100644 data/entities/expectations/concise/building-json-property-object-sub-property-concise.json create mode 100644 data/entities/expectations/concise/building-language-property-concise.json create mode 100644 data/entities/expectations/concise/building-language-property-sub-property-concise.json create mode 100644 data/entities/expectations/concise/building-location-attribute-concise.json create mode 100644 data/entities/expectations/concise/building-merge-normalized.json create mode 100644 data/entities/expectations/concise/building-mixed-normalized.json create mode 100644 data/entities/expectations/concise/building-multi-instances-attribute-normalized.json create mode 100644 data/entities/expectations/concise/building-multi-instances-attributes-concise.json create mode 100644 data/entities/expectations/concise/building-multivalued-relationship-concise.json create mode 100644 data/entities/expectations/concise/building-observation-space-geoproperty-concise.json create mode 100644 data/entities/expectations/concise/building-operation-space-geoproperty-concise.json create mode 100644 data/entities/expectations/concise/building-property-shapes-normalized.json create mode 100644 data/entities/expectations/concise/building-relationship-concise.json create mode 100644 data/entities/expectations/concise/building-relationship-normalized.json create mode 100644 data/entities/expectations/concise/building-replace-attribute-normalized.json create mode 100644 data/entities/expectations/concise/building-replace-normalized.json create mode 100644 data/entities/expectations/concise/building-simple-attributes-concise.json create mode 100644 data/entities/expectations/concise/building-sub-attribute-normalized.json create mode 100644 data/entities/expectations/concise/building-two-geometry-attribute-concise.geojson create mode 100644 data/entities/expectations/concise/building-update-normalized.json create mode 100644 data/entities/expectations/concise/building-vocab-property-string-concise.json create mode 100644 data/entities/fragmentEntities/concise/building-append-fragment-concise.jsonld create mode 100644 data/entities/fragmentEntities/concise/building-replace-attribute-concise.json create mode 100644 data/entities/fragmentEntities/concise/building-update-fragment-concise.jsonld create mode 100644 data/subscriptions/expectations/building-location-attribute-concise-notification.json create mode 100644 data/subscriptions/subscription-building-entities-entityCreated-concise.jsonld diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76544111..62c65f91 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,4 +3,4 @@ repos: rev: v6.9.2 hooks: - id: robocop-format - additional_dependencies: [typing_extensions] + additional_dependencies: [typing_extensions, click] diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_31.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_31.robot new file mode 100644 index 00000000..eb05f4d1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_31.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Check that entities can be queried in a concise representation for every kind of attribute + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Created Entity +Test Template Query Entities In A Concise Representation + + +*** Test Cases *** EXPECTATION_FILENAME +019_31_01 Property + [Tags] e-query 5_7_2 4_5_2_3 since_v1.6.1 + [Setup] Create Initial Entity building-simple-attributes.jsonld + concise/building-simple-attributes-concise.json +019_31_02 Relationship + [Tags] e-query 5_7_2 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity building-relationship.jsonld + concise/building-relationship-concise.json +019_31_03 GeoProperty + [Tags] e-query 5_7_2 4_7_3 since_v1.6.1 + [Setup] Create Initial Entity building-location-attribute.jsonld + concise/building-location-attribute-concise.json +019_31_04 JsonProperty + [Tags] e-query 5_7_2 4_5_24_3 since_v1.6.1 + [Setup] Create Initial Entity building-json-property-object.jsonld + concise/building-json-property-object-concise.json +019_31_05 LanguageProperty + [Tags] e-query 5_7_2 4_5_18_3 since_v1.6.1 + [Setup] Create Initial Entity building-language-property.jsonld + concise/building-language-property-concise.json +019_31_06 VocabProperty + [Tags] e-query 5_7_2 4_5_20_3 since_v1.6.1 + [Setup] Create Initial Entity building-vocab-property-string.jsonld + concise/building-vocab-property-string-concise.json + + +*** Keywords *** +Query Entities In A Concise Representation + [Documentation] Check that entities can be queried in a concise representation for a given kind of attribute + [Arguments] ${expectation_filename} + ${response}= Query Entities + ... entity_ids=${entity_id} + ... entity_types=Building + ... format=concise + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response.json()[0]} + ... ${True} + +Create Initial Entity + [Arguments] ${source_filename} + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${source_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Created Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot index ee900e93..d0916a5d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_05.robot @@ -16,29 +16,39 @@ Test Template Retrieve Entity In GeoJSON Representation ${filename}= building-two-geometry-attributes.jsonld -*** Test Cases *** OPTIONS EXPECTATION_FILENAME -018_05_01 Simplified +*** Test Cases *** OPTIONS FORMAT GEOMETRY_PROPERTY EXPECTATION_FILENAME +018_05_01 Simplified Using Options Param [Tags] e-retrieve 6_3_7 - keyValues ${EMPTY} building-two-geometry-attribute-simplified.geojson -018_05_02 Normalized + keyValues ${EMPTY} ${EMPTY} building-two-geometry-attribute-simplified.geojson +018_05_02 Simplified Using Format Param [Tags] e-retrieve 6_3_7 - ${EMPTY} ${EMPTY} building-two-geometry-attribute-normalized.geojson -018_05_03 With geometryProperty + ${EMPTY} keyValues ${EMPTY} building-two-geometry-attribute-simplified.geojson +018_05_03 Normalized [Tags] e-retrieve 6_3_7 - ${EMPTY} observationSpace building-two-geometry-property-on-observation-space.geojson -018_05_04 With Nonexistent geometryProperty + ${EMPTY} ${EMPTY} ${EMPTY} building-two-geometry-attribute-normalized.geojson +018_05_04 With geometryProperty [Tags] e-retrieve 6_3_7 - ${EMPTY} operationSpace building-two-geometry-property-on-nonexistent-operation-space.geojson + ${EMPTY} ${EMPTY} observationSpace building-two-geometry-property-on-observation-space.geojson +018_05_05 With Nonexistent geometryProperty + [Tags] e-retrieve 6_3_7 + ${EMPTY} ${EMPTY} operationSpace building-two-geometry-property-on-nonexistent-operation-space.geojson +018_05_06 Concise Using Options Param + [Tags] e-retrieve 6_3_7 4_5_2_3 4_7_3 since_v1.6.1 + concise ${EMPTY} ${EMPTY} concise/building-two-geometry-attribute-concise.geojson +018_05_07 Concise Using Format Param + [Tags] e-retrieve 6_3_7 4_5_2_3 4_7_3 since_v1.6.1 + ${EMPTY} concise ${EMPTY} concise/building-two-geometry-attribute-concise.geojson *** Keywords *** Retrieve Entity In GeoJSON Representation [Documentation] Check that the queried entity by id can be returned in a GeoJSON format - [Arguments] ${options} ${geometry_property} ${expectation_filename} + [Arguments] ${options} ${format} ${geometry_property} ${expectation_filename} ${response}= Retrieve Entity ... id=${entity_id} ... accept=${CONTENT_TYPE_GEOJSON} ... options=${options} + ... format=${format} ... context=${ngsild_test_suite_context} ... geometryProperty=${geometry_property} Check Response Status Code 200 ${response.status_code} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot index 408bed06..ad535489 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot @@ -16,22 +16,32 @@ Test Template Retrieve Entity With observationSpace Geospatial Property ${filename}= building-observation-space-geoproperty.jsonld -*** Test Cases *** OPTIONS EXPECTATION_FILENAME -018_08_01 Simplified +*** Test Cases *** OPTIONS FORMAT EXPECTATION_FILENAME +018_08_01 Simplified Using Options Param [Tags] e-retrieve 5_7_1 4_7 - keyValues building-observation-space-geoproperty-simplified.jsonld -018_08_02 Normalized + keyValues ${EMPTY} building-observation-space-geoproperty-simplified.jsonld +018_08_02 Simplified Using Format Param [Tags] e-retrieve 5_7_1 4_7 - ${EMPTY} building-observation-space-geoproperty-normalized.jsonld + ${EMPTY} keyValues building-observation-space-geoproperty-simplified.jsonld +018_08_03 Normalized + [Tags] e-retrieve 5_7_1 4_7 + ${EMPTY} ${EMPTY} building-observation-space-geoproperty-normalized.jsonld +018_08_04 Concise Using Options Param + [Tags] e-retrieve 5_7_1 4_7_3 since_v1.6.1 + concise ${EMPTY} concise/building-observation-space-geoproperty-concise.json +018_08_05 Concise Using Format Param + [Tags] e-retrieve 5_7_1 4_7_3 since_v1.6.1 + ${EMPTY} concise concise/building-observation-space-geoproperty-concise.json *** Keywords *** Retrieve Entity With observationSpace Geospatial Property [Documentation] Check that an entity with observationSpace geospatial Property can be retrieved - [Arguments] ${options} ${expectation_filename} + [Arguments] ${options} ${format} ${expectation_filename} ${response}= Retrieve Entity ... id=${entity_id} ... options=${options} + ... format=${format} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot index 853465b0..81febede 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot @@ -16,22 +16,32 @@ Test Template Retrieve Entity With operationSpace Geospatial Property ${filename}= building-operation-space-geoproperty.jsonld -*** Test Cases *** OPTIONS EXPECTATION_FILENAME -018_09_01 Simplified +*** Test Cases *** OPTIONS FORMAT EXPECTATION_FILENAME +018_09_01 Simplified Using Options Param [Tags] e-retrieve 5_7_1 4_7 - keyValues building-operation-space-geoproperty-simplified.jsonld -018_09_02 Normalized + keyValues ${EMPTY} building-operation-space-geoproperty-simplified.jsonld +018_09_02 Simplified Using Format Param [Tags] e-retrieve 5_7_1 4_7 - ${EMPTY} building-operation-space-geoproperty-normalized.jsonld + ${EMPTY} keyValues building-operation-space-geoproperty-simplified.jsonld +018_09_03 Normalized + [Tags] e-retrieve 5_7_1 4_7 + ${EMPTY} ${EMPTY} building-operation-space-geoproperty-normalized.jsonld +018_09_04 Concise Using Options Param + [Tags] e-retrieve 5_7_1 4_7_3 since_v1.6.1 + concise ${EMPTY} concise/building-operation-space-geoproperty-concise.json +018_09_05 Concise Using Format Param + [Tags] e-retrieve 5_7_1 4_7_3 since_v1.6.1 + ${EMPTY} concise concise/building-operation-space-geoproperty-concise.json *** Keywords *** Retrieve Entity With operationSpace Geospatial Property [Documentation] Check that an entity with operationSpace geospatial Property can be retrieved - [Arguments] ${options} ${expectation_filename} + [Arguments] ${options} ${format} ${expectation_filename} ${response}= Retrieve Entity ... id=${entity_id} ... options=${options} + ... format=${format} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_23.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_23.robot new file mode 100644 index 00000000..3aad2596 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_23.robot @@ -0,0 +1,87 @@ +*** Settings *** +Documentation Check that an entity can be retrieved in a concise representation for every kind of attribute + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Created Entity +Test Template Retrieve Entity In A Concise Representation + + +*** Test Cases *** EXPECTATION_FILENAME +018_23_01 Property + [Tags] e-retrieve 5_7_1 4_5_2_3 since_v1.6.1 + [Setup] Create Initial Entity building-simple-attributes.jsonld + concise/building-simple-attributes-concise.json +018_23_02 Relationship + [Tags] e-retrieve 5_7_1 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity building-relationship.jsonld + concise/building-relationship-concise.json +018_23_03 Multivalued Relationship + [Tags] e-retrieve 5_7_1 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity building-multivalued-relationship.jsonld + concise/building-multivalued-relationship-concise.json +018_23_04 GeoProperty + [Tags] e-retrieve 5_7_1 4_7_3 since_v1.6.1 + [Setup] Create Initial Entity building-location-attribute.jsonld + concise/building-location-attribute-concise.json +018_23_05 JsonProperty + [Tags] e-retrieve 5_7_1 4_5_24_3 since_v1.6.1 + [Setup] Create Initial Entity building-json-property-object.jsonld + concise/building-json-property-object-concise.json +018_23_06 LanguageProperty + [Tags] e-retrieve 5_7_1 4_5_18_3 since_v1.6.1 + [Setup] Create Initial Entity building-language-property.jsonld + concise/building-language-property-concise.json +018_23_07 VocabProperty + [Tags] e-retrieve 5_7_1 4_5_20_3 since_v1.6.1 + [Setup] Create Initial Entity building-vocab-property-string.jsonld + concise/building-vocab-property-string-concise.json +018_23_08 JsonProperty With Sub-Attribute + [Tags] e-retrieve 5_7_1 4_5_24_3 since_v1.6.1 + [Setup] Create Initial Entity building-json-property-object-sub-property.jsonld + concise/building-json-property-object-sub-property-concise.json +018_23_09 LanguageProperty With Sub-Attribute + [Tags] e-retrieve 5_7_1 4_5_18_3 since_v1.6.1 + [Setup] Create Initial Entity building-language-property-sub-property.jsonld + concise/building-language-property-sub-property-concise.json +018_23_10 Multi-Instance Property And Relationship + [Tags] e-retrieve 5_7_1 4_5_2_3 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity building-multi-instances-attributes.jsonld + concise/building-multi-instances-attributes-concise.json +018_23_11 Different Attributes Instances And Types + [Tags] e-retrieve 5_7_1 4_5_2_3 4_5_3_3 4_7_3 4_5_18_3 since_v1.6.1 + [Setup] Create Initial Entity building-different-attributes-instances-and-types.jsonld + concise/building-different-attributes-instances-and-types-concise.json + + +*** Keywords *** +Retrieve Entity In A Concise Representation + [Documentation] Check that an entity can be retrieved in a concise representation for a given kind of attribute + [Arguments] ${expectation_filename} + ${response}= Retrieve Entity + ... id=${entity_id} + ... format=concise + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response.json()} + ... ${True} + +Create Initial Entity + [Arguments] ${source_filename} + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${source_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Created Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_16.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_16.robot new file mode 100644 index 00000000..6ff9c6e4 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_16.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Check that one can create an entity from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Created Entity +Test Template Verify Entity Created From A Concise Body Is Normalized + + +*** Test Cases *** EXPECTATION_FILENAME +001_16_01 Concise Properties + [Tags] e-create 5_6_1 4_5_2_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-property-shapes-concise.jsonld + concise/building-property-shapes-normalized.json +001_16_02 Concise Relationship + [Tags] e-create 5_6_1 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-relationship-concise.jsonld + concise/building-relationship-normalized.json +001_16_03 Concise GeoProperty + [Tags] e-create 5_6_1 4_7_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-geoproperty-concise.jsonld + concise/building-geoproperty-normalized.json +001_16_04 Concise Advanced Attributes + [Tags] e-create 5_6_1 4_5_24_3 4_5_18_3 4_5_20_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-advanced-attributes-concise.jsonld + concise/building-advanced-attributes-normalized.json +001_16_05 Concise Passthrough Mixed With Normalized + [Tags] e-create 5_6_1 4_5_2_3 4_5_3_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-mixed-normalized-concise.jsonld + concise/building-mixed-normalized.json +001_16_06 Concise Multi Instance Attribute + [Tags] e-create 5_6_1 4_5_2_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-multi-instances-attribute-concise.jsonld + concise/building-multi-instances-attribute-normalized.json +001_16_07 Concise Sub Attribute + [Tags] e-create 5_6_1 4_5_2_3 since_v1.6.1 + [Setup] Create Initial Entity concise/building-sub-attribute-concise.jsonld + concise/building-sub-attribute-normalized.json + + +*** Keywords *** +Verify Entity Created From A Concise Body Is Normalized + [Documentation] Check that an entity created from a concise body is stored in a normalized representation + [Arguments] ${expectation_filename} + ${response}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response.json()} + ... ${True} + +Create Initial Entity + [Arguments] ${source_filename} + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${source_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Created Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/MergeEntity/056_11.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/MergeEntity/056_11.robot new file mode 100644 index 00000000..ab4ed063 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/MergeEntity/056_11.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that one can merge an entity from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${fragment_filename}= concise/building-merge-replace-concise.jsonld +${expectation_filename}= concise/building-merge-normalized.json + + +*** Test Cases *** +056_11_01 Merge An Entity From A Concise Body + [Documentation] Check that one can merge an entity with a concise body normalized server-side + [Tags] e-merge 5_6_17 4_5_2_3 4_5_3_3 since_v1.6.1 + ${response}= Merge Entity + ... entity_id=${entity_id} + ... entity_filename=${fragment_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response.status_code} + Check Response Body Is Empty ${response} + ${response1}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response1.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response1.json()} + ... ${True} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... building-simple-attributes.jsonld + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/ReplaceEntity/054_05.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/ReplaceEntity/054_05.robot new file mode 100644 index 00000000..4912209d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/ReplaceEntity/054_05.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that one can replace an entity from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${replacement_filename}= concise/building-merge-replace-concise.jsonld +${expectation_filename}= concise/building-replace-normalized.json + + +*** Test Cases *** +054_05_01 Replace An Entity From A Concise Body + [Documentation] Check that one can replace an entity with a concise body normalized server-side + [Tags] e-replace 5_6_18 4_5_2_3 4_5_3_3 since_v1.6.1 + ${response}= Replace Entity + ... entity_id=${entity_id} + ... filename=${replacement_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response.status_code} + Check Response Body Is Empty ${response} + ${response1}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response1.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response1.json()} + ... ${True} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... building-simple-attributes.jsonld + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_13.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_13.robot new file mode 100644 index 00000000..091d150f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_13.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that one can append entity attributes from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${fragment_filename}= concise/building-append-fragment-concise.jsonld +${expectation_filename}= concise/building-append-normalized.json + + +*** Test Cases *** +010_13_01 Append Concise Attributes + [Documentation] Check that one can append concise attributes and that they are normalized server-side + [Tags] ea-append 5_6_3 4_5_2_3 4_5_3_3 since_v1.6.1 + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response.status_code} + Check Response Body Is Empty ${response} + ${response1}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response1.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response1.json()} + ... ${True} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... building-minimal.jsonld + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/ReplaceEntityAttribute/055_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/ReplaceEntityAttribute/055_04.robot new file mode 100644 index 00000000..fd40d9bc --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/ReplaceEntityAttribute/055_04.robot @@ -0,0 +1,57 @@ +*** Settings *** +Documentation Check that one can replace an entity attribute from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${attribute_filename}= fragmentEntities/concise/building-replace-attribute-concise.json +${expectation_filename}= concise/building-replace-attribute-normalized.json + + +*** Test Cases *** +055_04_01 Replace An Entity Attribute From A Concise Fragment + [Documentation] Check that one can replace an attribute with a concise fragment normalized server-side + [Tags] ea-replace 5_6_19 4_5_2_3 since_v1.6.1 + ${attribute}= Load Test Sample + ... test_sample_file_path=entities/${attribute_filename} + ... test_sample_id=${entity_id} + ${response}= Replace Attribute Selecting Content Type + ... entity_id=${entity_id} + ... attr_id=subCategory + ... attribute_fragment=${attribute} + ... content_type=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 204 ${response.status_code} + Check Response Body Is Empty ${response} + ${response1}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response1.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response1.json()} + ... ${True} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... building-simple-attributes.jsonld + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_10.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_10.robot new file mode 100644 index 00000000..a812e3d9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_10.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that one can update entity attributes from a concise representation body + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${fragment_filename}= concise/building-update-fragment-concise.jsonld +${expectation_filename}= concise/building-update-normalized.json + + +*** Test Cases *** +011_10_01 Update Concise Attributes + [Documentation] Check that one can update existing attributes with a concise body normalized server-side + [Tags] ea-update 5_6_2 4_5_2_3 since_v1.6.1 + ${response}= Update Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 204 ${response.status_code} + Check Response Body Is Empty ${response} + ${response1}= Retrieve Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response1.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response1.json()} + ... ${True} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + Set Test Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... building-simple-attributes.jsonld + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_44.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_44.robot new file mode 100644 index 00000000..94922ebd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_44.robot @@ -0,0 +1,60 @@ +*** Settings *** +Documentation Check that a notification is sent in a concise representation when notification format is concise + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationSubscription.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/NotificationUtils.resource + +Suite Setup Setup Server And Subscriptions +Suite Teardown Delete Server And Subscriptions + + +*** Variables *** +${subscription_payload_file_path}= subscriptions/subscription-building-entities-entityCreated-concise.jsonld +${building_filename}= building-location-attribute.jsonld +${expectation_file_path}= building-location-attribute-concise-notification.json +${notification_server_send_url}= http://${notification_server_host}:${notification_server_port}/notify + + +*** Test Cases *** +046_44_01 Check That A Notification Is Sent In A Concise Representation + [Documentation] Check that a notification is sent in a concise representation when notification format is concise + [Tags] sub-notification 5_8_6 4_5_2_3 4_7_3 since_v1.6.1 + ${entity_id}= Generate Random Building Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity Selecting Content Type + ... ${building_filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + + ${notification} ${headers}= Wait for notification timeout=${10} + Should be Equal ${subscription_id} ${notification}[subscriptionId] + Should be Equal ${entity_id} ${notification}[data][0][id] + Check Notification Containing Entity Element ${expectation_file_path} ${notification} + + +*** Keywords *** +Setup Server And Subscriptions + ${subscription_id}= Generate Random Subscription Id + ${subscription_payload}= Load Subscription Sample With Reachable Endpoint + ... ${subscription_payload_file_path} + ... ${subscription_id} + ... ${notification_server_send_url} + Set Suite Variable ${subscription_id} + Start Local Server ${notification_server_host} ${notification_server_port} + + ${create_response}= Create Subscription From Subscription Payload + ... ${subscription_payload} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response.status_code} + Sleep 1s + +Delete Server And Subscriptions + Delete Subscription ${subscription_id} + Delete Entity ${entity_id} + Stop Local Server diff --git a/data/entities/concise/building-advanced-attributes-concise.jsonld b/data/entities/concise/building-advanced-attributes-concise.jsonld new file mode 100644 index 00000000..7e13d446 --- /dev/null +++ b/data/entities/concise/building-advanced-attributes-concise.jsonld @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-04", + "type": "Building", + "jsonProperty": { + "json": { + "id": "some-id", + "type": "some-type", + "anythingElse": "anything-else" + } + }, + "street": { + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "vocabProperty": { + "vocab": "monument" + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-geoproperty-concise.jsonld b/data/entities/concise/building-geoproperty-concise.jsonld new file mode 100644 index 00000000..beb460b9 --- /dev/null +++ b/data/entities/concise/building-geoproperty-concise.jsonld @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-03", + "type": "Building", + "location": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + }, + "observationSpace": { + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-merge-replace-concise.jsonld b/data/entities/concise/building-merge-replace-concise.jsonld new file mode 100644 index 00000000..6a1195c0 --- /dev/null +++ b/data/entities/concise/building-merge-replace-concise.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "subCategory": "landmark", + "locatedAt": { + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-mixed-normalized-concise.jsonld b/data/entities/concise/building-mixed-normalized-concise.jsonld new file mode 100644 index 00000000..1817b6ae --- /dev/null +++ b/data/entities/concise/building-mixed-normalized-concise.jsonld @@ -0,0 +1,15 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-05", + "type": "Building", + "name": "Eiffel Tower", + "subCategory": { + "type": "Property", + "value": "tourism" + }, + "locatedAt": { + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-multi-instances-attribute-concise.jsonld b/data/entities/concise/building-multi-instances-attribute-concise.jsonld new file mode 100644 index 00000000..6942b2a6 --- /dev/null +++ b/data/entities/concise/building-multi-instances-attribute-concise.jsonld @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-06", + "type": "Building", + "name": [ + { + "value": "Eiffel Tower", + "datasetId": "urn:ngsi-ld:Dataset:english-name" + }, + { + "value": "Tour Eiffel", + "datasetId": "urn:ngsi-ld:Dataset:french-name" + } + ], + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-property-shapes-concise.jsonld b/data/entities/concise/building-property-shapes-concise.jsonld new file mode 100644 index 00000000..8f791996 --- /dev/null +++ b/data/entities/concise/building-property-shapes-concise.jsonld @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-01", + "type": "Building", + "name": "Eiffel Tower", + "subCategory": { + "value": "tourism" + }, + "airQualityLevel": { + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": false, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-relationship-concise.jsonld b/data/entities/concise/building-relationship-concise.jsonld new file mode 100644 index 00000000..b9c3ab11 --- /dev/null +++ b/data/entities/concise/building-relationship-concise.jsonld @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-02", + "type": "Building", + "locatedAt": { + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/concise/building-sub-attribute-concise.jsonld b/data/entities/concise/building-sub-attribute-concise.jsonld new file mode 100644 index 00000000..f1dc3206 --- /dev/null +++ b/data/entities/concise/building-sub-attribute-concise.jsonld @@ -0,0 +1,14 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-01", + "type": "Building", + "airQualityLevel": { + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "hasWeatherObserved": { + "object": "urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/expectations/concise/building-advanced-attributes-normalized.json b/data/entities/expectations/concise/building-advanced-attributes-normalized.json new file mode 100644 index 00000000..7f8ba133 --- /dev/null +++ b/data/entities/expectations/concise/building-advanced-attributes-normalized.json @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-04", + "type": "Building", + "jsonProperty": { + "type": "JsonProperty", + "json": { + "id": "some-id", + "type": "some-type", + "anythingElse": "anything-else" + } + }, + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "vocabProperty": { + "type": "VocabProperty", + "vocab": "monument" + } +} diff --git a/data/entities/expectations/concise/building-append-normalized.json b/data/entities/expectations/concise/building-append-normalized.json new file mode 100644 index 00000000..80e44c1a --- /dev/null +++ b/data/entities/expectations/concise/building-append-normalized.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:010-12-01", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-different-attributes-instances-and-types-concise.json b/data/entities/expectations/concise/building-different-attributes-instances-and-types-concise.json new file mode 100644 index 00000000..44f20b87 --- /dev/null +++ b/data/entities/expectations/concise/building-different-attributes-instances-and-types-concise.json @@ -0,0 +1,62 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-11", + "type": "Building", + "name": [ + { + "value": "Eiffel Tower", + "datasetId": "urn:ngsi-ld:Dataset:01" + }, + { + "value": "The iron lady", + "datasetId": "urn:ngsi-ld:Dataset:02" + } + ], + "locatedAt": [ + { + "object": "urn:ngsi-ld:City:Paris", + "datasetId": "urn:ngsi-ld:Dataset:01" + }, + { + "object": "urn:ngsi-ld:District:Paris:08", + "datasetId": "urn:ngsi-ld:Dataset:02" + } + ], + "location": [ + { + "value": { + "type": "Point", + "coordinates": [ + 2.3514, + 48.8575 + ] + }, + "datasetId": "urn:ngsi-ld:Dataset:01" + }, + { + "value": { + "type": "Point", + "coordinates": [ + 2.2944, + 48.8585 + ] + }, + "datasetId": "urn:ngsi-ld:Dataset:02" + } + ], + "street": [ + { + "languageMap": { + "fr": "Jardin de la Tour Eiffel", + "en": "Eiffel Tower Garden" + }, + "datasetId": "urn:ngsi-ld:Dataset:01" + }, + { + "languageMap": { + "fr": "Avenue Gustave Eiffel", + "en": "Avenue Gustave Eiffel" + }, + "datasetId": "urn:ngsi-ld:Dataset:02" + } + ] +} diff --git a/data/entities/expectations/concise/building-geoproperty-normalized.json b/data/entities/expectations/concise/building-geoproperty-normalized.json new file mode 100644 index 00000000..c7749527 --- /dev/null +++ b/data/entities/expectations/concise/building-geoproperty-normalized.json @@ -0,0 +1,24 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-03", + "type": "Building", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + }, + "observationSpace": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + } +} diff --git a/data/entities/expectations/concise/building-json-property-object-concise.json b/data/entities/expectations/concise/building-json-property-object-concise.json new file mode 100644 index 00000000..38841493 --- /dev/null +++ b/data/entities/expectations/concise/building-json-property-object-concise.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-05", + "type": "Building", + "jsonProperty": { + "json": { + "id": "some-id", + "type": "some-type", + "null": null, + "anythingElse": "anything-else" + } + } +} diff --git a/data/entities/expectations/concise/building-json-property-object-sub-property-concise.json b/data/entities/expectations/concise/building-json-property-object-sub-property-concise.json new file mode 100644 index 00000000..e9b3b9ef --- /dev/null +++ b/data/entities/expectations/concise/building-json-property-object-sub-property-concise.json @@ -0,0 +1,13 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-08", + "type": "Building", + "jsonProperty": { + "json": { + "id": "some-id", + "type": "some-type", + "null": null, + "anythingElse": "anything-else" + }, + "source": "Speedometer" + } +} diff --git a/data/entities/expectations/concise/building-language-property-concise.json b/data/entities/expectations/concise/building-language-property-concise.json new file mode 100644 index 00000000..ab7d57e9 --- /dev/null +++ b/data/entities/expectations/concise/building-language-property-concise.json @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-06", + "type": "Building", + "street": { + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + } +} diff --git a/data/entities/expectations/concise/building-language-property-sub-property-concise.json b/data/entities/expectations/concise/building-language-property-sub-property-concise.json new file mode 100644 index 00000000..a4699e81 --- /dev/null +++ b/data/entities/expectations/concise/building-language-property-sub-property-concise.json @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-09", + "type": "Building", + "street": { + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + }, + "source": "Speedometer" + } +} diff --git a/data/entities/expectations/concise/building-location-attribute-concise.json b/data/entities/expectations/concise/building-location-attribute-concise.json new file mode 100644 index 00000000..4d46961a --- /dev/null +++ b/data/entities/expectations/concise/building-location-attribute-concise.json @@ -0,0 +1,13 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-04", + "type": "Building", + "name": "Eiffel Tower", + "subCategory": "tourism", + "location": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } +} diff --git a/data/entities/expectations/concise/building-merge-normalized.json b/data/entities/expectations/concise/building-merge-normalized.json new file mode 100644 index 00000000..91d9851c --- /dev/null +++ b/data/entities/expectations/concise/building-merge-normalized.json @@ -0,0 +1,26 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": "landmark" + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-mixed-normalized.json b/data/entities/expectations/concise/building-mixed-normalized.json new file mode 100644 index 00000000..fae744b8 --- /dev/null +++ b/data/entities/expectations/concise/building-mixed-normalized.json @@ -0,0 +1,16 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-05", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": "tourism" + }, + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-multi-instances-attribute-normalized.json b/data/entities/expectations/concise/building-multi-instances-attribute-normalized.json new file mode 100644 index 00000000..ab5e3719 --- /dev/null +++ b/data/entities/expectations/concise/building-multi-instances-attribute-normalized.json @@ -0,0 +1,16 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-06", + "type": "Building", + "name": [ + { + "type": "Property", + "value": "Eiffel Tower", + "datasetId": "urn:ngsi-ld:Dataset:english-name" + }, + { + "type": "Property", + "value": "Tour Eiffel", + "datasetId": "urn:ngsi-ld:Dataset:french-name" + } + ] +} diff --git a/data/entities/expectations/concise/building-multi-instances-attributes-concise.json b/data/entities/expectations/concise/building-multi-instances-attributes-concise.json new file mode 100644 index 00000000..52a44048 --- /dev/null +++ b/data/entities/expectations/concise/building-multi-instances-attributes-concise.json @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Building:9351575645928687", + "type": "Building", + "name": [ + { + "value": "Eiffel Tower" + }, + { + "value": "Tour Eiffel", + "datasetId": "urn:ngsi-ld:Dataset:french-name" + }, + { + "value": "Eiffelturm", + "datasetId": "urn:ngsi-ld:Dataset:german-name" + } + ], + "locatedAt": [ + { + "object": "urn:ngsi-ld:City:Paris" + }, + { + "datasetId": "urn:ngsi-ld:Dataset:french-name", + "object": "urn:ngsi-ld:Ville:Paris" + }, + { + "datasetId": "urn:ngsi-ld:Dataset:spanish-name", + "object": "urn:ngsi-ld:Ciudad:ParĂ­s" + } + ] +} \ No newline at end of file diff --git a/data/entities/expectations/concise/building-multivalued-relationship-concise.json b/data/entities/expectations/concise/building-multivalued-relationship-concise.json new file mode 100644 index 00000000..6580aca8 --- /dev/null +++ b/data/entities/expectations/concise/building-multivalued-relationship-concise.json @@ -0,0 +1,10 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-03", + "type": "Building", + "locatedAt": { + "object": [ + "urn:ngsi-ld:City:Paris", + "urn:ngsi-ld:City:Lyon" + ] + } +} diff --git a/data/entities/expectations/concise/building-observation-space-geoproperty-concise.json b/data/entities/expectations/concise/building-observation-space-geoproperty-concise.json new file mode 100644 index 00000000..2240fdf9 --- /dev/null +++ b/data/entities/expectations/concise/building-observation-space-geoproperty-concise.json @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "observationSpace": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } +} diff --git a/data/entities/expectations/concise/building-operation-space-geoproperty-concise.json b/data/entities/expectations/concise/building-operation-space-geoproperty-concise.json new file mode 100644 index 00000000..c951d3bf --- /dev/null +++ b/data/entities/expectations/concise/building-operation-space-geoproperty-concise.json @@ -0,0 +1,31 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "operationSpace": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.12, + 0.23 + ], + [ + 101.12, + 0.23 + ], + [ + 101.12, + 1.23 + ], + [ + 100.12, + 1.23 + ], + [ + 100.12, + 0.23 + ] + ] + ] + } +} diff --git a/data/entities/expectations/concise/building-property-shapes-normalized.json b/data/entities/expectations/concise/building-property-shapes-normalized.json new file mode 100644 index 00000000..88baf882 --- /dev/null +++ b/data/entities/expectations/concise/building-property-shapes-normalized.json @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-01", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": "tourism" + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + } +} diff --git a/data/entities/expectations/concise/building-relationship-concise.json b/data/entities/expectations/concise/building-relationship-concise.json new file mode 100644 index 00000000..04edb655 --- /dev/null +++ b/data/entities/expectations/concise/building-relationship-concise.json @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-02", + "type": "Building", + "locatedAt": { + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-relationship-normalized.json b/data/entities/expectations/concise/building-relationship-normalized.json new file mode 100644 index 00000000..eb463ad9 --- /dev/null +++ b/data/entities/expectations/concise/building-relationship-normalized.json @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-02", + "type": "Building", + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-replace-attribute-normalized.json b/data/entities/expectations/concise/building-replace-attribute-normalized.json new file mode 100644 index 00000000..60a497f4 --- /dev/null +++ b/data/entities/expectations/concise/building-replace-attribute-normalized.json @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:055-04-01", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": "landmark" + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + } +} diff --git a/data/entities/expectations/concise/building-replace-normalized.json b/data/entities/expectations/concise/building-replace-normalized.json new file mode 100644 index 00000000..166295f7 --- /dev/null +++ b/data/entities/expectations/concise/building-replace-normalized.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:054-04-01", + "type": "Building", + "subCategory": { + "type": "Property", + "value": "landmark" + }, + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + } +} diff --git a/data/entities/expectations/concise/building-simple-attributes-concise.json b/data/entities/expectations/concise/building-simple-attributes-concise.json new file mode 100644 index 00000000..e1e4ad66 --- /dev/null +++ b/data/entities/expectations/concise/building-simple-attributes-concise.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-01", + "type": "Building", + "name": "Eiffel Tower", + "subCategory": "tourism", + "airQualityLevel": { + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": false +} diff --git a/data/entities/expectations/concise/building-sub-attribute-normalized.json b/data/entities/expectations/concise/building-sub-attribute-normalized.json new file mode 100644 index 00000000..61669cd5 --- /dev/null +++ b/data/entities/expectations/concise/building-sub-attribute-normalized.json @@ -0,0 +1,13 @@ +{ + "id": "urn:ngsi-ld:Building:001-16-01", + "type": "Building", + "airQualityLevel": { + "type": "Property", + "value": 4, + "observedAt": "2020-09-09T16:40:00.000Z", + "hasWeatherObserved": { + "type": "Relationship", + "object": "urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + } +} diff --git a/data/entities/expectations/concise/building-two-geometry-attribute-concise.geojson b/data/entities/expectations/concise/building-two-geometry-attribute-concise.geojson new file mode 100644 index 00000000..c5737c1c --- /dev/null +++ b/data/entities/expectations/concise/building-two-geometry-attribute-concise.geojson @@ -0,0 +1,24 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + }, + "properties": { + "type": "Building", + "name": "Eiffel Tower", + "subCategory": "tourism", + "location": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + }, + "observationSpace": { + "type": "Point", + "coordinates": [11.1111, 11.1111] + } + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/expectations/concise/building-update-normalized.json b/data/entities/expectations/concise/building-update-normalized.json new file mode 100644 index 00000000..a6d7b58e --- /dev/null +++ b/data/entities/expectations/concise/building-update-normalized.json @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:011-10-01", + "type": "Building", + "name": { + "type": "Property", + "value": "La Tour Eiffel" + }, + "subCategory": { + "type": "Property", + "value": "landmark" + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + } +} diff --git a/data/entities/expectations/concise/building-vocab-property-string-concise.json b/data/entities/expectations/concise/building-vocab-property-string-concise.json new file mode 100644 index 00000000..49bddd76 --- /dev/null +++ b/data/entities/expectations/concise/building-vocab-property-string-concise.json @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Building:018-23-07", + "type": "Building", + "vocabProperty": { + "vocab": "monument" + } +} diff --git a/data/entities/fragmentEntities/concise/building-append-fragment-concise.jsonld b/data/entities/fragmentEntities/concise/building-append-fragment-concise.jsonld new file mode 100644 index 00000000..91a09242 --- /dev/null +++ b/data/entities/fragmentEntities/concise/building-append-fragment-concise.jsonld @@ -0,0 +1,9 @@ +{ + "name": "Eiffel Tower", + "locatedAt": { + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/fragmentEntities/concise/building-replace-attribute-concise.json b/data/entities/fragmentEntities/concise/building-replace-attribute-concise.json new file mode 100644 index 00000000..627212e7 --- /dev/null +++ b/data/entities/fragmentEntities/concise/building-replace-attribute-concise.json @@ -0,0 +1,3 @@ +{ + "value": "landmark" +} diff --git a/data/entities/fragmentEntities/concise/building-update-fragment-concise.jsonld b/data/entities/fragmentEntities/concise/building-update-fragment-concise.jsonld new file mode 100644 index 00000000..0d9b1ee0 --- /dev/null +++ b/data/entities/fragmentEntities/concise/building-update-fragment-concise.jsonld @@ -0,0 +1,7 @@ +{ + "name": "La Tour Eiffel", + "subCategory": "landmark", + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/data/entities/vehicle-scope-attribute.json b/data/entities/vehicle-scope-attribute.json index 94cad926..0e4142bf 100644 --- a/data/entities/vehicle-scope-attribute.json +++ b/data/entities/vehicle-scope-attribute.json @@ -1,3 +1 @@ -{ - "scope":"/Company123/UnitA" -} \ No newline at end of file +"/Company123/UnitA" \ No newline at end of file diff --git a/data/subscriptions/expectations/building-location-attribute-concise-notification.json b/data/subscriptions/expectations/building-location-attribute-concise-notification.json new file mode 100644 index 00000000..48d0674f --- /dev/null +++ b/data/subscriptions/expectations/building-location-attribute-concise-notification.json @@ -0,0 +1,12 @@ +{ + "type": "Building", + "name": "Eiffel Tower", + "subCategory": "tourism", + "location": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } +} diff --git a/data/subscriptions/subscription-building-entities-entityCreated-concise.jsonld b/data/subscriptions/subscription-building-entities-entityCreated-concise.jsonld new file mode 100644 index 00000000..7a2a2139 --- /dev/null +++ b/data/subscriptions/subscription-building-entities-entityCreated-concise.jsonld @@ -0,0 +1,22 @@ +{ + "id":"urn:ngsi-ld:Subscription:randomUUID", + "type":"Subscription", + "entities":[ + { + "type":"Building" + } + ], + "notification":{ + "format":"concise", + "endpoint":{ + "uri":"http://localhost:1111/notify", + "accept":"application/json" + } + }, + "notificationTrigger": [ + "entityCreated" + ], + "@context":[ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index 00c9c054..68836116 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -1368,7 +1368,7 @@ class Requests: def query_entities(kwargs) -> str: expected_parameters = ['entity_ids', 'entity_types', 'accept', 'attrs', 'context', 'geoproperty', - 'options', 'limit', 'entity_id_pattern', + 'options', 'format', 'limit', 'entity_id_pattern', 'scopeq', 'georel', 'coordinates', 'geometry', 'count' , 'q' , 'datasetId', 'join', 'joinLevel', 'pick', 'omit', 'local', 'orderBy', 'local'] @@ -1391,6 +1391,8 @@ class Requests: response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" case 'options': response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'format': + response = f"{response} and\n Query Parameter: format set to '{value}'" case 'limit': response = f"{response} and\n Query Parameter: limit set to '{value}'" case 'entity_id_pattern': diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 332029af..c4a7dcbd 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -35,6 +35,7 @@ Query Entities ... ${context}=${EMPTY} ... ${geoproperty}=${EMPTY} ... ${options}=${EMPTY} + ... ${format}=${EMPTY} ... ${limit}=${EMPTY} ... ${entity_id_pattern}=${EMPTY} ... ${scopeq}=${EMPTY} @@ -78,6 +79,7 @@ Query Entities IF ${options_length}>0 Set To Dictionary ${params} options=${options} END + IF '${format}'!='' Set To Dictionary ${params} format=${format} IF ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} END -- GitLab