openapi: 3.0.3 info: description: This OAS file describes the NGSI-LD API defined by the ETSI ISG CIM group. This Cross-domain Context Information Management API allows to provide, consume and subscribe to context information in multiple scenarios and involving multiple stakeholders version: latest title: ETSI ISG CIM / NGSI-LD API Entry Point Temporal API contact: email: NGSI-LD@etsi.org tags: - name: Temporal paths: /temporal/entities/: get: description: Query temporal evolution of Entities from an NGSI-LD system operationId: queryTemporalEntities tags: - Temporal parameters: - $ref: '#/components/parameters/id' - $ref: '#/components/parameters/idPattern' - $ref: '#/components/parameters/type' - $ref: '#/components/parameters/attrs' - $ref: '#/components/parameters/q' - $ref: '#/components/parameters/georel' - $ref: '#/components/parameters/geometry' - $ref: '#/components/parameters/coordinates' - $ref: '#/components/parameters/geoproperty' - $ref: '#/components/parameters/timerel' - $ref: '#/components/parameters/timeproperty' - $ref: '#/components/parameters/time' - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/csf' - $ref: '#/components/parameters/limit' - $ref: '#/components/parameters/components-parameters-options' - $ref: '#/components/parameters/lastN' responses: '200': description: OK content: application/json;application/ld+json: schema: $ref: '#/components/schemas/EntityTemporalList' examples: simple: externalValue: https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/EntityTemporalList-example.json '400': description: Bad request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' post: description: Create or update temporal representation of an Entity within an NGSI-LD system operationId: createUpdateEntityTemporal tags: - Temporal requestBody: required: true content: application/json;application/ld+json: schema: $ref: '#/components/schemas/EntityTemporal' examples: simple: externalValue: https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/EntityTemporal-example_C5.5.3.json responses: '201': description: Created. Contains the resource URI of the created Entity '204': description: Updated. No Content '400': description: Bad request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '409': description: Already exists content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' /temporal/entities/{entityId}: get: description: Retrieve the temporal representation of an specific Entity from an NGSI-LD system. It's possible to specify the Entity attributes to be retrieved by using query parameters operationId: retrieveEntityTemporalById tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' - $ref: '#/components/parameters/attrs' - $ref: '#/components/parameters/parameters-type' - $ref: '#/components/parameters/components-parameters-options' - $ref: '#/components/parameters/timerel' - $ref: '#/components/parameters/timeproperty' - $ref: '#/components/parameters/time' - $ref: '#/components/parameters/endTime' - $ref: '#/components/parameters/lastN' responses: '200': description: OK content: application/json;application/ld+json: schema: $ref: '#/components/schemas/EntityTemporal' examples: simple: externalValue: https://forge.etsi.org/rep/NGSI-LD/NGSI-LD/raw/master/examples/EntityTemporal-example_C5.5.3.json '400': description: Bad request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' delete: description: Removes the temporal representation of an Entity from an NGSI-LD system operationId: removeEntityTemporalById tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' - $ref: '#/components/parameters/parameters-type' responses: '204': description: No Content. The entity was removed successfully '400': description: Bad Request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' /temporal/entities/{entityId}/attrs/: post: description: Add new attributes to an existing Temporal Entity within an NGSI-LD system operationId: addTemporalEntityAttrs tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' requestBody: required: true content: application/json;application/ld+json: schema: $ref: '#/components/schemas/EntityTemporalFragment' responses: '204': description: No Content '400': description: Bad request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' /temporal/entities/{entityId}/attrs/{attrId}: delete: description: Attribute from Temporal Representation of Entity deletion operationId: removeEntityTemporalAttr tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' - $ref: '#/components/parameters/attrId' responses: '204': description: No Content. '400': description: Bad Request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' /temporal/entities/{entityId}/attrs/{attrId}/{instanceId}: patch: description: Allows modifying a specific Attribute (Property or Relationship) instance, identified by its instanceId, of a Temporal Representation of an Entity. operationId: modifyEntityTemporalAttrInstance tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' - $ref: '#/components/parameters/attrId' - $ref: '#/components/parameters/instanceId' requestBody: required: true content: application/json;application/ld+json: schema: $ref: '#/components/schemas/EntityTemporalFragment' responses: '204': description: No Content '400': description: Bad request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' delete: description: Attribute Instance deletion by instance id. operationId: removeEntityTemporalAttrInstance tags: - Temporal parameters: - $ref: '#/components/parameters/entityId' - $ref: '#/components/parameters/attrId' - $ref: '#/components/parameters/instanceId' responses: '204': description: No Content. '400': description: Bad Request content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' '404': description: Not Found content: application/json;application/ld+json: schema: $ref: '#/components/schemas/ProblemDetails' components: parameters: coordinates: name: coordinates description: Coordinates serialized as a string in: query required: false schema: $ref: '#/components/schemas/coordinates' entityId: name: entityId description: Entity Id in: path required: true schema: type: string format: uri geoproperty: name: geoproperty description: The name of the property that contains the geo-spatial data that will be used to resolve the geoquery in: query required: false schema: type: string minLength: 1 time: name: time description: start time for temporal query in: query required: false schema: type: string format: date-time type: name: type description: Comma separated list of Entity type names to be retrieved in: query required: false schema: type: string minLength: 1 lastN: name: lastN description: Only retrieve last N instances in: query required: false schema: type: integer minimum: 1 components-parameters-options: name: options description: Options dictionary in: query required: false schema: type: string enum: - temporalValues - sysAttrs id: name: id description: Comma separated list of URIs to be retrieved in: query required: false schema: type: string format: uri attrs: name: attrs description: Comma separated list of attribute names (properties or relationships) to be retrieved in: query required: false schema: type: string minLength: 1 instanceId: name: instanceId description: Instance Id in: path required: true schema: type: string format: uri attrId: name: attrId description: Attribute Id in: path required: true schema: $ref: '#/components/schemas/Name' q: name: q description: Query in: query required: false schema: type: string minLength: 1 timerel: name: timerel description: Time relationship in: query required: false schema: $ref: '#/components/schemas/timerel' endTime: name: endTime description: end time for temporal query in: query required: false schema: type: string format: date-time idPattern: name: idPattern description: Regular expression that must be matched by Entity ids in: query required: false schema: type: string format: regexp timeproperty: name: timeproperty description: The name of the property that contains the temporal data that will be used to resolve the temporal query in: query required: false schema: $ref: '#/components/schemas/Name' geometry: name: geometry description: Geometry in: query required: false schema: $ref: '#/components/schemas/geometry' csf: name: csf description: Context Source Filter in: query required: false schema: type: string minLength: 1 georel: name: georel description: Geo-relationship in: query required: false schema: $ref: '#/components/schemas/georel' parameters-type: name: type description: Entity Type in: query required: false schema: $ref: '#/components/schemas/Name' limit: name: limit description: Pagination limit in: query required: false schema: type: integer minimum: 1 schemas: positionArray: description: An array of positions type: array items: $ref: '#/components/schemas/position' LineString: type: object properties: type: type: string enum: - LineString coordinates: $ref: '#/components/schemas/lineString' MultiLineString: type: object properties: type: type: string enum: - MultiLineString coordinates: type: array items: $ref: '#/components/schemas/lineString' geometry: type: string enum: - Point - MultiPoint - LineString - MultiLineString - Polygon - MultiPolygon Point: type: object properties: type: type: string enum: - Point coordinates: $ref: '#/components/schemas/position' Name: type: string pattern: ^((\d|[a-zA-Z]|_)+(:(\d|[a-zA-Z]|_)+)?(#\d+)?)$ minLength: 1 description: NGSI-LD Name Relationship: type: object properties: type: type: string enum: - Relationship object: type: string format: uri observedAt: $ref: '#/components/schemas/observedAt' createdAt: $ref: '#/components/schemas/createdAt' modifiedAt: $ref: '#/components/schemas/modifiedAt' datasetId: $ref: '#/components/schemas/datasetId' instanceId: $ref: '#/components/schemas/instanceId' required: - type - object additionalProperties: oneOf: - $ref: '#/components/schemas/Property' - $ref: '#/components/schemas/Relationship' georel: oneOf: - type: string enum: - equals - disjoint - intersects - within - contains - overlaps - type: string pattern: ^near;((maxDistance==\d+)|(minDistance==\d+))$ Property: type: object properties: type: type: string enum: - Property value: oneOf: - string - number - boolean - array - object observedAt: $ref: '#/components/schemas/observedAt' createdAt: $ref: '#/components/schemas/createdAt' modifiedAt: $ref: '#/components/schemas/modifiedAt' datasetId: $ref: '#/components/schemas/datasetId' instanceId: $ref: '#/components/schemas/instanceId' required: - type - value additionalProperties: oneOf: - $ref: '#/components/schemas/Property' - $ref: '#/components/schemas/Relationship' modifiedAt: type: string format: date-time Polygon: type: object properties: type: type: string enum: - Polygon coordinates: $ref: '#/components/schemas/polygon' EntityTemporal: allOf: - $ref: '#/components/schemas/EntityTemporalFragment' - type: object required: - type - id position: description: A single position type: array minItems: 2 maxItems: 2 items: type: number additionalProperties: false timerel: type: string enum: - before - after - between ProblemDetails: type: object properties: type: type: string format: uri title: type: string detail: type: string required: - type EntityTemporalFragment: type: object properties: '@context': $ref: '#/components/schemas/LdContext' location: type: array items: $ref: '#/components/schemas/GeoProperty' minItems: 1 observationSpace: type: array items: $ref: '#/components/schemas/GeoProperty' minItems: 1 operationSpace: type: array items: $ref: '#/components/schemas/GeoProperty' minItems: 1 id: type: string format: uri type: $ref: '#/components/schemas/Name' createdAt: $ref: '#/components/schemas/createdAt' modifiedAt: $ref: '#/components/schemas/modifiedAt' additionalProperties: oneOf: - type: array items: $ref: '#/components/schemas/Property' minItems: 1 - type: array items: $ref: '#/components/schemas/Relationship' minItems: 1 - type: array items: $ref: '#/components/schemas/GeoProperty' minItems: 1 linearRing: description: An array of four positions where the first equals the last allOf: - $ref: '#/components/schemas/positionArray' - minItems: 4 MultiPoint: type: object properties: type: type: string enum: - MultiPoint coordinates: $ref: '#/components/schemas/positionArray' datasetId: type: string format: uri coordinates: oneOf: - $ref: '#/components/schemas/position' - $ref: '#/components/schemas/positionArray' - $ref: '#/components/schemas/lineString' - $ref: '#/components/schemas/polygon' lineString: description: An array of two or more positions allOf: - $ref: '#/components/schemas/positionArray' - minItems: 2 polygon: description: An array of linear rings type: array items: $ref: '#/components/schemas/linearRing' GeoProperty: type: object properties: type: type: string enum: - GeoProperty value: $ref: '#/components/schemas/Geometry' observedAt: $ref: '#/components/schemas/observedAt' createdAt: $ref: '#/components/schemas/createdAt' modifiedAt: $ref: '#/components/schemas/modifiedAt' datasetId: $ref: '#/components/schemas/datasetId' instanceId: $ref: '#/components/schemas/instanceId' required: - type - value additionalProperties: oneOf: - $ref: '#/components/schemas/Property' - $ref: '#/components/schemas/Relationship' instanceId: type: string format: uri EntityTemporalList: type: array items: $ref: '#/components/schemas/EntityTemporal' observedAt: type: string format: date-time MultiPolygon: type: object properties: type: type: string enum: - MultiPolygon coordinates: type: array items: $ref: '#/components/schemas/polygon' LdContext: oneOf: - type: object - type: string format: uri - type: array minItems: 1 items: oneOf: - type: string format: uri - type: object Geometry: description: ' Avalid GeoJSON geometry object' oneOf: - $ref: '#/components/schemas/Point' - $ref: '#/components/schemas/MultiPoint' - $ref: '#/components/schemas/Polygon' - $ref: '#/components/schemas/LineString' - $ref: '#/components/schemas/MultiLineString' - $ref: '#/components/schemas/MultiPolygon' createdAt: type: string format: date-time externalDocs: description: Find out more about the ETSI ISG Context Information Management url: https://portal.etsi.org/tb.aspx?tbid=854&SubTB=854