Commit 1a85ed49 authored by thomas Bousselin's avatar thomas Bousselin Committed by Benoit Orihuela
Browse files

Feature/between check for entities

parent 91278e0c
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -19,25 +19,29 @@ ${second_vehicle_payload_file}= 2020-09-vehicle-temporal-representation.json
${bus_payload_file}=                2020-08-bus-temporal-representation.jsonld


*** Test Cases ***    TIMEREL    TIMEAT    EXPECTATION_FILE
*** Test Cases ***    TIMEREL    TIMEAT    ENDTIMEAT    EXPECTATION_FILE
021_01_01 After
    [Tags]    te-query    5_7_4
    after    2020-08-01T12:04:00Z    vehicles-temporal-representation-021-01-01.jsonld
    after    2020-08-01T12:04:00Z    ${EMPTY}    vehicles-temporal-representation-021-01-01.jsonld
021_01_02 Before
    [Tags]    te-query    5_7_4
    before    2020-09-01T13:06:00Z    vehicles-temporal-representation-021-01-02.jsonld
    before    2020-09-01T13:06:00Z    ${EMPTY}    vehicles-temporal-representation-021-01-02.jsonld
021_01_03 Between
    [Tags]    te-query    5_7_4
    between    2020-08-01T12:04:00Z    2020-09-01T13:06:00Z    vehicles-temporal-representation-021-01-03.jsonld


*** Keywords ***
Query the temporal evolution of entities
    [Documentation]    Check that one can query the temporal evolution of entities
    [Arguments]    ${timerel}    ${timeat}    ${expectation_file}
    [Arguments]    ${timerel}    ${timeAt}    ${endTimeAt}    ${expectation_file}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle

    ${response}=    Query Temporal Representation Of Entities
    ...    entity_types=${entity_types_to_be_retrieved}
    ...    timerel=${timerel}
    ...    timeAt=${timeat}
    ...    timeAt=${timeAt}
    ...    endTimeAt=${endTimeAt}
    ...    context=${ngsild_test_suite_context}

    @{temporal_entities_representation_ids}=    Create List
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,9 @@ ${second_vehicle_payload_file}= 2020-09-vehicle-temporal-representation.json
021_13_02 Before
    [Tags]    te-query    5_7_4
    entity-operations-before-query.jsonld    vehicles-temporal-representation-021-13-02.jsonld
021_13_03 Between
    [Tags]    te-query    5_7_4
    entity-operations-between-query.jsonld    vehicles-temporal-representation-021-13-03.jsonld


*** Keywords ***
+9 −5
Original line number Diff line number Diff line
@@ -19,24 +19,28 @@ ${second_vehicle_payload_file}= 2020-09-vehicle-temporal-representation.json
${bus_payload_file}=                2020-08-bus-temporal-representation.jsonld


*** Test Cases ***    TIMEREL    TIMEAT    EXPECTATION_FILE
*** Test Cases ***    TIMEREL    TIMEAT    ENDTIMEAT    EXPECTATION_FILE
021_14_01 After
    [Tags]    te-query    5_7_4
    after    2020-08-01T12:04:00Z    vehicles-temporal-representation-021-14-01.json
    after    2020-08-01T12:04:00Z    ${EMPTY}    vehicles-temporal-representation-021-14-01.json
021_14_02 Before
    [Tags]    te-query    5_7_4
    before    2020-09-01T13:06:00Z    vehicles-temporal-representation-021-14-02.json
    before    2020-09-01T13:06:00Z    ${EMPTY}    vehicles-temporal-representation-021-14-02.json
021_14_02 Between
    [Tags]    te-query    5_7_4
    between    2020-08-01T12:04:00Z    2020-09-01T13:06:00Z    vehicles-temporal-representation-021-14-03.json


*** Keywords ***
Query the temporal evolution of entities
    [Documentation]    Check that one can query the temporal evolution of entities with the simplified representation
    [Arguments]    ${timerel}    ${timeat}    ${expectation_file}
    [Arguments]    ${timerel}    ${timeAt}    ${endTimeAt}    ${expectation_file}
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle
    ${response}=    Query Temporal Representation Of Entities
    ...    entity_types=${entity_types_to_be_retrieved}
    ...    timerel=${timerel}
    ...    timeAt=${timeat}
    ...    timeAt=${timeAt}
    ...    endTimeAt=${endTimeAt}
    ...    context=${ngsild_test_suite_context}
    ...    options=temporalValues
    @{temporal_entities_representation_ids}=    Create List
+11 −0
Original line number Diff line number Diff line
{
    "type": "Query",
    "entities": [{
        "type": "Vehicle"
    }],
    "temporalQ": {
       "timerel":"between",
       "timeAt":"2020-08-02T12:05:00Z",
       "endTimeAt":"2020-09-01T13:06:00Z"
    }
}
 No newline at end of file
+63 −0
Original line number Diff line number Diff line
[
   {
      "id":"urn:ngsi-ld:Vehicle:randomUUID",
      "type":"Vehicle",
      "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",
      "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
Loading