FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 43 forks source link

011_01 - Check that you can update entity attributes (011_01_01 Check that you can update existing attributes with no datasetId) #1507

Closed lafrigolet closed 11 months ago

lafrigolet commented 11 months ago

TP.NGSI-LD.ContextInformation.Provision.EntityAttributes.UpdateEntityAttributes.011_01 :: 011_01_01 Check that you can update existing attributes with no datasetId

Context Broker Information:

Version: develop commit 238ac6c353325f8d486ef79ea137df20df12f277 Launch command: orionld -fg

011_01_01 Check that you can update existing attributes with no datasetId | FAIL |

Item root['isParked']['https://uri.etsi.org/ngsi-ld/default-context/providedBy'] added to dictionary. Item root['speed'][1]['https://ngsi-ld-test-suite/context#source'] added to dictionary. Item root['isParked']['providedBy'] removed from dictionary. Item root['speed'][1]['source'] removed from dictionary.

Test Request/Response Flow

Request:

POST http://127.0.0.1:1026/ngsi-ld/v1/entities/
Host: 127.0.0.1:1026
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, br, zstd
Accept: */*
Connection: keep-alive
Content-Type: application/ld+json
Content-Length: 761

{"id": "urn:ngsi-ld:Vehicle:5518988696484363", "type": "Vehicle", "brandName": {"type": "Property", "value": "Mercedes"}, "isParked": {"type": "Relationship", "object": "urn:ngsi-ld:OffStreetParking:Downtown1", "observedAt": "2017-07-29T12:00:04Z", "providedBy": {"type": "Relationship", "object": "urn:ngsi-ld:Person:Bob"}, "datasetId": "urn:ngsi-ld:Relationship:parked12345"}, "speed": [{"type": "Property", "value": 55, "source": {"type": "Property", "value": "Speedometer"}}, {"type": "Property", "value": 54.5, "source": {"type": "Property", "value": "GPS"}, "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed"}], "@context": ["https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"]}

Response:

HTTP/1.1 201 Created
Date: Mon, 18 Dec 2023 13:03:25 GMT
Location: /ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5518988696484363
Content-Length: 0

Request:

PATCH http://127.0.0.1:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5518988696484363/attrs/
Host: 127.0.0.1:1026
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, br, zstd
Accept: */*
Connection: keep-alive
Content-Type: application/ld+json
Content-Length: 331

{
    "speed": {
        "type": "Property",
        "value": 99,
        "source": {
            "type": "Property",
            "value": "Speedometer"
        }
    },
    "@context": [
        "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
    ]
}

Response:

HTTP/1.1 204 No Content
Date: Mon, 18 Dec 2023 13:03:25 GMT

Request:

GET http://127.0.0.1:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5518988696484363
Host: 127.0.0.1:1026
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, br, zstd
Accept: application/ld+json
Connection: keep-alive
Link: <https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json"

Response:

HTTP/1.1 200 OK
Date: Mon, 18 Dec 2023 13:03:25 GMT
Content-Type: application/ld+json
Content-Length: 794

{"@context":"https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld","id":"urn:ngsi-ld:Vehicle:5518988696484363","type":"Vehicle","isParked":{"type":"Relationship","object":"urn:ngsi-ld:OffStreetParking:Downtown1","observedAt":"2017-07-29T12:00:04Z","https://uri.etsi.org/ngsi-ld/default-context/providedBy":{"type":"Relationship","object":"urn:ngsi-ld:Person:Bob"},"datasetId":"urn:ngsi-ld:Relationship:parked12345"},"speed":[{"type":"Property","value":99,"source":{"type":"Property","value":"Speedometer"}},{"type":"Property","value":54.5,"https://ngsi-ld-test-suite/context#source":{"type":"Property","value":"GPS"},"datasetId":"urn:ngsi-ld:Property:gpsBxyz123-speed"}],"brandName":{"type":"Property","value":"Mercedes"}}

Request:

DELETE http://127.0.0.1:1026/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5518988696484363
Host: 127.0.0.1:1026
User-Agent: python-requests/2.31.0
Accept-Encoding: gzip, deflate, br, zstd
Accept: */*
Connection: keep-alive
Content-Length: 0

Response:

HTTP/1.1 204 No Content
Date: Mon, 18 Dec 2023 13:03:25 GMT