From 1127f4fcd539dd5ef8b28f4f8e589d0e96423d17 Mon Sep 17 00:00:00 2001 From: daniel-gonzalez-sanchez Date: Fri, 20 Jun 2025 14:52:38 +0200 Subject: [PATCH 1/2] Including sample schemas for vehicular use case. Updating references to NGSI-LD meta-model schemas within sample custom schemas. --- .../vehicle-information-custom-schemas.yaml | 315 ++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100755 examples/customSchemas/vehicle-information-custom-schemas.yaml diff --git a/examples/customSchemas/vehicle-information-custom-schemas.yaml b/examples/customSchemas/vehicle-information-custom-schemas.yaml new file mode 100755 index 0000000..c63599c --- /dev/null +++ b/examples/customSchemas/vehicle-information-custom-schemas.yaml @@ -0,0 +1,315 @@ +openapi: 3.0.3 +info: + title: Example schemas for vehicle information + version: 0.0.1 + description: | + Example schemas compliant with the NGSI-LD OAS metamodel according to ETSI GS CIM 009. +paths: {} +components: + schemas: + Vehicle: + description: | + NGSI-LD Entity Type that represents a vehicle. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be Vehicle. + type: string + enum: + - Vehicle + default: Vehicle + brandName: + $ref: '#/components/schemas/BrandName' + street: + $ref: '#/components/schemas/Street' + isParked: + $ref: '#/components/schemas/IsParked' + category: + $ref: '#/components/schemas/Category' + tyreTreadDepths: + $ref: '#/components/schemas/TyreTreadDepths' + passengers: + $ref: '#/components/schemas/Passengers' + route: + $ref: '#/components/schemas/Route' + - required: + - type + - brandName + BrandName: + description: | + NGSI-LD Property Type. The vehicle brand name. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Property' + - type: object + properties: + value: + type: string + required: + - value + additionalProperties: false + Street: + description: | + NGSI-LD LanguageProperty Type. The vehicle street. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/LanguageProperty' + - type: object + properties: + languageMap: + type: object + required: + - languageMap + additionalProperties: false + IsParked: + additionalProperties: false + description: | + NGSI-LD Relationship type to identify the parking where is the vehicle (i.e., the identifier of an NGSI-LD Entity of type OffStreetParking). + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Relationship' + - type: object + properties: + object: + type: string + format: uri + objectType: + type: string + format: uri + providedBy: + $ref: '#/components/schemas/ProvidedBy' + required: + - object + ProvidedBy: + additionalProperties: false + description: | + NGSI-LD Relationship type to identify the entity that provides something (i.e., the identifier of an NGSI-LD Entity of particular type). + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Relationship' + - type: object + properties: + object: + type: string + format: uri + required: + - object + Category: + description: | + NGSI-LD VocabProperty Type. The vehicle category. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/VocabProperty' + - type: object + properties: + vocab: + type: string + required: + - vocab + additionalProperties: false + TyreTreadDepths: + description: | + NGSI-LD ListProperty Type. The vehicle tyre tread depths. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/ListProperty' + - type: object + properties: + valueList: + items: + type: string + required: + - valueList + additionalProperties: false + Passengers: + description: | + NGSI-LD Relationship type to identify the passengers of the vehicle (i.e., the identifier of an NGSI-LD Entity of type Person). + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Relationship' + - type: object + properties: + object: + type: array + items: + type: string + format: uri + objectType: + type: string + format: uri + required: + - object + additionalProperties: false + Route: + description: | + NGSI-LD ListRelationship type to identify the route of the vehicle (i.e., the list of identifier of NGSI-LD Entities of type City). + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/ListRelationship' + - type: object + properties: + objectList: + type: array + items: + type: object + format: uri + objectType: + type: string + format: uri + required: + - objectList + additionalProperties: false + OffStreetParking: + description: | + NGSI-LD Entity Type that represents a parking. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be OffStreetParking. + type: string + enum: + - OffStreetParking + default: OffStreetParking + name: + $ref: '#/components/schemas/Name' + availableSpotNumber: + $ref: '#/components/schemas/AvailableSpotNumber' + totalSpotNumber: + $ref: '#/components/schemas/TotalSpotNumber' + operatedBy: + $ref: '#/components/schemas/OperatedBy' + - required: + - type + - name + AvailableSpotNumber: + description: | + NGSI-LD Property Type. The available spot number. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Property' + - type: object + properties: + value: + type: number + reliability: + $ref: '#/components/schemas/Reliability' + providedBy: + $ref: '#/components/schemas/ProvidedBy' + required: + - value + additionalProperties: false + Reliability: + description: | + NGSI-LD Property Type. The reliability of the available spot number. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Property' + - type: object + properties: + value: + type: number + required: + - value + additionalProperties: false + TotalSpotNumber: + description: | + NGSI-LD Property Type. The total spot number. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Property' + - type: object + properties: + value: + type: number + required: + - value + additionalProperties: false + Person: + description: | + NGSI-LD Entity Type that represents a person. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be Person. + type: string + enum: + - Person + default: Person + name: + $ref: '#/components/schemas/Name' + - required: + - type + - name + City: + description: | + NGSI-LD Entity Type that represents a city. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be City. + type: string + enum: + - City + default: City + name: + $ref: '#/components/schemas/Name' + - required: + - type + - name + Camera: + description: | + NGSI-LD Entity Type that represents a camera. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be Camera. + type: string + enum: + - Camera + default: Camera + name: + $ref: '#/components/schemas/Name' + - required: + - type + - name + Company: + description: | + NGSI-LD Entity Type that represents a company. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Entity' + - type: object + properties: + type: + description: NGSI-LD Entity identifier. It has to be Company. + type: string + enum: + - Company + default: Company + name: + $ref: '#/components/schemas/Name' + - required: + - type + - name + Name: + description: | + NGSI-LD Property Type. The natural name of an entity. + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Property' + - type: object + properties: + value: + type: string + required: + - value + additionalProperties: false + OperatedBy: + description: | + NGSI-LD Relationship type to identify the company that operates the parking (i.e., the identifier of an NGSI-LD Entity of type Company). + allOf: + - $ref: '../../openapi-3.0.3/ngsi-ld-api.yaml#/components/schemas/Relationship' + - type: object + properties: + object: + type: string + required: + - object + additionalProperties: false \ No newline at end of file -- GitLab From 6f76eaff2e08a384677636fbd2bd8eafd1c85bc2 Mon Sep 17 00:00:00 2001 From: daniel-gonzalez-sanchez Date: Fri, 20 Jun 2025 14:54:42 +0200 Subject: [PATCH 2/2] Updating README to include reference to ETSI GS CIM 047 V1.1.2 document. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5c8b0f..2a1b62c 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,10 @@ This repository contains the OpenAPI Specification (OAS) for the NGSI-LD API spe ## Online Documentation -### Specification Document +### Specification Documents -* [ETSI GS CIM 009](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.07.01_60/gs_CIM009v010701p.pdf) +* [ETSI GS CIM 047 V1.1.2](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/047/01.01.02_60/gs_CIM047v010102p.pdf) +* [ETSI GS CIM 009 v1.7.1](https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.07.01_60/gs_CIM009v010701p.pdf) ### Navigate API -- GitLab