From a502cb6db42c500738f2dc5a02ded9c6a29a9fa6 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Mon, 14 Dec 2020 14:29:04 +0100 Subject: [PATCH 01/12] feat: add tp 021_01 --- .../021_01.robot | 40 +++++++++++++++++++ resources/ApiUtils.resource | 16 ++++++++ 2 files changed, 56 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot new file mode 100644 index 00000000..c0ddded8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Test Template Query the temporal evolution of entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld + +*** Test Cases *** TIMEREL TIME +After after 2020-08-01T12:00:00Z +Before before 2020-08-01T12:00:00Z + + +*** Keywords *** +Query the temporal evolution of entities + [Arguments] ${timerel} ${time} + [Documentation] Check that you can query the temporal evolution of entities + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} time=${time} context=${ngsild_test_suite_context} + + Check Response Status Code Set To 200 + + #TODO Call Delete Temporal Representation Of Entity + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 13733600..5afcb9d2 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -154,3 +154,19 @@ Delete Temporal Representation Of Entity ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} Output request Output response + +Query Temporal Representation Of Entities + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${time}=${EMPTY} + ${entity_types_length} = Get Length ${entity_types} + &{headers}= Create Dictionary + &{params}= Create Dictionary + + Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" + Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + Run Keyword If '${time}'!='' Set To Dictionary ${params} time=${time} + + ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} + Output request + Output response + Set Test Variable ${response} -- GitLab From 7d5eb520dc775786a09d7d37050269d9521e6dcb Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 16:48:26 +0100 Subject: [PATCH 02/12] feat: complete implementation of tp 021_01 --- .../021_01.robot | 32 +++++--- .../020_01.robot | 2 +- .../020_02.robot | 2 +- .../020_03.robot | 2 +- .../020_04.robot | 8 +- .../020_05.robot | 2 +- .../020_08.robot | 2 +- .../020_09.robot | 2 +- .../020_10.robot | 2 +- ...-bus-temporal-representation-sample.jsonld | 48 +++++++++++ ...entation-multiple-instances-sample.jsonld} | 66 +++++++-------- ...ule-temporal-representation-sample.jsonld} | 12 +-- ...cule-temporal-representation-sample.jsonld | 48 +++++++++++ ...l-representation-020-01-expectation.jsonld | 12 +-- ...l-representation-020-02-expectation.jsonld | 12 +-- ...l-representation-020-03-expectation.jsonld | 6 +- ...epresentation-020-04-01-expectation.jsonld | 4 +- ...epresentation-020-04-02-expectation.jsonld | 6 +- ...epresentation-020-04-03-expectation.jsonld | 8 +- ...epresentation-020-05-01-expectation.jsonld | 40 ++++----- ...epresentation-020-05-02-expectation.jsonld | 66 +++++++-------- ...l-representation-020-10-expectation.jsonld | 12 +-- ...l-representation-021-01-expectation.jsonld | 76 +++++++++++++++++ ...l-representation-021-02-expectation.jsonld | 81 +++++++++++++++++++ resources/ApiUtils.resource | 4 +- resources/AssertionUtils.resource | 12 +++ 26 files changed, 422 insertions(+), 145 deletions(-) create mode 100644 data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld rename data/temporalEntities/{vehicule-temporal-representation-multiple-instances-sample.jsonld => 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld} (64%) rename data/temporalEntities/{vehicule-temporal-representation-sample.jsonld => 2020-08-vehicule-temporal-representation-sample.jsonld} (76%) create mode 100644 data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index c0ddded8..aec4b475 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -5,36 +5,48 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities Test Template Query the temporal evolution of entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld -${expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld -*** Test Cases *** TIMEREL TIME -After after 2020-08-01T12:00:00Z -Before before 2020-08-01T12:00:00Z +*** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE +After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-expectation.jsonld +Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-02-expectation.jsonld *** Keywords *** Query the temporal evolution of entities - [Arguments] ${timerel} ${time} + [Arguments] ${timerel} ${timeAt} ${expectation_file} [Documentation] Check that you can query the temporal evolution of entities [Tags] mandatory @{entity_types_to_be_retrieved}= Create List Vehicle - Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} time=${time} context=${ngsild_test_suite_context} + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=${timerel} timeAt=${timeAt} context=${ngsild_test_suite_context} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} - #TODO Call Delete Temporal Representation Of Entity Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${vehicle_payload_file} ${second_temporal_entity_representation_id} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot index 1fedda07..d6ffc50b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_01.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-01-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot index 54f83eb6..80aaad87 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_02.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-02-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot index b2b62855..a23dc00b 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_03.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-03-expectation.jsonld *** Test Case *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot index b56fa289..f3b5cf89 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_04.robot @@ -10,12 +10,12 @@ Test Template Retrieve the temporal evolution of an entity matching the given N *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT VEHICLE_EXPECTATION_FILE -After after 2018-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld -Before before 2018-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld -Between between 2018-08-01T12:00:00Z 2018-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld +After after 2020-08-01T13:03:00Z ${EMPTY} vehicle-temporal-representation-020-04-01-expectation.jsonld +Before before 2020-08-01T12:05:00Z ${EMPTY} vehicle-temporal-representation-020-04-02-expectation.jsonld +Between between 2020-08-01T12:00:00Z 2020-08-01T13:00:00Z vehicle-temporal-representation-020-04-03-expectation.jsonld *** Keywords *** Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 3810a1c2..d7d6e7c3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -10,7 +10,7 @@ Test Template Retrieve the temporal evolution of the last N instances of entity *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-multiple-instances-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld *** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE Retrieve Some Instances ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot index 20892e4a..909493fc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_08.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Case *** Retrieve the temporal evolution of non-existing entity attributes diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot index c67b3d1c..b93dc652 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_09.robot @@ -10,7 +10,7 @@ Test Template Retrieve the temporal evolution of an entity with an invalid requ *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT ENDTIMEAT After after ${EMPTY} ${EMPTY} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot index 0813a452..bd14fb81 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_10.robot @@ -9,7 +9,7 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${vehicle_payload_file}= vehicule-temporal-representation-sample.jsonld +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${vehicle_expectation_file}= vehicle-temporal-representation-020-10-expectation.jsonld *** Test Case *** diff --git a/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld new file mode 100644 index 00000000..22efffc5 --- /dev/null +++ b/data/temporalEntities/2020-08-bus-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":[ + { + "type":"Property", + "value":"Mercedes" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld similarity index 64% rename from data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld rename to data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index 605dd0e0..23e1fff4 100644 --- a/data/temporalEntities/vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -11,169 +11,169 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" }, { "type":"Property", "value":110, - "observedAt":"2018-08-01T12:09:00Z" + "observedAt":"2020-08-01T12:09:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:11:00Z" + "observedAt":"2020-08-01T12:11:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:13:00Z" + "observedAt":"2020-08-01T12:13:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T14:20:00Z" + "observedAt":"2020-08-01T14:20:00Z" }, { "type":"Property", "value":30, - "observedAt":"2018-08-01T15:05:00Z" + "observedAt":"2020-08-01T15:05:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T15:07:00Z" + "observedAt":"2020-08-01T15:07:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T15:20:00Z" + "observedAt":"2020-08-01T15:20:00Z" }, { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "@context":[ diff --git a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld similarity index 76% rename from data/temporalEntities/vehicule-temporal-representation-sample.jsonld rename to data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld index 3423d17c..070d566b 100644 --- a/data/temporalEntities/vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-sample.jsonld @@ -11,34 +11,34 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ], "@context":[ diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld new file mode 100644 index 00000000..df193cf7 --- /dev/null +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -0,0 +1,48 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Volvo" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld index 3671ae37..b632d1c6 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-01-expectation.jsonld @@ -9,35 +9,35 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "https://ngsi-ld-test-suite/context#fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld index ca4ca6ed..74f8d774 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-02-expectation.jsonld @@ -9,35 +9,35 @@ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ], "fuelLevel":[ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld index facf8b67..0c4045ef 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-03-expectation.jsonld @@ -5,17 +5,17 @@ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld index 32bf63c0..1a212875 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-01-expectation.jsonld @@ -9,12 +9,12 @@ { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld index af46993b..eb29e25a 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-02-expectation.jsonld @@ -8,18 +8,18 @@ "fuelLevel":{ "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld index 8c87d29e..4af9cc6c 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-04-03-expectation.jsonld @@ -8,23 +8,23 @@ "fuelLevel":{ "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld index 34e35ca1..8799061b 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -9,104 +9,104 @@ { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "speed":[ { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld index 6399ccd0..f8de9cff 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -9,169 +9,169 @@ { "type":"Property", "value":67, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":53, - "observedAt":"2018-08-01T13:05:00Z" + "observedAt":"2020-08-01T13:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T14:07:00Z" + "observedAt":"2020-08-01T14:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T14:20:00Z" + "observedAt":"2020-08-01T14:20:00Z" }, { "type":"Property", "value":30, - "observedAt":"2018-08-01T15:05:00Z" + "observedAt":"2020-08-01T15:05:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T15:07:00Z" + "observedAt":"2020-08-01T15:07:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T15:20:00Z" + "observedAt":"2020-08-01T15:20:00Z" }, { "type":"Property", "value":76, - "observedAt":"2018-08-01T16:05:00Z" + "observedAt":"2020-08-01T16:05:00Z" }, { "type":"Property", "value":70, - "observedAt":"2018-08-01T17:07:00Z" + "observedAt":"2020-08-01T17:07:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T18:03:00Z" + "observedAt":"2020-08-01T18:03:00Z" }, { "type":"Property", "value":48, - "observedAt":"2018-08-01T19:05:00Z" + "observedAt":"2020-08-01T19:05:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T19:07:00Z" + "observedAt":"2020-08-01T19:07:00Z" }, { "type":"Property", "value":35, - "observedAt":"2018-08-01T20:05:00Z" + "observedAt":"2020-08-01T20:05:00Z" }, { "type":"Property", "value":31, - "observedAt":"2018-08-01T20:07:00Z" + "observedAt":"2020-08-01T20:07:00Z" }, { "type":"Property", "value":28, - "observedAt":"2018-08-01T21:03:00Z" + "observedAt":"2020-08-01T21:03:00Z" }, { "type":"Property", "value":24, - "observedAt":"2018-08-01T21:05:00Z" + "observedAt":"2020-08-01T21:05:00Z" }, { "type":"Property", "value":19, - "observedAt":"2018-08-01T22:07:00Z" + "observedAt":"2020-08-01T22:07:00Z" } ], "speed":[ { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:03:00Z" + "observedAt":"2020-08-01T12:03:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:05:00Z" + "observedAt":"2020-08-01T12:05:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:07:00Z" + "observedAt":"2020-08-01T12:07:00Z" }, { "type":"Property", "value":110, - "observedAt":"2018-08-01T12:09:00Z" + "observedAt":"2020-08-01T12:09:00Z" }, { "type":"Property", "value":100, - "observedAt":"2018-08-01T12:11:00Z" + "observedAt":"2020-08-01T12:11:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:13:00Z" + "observedAt":"2020-08-01T12:13:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:15:00Z" + "observedAt":"2020-08-01T12:15:00Z" }, { "type":"Property", "value":40, - "observedAt":"2018-08-01T12:17:00Z" + "observedAt":"2020-08-01T12:17:00Z" }, { "type":"Property", "value":50, - "observedAt":"2018-08-01T12:19:00Z" + "observedAt":"2020-08-01T12:19:00Z" }, { "type":"Property", "value":60, - "observedAt":"2018-08-01T12:21:00Z" + "observedAt":"2020-08-01T12:21:00Z" }, { "type":"Property", "value":80, - "observedAt":"2018-08-01T12:23:00Z" + "observedAt":"2020-08-01T12:23:00Z" }, { "type":"Property", "value":85, - "observedAt":"2018-08-01T12:25:00Z" + "observedAt":"2020-08-01T12:25:00Z" }, { "type":"Property", "value":105, - "observedAt":"2018-08-01T12:27:00Z" + "observedAt":"2020-08-01T12:27:00Z" }, { "type":"Property", "value":120, - "observedAt":"2018-08-01T12:29:00Z" + "observedAt":"2020-08-01T12:29:00Z" }, { "type":"Property", "value":125, - "observedAt":"2018-08-01T12:31:00Z" + "observedAt":"2020-08-01T12:31:00Z" }, { "type":"Property", "value":130, - "observedAt":"2018-08-01T12:35:00Z" + "observedAt":"2020-08-01T12:35:00Z" } ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld index 6ed056e1..14fa90a4 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-10-expectation.jsonld @@ -3,13 +3,13 @@ "type":"Vehicle", "brandName": "Volvo", "speed":[ - [ 120, "2018-08-01T12:03:00Z" ], - [ 80, "2018-08-01T12:05:00Z" ], - [ 100, "2018-08-01T12:07:00Z" ] + [ 120, "2020-08-01T12:03:00Z" ], + [ 80, "2020-08-01T12:05:00Z" ], + [ 100, "2020-08-01T12:07:00Z" ] ], "fuelLevel":[ - [ 67, "2018-08-01T12:03:00Z" ], - [ 53, "2018-08-01T13:05:00Z" ], - [ 40, "2018-08-01T14:07:00Z" ] + [ 67, "2020-08-01T12:03:00Z" ], + [ 53, "2020-08-01T13:05:00Z" ], + [ 40, "2020-08-01T14:07:00Z" ] ] } \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld new file mode 100644 index 00000000..6813f472 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld new file mode 100644 index 00000000..8362782b --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld @@ -0,0 +1,81 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 5afcb9d2..dfd17372 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -156,7 +156,7 @@ Delete Temporal Representation Of Entity Output response Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${time}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -164,7 +164,7 @@ Query Temporal Representation Of Entities Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - Run Keyword If '${time}'!='' Set To Dictionary ${params} time=${time} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 0b31186a..d33de575 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -45,6 +45,18 @@ Check Response Body Containing EntityTemporal element ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entity_representation} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal Comparaison Failed +Check Response Body Containing List Containing EntityTemporal elements + [Arguments] ${filename} ${temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Load Json From File ${EXECDIR}/data/temporalEntities/expectations/${filename} + ${index}= Set Variable 0 + FOR ${temporal_entity_representation_id} IN @{temporal_entities_representation_ids} + ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} + ${index}= Evaluate ${index} + 1 + END + log ${temporal_entities_representation_payload} + ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} + Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed + Check Response Body Containing ProblemDetails Element Containing Type Element set to [Arguments] ${response} ${type} Should Be Equal ${response['body']['type']} ${type} -- GitLab From 9fe2c9a4508342054aef5703313bd47bee496423 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 17:06:35 +0100 Subject: [PATCH 03/12] feat: add tp 021_02 --- .../021_01.robot | 4 +- .../021_02.robot | 47 +++++++++++ ...presentation-021-01-01-expectation.jsonld} | 0 ...epresentation-021-01-02-expectation.jsonld | 81 +++++++++++++++++++ ...l-representation-021-02-expectation.jsonld | 37 --------- resources/ApiUtils.resource | 4 +- 6 files changed, 133 insertions(+), 40 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot rename data/temporalEntities/expectations/{vehicles-temporal-representation-021-01-expectation.jsonld => vehicles-temporal-representation-021-01-01-expectation.jsonld} (100%) create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot index aec4b475..44b84152 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot @@ -16,8 +16,8 @@ ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample ${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld *** Test Cases *** TIMEREL TIMEAT EXPECTATION_FILE -After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-expectation.jsonld -Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-02-expectation.jsonld +After after 2020-08-01T12:05:00Z vehicles-temporal-representation-021-01-01-expectation.jsonld +Before before 2020-09-01T13:05:00Z vehicles-temporal-representation-021-01-02-expectation.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot new file mode 100644 index 00000000..e90130c1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of certain attributes of entities +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of certain attributes of entities + [Documentation] Check that you can query the temporal evolution of certain attributes of entities + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + @{temporal_attributes_to_be_retrieved}= Create List speed + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z attrs=${temporal_attributes_to_be_retrieved} context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + Set Suite Variable ${third_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld similarity index 100% rename from data/temporalEntities/expectations/vehicles-temporal-representation-021-01-expectation.jsonld rename to data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld new file mode 100644 index 00000000..8362782b --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld @@ -0,0 +1,81 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld index 8362782b..105bf3a1 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-02-expectation.jsonld @@ -2,27 +2,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - } - ], "speed":[ { "type":"Property", @@ -44,22 +23,6 @@ { "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", - "brandName":{ - "type":"Property", - "value":"Volvo" - }, - "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-09-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-09-01T13:05:00Z" - } - ], "speed":[ { "type":"Property", diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index dfd17372..6136128e 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -156,8 +156,9 @@ Delete Temporal Representation Of Entity Output response Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} + ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary &{params}= Create Dictionary @@ -165,6 +166,7 @@ Query Temporal Representation Of Entities Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} + Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 00dec15886f2209deeda42192ea319e3025ab9a8 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 17:21:52 +0100 Subject: [PATCH 04/12] feat: add tp 021_03 --- .../021_02.robot | 6 - .../021_03.robot | 41 ++++ ...l-representation-021-03-expectation.jsonld | 196 ++++++++++++++++++ resources/ApiUtils.resource | 17 +- 4 files changed, 246 insertions(+), 14 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot index e90130c1..02eec535 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_02.robot @@ -9,10 +9,8 @@ Suite Teardown Delete Initial Entities *** Variable *** ${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: -${bus_id_prefix}= urn:ngsi-ld:Bus: ${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld ${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld -${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld ${expectation_file}= vehicles-temporal-representation-021-02-expectation.jsonld *** Test Case *** @@ -33,15 +31,11 @@ Query the temporal evolution of certain attributes of entities Setup Initial Entities ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} - ${third_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} - Create Temporal Representation Of Entity ${bus_payload_file} ${third_temporal_entity_representation_id} Set Suite Variable ${first_temporal_entity_representation_id} Set Suite Variable ${second_temporal_entity_representation_id} - Set Suite Variable ${third_temporal_entity_representation_id} Delete Initial Entities Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} - Delete Temporal Representation Of Entity ${third_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot new file mode 100644 index 00000000..ed1ebdb0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of the last N instances of entities attributes +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-03-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of the last N instances of entities attributes + [Documentation] Check that you can query the temporal evolution of the last N instances of entities attributes + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + @{temporal_attributes_to_be_retrieved}= Create List speed + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld new file mode 100644 index 00000000..114e9d97 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld @@ -0,0 +1,196 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":110, + "observedAt":"2020-08-01T12:09:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:11:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:13:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T12:15:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T12:17:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T12:19:00Z" + }, + { + "type":"Property", + "value":60, + "observedAt":"2020-08-01T12:21:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:23:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2020-08-01T12:25:00Z" + }, + { + "type":"Property", + "value":105, + "observedAt":"2020-08-01T12:27:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:29:00Z" + }, + { + "type":"Property", + "value":125, + "observedAt":"2020-08-01T12:31:00Z" + }, + { + "type":"Property", + "value":130, + "observedAt":"2020-08-01T12:35:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":35, + "observedAt":"2020-08-01T14:20:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2020-08-01T15:05:00Z" + }, + { + "type":"Property", + "value":85, + "observedAt":"2020-08-01T15:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T15:20:00Z" + }, + { + "type":"Property", + "value":76, + "observedAt":"2020-08-01T16:05:00Z" + }, + { + "type":"Property", + "value":70, + "observedAt":"2020-08-01T17:07:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-08-01T18:03:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2020-08-01T19:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T19:07:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2020-08-01T20:05:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2020-08-01T20:07:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2020-08-01T21:03:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2020-08-01T21:05:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-08-01T22:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 6136128e..e7a5d471 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -148,15 +148,8 @@ Retrieve Temporal Representation Of Entity Output response Set Test Variable ${response} -Delete Temporal Representation Of Entity - [Arguments] ${temporal_entity_representation_id} - - ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} - Output request - Output response - Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary @@ -167,8 +160,16 @@ Query Temporal Representation Of Entities Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} + Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request Output response Set Test Variable ${response} + +Delete Temporal Representation Of Entity + [Arguments] ${temporal_entity_representation_id} + + ${response}= DELETE ${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + Output request + Output response -- GitLab From c43113615481c486317bbdcdec492e67bbaf7397 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 17:31:23 +0100 Subject: [PATCH 05/12] feat: add tp 021_04 --- .../021_03.robot | 1 - .../021_04.robot | 40 +++++++++ ...l-representation-021-04-expectation.jsonld | 86 +++++++++++++++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index ed1ebdb0..01253a3d 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -19,7 +19,6 @@ Query the temporal evolution of the last N instances of entities attributes [Tags] mandatory @{entity_types_to_be_retrieved}= Create List Vehicle - @{temporal_attributes_to_be_retrieved}= Create List speed Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z lastN=${14} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot new file mode 100644 index 00000000..53380e1f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_04.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities using a context +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-04-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities using a context + [Documentation] Check that you can query the temporal evolution of entities using a context + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld new file mode 100644 index 00000000..f30d6425 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file -- GitLab From 0d7746703780661e6cd0efbce052a69b28523c78 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 17:41:39 +0100 Subject: [PATCH 06/12] feat: add tp 021_05 --- .../021_05.robot | 41 +++++++++ ...l-representation-021-05-expectation.jsonld | 86 +++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot new file mode 100644 index 00000000..1955e003 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_05.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given type(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${bus_id_prefix}= urn:ngsi-ld:Bus: +${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${bus_payload_file}= 2020-08-bus-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-05-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given type(s) + [Documentation] Check that you can query the temporal evolution of entities matching the given type(s) + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle Bus + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${bus_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${bus_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld new file mode 100644 index 00000000..7043d27c --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-05-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Bus:randomUUID", + "type":"Bus", + "brandName":{ + "type":"Property", + "value":"Mercedes" + }, + "fuelLevel":[ + { + "type":"Property", + "value":210, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":145, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":124, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":45, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + } +] \ No newline at end of file -- GitLab From 5b4a18281e732b3bbc0493aef4d7f42a9a9e02ff Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Wed, 16 Dec 2020 18:22:51 +0100 Subject: [PATCH 07/12] feat: add tp 021_06 --- .../021_06.robot | 41 +++++++++++++++++ ...l-representation-021-06-expectation.jsonld | 44 +++++++++++++++++++ resources/ApiUtils.resource | 4 +- 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot new file mode 100644 index 00000000..d7735dfd --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given identifier(s) +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-06-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given identifier(s) + [Documentation] Check that you can query the temporal evolution of entities matching the given identifier(s) + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + @{entity_ids_to_be_retrieved}= Create List ${first_temporal_entity_representation_id} + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld new file mode 100644 index 00000000..c5cd1101 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-06-expectation.jsonld @@ -0,0 +1,44 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e7a5d471..9424ca5f 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -149,14 +149,16 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} + ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary &{params}= Create Dictionary Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} + Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} -- GitLab From de9b8775d6d21508933a5ab514e85d0d3429605e Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 09:45:34 +0100 Subject: [PATCH 08/12] fear: add TODO to update time parameter + remove unecessary log --- resources/ApiUtils.resource | 2 +- resources/AssertionUtils.resource | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 9424ca5f..f2b3e618 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -155,11 +155,11 @@ Query Temporal Representation Of Entities ${attrs_length} = Get Length ${attrs} &{headers}= Create Dictionary &{params}= Create Dictionary - Run Keyword If '${context}'!='' Set To Dictionary ${headers} Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} + # TODO Rename time parameter to timeAt Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index d33de575..ef5d6446 100644 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -53,7 +53,6 @@ Check Response Body Containing List Containing EntityTemporal elements ${temporal_entities_representation_payload}= Update Value To Json ${temporal_entities_representation_payload} $.[${index}]..id ${temporal_entity_representation_id} ${index}= Evaluate ${index} + 1 END - log ${temporal_entities_representation_payload} ${comparaison_result}= Compare Dictionaries Ignoring Keys ${response['body']} ${temporal_entities_representation_payload} ${instance_id_regex_expr} Should Be True ${comparaison_result} msg=EntityTemporal List Comparaison Failed -- GitLab From 54f5a1afe31bddeabe8b81945ad8eacaed60daec Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 11:21:31 +0100 Subject: [PATCH 09/12] feat: add tp 021_07 --- .../021_06.robot | 2 +- .../021_07.robot | 40 +++++++++ ...l-representation-021-07-expectation.jsonld | 86 +++++++++++++++++++ resources/ApiUtils.resource | 3 +- 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot index d7735dfd..953470c1 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_06.robot @@ -23,7 +23,7 @@ Query the temporal evolution of entities matching the given identifier(s) Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_ids=${entity_ids_to_be_retrieved} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} - @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} Check Response Status Code Set To 200 Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot new file mode 100644 index 00000000..ec96446e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_07.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given id pattern +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-07-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given id pattern + [Documentation] Check that you can query the temporal evolution of entities matching the given id pattern + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} entity_id_pattern=urn:ngsi-ld:Vehicle:.* timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld new file mode 100644 index 00000000..f30d6425 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld @@ -0,0 +1,86 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":80, + "observedAt":"2020-09-01T12:05:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index f2b3e618..58e6ca2a 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -149,7 +149,7 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} @@ -163,6 +163,7 @@ Query Temporal Representation Of Entities Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} + Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 64eab128a582944efc3c1c6fb0dca42c5f8e4179 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 11:38:40 +0100 Subject: [PATCH 10/12] feat: add tp 021_08 --- .../021_08.robot | 40 ++++++++++ ...cule-temporal-representation-sample.jsonld | 2 +- ...epresentation-021-01-01-expectation.jsonld | 2 +- ...epresentation-021-01-02-expectation.jsonld | 2 +- ...l-representation-021-03-expectation.jsonld | 2 +- ...l-representation-021-04-expectation.jsonld | 2 +- ...l-representation-021-07-expectation.jsonld | 2 +- ...l-representation-021-08-expectation.jsonld | 76 +++++++++++++++++++ resources/ApiUtils.resource | 3 +- 9 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot new file mode 100644 index 00000000..ef0c3a0f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_08.robot @@ -0,0 +1,40 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-08-expectation.jsonld + +*** Test Case *** +Query the temporal evolution of entities matching the given NGSI-LD query + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD query + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} ngsild_query=speed>90;brandName!=Mercedes timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${first_temporal_entity_representation_id} ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +*** Keywords *** +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld index df193cf7..4f095bf1 100644 --- a/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld +++ b/data/temporalEntities/2020-09-vehicule-temporal-representation-sample.jsonld @@ -4,7 +4,7 @@ "brandName":[ { "type":"Property", - "value":"Volvo" + "value":"BMW" } ], "speed":[ diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld index 6813f472..6fb2bc95 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-01-expectation.jsonld @@ -36,7 +36,7 @@ "type":"Vehicle", "brandName":{ "type":"Property", - "value":"Volvo" + "value":"BMW" }, "fuelLevel":[ { diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld index 8362782b..5c0a60b0 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-01-02-expectation.jsonld @@ -46,7 +46,7 @@ "type":"Vehicle", "brandName":{ "type":"Property", - "value":"Volvo" + "value":"BMW" }, "fuelLevel":[ { diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld index 114e9d97..4abeba3b 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld @@ -156,7 +156,7 @@ "type":"Vehicle", "brandName":{ "type":"Property", - "value":"Volvo" + "value":"BMW" }, "speed":[ { diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld index f30d6425..fdbbaea5 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-04-expectation.jsonld @@ -46,7 +46,7 @@ "type":"Vehicle", "brandName":{ "type":"Property", - "value":"Volvo" + "value":"BMW" }, "fuelLevel":[ { diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld index f30d6425..fdbbaea5 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-07-expectation.jsonld @@ -46,7 +46,7 @@ "type":"Vehicle", "brandName":{ "type":"Property", - "value":"Volvo" + "value":"BMW" }, "fuelLevel":[ { diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld new file mode 100644 index 00000000..1923befa --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-08-expectation.jsonld @@ -0,0 +1,76 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Volvo" + }, + "fuelLevel":[ + { + "type":"Property", + "value":67, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-08-01T13:05:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-08-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-08-01T12:07:00Z" + } + ] + }, + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"BMW" + }, + "fuelLevel":[ + { + "type":"Property", + "value":53, + "observedAt":"2020-09-01T13:05:00Z" + }, + { + "type":"Property", + "value":67, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-09-01T14:07:00Z" + } + ], + "speed":[ + { + "type":"Property", + "value":120, + "observedAt":"2020-09-01T12:03:00Z" + }, + { + "type":"Property", + "value":100, + "observedAt":"2020-09-01T12:07:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 58e6ca2a..b56f9277 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -149,7 +149,7 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} @@ -164,6 +164,7 @@ Query Temporal Representation Of Entities Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} + Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 497ca1a99a71a19cb6659a12339524d9fff1f405 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 12:38:02 +0100 Subject: [PATCH 11/12] feat: add tp 021_09 --- .../021_09.robot | 45 +++++++++++++ ...representation-with-location-sample.jsonld | 66 +++++++++++++++++++ ...epresentation-021-09-01-expectation.jsonld | 54 +++++++++++++++ ...epresentation-021-09-02-expectation.jsonld | 62 +++++++++++++++++ resources/ApiUtils.resource | 6 +- 5 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot create mode 100644 data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot new file mode 100644 index 00000000..9c5ab855 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query +Resource ${EXECDIR}/resources/ApiUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Query the temporal evolution of entities matching the given NGSI-LD geo-query + +*** Variable *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= 2020-08-vehicule-temporal-representation-sample.jsonld +${second_vehicle_payload_file}= 2020-10-vehicule-temporal-representation-with-location-sample.jsonld +${expectation_file}= vehicles-temporal-representation-021-09-expectation.jsonld + +*** Test Cases *** GEOREL GEOMETRY COORDINATES GEOPROPERTY EXPECTATION_FILE +Near Point near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01-expectation.jsonld +Within Polygon within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location vehicles-temporal-representation-021-09-02-expectation.jsonld + +*** Keywords *** +Query the temporal evolution of entities matching the given NGSI-LD geo-query + [Arguments] ${georel} ${geometry} ${coordinates} ${geoproperty} ${expectation_file} + [Documentation] Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query + [Tags] mandatory + + @{entity_types_to_be_retrieved}= Create List Vehicle + + Query Temporal Representation Of Entities entity_types=${entity_types_to_be_retrieved} georel=${georel} geometry=${geometry} coordinates=${coordinates} geoproperty=${geoproperty} timerel=after timeAt=2020-07-01T12:05:00Z context=${ngsild_test_suite_context} + + @{temporal_entities_representation_ids}= Create List ${second_temporal_entity_representation_id} + Check Response Status Code Set To 200 + Check Response Body Containing List Containing EntityTemporal elements ${expectation_file} ${temporal_entities_representation_ids} + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${first_vehicle_payload_file} ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity ${second_vehicle_payload_file} ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld new file mode 100644 index 00000000..e88e09d5 --- /dev/null +++ b/data/temporalEntities/2020-10-vehicule-temporal-representation-with-location-sample.jsonld @@ -0,0 +1,66 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":[ + { + "type":"Property", + "value":"Audi" + } + ], + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Point", + "coordinates":[ + 2.35, + 42.22 + ], + "observedAt":"2020-10-01T12:05:00Z" + } + ], + "@context":[ + "https://raw.githubusercontent.com/easy-global-market/ngsild-api-data-models/feature/add-json-ld-context-for-ngsi-ld-test-suite/ngsi-ld-test-suite/ngsi-ld-test-suite-context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld new file mode 100644 index 00000000..fc6f36e2 --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-01-expectation.jsonld @@ -0,0 +1,54 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Audi" + }, + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + } + ] + } +] \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld new file mode 100644 index 00000000..8d6466fc --- /dev/null +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-09-02-expectation.jsonld @@ -0,0 +1,62 @@ +[ + { + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "brandName":{ + "type":"Property", + "value":"Audi" + }, + "speed":[ + { + "type":"Property", + "value":150, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":90, + "observedAt":"2020-10-01T12:05:00Z" + }, + { + "type":"Property", + "value":127, + "observedAt":"2020-10-01T12:07:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":89, + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Property", + "value":78, + "observedAt":"2020-10-01T13:05:00Z" + }, + { + "type":"Property", + "value":62, + "observedAt":"2020-10-01T14:07:00Z" + } + ], + "location":[ + { + "type":"Point", + "coordinates":[ + -8.5, + 41.2 + ], + "observedAt":"2020-10-01T12:03:00Z" + }, + { + "type":"Point", + "coordinates":[ + -8.45, + 41.22 + ], + "observedAt":"2020-10-01T12:05:00Z" + } + ] + } +] \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index b56f9277..1d74f350 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -149,7 +149,7 @@ Retrieve Temporal Representation Of Entity Set Test Variable ${response} Query Temporal Representation Of Entities - [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} + [Arguments] ${context}=${EMPTY} ${entity_types}=${EMPTY} ${entity_ids}=${EMPTY} ${entity_id_pattern}=${EMPTY} ${ngsild_query}=${EMPTY} ${georel}=${EMPTY} ${geometry}=${EMPTY} ${coordinates}=${EMPTY} ${geoproperty}=${EMPTY} ${timerel}=${EMPTY} ${timeAt}=${EMPTY} ${attrs}=${EMPTY} ${lastN}=${EMPTY} ${entity_types_length} = Get Length ${entity_types} ${entity_ids_length} = Get Length ${entity_ids} ${attrs_length} = Get Length ${attrs} @@ -165,6 +165,10 @@ Query Temporal Representation Of Entities Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} Run Keyword If '${ngsild_query}'!='' Set To Dictionary ${params} q=${ngsild_query} + Run Keyword If '${georel}'!='' Set To Dictionary ${params} georel=${georel} + Run Keyword If '${geometry}'!='' Set To Dictionary ${params} geometry=${geometry} + Run Keyword If '${coordinates}'!='' Set To Dictionary ${params} coordinates=${coordinates} + Run Keyword If '${geoproperty}'!='' Set To Dictionary ${params} geoproperty=${geoproperty} ${response}= GET ${TEMPORAL_ENTITIES_ENDPOINT_PATH} headers=${headers} query=${params} Output request -- GitLab From 2f063451cb5f1929cbd2b1cad25f93ecbf8c5740 Mon Sep 17 00:00:00 2001 From: Houcem Kacem Date: Thu, 17 Dec 2020 13:52:46 +0100 Subject: [PATCH 12/12] fix: rename time parameter to timeAt --- resources/ApiUtils.resource | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index 1d74f350..28d92519 100644 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -159,8 +159,7 @@ Query Temporal Representation Of Entities Run Keyword If ${entity_types_length}>0 Set To Dictionary ${params} type=${entity_types} Run Keyword If ${entity_ids_length}>0 Set To Dictionary ${params} id=${entity_ids} Run Keyword If '${timerel}'!='' Set To Dictionary ${params} timerel=${timerel} - # TODO Rename time parameter to timeAt - Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} time=${timeAt} + Run Keyword If '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} Run Keyword If ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} Run Keyword If '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} Run Keyword If '${entity_id_pattern}'!='' Set To Dictionary ${params} idPattern=${entity_id_pattern} -- GitLab