diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76544111345f718bb6e9dae2e0750284e97c645c..62c65f9153ec6dc000ff15bd5999175c35623ff8 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 0000000000000000000000000000000000000000..eb05f4d175b4e0b609f318837bd236983b7e0570 --- /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 ee900e93186916084c0e659373c0fdd219ac8c23..d0916a5daf9d38a6b045af0f6068875bd9b3dc64 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 408bed0615ef7da5ae56b1146ca032ad672c06b1..ad5354895c48eeed98a75863a7468bdbf8157a50 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 853465b0ace97deda4be7c0abcaa577f41efa7a8..81febede91a34b8a46feaae94b5b179df36c59a0 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 0000000000000000000000000000000000000000..3aad25967488e7280955b0af8087d4a6470f1a21 --- /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 0000000000000000000000000000000000000000..6ff9c6e41c81e221d49f8e4708ff6a52d59a62a5 --- /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 0000000000000000000000000000000000000000..ab4ed0637427f405e9b8bcc432492c1d979baa69 --- /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 0000000000000000000000000000000000000000..4912209ddc0fd32a5eb7b4151a6b47d91d54a4e5 --- /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 0000000000000000000000000000000000000000..091d150f2b0c97dd22115c3ac3034697ea01fd37 --- /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 0000000000000000000000000000000000000000..fd40d9bc06e88b6196acbeab5503bfa55055e246 --- /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 0000000000000000000000000000000000000000..a812e3d970149130f04c52e8c9b9c7e4ef8e3018 --- /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 0000000000000000000000000000000000000000..94922ebd10a8a6e7f720db4364256699e1243494 --- /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 0000000000000000000000000000000000000000..7e13d446eb54665eedc62fac0dd67e5017d39f06 --- /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 0000000000000000000000000000000000000000..beb460b91c985fa4e464262a3ffba453d23a0230 --- /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 0000000000000000000000000000000000000000..6a1195c0b66b8c8ee14245c8eca98090529f64b7 --- /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 0000000000000000000000000000000000000000..1817b6ae697afcba9bfaa5129bd2b6a602bd741d --- /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 0000000000000000000000000000000000000000..6942b2a6ac071a289c779c9a36e1b1515b94b8c6 --- /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 0000000000000000000000000000000000000000..8f791996d50eaf4da323b765b2ddfe1cfce07e1d --- /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 0000000000000000000000000000000000000000..b9c3ab11ced359f566774741a4f9acb18845ebcf --- /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 0000000000000000000000000000000000000000..f1dc32068da9292c7fab4771fac4753082bedb39 --- /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 0000000000000000000000000000000000000000..7f8ba133f0619afc3a155548f454cf2e3b4f003f --- /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 0000000000000000000000000000000000000000..80e44c1a06053913231eb578cccdf7bc3c11db19 --- /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 0000000000000000000000000000000000000000..44f20b872aee646b29cda5cf9dc25fbd1b14d9ad --- /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 0000000000000000000000000000000000000000..c7749527b6bab521400de16a209ba72b31e7815b --- /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 0000000000000000000000000000000000000000..38841493eb12f8619e627133d34c05a18f427b8f --- /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 0000000000000000000000000000000000000000..e9b3b9ef18c1f7e894947bb4dc63803da6616b5a --- /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 0000000000000000000000000000000000000000..ab7d57e961f9804872887851dd8b9cb88b5dd077 --- /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 0000000000000000000000000000000000000000..a4699e811e012cd14c04227c93706e69ff7669ac --- /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 0000000000000000000000000000000000000000..4d46961a9f57fef588aa36eb6919f234ca7da34a --- /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 0000000000000000000000000000000000000000..91d9851c1ec52da985aa713a1dabf85a72d29276 --- /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 0000000000000000000000000000000000000000..fae744b8fef8dd7e04f3a7ccfede378b0225d640 --- /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 0000000000000000000000000000000000000000..ab5e3719912f89a808418ba4c7c755b8967b6059 --- /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 0000000000000000000000000000000000000000..52a4404836976e1ec8c998b49d8acee0b5f28241 --- /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 0000000000000000000000000000000000000000..6580aca8123f14dcd483223a3db0eb17c0fd4e3e --- /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 0000000000000000000000000000000000000000..2240fdf981d7bf95b917afb3e41adcad87110505 --- /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 0000000000000000000000000000000000000000..c951d3bf91631f39bc13c87844eb7b28c218d503 --- /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 0000000000000000000000000000000000000000..88baf8821ddf8540adfa75220c6d137beeddcc63 --- /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 0000000000000000000000000000000000000000..04edb6558fca4659294355fc93f21d8c7284d185 --- /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 0000000000000000000000000000000000000000..eb463ad9dae10b3001b3122371149136eee260e5 --- /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 0000000000000000000000000000000000000000..60a497f4509859bd83ffb55dc9ec7014fec87810 --- /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 0000000000000000000000000000000000000000..166295f762f6681a1523772599ecde2cd9064513 --- /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 0000000000000000000000000000000000000000..e1e4ad66b23db555d5f4fcf16988fde324e256d7 --- /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 0000000000000000000000000000000000000000..61669cd50af7c2df66e01d8f1b419ae6b3ca96fe --- /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 0000000000000000000000000000000000000000..c5737c1c97cb99a7bac7c54cb74915223cf8ba8f --- /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 0000000000000000000000000000000000000000..a6d7b58e42a9bbcc57f25eaf2edfb9af79a2ed8f --- /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 0000000000000000000000000000000000000000..49bddd761f46da5892c0d57aa32873b11b172368 --- /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 0000000000000000000000000000000000000000..91a092429a5b1160a88d264ca337726b4f351944 --- /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 0000000000000000000000000000000000000000..627212e7f3fc1a0fe8e0a1fb8bf2bdc2ab5566d0 --- /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 0000000000000000000000000000000000000000..0d9b1ee0b1124e35bb01e19809c256e7e18798aa --- /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 94cad926f457d3759dab6adf141229adb436c204..0e4142bf5976b1ba0357649c28a876ecb0dfcf1e 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 0000000000000000000000000000000000000000..48d0674f5d074dc377ec457ffddfdfc966d4fdac --- /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 0000000000000000000000000000000000000000..7a2a21392c050a4102469932ee4eeec6e6c91786 --- /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 00c9c054f8f4567ab54d9559c1b2c52087f212ee..688361163af6ee85546afda4bc9ec42288813e98 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 332029af3fd6d19590c97b847489f4002a7f32f8..c4a7dcbd09549756aa462863a6adbe9c9915aa8e 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